valdi-mock-iterate

Compares design mocks against rendered Valdi screenshots and produces structured visual fix feedback.

16.4k|541|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/Snapchat/Valdi --skill valdi-mock-iterate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: valdi-mock-iterate
Source: https://github.com/Snapchat/Valdi/tree/main/ai-skills/skills/valdi-mock-iterate
Command: npx skills add https://github.com/Snapchat/Valdi --skill valdi-mock-iterate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

When generating Valdi UI code from a design mock, it is hard to objectively judge how close the rendered output is to the target design. This Skill acts as the critic in a mock-to-module pipeline, systematically comparing the mock and the rendered screenshot and producing specific, actionable code fixes without ever looking at the source code.

Core Features & Use Cases

  • Systematic visual comparison: Scans layout, spacing, typography, colors, and components to list every difference between mock and rendered output.
  • Structured fix feedback: Outputs ISSUE/ELEMENT/EXPECTED/ACTUAL/FIX/SEVERITY entries plus a match score, top-3 fixes, and a MATCH/ITERATE/RESTRUCTURE verdict.
  • Pixel diff tooling: Bundled scripts compute an objective match percentage with auto-masking of avatar regions and generate a side-by-side diff image.
  • Use Case: In a generator+critic loop, feed a Figma export and a valdi inspect snapshot screenshot to get prioritized fixes like font size bumps, spacing corrections, and missing dividers until the output matches the design.

Quick Start

Compare this design mock image with the rendered Valdi screenshot and tell me exactly what to fix to make them match.

Frequently Asked Questions about valdi-mock-iterate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare a design mock with a rendered Valdi screenshot?

Provide both the mock image and the rendered screenshot from valdi inspect snapshot, then scan layout, spacing, typography, colors, and components systematically. Report each difference as a structured entry with expected value, actual value, and a specific code fix.

How to get an objective match score between two UI screenshots?

Run the bundled diff.py script with the --auto-mask flag on the mock and rendered images. It prints a match percentage and writes a side-by-side diff image to /tmp/mock-vs-render-diff.png where bright spots indicate mismatches.

What are the most common first-iteration mistakes in generated Valdi UI?

The most frequent issues are font sizes 30-50% too small, vertical spacing too tight, text colors too dark, card padding too small, and border radii too sharp. Recommending all of these fixes at once dramatically reduces iteration count.

Why should avatar regions be masked when diffing UI screenshots?

Avatars, thumbnails, and Bitmoji render as colored placeholder circles that unfairly penalize the match score. The --auto-mask flag auto-detects and excludes these regions so the score reflects real layout and styling differences.

What differences should not be reported when reviewing rendered UI?

Do not report platform rendering differences like system font rendering, shadow approximation, scroll indicators, or status bar chrome. Also skip animation timing, gesture behavior, and dynamic data, since these cannot be fixed by editing the .tsx layout file.