[01] LOOP
DesignmanualHardened

Figma-to-Code Loop

Implement a Figma design in code, screenshot the result, diff against the design spec, and iterate until they match.

by Trooper

Kickoff prompt
Start the "Figma-to-Code Loop" loop.

Goal: implemented UI matches Figma spec within agreed tolerance
Max iterations: 12
Between iterations run: Compare implementation screenshot against Figma export or spec
Exit when: visual diff is within approved pixel tolerance

Step 1: Implement the Figma design, screenshot, diff against spec, and iterate until match.

## Before you start

Connect plugins:
- GitHub (required) — Read branches, PRs, reviews, checks, workflow runs, and source diffs.
- Browser / Web access (required) — Open pages, inspect live state, collect evidence, and verify changes.
- Figma (required) — Inspect designs, dimensions, assets, and handoff notes.

Attach skills:
- Loop runner (required) — Self-pace iterations, run the check between passes, and stop only on the exit condition.
- Code change + local verification (optional) — Edit code safely, run commands, and keep changes scoped.
- Visual design QA (optional) — Compare implementation against visual expectations and capture regressions.
- Browser QA (optional) — Exercise product flows, capture visual evidence, and verify fixes in-browser.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

Paste the kickoff prompt into Cursor, Claude Code, or Codex. Deeplinks do not install hook files.

Steps

1. Implement design

Build the Figma frame in code using project components and tokens.

2. Screenshot diff

Capture the implementation and overlay against the Figma export.

3. Iterate until match

Fix spacing, typography, and color drift until within tolerance.

Flow diagram

Guardrails

Rules the agent must follow so it cannot cheat the exit condition.

  • Do not alter the Figma spec without designer approval
  • Use design tokens and existing component library where possible
  • Document any intentional deviations with rationale

More Design loops