--- name: feedback-prod-screenshot-to-docx description: "Chụp nhiều màn web-app prod, khoanh-đỏ, chèn vào Word guide — MCP save_to_disk KHÔNG ra file ở env này → pipeline PowerShell CopyFromScreen + Win32 + DOM overlay + python-docx" metadata: node_type: memory type: feedback originSessionId: 2185d1f4-1ec8-4d7d-8c6f-fcde0a977640 --- Khi anh nhờ "mở chrome chụp ảnh dán vào" guide Word: MCP `save_to_disk` (Chrome MCP `computer{screenshot}` + computer-use `screenshot`) **KHÔNG persist file lead truy-cập được** ở env này (chỉ đính ảnh vào hội-thoại; gif_creator = 0-frame cho ảnh tĩnh) → dùng pipeline tự-chế ra PNG thật. Proven S90 (12 màn eoffice → `Huong-dan-Duyet-NCC.docx`). **Why:** không có file PNG trên disk = không PIL/python-docx chèn được; phải bypass MCP bằng native capture. **How to apply:** 1. **Chụp:** PowerShell `.NET [System.Drawing.Graphics]::CopyFromScreen` (sau `SetProcessDPIAware`) → PNG full-res. Win32 đưa đúng cửa-sổ Chrome lên trước: `EnumWindows`+`GetWindowThreadProcessId` **lọc process `chrome.exe`** (KHÔNG lọc title — app Claude-Code Electron cùng class `Chrome_WidgetWin_1` + title chứa tên-project → khớp NHẦM) + `SetForegroundWindow` + ALT-tap. 2. **Khoanh đỏ:** inject DOM overlay `window.__ccA([{text|q,n,minLeft/maxLeft/exact/up/nth}])` **element-based** (`getBoundingClientRect`) — KHÔNG rect-cứng (Chrome-screenshot render kích-thước đổi 812↔833). Match **case-INSENSITIVE** (label CSS uppercase → textContent mixed-case). `minLeft>250` bỏ sidebar (text trùng menu). 3. **Crop:** chrome+taskbar (top=92/bottom=72); banner CDP "Claude started debugging" sau `navigate` → top≈146; verify = **montage dải-trên 12 ảnh** (heuristic-color nhầm header trắng, không tin được). 4. **Chèn:** `python-docx cell.add_picture(width=Inches(≤6.1))` — A4 content=6.27" nên 6.3" tràn. 5. **An-toàn prod:** chỉ xem/scroll/screenshot, KHÔNG bấm nút mutate (Gửi/Duyệt/Trả-lại/Tạo-HĐ); `?mode=new` không tạo draft tới khi sửa field (auto-save on-edit). Chi-tiết → `docs/gotchas.md #74` + session log `2026-06-25-S90-guide-screenshots-insert.md`. Liên-quan browser-driving = em-main solo (vòng-lặp thị-giác, không fan-out Workflow) [[feedback-workflow-fanout-reliability]].