Design-to-code pipeline: extract copy from URLs, extract design tokens from images, then build React components or HTML preview variants. Use when: extracting content from websites, extracting design systems, generating frontend code, previewing design variants, sending to Figma via MCP. Also use when the user wants to build a page from a reference URL or screenshot, redesign an existing site, create visual prototypes, or generate code from a design. Triggers on "extract copy", "extract design", "build frontend", "generate variants", "export design", "send to Figma", "build from reference", "redesign this", "create prototype".
Design-to-code pipeline: discover, extract, tokenize, build.
discovery --> copy --> design --> frontend / variants / export
Each step is independent. Can run isolated or chained. Discovery is always the first step -- never skip it.
Before any operation, establish project context.
Look for existing documents in .artifacts/docs/:
prd.md -- PRDbrief.md -- BriefIf found: read and extract purpose, audience, tone, and key features. Skip to the relevant trigger operation.
Ask up to 4 questions, one stage only:
If the user answers "I don't know" to any question, mark as TBD and move forward. Summarize understanding before proceeding.
Phase 1 -- Extraction (how to obtain design tokens):
Has URL reference?
Yes --> Extract copy --> Extract design
No --> Has image reference?
Yes --> Extract design
No --> Visual discovery (tone, colors, typography) --> Extract design
Phase 2 -- Building (what to build -- user chooses):
design.json exists --> What to build?
Preview first --> Variants --> Frontend or Export
Build directly --> Frontend
Send to Figma --> Variants --> Export
External tool --> Generate prompt (v0, aura.build, replit, etc.)
Valid paths after design.json:
.artifacts/design/
├── copy.yaml # Structured content
├── design.json # Design tokens
└── variants/
├── minimal/index.html # Variant preview
├── editorial/index.html
├── startup/index.html
├── bold/index.html
├── {custom}/index.html # Custom variant (if requested)
└── index.html # Comparison page
src/ # React components (frontend)
Load only the reference matching the current trigger. For frontend and variants operations, also load aesthetics.md and web-standards.md as auto-loaded dependencies.
Never simultaneous:
| Trigger Pattern | Reference |
|---|---|
| Extract copy, copy from URL, content from website | copy.md |
| Extract design, design from image, design tokens | design.md |
| Trigger Pattern | Reference |
|---|---|
| Build frontend, create components, generate React | frontend.md |
| Generate variants, preview designs, HTML variants | variants.md |
| Export design, export to Figma, send to Figma | export.md |
aesthetics.md -- loaded by frontend.md and variants.md as design principlesweb-standards.md -- loaded by frontend.md and variants.md as implementation rulescopy.md ---------> design.md (content informs design)
design.md -------> frontend.md (tokens required)
design.md -------> variants.md (tokens required)
aesthetics.md ------> frontend.md (design principles)
aesthetics.md ------> variants.md (design principles)
web-standards.md --> frontend.md (implementation rules)
web-standards.md --> variants.md (implementation rules)
variants.md -----> frontend.md (user picks variant, then builds React)
variants.md -----> export.md (variants required for Figma export)
DO:
DON'T: