The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the One Shot Ui listing page.
Deterministic screenshot diffing for AI coding agents. Turn a reference screenshot into structured data, diff any build against it — pixel, layout, color, and type — then get the exact CSS to fix. Or copy a UI's design language onto a brand-new screen.
AI agents get UI ~90% of the way there — then stall. The layout looks right, but a card is 8px too tall, a panel is the wrong shade of gray, a shadow is flat, a gap is off by 24px. Asking the model to "look at the screenshot again and fix it" is slow, and you get a different answer every time.
one-shot-ui closes that last 10% deterministically. It extracts structured data from a reference screenshot — layout regions, colors, typography, spacing, design tokens — diffs your implementation against it, and returns specific, ranked fixes, not "make it look more like this."
Copy-paste CSS, ranked by visual impact — every example above is real output from the run below.
The run command loops extract → capture → compare → fix until the heatmap goes quiet. In the run above, the agent's first build looked identical to the eye — one-shot-ui flagged 15 concrete deltas (position, size, color, shadow, spacing) and the loop drove the build to ~2.5% pixel mismatch, within ~0.5% of the tool's own estimated irreducible floor (≈2%, sub-pixel font rendering) for this design.
width: 616px, #303040, gap: 176px), grouped by component and ranked by visual impact.converge scores structural fidelity — is the reference's content present, placed, and legible? — not just pixel mismatch, and it refuses to win pixels by hiding, overlapping, or recoloring text into its background. It even flags reference text your build renders but clips out of view (a fixed-height overflow:hidden box) — the failure a pixel diff rewards, because cropped text lowers the mismatch.AGENTS.md (auto-discovered by Claude Code, Cursor, Codex, …) plus a Claude Code skill, so your agent drives it without hand-holding.Matching a screenshot pixel-for-pixel is one job. The other: building a different screen that feels like it belongs to the same design system. one-shot-ui extracts the design language from a reference and verifies a new UI conforms to it — deterministically, with no pixel oracle to lean on.
It reports measured facts and leaves the taste to the agent: it won't name your "primary" color or classify the mood — you decide those from the image (you're the vision model; the tool is your exact, hallucination-free eyes). Conformance is judged on what a screenshot grounds reliably — palette, spacing rhythm, type scale — while roundedness and elevation are flagged as advisories, since a raster can't pin them down.
For commands that need a browser (capture, run):
Every command supports --json for structured, agent-friendly output.
one-shot-ui ships an AGENTS.md (auto-discovered by Claude Code, Cursor, Codex, and other agent tools) plus a skill/SKILL.md for Claude Code.
Install the skill in one line:
one-shot-ui also runs as a local MCP server, so any
MCP-capable agent (Claude Code, Cursor, Cline, Windsurf, VS Code) can call compare,
converge, suggest_fixes, extract, tokens, plan, and style_check as tools — no shell
glue. It runs over stdio, makes no network calls, and needs no API keys.
Or add to any client's MCP config:
See docs/MCP.md for per-client setup and registry publishing.
| Command | Purpose | Key Flags |
|---|---|---|
extract | Analyze a screenshot into layout, color, and text data | --json, --no-ocr, --overlay, --fine |
compare | Pixel + structural diff between two screenshots | --json, --heatmap, --dom-diff |
tokens | Design tokens + a reusable style system (palette, spacing, type, radii) | --json, --emit shadcn|tailwind|json |
style-check | Check a new UI conforms to a reference's design language | --json (new UI = URL / HTML / screenshot) |
plan | Generate an implementation strategy | --json |
capture | Screenshot a URL or local HTML file | --url, --file, --output |
suggest-fixes | Tailwind/CSS fix suggestions from a diff | --json, --top, --dom-diff, --framework |
converge | Closed-loop optimizer: pixel-verified CSS patch + structural fidelity score, flags hidden/clipped text | --impl, --out, --json, --budget-seconds |
run | Multi-pass extract→capture→compare→fix loop | --impl, --max-passes, --threshold |
benchmark | Run benchmark suites | --json, --output |
run chains all four in a loop until the diff drops below --threshold.
Requires Bun.
Dev scripts run directly from source:
Build for npm:
MIT