---
description: "Audits a screen's mock-mode build against its Figma design (iOS / Android, local-only). Picks the repo and module, gates on mock support, enumerates every state driver into a countable target set, builds Debug in a worktree, launches in mock mode, fetches the Figma variants, compares each on pixels, px-spacing, typography and color, and exports a side-by-side annotated report (HTML + PDF + Confluence) to ~/DesignChecks. A coverage gate fails the run when a target is neither audited nor skipped with a reason. Use when checking that an implemented screen matches its Figma design, after a UI change or before a design review."
description-tr: "Mock-mod vs Figma tasarım denetimi (iOS / Android, yalnızca lokal). Repo + modül seç, mock desteğini geçitle, her state sürücüsünü sayılabilir bir hedef kümesine çıkar, worktree'de Debug derle, mock modda aç, Figma varyantlarını çek, her varyantı piksel + px-boşluk + tipografi + renk düzeyinde karşılaştır, yan yana annotasyonlu raporu (HTML + PDF + Confluence) ~/DesignChecks altına aktar. Bir hedef ne denetlenmiş ne de gerekçeyle atlanmışsa kapsam geçidi koşuyu başarısız sayar. Uygulanmış bir ekranın Figma tasarımıyla eşleştiğini doğrularken, UI değişikliğinden sonra veya tasarım incelemesinden önce kullan."
argument-hint: '[scope]  -  empty = whole module; screen name; screen@variant; Figma URL(s); --resume'
parameters: [{"name":"scope","kind":"text"},{"name":"--resume","kind":"flag"}]
gui: form
destructive: false
confirm: none
allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, AskUserQuestion, Skill, mcp__claude_ai_Figma__get_metadata, mcp__claude_ai_Figma__get_design_context, mcp__claude_ai_Figma__get_screenshot, mcp__multi-agent__design_mock_detect, mcp__multi-agent__design_scenario_inventory, mcp__multi-agent__design_mock_launch, mcp__multi-agent__design_ui_geometry, mcp__multi-agent__design_visual_compare, mcp__multi-agent__design_contrast_check, mcp__multi-agent__ios_visual_diff, mcp__multi-agent__design_report, mcp__multi-agent__ios_list_devices, mcp__multi-agent__ios_boot_device, mcp__multi-agent__ios_launch_app, mcp__multi-agent__ios_terminate_app, mcp__multi-agent__ios_screenshot, mcp__multi-agent__ios_tap, mcp__multi-agent__ios_swipe, mcp__multi-agent__ios_type_text, mcp__multi-agent__ios_open_url, mcp__multi-agent__ios_get_ui_tree, mcp__multi-agent__ios_status_bar, mcp__multi-agent__ios_set_appearance, mcp__multi-agent__ios_set_locale, mcp__multi-agent__ios_xcodebuild, mcp__multi-agent__ios_xcresult, mcp__multi-agent__android_list_devices, mcp__multi-agent__android_screenshot, mcp__multi-agent__android_tap, mcp__multi-agent__android_swipe, mcp__multi-agent__android_type_text, mcp__multi-agent__android_open_url, mcp__multi-agent__android_launch_app, mcp__multi-agent__android_stop_app
---

# /multi-agent:design-check - Mock-mode vs Figma design audit

**Access check, before anything else.** This command can write outside this machine, so a login the site closed is stopped here, before any question or write.

```bash
ACCESS_LINE=$(node "$HOME/.claude/scripts/usage-access.mjs"); ACCESS_RC=$?
```

`ACCESS_RC` 3: print `$ACCESS_LINE` as written and stop: no question, no write, attended or unattended. Any other exit continues (the check fails open). Contract: `$HOME/.claude/multi-agent-refs/features/usage-reporting.md` "The access check".

Runs the app in **mock mode** on a simulator / emulator and compares each screen and mock variant against Figma at the **pixel + geometry + typography + color** level. **Local-only**: no CI, no commits, no PR; the report goes to `~/DesignChecks/`, the worktree only isolates the Debug build.

> **Language**: this spec stays English. `outputLanguage` covers conversational lines and the report (`design_report` `report.lang`); `header` chips, paths, identifiers and logs stay English. Contract: `$HOME/.claude/multi-agent-refs/rules.md` "Language Application".

## Gotchas

- A scope that matches no inventory target is an error, not an empty run; print the closest ids and stop.
- The coverage gate fails the run when a target was neither audited nor skipped with a reason. "Not reached" is not "passed".
- A Figma variant with no matching mock state is a finding about the mock, not a pass for the screen.

## Scope, requirements, tracker

Before Phase 0, read `$HOME/.claude/multi-agent-refs/design-check/scope-and-ledger.md`: the scope grammar (empty, screen, `screen@variant`, target id, Figma URL, `--resume`), the requirements, the tracker detail and the ledger rules. Whole-module is the default and is meant to finish; scope is for resuming or re-checking, never for trimming. No mock mode and no snapshot capture: halt.

Tracker: `phase-tracker.sh init` + `add` for `0:Init & Gate`, `1:Build & Launch`, `2:Figma`, `3:Drive & Compare`, `4:Report`, plus `TaskCreate` in phase order first (`$HOME/.claude/multi-agent-refs/tracker-contract.md`).

Every Phase 0 / Phase 2 decision is a native `AskUserQuestion` per `picker-contract.md` with a `Step <i>/<n>` breadcrumb; confirm even a single option; never inherit state from a previous run.

## Phase 0 - Init, feasibility gate, inventory

Read `$HOME/.claude/multi-agent-refs/design-check/mcp-currency-gate.md` for step 0 and `$HOME/.claude/multi-agent-refs/design-check/init-inventory.md` for steps 1-9.

0. **MCP currency gate** before anything expensive: session stale or disk stale: **HALT** (reconnect, or update the checkout). Never substitute a local `node` call for a missing tool.
1-3. Repo picker, module picker, platform detect.
3b. **Config check**: `design-check-config.mjs --repo <repo>` holds `design-check-config.json` to its schema; exit 1: print its output as written and **HALT**, exit 2: the repo path does not resolve, stop, any other exit continues (a missing file is valid). Detail in `init-inventory.md`.
4. **Mock feasibility** (`design_mock_detect`): `false`: offer the **snapshot lane** (`captureLane = "snapshot"`, no in-app flips), declined or not renderable: **HALT** with `reason`, never fabricate a comparison. `"debug-only"`: warn, Continue / Cancel. `true`: persist `state.designCheck.mock`.
5. **Scenario inventory** (`design_scenario_inventory`) is the target set; persist verbatim. `truncated: true`: say so and pass `coverage.truncatedInventory: true` in Phase 4. `targetCount: 0`: only the default launch state is auditable. List `ignored[]`.
6-7. Scope resolve, `--resume`; confirm only above `coverage.confirmAbove` relaunches, as a cost estimate, never offering a smaller scope.
8-9. Report dir now; worktree `{projectRoot}/.worktrees/DC-<shortId>`, never under $HOME.

## Phase 1 - Build & launch

Debug build in the worktree, launch via `design_mock_launch`; Phase 3 relaunches, never rebuilds. Read `$HOME/.claude/multi-agent-refs/design-check/build-launch.md` for Phase 1.

## Phase 2 - Figma mapping

The only Figma discovery; later only a node the user hands over in 3.3. **Ambiguous or unmatched: defer to 3.3, never guess.** Read `$HOME/.claude/multi-agent-refs/design-check/figma-mapping.md` for Phase 2.

## Phase 3 - Drive, capture, match, compare

Iterate `scope.targetIds`; done when every id is resolved, not when taps run out. Before the first compare, read `$HOME/.claude/multi-agent-refs/features/design-conformance.md`.

- **3.1** Drive `inventory.plan` batch by batch; persist `state` and `run-state.json` after every capture. Unreachable: skip with a concrete reason. Read `$HOME/.claude/multi-agent-refs/design-check/drive-capture.md`.
- **3.2-3.4** Confident matches only; batch-ask everything unmatched ONCE, showing each live screenshot; compare all pairs (`tolerance_px: 2, color_tolerance: 3, max_diff_pct: 1.0`), sheets and modals with region alignment. **Edge insets are defects**: never raise `tolerance_px` to hide one. Read `$HOME/.claude/multi-agent-refs/design-check/compare.md`.
- **3.5** Every id ends covered or skipped; `covered + skipped` must equal `targetIds` before Phase 4.

## Phase 4 - Report and coverage gate

Use `state.designCheck.reportDir`. Pass ids, not counts; each variant carries `walk` with `didNotConverge` and `notVerified`. Export with `design_report` (Confluence only when enabled). Read `$HOME/.claude/multi-agent-refs/design-check/export.md` for Phase 4.

**Coverage gate (blocking)**: `pass`: report results and paths. `fail`: the run is **INCOMPLETE**; print `coverageError`, `unaccountedIds` and `/multi-agent:design-check --resume`. Never pad the covered list. Remove the worktree unless asked to keep it; never the report dir.
