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 集成