Best for
- Designing the visual system and style guide for a new web application
- Establishing a consistent design language across multiple sub-brands or pages
- Creating a robust utility system (CSS custom properties) for developers and AI coding agents
- Standardizing typography, spacing rules, and WCAG accessibility targets
- Defining iconography, motion design, and responsive component behavior
What it produces
The generated document covers:- Design system overview — brand personality, design principles (Atomic hierarchy, 8px grid, dark mode parity, accessibility)
- Design token architecture — three-layer model: primitive tokens → semantic tokens → component tokens; theming mechanism (CSS class / data attribute / media query)
- Color palette — brand colors table (light + dark mode values, contrast ratio, semantic purpose), neutral scale (9–11 grays), utility colors (info/warning/success/error)
- Typography — font family choices, font loading strategy (
font-display, preloading, fallback stacks), fluid type scale usingclamp()(Display H1 through Code), line length, modular scale ratio - Spacing system — 8px grid scale as CSS custom properties (
--space-1through--space-16), component spacing table - Border radius and shadows — radius scale (sm/md/lg/pill), shadow scales for light and dark mode
- z-index system — named layers (
--z-basethrough--z-toast: 700),isolation: isolateguidance - Iconography — icon set selection (e.g., Lucide, Phosphor, Heroicons), sizing grid (8/16/24/32px), stroke width consistency, SVG vs. icon font decision
- Imagery guidelines — photography style, illustration style, placeholder/empty-state image patterns
- Motion design — timing curves (
ease-out,ease-in,ease-in-outas cubic-bezier values), duration scale, micro-interactions per element, loading animation patterns,prefers-reduced-motionfallbacks - UI component library — 13 required components: Buttons, Form Inputs, Cards, Badges, Tables, Modals, Navigation, Dropdowns, Tooltips, Tabs, Accordion, Alerts, Toast Notifications; each with all interactive states and responsive behavior
- Component state matrix — Default, Hover, Active, Focus-Visible, Disabled, Error, Loading — for every interactive component
- Layout, responsive, and accessibility rules — grid system, breakpoints (mobile/tablet/desktop/wide), responsive component behavior per breakpoint, WCAG 2.2 checklist
- Component state reference — per data-fetching component: Loading state, Empty state, Error state
- Alternatives considered
How to invoke it
Example scenarios
Checkout portal
Analytics dashboard
Marketing website
Admin panel
Key concepts
Three-layer token architecture — never hardcode colors
Three-layer token architecture — never hardcode colors
WCAG 2.2 — contrast ratios verified for both themes
WCAG 2.2 — contrast ratios verified for both themes
- Normal text: minimum 4.5:1 contrast ratio against its background (Level AA)
- Large text (18pt+ / 24px+): minimum 3:1 ratio
- Interactive elements: visible, high-contrast focus outline (non-optional)
- Touch targets on mobile: minimum 44×44px (WCAG 2.2 Target Size)
8px grid — no arbitrary spacing values
8px grid — no arbitrary spacing values
13px, 27px, or 41px create visual inconsistency and unpredictable layout math.Motion design — purposeful and reduced-motion safe
Motion design — purposeful and reduced-motion safe
prefers-reduced-motion: reduce — every animation needs a reduced-motion fallback. Animations are not decoration: they communicate state changes and guide attention.z-index management — named layers, no magic numbers
z-index management — named layers, no magic numbers
isolation: isolate on components that create stacking contexts prevents z-index bleed between component trees.13 required components — all interactive states
13 required components — all interactive states
Responsive component behavior — document per breakpoint
Responsive component behavior — document per breakpoint
Interview process
Phase 1: Socratic clarification (mandatory)
.engineering-docs/ files. Up to 3 questions: brand tone and emotion (authoritative/developer-centric/creative), brand seed colors or hex values, and key UI components needed (checkout forms, data tables, charts).Phase 2: Design token definition
Phase 3: Component specifications
Phase 4: Layout and interaction rules
Phase 5: Revision (after user review)
last_updated.Output structure
The generated.engineering-docs/10-design-system-specification.md follows this structure:
Handoff
Reads from
1-business-plan.md— brand identity, target audience, positioning3-user-personas.md— user expectations, accessibility needs12-security-threat-model.md— security UX requirements (auth flows, error states)
Feeds into
14-technical-blueprint.md— design tokens and component specs referenced in feature designs15-implementation-plan.md— design system setup as an early build phase- Frontend implementation — CSS custom properties and component HTML patterns used directly
Quality gate
- Every color token has both light and dark mode values defined, and contrast ratios are verified for all text-bearing tokens
- All spacing, padding, and margin values align to the 8px grid (or documented 4px sub-grid for fine adjustments)
- Every interactive component specifies all states: Default, Hover, Active, Focus-Visible, Disabled, Error, and Loading
- Focus indicator styles are defined for all interactive elements with sufficient contrast in both light and dark backgrounds
- The typography scale is complete with size, weight, line height, and semantic purpose for each level
- Icon set is selected, sizing grid defined (8/16/24/32px), and stroke width is consistent
- z-index scale is defined with named layers and no raw numeric values in any component
- Font loading strategy is documented (
font-display, preloading, fallback stacks) - Every data-fetching component has Loading, Empty, and Error states defined
- Responsive behavior is documented for tables, navigation, modals, and multi-column layouts
- Motion design tokens are defined with
prefers-reduced-motionfallbacks for every animation - Design token architecture is layered (primitive → semantic → component) with documented inheritance
