Skip to content

generate-workflow

Use when orchestrating a full design-to-code pipeline — from Figma token extraction through Stitch or Magic component generation to component library registration. Also use when the user says “design to code”, “full UX workflow”, “design pipeline”, “generate from design”, or “end-to-end UI build”.

ModelSource
sonnetpack: ux-ui
Full Reference

Full design-to-code orchestrator. Sequences figma-sync → stitch-design/magic-21st → component-library in a repeatable pipeline. One skill to coordinate the whole flow.

┏━ 🎨 generate-workflow ━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ [one-line: what design-to-code task] ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┌─────────────────────────────────────────────────────────────┐
│ generate-workflow │
│ │
│ [A] SOURCE → has Figma file? ──yes──→ figma-sync │
│ no ──────→ stitch-design │
│ neither ──────→ ui-craft (vibe) │
│ │
│ [B] GENERATE → component needed? ────→ magic-21st │
│ full screen? ────→ stitch-design │
│ both? ────→ stitch first, │
│ magic second │
│ │
│ [C] REGISTER → always ────→ component-library │
│ │
│ [D] DOCUMENT → if Storybook present → storybook skill │
│ always ────→ JSDoc in file │
└─────────────────────────────────────────────────────────────┘
SituationFirst Tool
Figma file URL providedfigma-sync — extract tokens first
No Figma file, need a visual designstitch-design — generate design
No Figma, no need for full designui-craft (frontend pack) — set direction
Pure code, no design tools neededSkip to Step B
What’s neededTool
Individual UI componentmagic-21st
Full screen / page designstitch-design then implement
Both design + componentstitch-design first → magic-21st second
Existing component updatemagic-21st component update tool

Always run component-library after generating. No exceptions — orphan components accumulate.

Project setupDocumentation
Storybook configuredCreate story alongside component
No StorybookAdd JSDoc + usage example in file
Design tokensUpdate tokens.css from figma-sync output
1. figma-sync → extract @theme tokens from Figma file
2. magic-21st → /ui [component] using the extracted tokens
3. component-library → register + barrel export
1. ui-craft → run Socratic Discovery, set aesthetic direction
2. stitch-design → generate full screen design from direction
3. magic-21st → generate individual components from stitch output
4. component-library → register all generated components
1. magic-21st → /ui [component] (direct, no design phase)
2. component-library → register

Use when: design direction is already established, just need a specific component fast.

1. figma-sync → extract ALL variables from Figma design system
2. Update tokens.css with new @theme values
3. magic-21st → regenerate outdated components to match new tokens
4. component-library → audit for stale components

When figma-sync produces tokens, pass them to Magic as context:

/ui Build a card component. Use these design tokens:
--color-brand-primary: oklch(62% 0.19 250)
--radius-card: 0.75rem
--font-heading: "Inter"
Match the Figma spec: [card frame description]

Explicit token context produces better-aligned output than implicit expectations.

This skill orchestrates:

  • figma-sync — token extraction
  • stitch-design — full-screen design generation
  • magic-21st — component generation
  • component-library — registration + audit
  • ui-craft (frontend pack) — aesthetic direction
  • storybook (frontend pack) — component documentation
Pipeline: [A source] → [B generate] → [C register] → [D document]
Tokens: [N] extracted / updated
Components: [N] generated / updated
Library: [N] registered
Next: test components or push to staging