one-shot-ui
v0.7.0Deterministic UI extraction and screenshot diffing for AI coding agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
compare Compare a build against a reference screenshot
Deterministically diff an implementation screenshot against a reference screenshot. Returns a pixel-mismatch ratio, width/height deltas, and a ranked list of structural issues (missing/extra elements, position, size, color, shadow, spacing), plus an irreducible-mismatch floor so you know when further pixel-chasing is futile. Inputs are image file paths (PNG/JPG); the same inputs always produce the same numbers.
| Parameter | Type | Description |
|---|---|---|
implementation_path * | string | Path (absolute, or relative to the server's launch directory) to the current build screenshot. |
reference_path * | string | Path (absolute, or relative to the server's launch directory) to the reference (design) screenshot. |
auto_resize | boolean | Resize the implementation to the reference's dimensions before diffing. |
disable_ocr | boolean | Skip OCR text extraction. OCR runs by default and roughly doubles latency; disable it when you don't need text content or typography (note: extract then returns empty fontSizes). |
heatmap_path | string | If set, write a diff heatmap PNG to this path. |
region | string | Limit the diff to a named semantic anchor from the reference. |
top | integer | Maximum number of issues to return (default 20). |
extract Extract structured design data from a screenshot
Analyze a single reference screenshot into structured data an agent can build from: layout regions (position/size), dominant colors, typography, spacing, and a suggested implementation strategy. Returns a compact summary by default; set full=true for the complete report. Input is an image file path.
| Parameter | Type | Description |
|---|---|---|
image_path * | string | Path (absolute, or relative to the server's launch directory) to the screenshot to analyze. |
disable_ocr | boolean | Skip OCR text extraction. OCR runs by default and roughly doubles latency; disable it when you don't need text content or typography (note: extract then returns empty fontSizes). |
fine | boolean | Use fine-grained (4px) layout detection for small details. |
full | boolean | Return the full detailed report instead of the compact summary. |
suggest_fixes Get ranked fix suggestions from a diff
Diff a build against a reference and return concrete, ranked fix observations (size, color, shadow, spacing) with values measured from the reference. Selectors are only emitted when they resolve from real DOM; for screenshot-only input the fixes are region-anchored observations with capped confidence rather than guessed selectors. Inputs are image file paths.
| Parameter | Type | Description |
|---|---|---|
implementation_path * | string | Path (absolute, or relative to the server's launch directory) to the current build screenshot. |
reference_path * | string | Path (absolute, or relative to the server's launch directory) to the reference (design) screenshot. |
disable_ocr | boolean | Skip OCR text extraction. OCR runs by default and roughly doubles latency; disable it when you don't need text content or typography (note: extract then returns empty fontSizes). |
framework | string | Output format: react or vanilla (default react). |
region | string | Limit fixes to a named semantic anchor from the reference. |
styling | string | Styling output: tailwind or css (default tailwind). |
top | integer | Maximum number of fixes to return (default 20). |
tokens Extract design tokens from a screenshot
Extract design tokens (color palette, spacing scale, radii) from a reference screenshot. Input is an image file path.
| Parameter | Type | Description |
|---|---|---|
image_path * | string | Path (absolute, or relative to the server's launch directory) to the screenshot to analyze. |
disable_ocr | boolean | Skip OCR text extraction. OCR runs by default and roughly doubles latency; disable it when you don't need text content or typography (note: extract then returns empty fontSizes). |
plan Generate an implementation strategy from a screenshot
Generate a suggested implementation plan (layout strategy, CSS primitives, repeated patterns, typography notes) from a reference screenshot. Input is an image file path.
| Parameter | Type | Description |
|---|---|---|
image_path * | string | Path (absolute, or relative to the server's launch directory) to the screenshot to analyze. |
disable_ocr | boolean | Skip OCR text extraction. OCR runs by default and roughly doubles latency; disable it when you don't need text content or typography (note: extract then returns empty fontSizes). |