one-shot-ui

v0.7.0
io.github.TN0123/one-shot-ui Checked 3 days ago Published 6 months ago

Deterministic 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.

ParameterTypeDescription
implementation_path *stringPath (absolute, or relative to the server's launch directory) to the current build screenshot.
reference_path *stringPath (absolute, or relative to the server's launch directory) to the reference (design) screenshot.
auto_resizebooleanResize the implementation to the reference's dimensions before diffing.
disable_ocrbooleanSkip 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_pathstringIf set, write a diff heatmap PNG to this path.
regionstringLimit the diff to a named semantic anchor from the reference.
topintegerMaximum 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.

ParameterTypeDescription
image_path *stringPath (absolute, or relative to the server's launch directory) to the screenshot to analyze.
disable_ocrbooleanSkip 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).
finebooleanUse fine-grained (4px) layout detection for small details.
fullbooleanReturn 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.

ParameterTypeDescription
implementation_path *stringPath (absolute, or relative to the server's launch directory) to the current build screenshot.
reference_path *stringPath (absolute, or relative to the server's launch directory) to the reference (design) screenshot.
disable_ocrbooleanSkip 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).
frameworkstringOutput format: react or vanilla (default react).
regionstringLimit fixes to a named semantic anchor from the reference.
stylingstringStyling output: tailwind or css (default tailwind).
topintegerMaximum 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.

ParameterTypeDescription
image_path *stringPath (absolute, or relative to the server's launch directory) to the screenshot to analyze.
disable_ocrbooleanSkip 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.

ParameterTypeDescription
image_path *stringPath (absolute, or relative to the server's launch directory) to the screenshot to analyze.
disable_ocrbooleanSkip 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).