
One Shot Ui
io.github.TN0123由 GitHub 帳號 TN0123 發布v0.7.0更新於 Oct 24, 2026
Deterministic UI extraction and screenshot diffing for AI coding agents.
概覽
本機 MCP 伺服器,可從截圖擷取 UI 結構、將實作與參考圖做差異比對,並回傳依影響排序的 CSS 修正建議。
- 可以做什麼
- 從參考截圖擷取版面區域、顏色、字體與文字
- 對兩張截圖做像素與結構差異比對,產生熱區圖與 DOM 差異
- 提供排序後的 CSS 或 Tailwind 修正建議,並以 converge 產出經像素驗證的修補檔
- 擷取設計權杖與樣式系統,並檢查新介面是否符合參考圖的設計語言
- 截取網址或本機 HTML 檔案的畫面,並產生實作方案或執行基準測試
- 適用情境
- 適合 AI 編碼代理已把介面做到接近參考截圖、但在間距、顏色、陰影或字體上仍有細微落差時,用可重現的確定性量測與具體 CSS 修正,取代反覆「再看一次截圖」的猜測。也適合檢查新頁面是否符合既有設計系統。
- 執行需求
- 透過 npx 以 stdio 在本機執行 npm 套件 one-shot-ui,需要 Node.js 與 npm。涉及瀏覽器截圖的指令需另外安裝 Playwright Chromium。未宣告任何 API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 One Shot Ui,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
one-shot-ui
Catch what the eye can't.
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.
[npm version] [license] [node]
[one-shot-ui diffs an agent's build against the reference screenshot and flags the exact deltas]The problem
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.
Watch it converge
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.
Why one-shot-ui
- Deterministic, not vibes. Stable pixel + structural diff scores — same input, same numbers — so you can gate CI on "is this pixel-close enough?"
- Exact fixes, not nudges. It returns concrete CSS (
width: 616px,#303040,gap: 176px), grouped by component and ranked by visual impact. - Structural, not just pixels. Detects missing/extra elements, position & size shifts, color, shadow, spacing, and typography — and labels which differences are irreducible (anti-aliasing, photographic content) so agents don't chase ghosts.
- Not gameable.
convergescores 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-heightoverflow:hiddenbox) — the failure a pixel diff rewards, because cropped text lowers the mismatch. - Agent-native. Ships an
AGENTS.md(auto-discovered by Claude Code, Cursor, Codex, …) plus a Claude Code skill, so your agent drives it without hand-holding. - Local & private. Pixel diffing, OCR, and layout extraction all run on your machine. No images leave your box, no API keys.
Copy a UI's style, not just match it
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.
Install
For commands that need a browser (capture, run):
Quick start
Every command supports --json for structured, agent-friendly output.
Use it with your coding agent
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:
Use it as an MCP server
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.
Commands
How it works
- extract — segments the reference into layout regions, samples colors/tokens, and OCRs text.
- capture — screenshots your implementation (URL or local HTML) at a matched viewport.
- compare — aligns the two, computes a pixel heatmap and a structural diff, and classifies each issue (layout / color / typography / spacing) plus whether it's actionable.
- suggest-fixes — turns issues into concrete, ranked CSS edits.
run chains all four in a loop until the diff drops below --threshold.
Development
Requires Bun.
Dev scripts run directly from source:
Build for npm:
License
MIT
來源:README.md,提交 b3f90a7
工具
0版本歷史
1- v0.7.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分