/bidi2pdf:page-screenshotsfrom bidi2pdf
Captures screenshots of web pages at phone/desktop widths in light/dark mode for design, UX, or accessibility reviews. Uses bidi2pdf's browser renderer.
Ships in bidi2pdf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A reviewer, human or agent, judges a page from what Chrome draws. Shoot every page that changed at phone width first, then desktop, each in light and dark mode, and hand over the files with the page and the width in their names.
Does not: compare screenshots against a baseline or judge them - it produces them. For a
visual regression check, diff the PNGs in your own test (bidi2pdf's contains_pdf_image compares
images inside a PDF, see pdf-specs).
error.code, error.hint and exit code;
never make the PDF or screenshot another way (Chrome's own print-to-PDF, another PDF engine).render-pdf skill's
preflight); run nothing that changes the system without the user's yes.--json result instead of inspecting the PDF with other
tools.bidi2pdf diagnose --url http://app:4000/pricing --screenshot pricing.png --media screen --color_scheme dark
The shot is the whole document at the browser's default viewport. Good for "what did Chrome see"; for review sets with fixed widths use the script below.
SKILL_DIR=/absolute/path/to/skills/page-screenshots
ruby "$SKILL_DIR/scripts/screenshots.rb" --base http://app:4000 --pages /,/pricing,/signup \
--widths 360,1280 --out tmp/screenshots --remote-browser-url http://remote-chrome:3000/session
Set SKILL_DIR first, to the absolute path of this skill's own folder - the folder of this SKILL.md, which the
agent (Claude Code, Codex) names when it loads the skill. Nothing guarantees that the variable is already set:
without it, the command looks for /scripts/screenshots.rb. In a checkout of bidi2pdf it is
"$PWD/claude-plugin/skills/page-screenshots". Run the script by that path, not relative to the project you are
shooting.
It writes one PNG for every page, width and colour scheme and prints each path:
<page path>-<width>-<scheme>.png, with the page's folders kept (/account/settings becomes
account/settings-360-light.png, / becomes index-...). When a page's path holds characters a file
name should not, or a query, the name gets a short hash of the path, so no two pages overwrite each
other. It sets the viewport, emulates prefers-color-scheme
with media: screen, waits for the network to go quiet and captures the full page. Without
--remote-browser-url it starts a local chromedriver. It needs the bidi2pdf release with
BrowserTab#emulate_media (0.1.23 or later).
localhost on your machine - use a name it resolves.tab.set_cookie) before
navigating, or shoot a page that does not need one.The same steps for your own test or tool:
tab.emulate_media(media: "screen", color_scheme: "dark")
tab.set_viewport(width: 360, height: 900)
tab.navigate_to("http://app:4000/pricing")
tab.wait_until_network_idle
tab.screenshot("tmp/pricing-360-dark.png")
screenshot(origin: "viewport") captures exactly the viewport instead of the whole page. A full-page
shot is as wide as the document, not the viewport: a page laid out by Paged.js comes out at its sheet
width (794 px for A4) once Paged.js has finished - a print layout, not a 360 px one. A
page that toggles dark mode by a class or data-theme instead of prefers-color-scheme needs that
attribute set (tab.execute_script(...)) - emulation changes only the media feature.
List the files with page, width and scheme, and say what the reviewer should look at (the changed part). Reviewers need both widths and both schemes; a dark-mode contrast bug never shows in a light screenshot.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
screenshots, design-review, ux-review, accessibility-review, bidi2pdf
npx claudepluginhub dieter-medium/bidi2pdf --plugin bidi2pdf6 skills in this plugin
/diagnose-pdfThis skill should be used when a PDF made with bidi2pdf (CLI, Ruby API or bidi2pdf-rails) is blank, half empty, unstyled, missing images or fonts, cut off, on the wrong number of pages, shows dates in the wrong format, or breaks words badly. A checklist from the cheapest check to the most expensive, using bidi2pdf diagnose./pdf-recipeThis skill should be used when a PDF needs more than one render call - waiting for an element, clicking something open, running a script, switching to screen view or a viewport first - or when a PDF must be checked (page count, text in it, no failed requests). Writes and validates a bidi2pdf recipe YAML without a browser, then runs it./pdf-specsThis skill should be used when writing or fixing RSpec specs that render PDFs or drive pages with bidi2pdf - asserting text, page count or images in a generated PDF, starting a Chrome container for the suite, or a browser spec that is flaky, times out or sees an empty page./remote-chromeThis skill should be used when bidi2pdf (or bidi2pdf-rails) should render in a shared Chrome container instead of a local browser - setting up the chromedriver container with Docker Compose, connecting to it, sizing it, keeping sessions from piling up, and printing HTML that nobody vouches for. Also when renders fail with "session not created", hang, or the container eats memory./render-pdfThis skill should be used when a web page, a URL or an HTML file has to become a PDF with bidi2pdf's command line, including a PDF of a page's screen view, dark mode or mobile layout, a tagged (accessible) PDF, or a PDF piped through stdin/stdout. Covers the order of commands, the waits, reading the JSON result and the exit codes.Other plugins' skills for the same job