[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.

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