$npx -y skills add krzysztofsurdy/code-virtuoso --skill web-screenshotCapture screenshots of web pages using shot-scraper (a Playwright-backed CLI). Use this skill whenever the user wants to take a screenshot of a website, capture a specific page element, grab a mobile or desktop view, screenshot a URL for documentation or comparison, automate visu
| 1 | # Web Screenshot |
| 2 | |
| 3 | Take reliable screenshots of web pages. This skill teaches a **tool-selection cascade** - pick the lightest tool that does the job, never install dependencies the environment did not ask for. |
| 4 | |
| 5 | ## Tool Selection Cascade |
| 6 | |
| 7 | Two cascades govern the skill: one for picking the **capture tool**, one for **escalating around a bot wall**. They are different decisions - do not mix them up. |
| 8 | |
| 9 | ### Cascade A: Picking the capture tool (no bot wall in sight) |
| 10 | |
| 11 | Before any capture, check what is already available in the environment and pick the lightest viable tool: |
| 12 | |
| 13 | | # | Tool | Detect with | Best for | Limits | |
| 14 | |---|---|---|---|---| |
| 15 | | 1 | **Browser MCP** (e.g. `mcp__*__browser_take_screenshot`) | Already loaded in this session - check the MCP tool list | Single ad-hoc shot, no install, full-page and element shots, navigation flows | Runs in docker with datacenter IP - bot walls block this; output path is inside the MCP container | |
| 16 | | 2 | **shot-scraper** (CLI) | `which shot-scraper` | Repeated captures, batch YAML, scripted automation, CI jobs | Headless by default - some bot walls fire only on headless; requires `pip install shot-scraper && shot-scraper install` once | |
| 17 | | 3 | **Playwright** (Python or Node) | `python -c "import playwright" 2>/dev/null` | Multi-step flows, headed mode with stealth, anti-bot escalation (see Cascade B Tier 1) | Library-level; more code per shot | |
| 18 | | 4 | **Ask user before installing** | None of the above present | Long-term tooling decisions | Never install silently | |
| 19 | |
| 20 | ### Cascade B: Escalating around a bot wall |
| 21 | |
| 22 | When Cascade A's pick gets blocked (status 403/429/503 or a CAPTCHA/block page), do not retry the same tool with new flags - escalate up the tiers in order. **Every tier aims at LIVE content.** Archived snapshots are not acceptable as a fallback - they give stale content with a third-party chrome on top. |
| 23 | |
| 24 | | # | Tier | What it does | When to pick it | |
| 25 | |---|---|---|---| |
| 26 | | 1 | **Playwright headed + stealth** | Local headed Chromium, stealth-patched, user's home IP | First escalation; user can install Playwright | |
| 27 | | 2 | **CDP attach to user's Chrome** | Use the user's actual running Chrome via `--remote-debugging-port` | User can relaunch Chrome with a debug flag; reuses their real session | |
| 28 | | 3 | **System-native browser + OS screen capture** | Open URL in the user's default browser, capture via the OS's built-in screenshot command | Last resort - no extra install, but brittle, steals focus, depends on OS permissions | |
| 29 | |
| 30 | **Critical rule: never `pip install` or `brew install` without asking first.** Same rule for installing browser binaries (`playwright install chromium`, `shot-scraper install`). If a tool is missing, surface what is missing and which install fixes it; let the user decide. |
| 31 | |
| 32 | [shot-scraper](https://github.com/simonw/shot-scraper) is the preferred install when long-term capture tooling is needed - it is a Playwright-backed CLI that wraps the common cases with sensible defaults. Playwright itself is the preferred install when bot-wall escalation is on the table. |
| 33 | |
| 34 | ## Core Principles |
| 35 | |
| 36 | | Principle | Meaning | |
| 37 | |---|---| |
| 38 | | **Default to shot-scraper** | One install, one command per shot. Falls through to Playwright only when shot-scraper hits a wall. | |
| 39 | | **Wait on something real** | Wait for an element, a function, or a fixed delay - never `networkidle`. Playwright's own docs discourage it. | |
| 40 | | **Element beats full page** | A targeted selector shot is smaller, stabler, and faster to diff than a stitched full-page capture. Use full-page only when layout is the subject. | |
| 41 | | **Disable animations** | CSS animations are the #1 source of flake. Always pass options that freeze them for any shot that will be compared or reused. | |
| 42 | | **Match the device** | Mobile vs desktop produces wildly different layouts. Set viewport width/height explicitly when the user cares about a specific form factor. | |
| 43 | | **Output is a file path** | Every shot lands at a known absolute path the caller can hand to the next step (framing, OCR, diffing). Never leave output to chance. | |
| 44 | |
| 45 | --- |
| 46 | |
| 47 | ## Quick Start |
| 48 | |
| 49 | ### Path A: Browser MCP is in-session (zero install) |
| 50 | |
| 51 | Use the MCP browser tools directly. No pip, no Chromium download. Names va |