/compare-screenshots
Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Claude Code
$ npx -y skills add dzhng/skills --skill compare-screenshots --agent claude-code
Codex
$ npx skills add dzhng/skills --skill compare-screenshots -a codex -y
Cursor
$ npx skills add dzhng/skills --skill compare-screenshots -a cursor -y
Gemini CLI
$ npx skills add dzhng/skills --skill compare-screenshots -a gemini-cli -y
GitHub Copilot
$ npx skills add dzhng/skills --skill compare-screenshots -a github-copilot -y
OpenCode
$ npx skills add dzhng/skills --skill compare-screenshots -a opencode -y
Windsurf
$ npx skills add dzhng/skills --skill compare-screenshots -a windsurf -y
SKILL.md
compare-screenshots.SKILL.mdname: compare-screenshots
description: Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Compare Screenshots
Judge images against the intended result. A user-approved design is the target; a historical baseline is only an earlier attempt and may be wrong. Metrics locate differences, never decide correctness. Use [design-with-images](../design-with-images/SKILL.md) for the full exploration-to-implementation loop.
Workflow
1. **Establish the target.** Use the user-approved reference and stated design requirements when available; do not replace them with your own taste. Otherwise derive the target from the visual requirement, what the thing depicts in reality and the domain skill that owns the look. Write it down in one or two concrete sentences ("low sun should cast long shadows east; trees fill the canopy; labels stay legible at this zoom").
- If the right answer isn't clear — competing valid readings, a taste or
product-intent call, a tradeoff only the owner can settle — **stop and ask the user** what the correct answer should be. Show them the comparison. Do not quietly default to the baseline to avoid asking; that bakes in whatever the baseline got wrong. 2. **Confirm comparability** so the differences you see are real, not capture artifacts: same viewport, DPR, route/page, frozen time/tick, camera intent, UI state, data, fonts/assets where they matter. If not comparable, fix capture setup or compare only a crop/feature where the mismatch is harmless. 3. **Measure the approved design.** For reference matching, read and complete [Reference Landmarks](references/reference-landmarks.md) before changing code or accepting a candidate. Then generate artifacts sized to the question: side-by-side, key-feature crops/zooms, grayscale, absolute grayscale heatmap, pixelmatch diff, per-image Sobel/edge maps, edge-difference heatmap, JSON metrics. 4. **Inspect boundaries before judging the whole.** For every changed visual effect, inspect all sides at native scale and in matched detail crops. Include the effect's full fade and surrounding space; a crop ending at the component box hides spill. Compare top/right/bottom/left extents separately, anchored to visible text, rules or silhouettes rather than inferred CSS bounds. Check every foreground feature crossed by the effect (lines, icons, text, adjacent panels): brightness, color, sharpness and continuity must match the target. A readable line can still be incorrectly dimmed. Record each check as reference observation → candidate observation → pass/fix/uncertain, with its crop. Use the landmark table to resolve local distances and contrast; full-frame averages cannot settle a local defect. 5. **Judge each divergence against the target.** For every place the two images differ, name what is actually there in plain terms — missing content, wrong camera, bad hierarchy, weak contrast, wrong depth, text overlap, layout shift, clipped edge, unexpected blur, style mismatch — and decide which side is closer to correct. The answer can be the candidate, the baseline, both wrong, or a genuine toss-up. 6. **Get a neutral second opinion** for disputed or high-stakes calls: a fresh subagent given only the two images and neutral labels, per `references/subagent-visual-review.md`. 7. **Resolve mismatches to an approved target.** When implementing a selected design, record material differences in spacing, shape, softness, typography and hierarchy; revise, recapture and repeat until resolved or the user changes the target. Do not silently exempt a difference because the code is simpler. 8. **Conclude with one verdict:** candidate is less wrong (accept, and re-bless the baseline if one exists), baseline is less wrong (reject), both wrong (another pass needed — say what's still off), or unclear (ask the user). Accept only when every boundary/overlap check passes or has an explicit user-approved deviation; uncertainty requires closer evidence, not a pass. Overall resemblance or a positive second opinion cannot cancel a local defect. Never accept on a lower score alone or reject on a higher one. Never hide content, blur detail, crop away differences, or make the capture less truthful to move a number.
Useful Metrics
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.
- Content proxies relevant to the scene: black/void ratio, terrain-like ratio,
water-like ratio, team-color ratio, label/text mask ratio.
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.
Single-Image Metrics
Every metric above measures one image against another, so none of them can answer "is this capture worth anything" when the
Read more
name: compare-screenshots description: Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Compare Screenshots
Judge images against the intended result. A user-approved design is the target; a historical baseline is only an earlier attempt and may be wrong. Metrics locate differences, never decide correctness. Use [design-with-images](../design-with-images/SKILL.md) for the full exploration-to-implementation loop.
Workflow
1. **Establish the target.** Use the user-approved reference and stated design requirements when available; do not replace them with your own taste. Otherwise derive the target from the visual requirement, what the thing depicts in reality and the domain skill that owns the look. Write it down in one or two concrete sentences ("low sun should cast long shadows east; trees fill the canopy; labels stay legible at this zoom").
- If the right answer isn't clear — competing valid readings, a taste or
product-intent call, a tradeoff only the owner can settle — **stop and ask the user** what the correct answer should be. Show them the comparison. Do not quietly default to the baseline to avoid asking; that bakes in whatever the baseline got wrong. 2. **Confirm comparability** so the differences you see are real, not capture artifacts: same viewport, DPR, route/page, frozen time/tick, camera intent, UI state, data, fonts/assets where they matter. If not comparable, fix capture setup or compare only a crop/feature where the mismatch is harmless. 3. **Measure the approved design.** For reference matching, read and complete [Reference Landmarks](references/reference-landmarks.md) before changing code or accepting a candidate. Then generate artifacts sized to the question: side-by-side, key-feature crops/zooms, grayscale, absolute grayscale heatmap, pixelmatch diff, per-image Sobel/edge maps, edge-difference heatmap, JSON metrics. 4. **Inspect boundaries before judging the whole.** For every changed visual effect, inspect all sides at native scale and in matched detail crops. Include the effect's full fade and surrounding space; a crop ending at the component box hides spill. Compare top/right/bottom/left extents separately, anchored to visible text, rules or silhouettes rather than inferred CSS bounds. Check every foreground feature crossed by the effect (lines, icons, text, adjacent panels): brightness, color, sharpness and continuity must match the target. A readable line can still be incorrectly dimmed. Record each check as reference observation → candidate observation → pass/fix/uncertain, with its crop. Use the landmark table to resolve local distances and contrast; full-frame averages cannot settle a local defect. 5. **Judge each divergence against the target.** For every place the two images differ, name what is actually there in plain terms — missing content, wrong camera, bad hierarchy, weak contrast, wrong depth, text overlap, layout shift, clipped edge, unexpected blur, style mismatch — and decide which side is closer to correct. The answer can be the candidate, the baseline, both wrong, or a genuine toss-up. 6. **Get a neutral second opinion** for disputed or high-stakes calls: a fresh subagent given only the two images and neutral labels, per `references/subagent-visual-review.md`. 7. **Resolve mismatches to an approved target.** When implementing a selected design, record material differences in spacing, shape, softness, typography and hierarchy; revise, recapture and repeat until resolved or the user changes the target. Do not silently exempt a difference because the code is simpler. 8. **Conclude with one verdict:** candidate is less wrong (accept, and re-bless the baseline if one exists), baseline is less wrong (reject), both wrong (another pass needed — say what's still off), or unclear (ask the user). Accept only when every boundary/overlap check passes or has an explicit user-approved deviation; uncertainty requires closer evidence, not a pass. Overall resemblance or a positive second opinion cannot cancel a local defect. Never accept on a lower score alone or reject on a higher one. Never hide content, blur detail, crop away differences, or make the capture less truthful to move a number.
Useful Metrics
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.
- Content proxies relevant to the scene: black/void ratio, terrain-like ratio,
water-like ratio, team-color ratio, label/text mask ratio.
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.
Single-Image Metrics
Every metric above measures one image against another, so none of them can answer "is this capture worth anything" when the
AI skills for growing software farms. My personal library of domain-agnostic agent skills, reused across every project. Small, composable, and hackable — works with any harness that supports skills: Claude Code, Codex, opencode, Cursor, duet, and 70+ others.
Other skills on skills.
More skills from other plugins.
karpathy-guidelines
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
agent-builder
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI…
Questions about compare-screenshots.
- Which coding agents can use compare-screenshots?
- compare-screenshots installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

