preview

Captures headless Chromium screenshots of Next.js dev server routes to verify visual changes.

Updated Nov 17, 2025
One-click install
npx skills add https://github.com/vzakharov/vovazakharov.com --skill preview-vzakharov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: preview
Source: https://github.com/vzakharov/vovazakharov.com/tree/main/.claude/skills/preview
Command: npx skills add https://github.com/vzakharov/vovazakharov.com --skill preview-vzakharov

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdfium2, pillow.

What problem does it solve? Judging visual changes by reading code is unreliable — spacing, overflow, contrast, and narrow-width reflow cannot be derived from source. This Skill renders the actual page in headless Chromium and captures screenshots so appearance is verified by observation, in both light and dark themes. ## Core Features & Use Cases - Headless screenshot capture: Boots the Next.js dev server, waits for it to answer, and captures viewport screenshots with Chrome's built-in --screenshot flag — no Playwright dependency. - Theme and width handling: Documents the --force-dark-mode flag for dark captures, the 500px headless width floor that falsifies sub-500px captures, and CDP-based driving for true phone widths, hover states, and pixel measurement. - Print verification: Rasterizes committed PDFs with pypdfium2 to inspect print stylesheets that only manifest on paginated paper. - Use Case: After changing a component's color, capture the route at 1280px in both themes, read the images back, and confirm the contrast holds in dark mode before claiming the change works. ## Quick Start Boot the dev server for the site and capture a screenshot of the changed route in both light and dark themes, then tell me what the images actually show.

Frequently Asked Questions about preview

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I take a screenshot of a web page with headless Chrome?

Run Chromium with --headless=new --screenshot=<path> --window-size=<W>,<H> and the target URL. The capture covers only the viewport, so increase the window height to see content below the fold.

How to test dark mode in headless Chrome screenshots?

Pass --force-dark-mode so the page's own color-scheme logic resolves to dark, and verify with --dump-dom that the expected attribute applied. Do not use --enable-features=WebContentsForceDark, which fabricates an inverted rendering the site's CSS never produces.

Why is my headless Chrome screenshot wrong at mobile widths?

Headless Chromium enforces a 500px layout floor: widths requested below 500 are laid out at 500 and then cropped, producing fake overflow. Use the DevTools Protocol's Emulation.setDeviceMetricsOverride for honest 360px or 390px captures.

Can headless Chrome capture hover states in screenshots?

Not by default — headless reports (hover: none), so :hover rules never apply. Pass --blink-settings with hover-capable pointer flags, or drive the page over CDP with Input.dispatchMouseEvent to set :hover before capturing.

How do I visually test print CSS stylesheets?

Rasterize the committed PDF with pypdfium2 and read the page images back, since print rules only appear on paginated paper. Never point Chromium at a file:// PDF — it renders the viewer chrome and writes a blank image.