/agent-skills:pixel-diff <reference> <repo-path> [route]from agent-skills
Verify a live UI implementation against a reference design via pixel-level screenshot diffing, reporting a mismatch percentage and localizing each differing region to a DOM selector. Use when implementing UI meant to match a design pixel-for-pixel, or when asked to check or verify visual fidelity against an HTML mock or a screenshot.
Ships in agent-skills. 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.
Diffs one screenshot against another and reports where they differ. It does not implement fixes itself — that's a separate step you take afterward with the report in hand.
Invoked with a reference (an HTML file path — a screenshot image also works, see below), the path to the repo holding the live implementation, and an optional route (default /). The repo must already have a playwright.config.ts with a webServer block — read it first; if webServer isn't configured, say so and stop rather than starting the dev server yourself.
Read playwright.config.ts. Confirm webServer exists and note its url — the base the live implementation is reachable at. If the reference is a screenshot image rather than HTML, read RASTER-REFERENCE.md before continuing; it changes how the viewport gets sized.
Write a throwaway spec file (wherever the config's testDir expects test files) that:
file://<reference-path>, sets the viewport to 1440×900 (deviceScaleFactor: 1) unless told otherwise, and takes a fullPage screenshot.<webServer.url><route> in a second page, performs whatever clicks, fills, or hovers get it into the state described in the invocation (a modal open, a tab selected — infer these from what you're asked to verify; there's no separate argument for them), then takes a fullPage screenshot at the same viewport.mask option (page.screenshot({ mask: [...], maskColor: '#000000' })), so that content never enters the diff. Only mask what's explicitly named; don't mask every image by default, since a wrong image or broken sizing is still a real mismatch worth catching. Check what a candidate selector actually bounds before using it — inspect its getBoundingClientRect() and children, don't infer scope from a class name or from it merely containing an image. A selector that resolves to a whole card (image and the price/text beneath it) masks that real, comparable text too, not just the photo; the fix is the narrower element (the image's own wrapper, e.g. :first-child of the card). A too-broad mask turns the reference into a bigger black rectangle than its counterpart on the live side, and that asymmetry itself gets counted as mismatch — it can dominate the whole report and bury genuine findings underneath it.pixelmatch, threshold from the invocation or 1% mismatch by default. For a plain pass/fail plus a diff image, its CLI works standalone with no install (npx pixelmatch reference.png current.png diff.png <threshold>). For localization (next bullet), you need pixelmatch and pngjs as real, resolvable packages instead — npx -p pixelmatch -p pngjs node script.js does not make them import-resolvable from a separate script. Scratch-install them (npm install --no-save pixelmatch pngjs in a throwaway directory outside the target repo) and put the diff script alongside that node_modules, so plain node script.js resolves them.pixelmatch's diff buffer (pngjs gives you that buffer read/write), flood-fill adjacent cells into clusters — and call elementFromPoint at its center against the live page to report a DOM selector, not raw coordinates. When scanning the diff buffer for mismatched pixels, match on the exact diffColor you passed in (default [255, 0, 0]) — don't just check that the red channel is 255. Anti-aliasing-only differences (excluded from mismatchedPixels when includeAA is left at its false default) are drawn in a different option, aaColor (defaults to yellow), not diffColorAlt — diffColorAlt is unrelated to AA at all; it recolors some counted mismatches to distinguish "added" from "removed" content, and defaults to null (off). Passing a color to diffColorAlt by mistake (easy to do, given the name) makes some real mismatches share a color with excluded AA pixels, throwing off any pixel count you compute from the buffer yourself. Leave diffColorAlt unset and match on diffColor exactly, and your own count will equal mismatchedPixels.pixelmatch's per-pixel YIQ-weighted tolerance — that tolerance is calibrated to wave through antialiasing, not to catch a uniform recolor, so a real, large color change can register as near-zero mismatch and never surface as a cluster at all. Reuse the grid cells from the clustering step above; for any cell pixelmatch did not flag, compute each image's own pixel-color variance within that cell. Where both images agree a cell is flat (low variance — a solid fill, not text or a photo), compare their average colors directly with a plain RGB Euclidean distance (no YIQ tolerance). Flag cells over a fixed cutoff (~30) as a solid-fill mismatch, reported separately from pixelmatch's own findings — this is the one class of real difference a global threshold can never be tuned to catch without also drowning in antialiasing noise, so it needs this separate, targeted check instead of a lower threshold.Run it: npx playwright test <spec-file>. This starts, or reuses, the dev server via the project's own webServer config.
Delete the spec file and both screenshots once you've read the results. Nothing from this skill gets committed.
State, in the conversation:
<img> or an element with a background-image, flag it as possibly non-deterministic content rather than a real mismatch, and suggest re-running with it masked.pixelmatch's own findings and labeled as such — these are real color differences that the mismatch percentage above does not include, since pixelmatch itself scored them as matching.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub joachimwedin/agent-skills --plugin agent-skills32 skills in this plugin
/blackbox-test-casesGenerate exhaustive, non-negotiably rigorous black-box test case descriptions (Given/When/Then, not code) for a public API's external contract — never its implementation. Use for zero-tolerance test coverage, an extremely strict/exhaustive black-box test case sweep, or whenever "thorough" test-case generation isn't thorough enough. Produces an API handoff file, one case file per sub-agent — each is its own source of truth — and a master index file pointing at all of them. Every case carries a checkbox so a later implementing agent can track what's been turned into runnable tests. This skill never writes runnable tests itself./brand-palettePick a primary and accent color that fit a given project and fit each other, or — given an explicit primary — pick three accent candidates that each fit the primary and the project, then generate the full Tailwind v4 color-token system (raw OKLCH scales plus the semantic layer, light and dark) for all three candidates as copy-paste CSS and a visual HTML report written into the project. Use when the user wants brand colors chosen for a project, a Tailwind color system generated from a repo, or a secondary/accent color picked to pair with a primary they already have./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.