From skills
Compares two screenshots to decide which is less wrong against a visual target, not against a baseline. Provides side-by-side inspection, crop/zoom, metrics, heatmaps, and edge diffing for UI, game, document, or chart visual validation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:compare-screenshotsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Decide which image is **less wrong** against what the scene should show — not
Decide which image is less wrong against what the scene should show — not whether the candidate matches the baseline. The baseline is just an earlier attempt; it can be wrong too. Treat both images as candidates measured against a target you establish yourself. Metrics locate where the images differ; they never decide who is right.
references/subagent-visual-review.md.Pick metrics that answer the question. For full visual comparisons, report:
mae: mean absolute grayscale difference, 0..255, lower is closer.rmse: grayscale root mean square error, lower is closer.diffRatio16, diffRatio32, diffRatio64: fraction of pixels over each
grayscale delta threshold.pixelmatchRatio: mismatch ratio from pixelmatch over grayscale images.edgeEnergyCurrent and edgeEnergyCandidate: average Sobel edge strength.edgeEnergyRatio: candidate/current. Far below 1 usually means missing
geometry, props, labels, or terrain; far above 1 usually means noisy or
incorrect detail.edgeDiffRatio32: fraction of pixels whose Sobel edge differs materially.avgLuminanceCurrent, avgLuminanceCandidate, avgLuminanceDelta: average
brightness and delta. Use when a render is visibly too dark/light even if a
broader distance score improves.For UI/document/layout reviews, also use crop bounds, text/foreground mask coverage, contrast checks, edge clipping, element positions, and before/after dimensions when those beat global pixel distance.
When a single fixed-pair number is useful, this default works for structural changes:
distance = 0.35 * diffRatio32 + 0.25 * pixelmatchRatio + 0.25 * edgeDiffRatio32 + 0.15 * min(1, abs(log2(edgeEnergyRatio)))
It measures distance from the other image, nothing more. Because the baseline can be wrong, a distance of 0 is not success and a large distance is not failure — a richer scene, clearer models, stronger labels, real depth, or better lighting all legitimately raise it. Use the score to find where the images move; decide who is right in step 4. Name the field for what it measures (distance, not "parity") so no one reads it as a verdict.
Report the full-frame score and, when UI dominates the shot, a labeled world-crop score. Use the world-crop score to locate renderer movement and keep the full-frame score so UI/camera mistakes stay visible.
Keep comparison scripts inside the skill or a temporary workspace, not in product code, unless the product genuinely needs screenshot comparison at runtime.
scripts/visual-parity-diff.mjs is a reusable local helper. Run it with
REFERENCE_DIR=<png-folder>, CANDIDATE_DIR=<png-folder>, and optional
OUT_DIR=<artifact-folder>. REPORT_ORDER=a,b,c pins ordering;
CROPS_JSON=<file> adds labeled crops (keyed by image id, each crop in pixels
or { "unit": "ratio" } normalized bounds).references/subagent-visual-review.md: neutral subagent prompt/config for an
independent judgment when history could bias you.npx claudepluginhub dzhng/skillsUses a fresh unprimed sub-agent to visually inspect screenshots for layout and rendering defects before accepting a fix or change.
Detects UI visual regressions via screenshot comparisons using Playwright, Cypress, Percy. Generates diffs, handles responsive breakpoints, and integrates with CI.
Detects visual and UI regressions via screenshot comparison and pixel-diff analysis using Playwright or Puppeteer. Captures cross-browser/viewport screenshots, categorizes layout shifts and color changes, generates diff reports for CI/CD PR checks.