Capture and visually verify local or preview web frontends across reproducible responsive viewport matrices. Use for before/after UI evidence, orientation audits, breakpoint regression checks, and cross-size visual QA; do not use for general web research or production mutations.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Responsive Web Capture?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bolens-responsive-web-capture)
---
name: responsive-web-capture
description: Capture and visually verify local or preview web frontends across reproducible responsive viewport matrices. Use for before/after UI evidence, orientation audits, breakpoint regression checks, and cross-size visual QA; do not use for general web research or production mutations.
---
# Responsive Web Capture
Choose the repository's existing browser harness first when it supports the requested captures. Keep that harness for authenticated state, hydration, interactions, and application-specific readiness; use its screenshot API and the appropriate viewport matrix without switching browser sessions. Use the bundled `scripts/capture-responsive.sh` only as a fallback for simple unauthenticated initial renders, producing initial-viewport PNGs, a TSV inventory, and a JSON run receipt.
The wrapper requires Bash, Python 3.9+, and installed Chrome/Chromium on Linux or macOS. ImageMagick is optional for labeled contact sheets. Prefer a repository-native preview server when routing, generated assets, authentication, or a production base path matters. Use `--directory` only for root-mounted static files.
## Choose the matrix
The flags below apply to the bundled helper. With another harness, use equivalent
requested viewport sizes and record its actual viewport, state, and artifacts;
do not run a second capture helper merely to obtain its receipt format.
- Use `--matrix quick` while iterating on a known defect.
- Use `--matrix standard` for ordinary responsive verification.
- Use `--matrix comprehensive` when a broad viewport audit is requested. It covers small and modern phones, tablets, laptops, 1080p, 1440p, ultrawide, and 4K, with portrait counterparts.
- Use repeated `--viewport WIDTHxHEIGHT` arguments for a focused regression rerun.
The fallback accepts at most 32 distinct viewports per run, with sides up to 8192 pixels and at most 16,777,216 pixels per image. It hashes PNGs in chunks and rejects files over 128 MiB. Split larger matrices into scoped runs.
Before starting a capture alongside other agents, follow the [shared browser capacity contract](../ci-maintenance/references/setup-contracts.md#browser-workload-ownership). The fallback helper isolates output and ports but does not enforce a host-wide concurrency limit. Use the existing coordinator or supervisor to serialize it when capacity is shared.
The comprehensive matrix is intentionally expensive. Capture representative routes rather than multiplying every route by every viewport without evidence that the cost is useful.
## Workflow
1. Discover the repository's build, preview, base-path, and browser-test commands. Build generated sites before capture.
2. Capture the baseline before editing when visual comparison matters.
3. Inspect every contact sheet and open suspicious original PNGs. A successful browser exit is not visual proof.
4. After editing, recapture affected viewports during iteration, then run the appropriate final matrix.
5. Run repository-native functional, console/network, and link checks separately. Use `web-quality-audit` for measured performance and accessibility, with `accessibility` or `core-web-vitals` for focused diagnosis. The bundled script captures an initial render and checks PNG dimensions; it does not replace interaction, accessibility, or performance testing.
6. For the bundled helper, inspect `receipt.json`: `complete` means all requested PNGs passed dimension checks. A failed capture exits nonzero and retains an `incomplete` receipt plus partial artifacts. Contact-sheet failure is recorded separately and does not discard successful captures. Report the URL, matrix, screenshots, receipt, and skipped coverage.
For sites deployed below a path such as `/project/`, start the repository-native server and pass its exact URL with `--url`. A root-mounted fallback can make absolute assets appear broken even when production is correct.
Keep evidence task-scoped unless the repository defines a tracked visual-baseline location. Use authorized test data and keep sensitive artifacts out of tracked directories.
Record each run's exact path for [temporary evidence cleanup](../git-hygiene/references/evidence-cleanup.md) at feature completion. Preserve requested screenshots, receipts, and visual baselines, then remove disposable task-owned run directories. The helper retains output for inspection and cannot determine feature completion. If handing off before completion, pass the paths and retention needs to the feature owner. Do not delete the shared `visual-evidence` root or another task's runs.
The helper requests reduced motion by default and records that choice. Use `--motion browser-default` to omit the override. Neither mode freezes animations or verifies the actual media-query result. A fixed capture delay is not a deterministic animation phase. Use `web-animation` and the repository's runtime-aware harness when scroll pinning, enter/exit states, or canvas assets need controlled capture. This script's viewport matrix does not prove those behaviors.
## Capture limits and controls
Use the repository's existing harness first when it can reach and capture the
required state. If it cannot, extend it or select a capable scripted tool through
[cli-web-evidence](../cli-web-evidence/SKILL.md); do not fall back to an initial
render when the task requires authenticated or hydrated state. The bundled fallback starts a fresh browser profile for every viewport. It does not reuse authentication, drive interactions, wait for hydration/fonts/images, scroll lazy content, assert page identity, or collect page-console/network diagnostics. For those checks and full-page coverage, use [cli-web-evidence](../cli-web-evidence/SKILL.md).
PNG dimensions are output pixels. They do not establish `innerWidth`/`innerHeight`, device emulation, or coverage of another browser engine. The receipt records requested scale and motion settings, not measured application behavior. Keep baseline and comparison settings consistent.
Each run gets a unique directory under `--output/PHASE/NAME/`; the default root is the system temporary directory's `visual-evidence`. Reruns preserve earlier evidence. `--directory` binds a loopback-only server to an automatically assigned port. An explicit occupied `--port` fails rather than reusing another server. This static server has no framework routing or authentication middleware.
`--timeout SECONDS` bounds each browser/contact-sheet command, default 30. `--ready-timeout SECONDS` controls the HTTP probe, default 10. The probe establishes reachability only. Browser processes and the owned server are cleaned up on failure or interruption. Each command log is capped at 1 MiB. Exceeding that limit stops the command and records failure. The server log has its own 1 MiB cap, with truncation recorded in `receipt.json`. Cleanup waits up to one second for the killed command to exit. `--no-contact-sheet` skips optional montage work. Read browser logs when capture fails. Do not weaken browser sandboxing to make a failed run appear successful.
## Script examples
```bash
scripts/capture-responsive.sh --name docs --directory ./dist --phase before --matrix standard
scripts/capture-responsive.sh --name app --url http://127.0.0.1:4173/project/ --phase after --matrix standard
scripts/capture-responsive.sh --name app --url http://127.0.0.1:4173/ --phase after \
--viewport 844x390 --viewport 915x412
```