GridProof

io.github.gridproof由 GitHub 帳號 gridproof 發布v0.1.3更新於 Oct 24, 2026

Gridproof your UI — automated spacing & grid QA in the agent loop (MCP server).

發布方自己的服務:Proof Holdings

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

以 Playwright 渲染執行中的前端頁面,回報間距、網格與點擊目標違規,讓編碼代理修正 UI 版面。

可以做什麼
GridProof 以無頭方式用 Playwright 渲染目標 URL,走訪 DOM 收集計算後的幾何資訊(外距、內距、gap、矩形),並依間距/權杖規則集檢查數值。它提供 gp_audit,回傳含選擇器、實際值/預期值與修正提示的結構化 JSON 違規清單;另提供 gp_report,輸入相同並額外把自包含的 HTML 報告寫入磁碟。共有四條規則:spacing-scale、arbitrary-value、gap-consistency、canonical-size。它只量測並提出建議,從不修改原始碼檔案。
適用情境
當代理正在產生或重構以 Tailwind 為基礎的 UI,而你希望在代理迴圈內自動做間距與網格檢查,讓代理稽核、修改、再稽核時使用。也適合透過一次性 CLI 對執行中的開發伺服器做快速人工檢查。它不是 CI 合併閘門,也不做截圖分析。
執行需求
以本機 stdio 程序在使用者機器上執行(僅桌面端)。需要 Node.js 與 npm 套件 gridproof,並一次性安裝約 150MB 的 Playwright Chromium。目標頁面需可連線,通常是執行中的本機開發伺服器。專案根目錄可選放 gridproof.config.json。未宣告任何驗證、帳號、API 金鑰或環境變數。
安裝前請注意
此伺服器會讀取渲染後的頁面,並在使用 gp_report 或 CLI 報告模式時將 HTML 報告檔寫入磁碟,請審慎選擇輸出路徑。它不修改原始碼檔案,程式碼變更由代理完成。它不將頁面內容傳送給第三方,也未宣告任何憑證。預設情況下發現項目僅為提示;只有點擊目標違規屬於錯誤,且不會讓建置失敗。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 GridProof,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

GridProof

[npm version] [license]

GridProof your UI — automated spacing & grid QA in the agent loop.

GridProof is an MCP server that renders your running frontend with Playwright, measures the computed geometry of every element, checks it against a spacing/token rule set, and hands back a structured fix report — so a coding agent can close the loop itself: generate, audit, fix, re-audit.

[GridProof HTML report showing spacing violations with fix hints]

The problem

AI coding agents are good at generating UI and bad at keeping it on a grid: py-[13px] instead of py-3, sibling cards with three different gaps, icons at 17px next to 24px. None of it breaks anything, so it ships — because nothing in the agent loop checks for it. GridProof is that check.

The loop

text
agent generates UI → gp_audit(url) → JSON violations with fix hints→ agent edits source → gp_audit(url) → clean report = done

The server never touches your source files. It measures a rendered page and points; the agent (which has your codebase open) makes the edit.

Quickstart

bash
# One-time: install the Chromium build Playwright uses (~150MB)npx playwright install chromium

Register in Claude Code

bash
claude mcp add gridproof -- npx -y gridproof

From a local checkout:

bash
npm install && npm run buildclaude mcp add gridproof -- node /absolute/path/to/gridproof/dist/index.js

Three ways to use it

1. gp_audit — inside the agent loop. The agent calls this MCP tool directly against your running dev server and gets back structured JSON (violations + fix hints) to act on.

2. gp_report — MCP tool that also writes an HTML report. Same inputs as gp_audit, plus it writes a self-contained, shareable HTML file to disk.

3. npx gridproof --report <url> — one-shot CLI. No MCP client needed; useful for a quick manual check or scripting.

bash
npx gridproof --report http://localhost:5173# writes ./gridproof-report.html, prints its path
npx gridproof --report http://localhost:5173 --out ./qa/report.html --viewport 375x812

The rules

Four rules. All report warn by default — nothing blocks, nothing has exit-code semantics. Suggest, don't forbid; the one exception is tap targets, which error because it's an accessibility floor, not a style opinion.

RuleDetectsSeverityExample fix
spacing-scaleComputed margin/padding/gap that isn't a multiple of the base unit (default 4px) and isn't an allowed valuewarnSnaps to the nearest valid value
arbitrary-valueOff-scale arbitrary Tailwind classeswarnpy-[13px] → py-3
gap-consistencySiblings in a flex/grid container spaced inconsistently when gap isn't setwarnSet gap-4 on the container instead of per-child margins
canonical-sizeIcon/interactive-element sizes off the canonical scale, and interactive elements below the tap-target minimumwarn (icons) / error (tap targets)Snap to canonical size; WCAG 2.5.8

Tailwind, and non-Tailwind pages

GridProof is built for Tailwind projects — that's where all four rules apply, since spacing-scale, arbitrary-value, and gap-consistency reason about Tailwind's spacing scale and utility classes.

On a page it doesn't detect as Tailwind, it auto-falls-back to accessibility-only checks: canonical-size still runs (tap targets, icon sizes), the three Tailwind-specific rules are skipped, and the report says so explicitly rather than silently under-reporting. You can force this with assumeTailwind: false in config.

Configuration

Optional gridproof.config.json at your project root (all fields optional; defaults shown):

json
{  "baseUnit": 4,  "allowedValues": [1, 2],  "canonicalSizes": [12, 14, 16, 20, 24, 32, 40, 48],  "minTapTarget": 44,  "tapTargetBreakpoint": 768,  "iconTolerance": 2,  "assumeTailwind": "auto",  "rules": {    "spacing-scale": "warn",    "arbitrary-value": "warn",    "gap-consistency": "warn",    "canonical-size": "error"  },  "suppress": [    { "selector": ".hero-art *", "rules": ["spacing-scale"] },    { "value": "13px", "reason": "optical correction, logo lockup" }  ]}

Inline suppression: data-gp-ignore (all rules) or data-gp-ignore="spacing-scale gap-consistency" on any element skips its subtree for those rules. Suppressed findings are counted, never listed.

What it deliberately does NOT do

  • No computer vision / screenshot analysis. It reads computed geometry, not pixels. A screenshot is attached to the HTML report, not analyzed.
  • No CI runner. It's an in-loop tool for an agent, not a merge gate — no exit codes, nothing fails a build.
  • No source editing. The server measures and suggests; the agent (which has your codebase) makes the edits.
  • No auth, no SaaS, no billing. It's a local MCP server and a CLI.
  • Not yet (v2 candidates, not implemented): column-grid clustering, cross-breakpoint alignment drift, Figma token import.

How it works

Playwright renders the target page headless, a single in-page script walks the DOM and collects computed geometry (margins, padding, gap, rects), and the rule engine checks each value against your config and emits violations with selectors, actual/expected values, and fix hints. It's tuned against roughly 60 real-world sites to keep false positives low — a subpixel rounding tolerance, an allowed-values list, and severity defaults all come out of that calibration, not guesswork.

Development

bash
npm installnpm run build   # tsc → dist/npm test        # vitest (unit + Playwright integration)npm run dev     # run the server from TypeScript (tsx)

License

MIT — v0.1.0

來源:README.md,提交 7e57e4a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Proof 整合