Generate DESIGN_SYSTEM.md + globals.css. Single source of truth for all visual decisions.
Prerequisites Check
- Read
progress.txt— brand colors, style direction, font preferences from IDEATE - Check for
UI_UX_SELECTIONS:block in progress.txt → if present → READ: ## Use UI/UX Selections - Read
./docs/TECH_STACK.md— CSS approach (Tailwind vs CSS Modules vs plain CSS vs SCSS) - Read
./docs/PRD.md— app type (ecommerce, SaaS, dashboard, landing) — affects component tokens
Generation Steps
- Extract design inputs from progress.txt (colors, style, fonts, dark mode)
- Generate complete color token tables (brand, primary palette 50-950, 3 gradients, neutral, semantic)
- Build typography system (font stack, type scale, weights)
- Build spacing, radius, shadow, breakpoint, animation, z-index scales
- Build component tokens (buttons, inputs, cards)
- Output complete CSS variables block (no #XXXXXX placeholders)
- Detect CSS approach from TECH_STACK.md:
- Tailwind in stack → output Tailwind config snippet AND globals.css with
@tailwindor@import "tailwindcss"(v4) - NOT Tailwind → skip Tailwind config step entirely; globals.css uses plain CSS
:root {}block only (no@tailwinddirectives)
- Tailwind in stack → output Tailwind config snippet AND globals.css with
- Output globals.css scaffold
- Save
./docs/DESIGN_SYSTEM.md - Save globals.css to
./src/styles/globals.css(or equivalent root CSS file) - Show first 20 lines as preview
- Run Validation Checklist
- Ask: "DESIGN_SYSTEM generated. Approve or request revisions?"
Output Structure
The document includes these sections in order:
- Overview (philosophy, style reference, default theme)
- Color Tokens (brand, primary 50-950 scale, 3 gradients, neutral, semantic)
- Typography (font stack, type scale)
- Spacing Scale (4px base unit, space-1 through space-20)
- Border Radius (none through full)
- Shadows (sm through xl + inner)
- Breakpoints (sm 640px through 2xl 1536px, mobile-first)
- Animation (duration + easing tokens)
- Z-Index Scale (dropdown through tooltip)
- Component Tokens (buttons: variants + sizes, inputs: states + sizes, cards: variants)
- CSS Variables block (complete :root {} + .dark {})
- Tailwind config snippet (if applicable)
- Color Usage Rules (enforcement block — BUILD must read this)
Then separately output globals.css scaffold.
Generation Rules
- All hex values are exact — from brand-colors interrogation or UI/UX selections. No #XXXXXX in final output.
- Full primary palette: generate actual hex values for all 11 shades (50-950)
- Dark mode: define light/dark pairs for all neutral tokens
- globals.css always generated even if CSS variables are incomplete
- Tailwind config uses CSS variable references, not hardcoded hex — dark mode needs only
.darkclass toggle 5a. If project does NOT use Tailwind: omit Tailwind config entirely from DESIGN_SYSTEM.md; globals.css is plain CSS only - Font family declared once in globals.css — never in component-level CSS
- Include Color Usage Rules section in DESIGN_SYSTEM.md:
ALWAYS: var(--color-primary) or className="text-primary" NEVER: #6366F1 or color: blue (hardcoded values)
Validation Checklist
DESIGN_SYSTEM VALIDATION:
✓/✗ All brand color hex values filled in (no #XXXXXX)
✓/✗ Full primary palette scale (50-950) with real hex values
✓/✗ 3 gradient presets defined as CSS variables
✓/✗ Dark mode values for all neutral tokens
✓/✗ Typography has exact font names
✓/✗ globals.css generated and saved
✓/✗ Tailwind config uses CSS variable references (not hardcoded hex) [skip if non-Tailwind stack]
✓/✗ Color Usage Rules section included
✓/✗ No placeholder text remains
Use UI/UX Selections
When UI_UX_SELECTIONS: block exists in progress.txt:
Extract palette, typography, and component style from that section.
These selections take priority over all other defaults.
Proceed with generation using these as the source for color and font decisions.