agentleFS
LucasCooperBeyLucasCooperBey/claude-skills/skills/visual-verdict/SKILL.md

visual-verdict

Skill1 starsChanged 5 months agoMITView on GitHub

Structured visual QA verdict for screenshot-to-reference comparisons. Returns JSON scores driving edit iterations. Use after any UI implementation to verify visual fidelity.

We split this skill into the rules it gives an agent

11 rules. 2 are common, 6 are distinctive, and 3 are very specific to this project.

  • 2

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After implementing any UI component, page, or design change

    line 12
  2. Distinctive:

    When verifying visual fidelity against Figma, ASCII mockups, or design specs

    line 13
  3. Distinctive:

    When no reference image exists (use design-taste for initial design instead)

    line 20
  4. Very specific:

    If score < 90, continue editing and re-run visual-verdict before any further code changes

    line 59
  5. Distinctive:

    Read reference image(s) — can be:

    line 79
  6. Very specific:

    If score >= 90: verdict is pass, mark complete

    line 132
  7. Very specific:

    If score < 90: apply suggestions, re-screenshot, re-run visual-verdict

    line 133
  8. Distinctive:

    If 3+ iterations without passing: escalate to user with full diff history

    line 134
  9. Common:

    When mismatch diagnosis is hard:

    line 138
  10. Distinctive:

    Keep visual-verdict as the authoritative decision

    line 140
  11. Common:

    Use pixel-level diff as a secondary debug aid to localize hotspots

    line 141

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Visual Verdict — Structured Visual QA

Compare generated UI screenshots against reference images and return a strict JSON verdict that drives the next edit iteration.

When to Use

  • After implementing any UI component, page, or design change
  • When verifying visual fidelity against Figma, ASCII mockups, or design specs
  • As a gate before marking frontend work complete
  • Inside design-taste and frontend-design workflows as verification step

When NOT to Use

  • Pure backend/API work with no visual output
  • When no reference image exists (use design-taste for initial design instead)

Inputs

InputRequiredSource
Reference image(s)YesFigma screenshot, design mockup, ASCII art render, or prior approved screenshot
Generated screenshotYes/screenshot skill, Playwright MCP browser_take_screenshot, or manual screenshot
Category hintOptionale.g. dashboard, form, table, marketing, mobile

Output Contract

Return JSON only with this exact shape:

{
  "score": 0,
  "verdict": "revise",
  "category_match": false,
  "differences": ["..."],
  "suggestions": ["..."],
  "reasoning": "short explanation"
}

Field Rules

FieldTypeDescription
scoreint 0-100Overall visual fidelity score
verdictstringpass (90+), revise (50-89), fail (<50)
category_matchboolDoes it match the intended UI category/style?
differences[]string[]Concrete visual mismatches (layout, spacing, typography, colors, hierarchy)
suggestions[]string[]Actionable next edits tied to differences
reasoningstring1-2 sentence summary

Pass Threshold

  • Target: 90+ to pass
  • If score < 90, continue editing and re-run visual-verdict before any further code changes
  • Track iteration count — if 3+ iterations without reaching 90, flag for human review

Workflow

Step 1: Capture Current State

# Option A: Use /screenshot skill
/screenshot browser

# Option B: Use Playwright MCP
browser_take_screenshot → saved to /tmp/screenshot-{timestamp}.png

# Option C: Manual
User provides screenshot path

Step 2: Load Reference

Read reference image(s) — can be:

  • Figma export screenshot
  • ASCII mockup rendered to image
  • Prior approved screenshot from ~/.claude/artifacts/visual-verdicts/
  • Design spec image

Step 3: Compare and Score

Evaluate across these dimensions (weighted):

DimensionWeightWhat to Check
Layout30%Element positioning, grid alignment, spacing ratios
Typography20%Font sizes, weights, line heights, hierarchy
Color20%Palette adherence, contrast, semantic color usage
Components15%Button styles, input fields, cards, icons match
Spacing15%Padding, margins, gaps between elements

Step 4: Generate Verdict

{
  "score": 87,
  "verdict": "revise",
  "category_match": true,
  "differences": [
    "Top nav spacing is 12px tighter than reference",
    "Primary button uses font-weight 500, reference shows 600",
    "Card border-radius is 8px, reference shows 6px"
  ],
  "suggestions": [
    "Increase nav item horizontal padding by 12px (px-4 → px-7)",
    "Set primary button font-weight to 600 (font-semibold)",
    "Reduce card border-radius to 6px (rounded-md)"
  ],
  "reasoning": "Core layout matches well. Typography weight and micro-spacing details need one more pass."
}

Step 5: Save Verdict

Save to ~/.claude/artifacts/visual-verdicts/{component}-{timestamp}.json

This creates an improvement trail:

visual-verdicts/
  home-page-20260401T1430.json    # score: 72
  home-page-20260401T1445.json    # score: 87
  home-page-20260401T1502.json    # score: 94 ← passed

Step 6: Loop or Pass

  • If score >= 90: verdict is pass, mark complete
  • If score < 90: apply suggestions, re-screenshot, re-run visual-verdict
  • If 3+ iterations without passing: escalate to user with full diff history

Debug Visualization

When mismatch diagnosis is hard:

  1. Keep visual-verdict as the authoritative decision
  2. Use pixel-level diff as a secondary debug aid to localize hotspots
  3. Convert hotspots into concrete differences[] and suggestions[]
# If pixelmatch is available:
npx pixelmatch reference.png generated.png diff.png 0.1

Integration Points

SkillHow Visual Verdict Fits
design-tasteRun visual-verdict after design-taste generates initial UI
frontend-designVerification gate before marking implementation done
redesignBefore/after comparison for upgrade quality
/screenshotInput capture for generated screenshots
review-changesAdd visual-verdict as pre-commit check for UI changes

Example: Full Loop

1. User: "Implement the home page from the ASCII mockup"
2. → frontend-design builds the page
3. → /screenshot captures result
4. → visual-verdict compares against ASCII mockup render
5. → Score: 78, verdict: revise
6.    Differences: sidebar width, heading size, card padding
7. → Apply 3 suggestions
8. → /screenshot captures updated result
9. → visual-verdict re-scores
10. → Score: 93, verdict: pass
11. → Done, commit

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.