# Design-to-Code Pipeline Patterns Orchestration workflows chaining Stitch design generation with ClaudeKit implementation skills. ## Basic Pipeline ``` Prompt -> Stitch Generate -> Export HTML -> Claude Implements Components ``` ### Steps 1. User describes desired UI in natural language 2. Run `stitch-generate.ts` with the prompt 3. Show preview image to user for approval 4. Run `stitch-export.ts --format all` to get HTML + DESIGN.md 5. Hand DESIGN.md to implementation skill 6. Implementation skill reads DESIGN.md and codes components ### Example ```bash # 1. Generate npx tsx stitch-generate.ts "E-commerce product page with image gallery, price, reviews, add-to-cart button" # 2. Export npx tsx stitch-export.ts --format all --output ./stitch-exports/ # 3. Implementation skill reads ./stitch-exports/DESIGN.md # 4. Activate ck:frontend-design to implement React components from the spec ``` ## Advanced Pipeline (with Variants) ``` Prompt -> Generate -> Variants -> User Picks -> Export -> Implement ``` ### Steps 1. Generate base design 2. Generate 2-3 variants with different aspects (color, layout) 3. Show all variants to user 4. User selects preferred variant 5. Export selected variant 6. Hand off to implementation ### Example ```bash # Generate with variants npx tsx stitch-generate.ts "SaaS pricing page" --variants 3 # User reviews images, picks variant 2 npx tsx stitch-export.ts --format all ``` ## DESIGN.md Specification DESIGN.md is an agent-readable markdown file containing extracted design tokens. ### Structure ```markdown # Design System ## Colors - `bg-blue-600` (primary background) - `text-gray-900` (body text) - `border-gray-200` (dividers) ## Typography - `text-2xl font-bold` (headings) - `text-base font-normal` (body) ## Spacing - `p-4` (card padding) - `gap-6` (grid gaps) ## Components - `