# design-check - Phase 2 Figma fetch & variant mapping

1. Resolve the Figma URL (`$ARGUMENTS`, or ask through the picker). Parse `fileKey` + `nodeId` (`figma.com/design/{fileKey}/...?node-id={id}`; convert `-`→`:` in node ids).
2. `mcp__claude_ai_Figma__get_metadata({ fileKey, nodeId })` → the frame tree. Treat direct child frames as **candidate variants**.
3. **Map inventory targets → Figma frames**: match each scoped target's `screen` + `label` (and `state.designCheck.mock.variantsHint`) to frame names by similarity.
   - Confident 1:1 match → accept.
   - Ambiguous or unmatched → deferred to the Phase 3.3 batch-ask, where the live capture can be shown alongside the question.
   - `debug-only` projects → a single variant (the default state) mapped to the primary frame.
4. For each mapped variant: `mcp__claude_ai_Figma__get_screenshot` (the design render PNG, downloaded locally) and `mcp__claude_ai_Figma__get_design_context` (node geometry: `absoluteBoundingBox`, `itemSpacing`, paddings, text `fontSize`/`fontFamily`, `fills` colors, and any `CodeConnectSnippet` component name). Flatten the node subtree with the geometry helper into a `figma_spec` element list. Record the Figma frame size (`figmaFrame`).

Persist the variant list + spec + PNG paths to `state.designCheck.variants[]`.
