1---2name: figma-pixel-verify3description: Measure whether a running UI matches a Figma design-spec table (computed styles / box metrics + optional screenshots). Use when checking pixel alignment / 对照 Figma 验收 after implement, including light/dark or multi-theme scope (switch theme, measure per-mode rows separately, report per theme). Bounded loop; honest residuals if no JS-eval channel. Triggers — 「检查像素对齐」「对照 Figma 验收」「设计保真检查」「是否对齐稿面」「figma 保真检查」「暗黑模式验收」「多主题保真检查」 / verify Figma fidelity, pixel check, dark mode fidelity check, multi-theme verify. Do NOT use as the primary implement workflow (use figma-pixel-implement) or for code→Figma.4---56# Figma Pixel Verify78Measure a **running** UI against a Figma **design-spec table** and report pass/fail with evidence. Optionally suggest bounded fixes; do not pretend measurement succeeded without a real measurement channel.910## When to use1112- After `figma-pixel-implement` (or any Figma implement pass that left a spec table)13- User asks to check pixel alignment / design fidelity / 对照稿面验收14- Standalone: user provides Figma URL + running preview URL/route; extract or rebuild a minimal spec table first1516## Inputs17181. **Design-spec table** — From implement artifacts, or rebuild via Figma metadata/variables (same columns as implement reference).192. **Runnable UI** — Local/dev URL, Storybook, or in-editor preview the Agent can observe.203. **Optional:** Figma screenshot for side-by-side vision (supporting evidence, not a substitute for numeric checks when JS-eval is available).2122## Workflow (ordered)23241. **Preflight** — Confirm preview is reachable; list which rows will be measured. If no spec table exists, extract a minimal one from Figma before claiming verify. Note the spec's theme scope (`mode` column / per-mode rows) and, when multiple themes are in scope, how the running UI switches themes (project toggle, `data-theme`, system preference) before measuring.252. **Vision (optional)** — Capture UI vs Figma screenshot; note gross mismatches (wrong component, missing block, theme drift).263. **Numeric measurement** — For each critical row, read **computed style** and/or **bounding box** from the live DOM (or equivalent runtime). Map selectors carefully; prefer stable test ids when present. For multi-theme specs, switch the running UI to each theme via its switching mechanism and measure per-mode rows under that theme — the same row under different themes is a separate verdict.274. **Compare** — Apply tolerances in [reference.md](reference.md). Assign a **verdict** per row.285. **Bounded fix loop** — On actionable DRIFT, fix code → re-measure. Cap at about **3** meaningful iterations, then stop with remaining residuals listed.296. **Report** — Use the template in [reference.md](reference.md). For multi-theme scope, report per theme (sections or a theme column). Overall status is not PASS if any critical HARDCODED/DRIFT/MISSING-style remains — in any theme in scope — unless the user explicitly accepts residuals.3031## Verdict taxonomy3233| Verdict | Meaning |34|---------|---------|35| **PASS** | Within tolerance of expected |36| **DRIFT** | Measurable but outside tolerance |37| **HARDCODED** | Value matches by luck or literal, not via project token/variable when the spec required a token — flag when token mapping was part of the contract |38| **VARIANT** | Matches a different documented variant (e.g. hover/dark) than the requested one |39| **MISSING-style** | Property not measurable (no node, no style, or channel unavailable) |4041## Tool intent (platform-agnostic)4243| Intent | Agent may use |44|--------|----------------|45| Open/preview UI | Browser MCP, simple browser, device preview |46| Read computed styles / boxes | JS evaluate in page, DevTools-like APIs, test harnesses |47| Screenshots | Browser or Figma screenshot tools |48| Apply fixes | Native edit tools, then re-measure |4950If **no** JS-eval / computed-style channel exists: run vision-only comparison, label numeric rows **MISSING-style** or residual, and **do not** claim pixel PASS.5152## Relationship5354| Skill | Boundary |55|-------|----------|56| `figma-pixel-implement` | Produces code + spec table; does not own final verdict |57| Agent-native Figma→code guidance / MCP fetch | Not a substitute for measurement |58| Host PDCA workflows | Optional invoke — not a default strong dependency |5960## Pitfalls6162- Declaring PASS from screenshots alone when measurement was possible.63- Infinite tweak loops without re-measure.64- Treating ±1 CSS px geometry noise on high-DPR as failure without noting DPR.65- Silent skip of mask/currentColor issues — if implement violated asset rules, call that out as root cause of color DRIFT.66- Marking per-mode rows PASS after measuring only the default theme — each theme in scope is measured under its own theme.