Design System Patterns
Human-centered design knowledge: user research, IA, visual + interaction design, design systems, accessibility, responsive behavior, platform guidelines, and design-to-code handoff. Combines cognitive psychology (Gestalt, Nielsen heuristics) with platform conventions (Material 3, Apple HIG) to produce accessible, conversion-optimized interfaces. Use this knowledge when applying the ui-ux-designer role or any workflow that needs UX rigor.
User Research
Design Thinking phases: Empathize → Define → Ideate → Prototype → Test.
Personas + Jobs-to-Be-Done
- Personas: evidence-based, not invented. Capture goals, frustrations, context, technical proficiency.
- JTBD: frame features as the job a user hires the product to do. Reduces feature inventory bias.
User Journeys
End-to-end touchpoints with emotions, pain points, and opportunities mapped per stage. Reveals friction invisible at the single-screen level.
Research Methods
Interviews, contextual inquiry, card sorting, tree testing, surveys, A/B testing, heatmaps. Choose by question: discovery (interviews), structure (card sort), validation (A/B).
Usability Testing
Task-based, think-aloud protocol. 5 users surface ~85% of issues (Nielsen). Test on real devices, not desktop simulations.
Information Architecture
- Content hierarchy: most important first. Progressive disclosure for complexity.
- Navigation: global, local, breadcrumbs, contextual. Cap top-level items at 7±2.
- Mental models: match user expectations, not org chart. Validate via card sorting.
- Wayfinding: user always knows where they are, where they can go, how to return.
- Search: prominent on content-heavy sites; autocomplete + filters + facets.
- Scan patterns: F-pattern for text-heavy pages; Z-pattern for landing pages.
Visual Design
Typography
- Maximum 2 typefaces per system.
- Type scale ratio 1.2–1.5 (modular scale).
- Line height 1.4–1.6 for body text.
- Line length 45–75 characters for readability.
Color
- 60-30-10 rule (dominant / secondary / accent).
- Semantic status colors (success, warning, error, info) mapped to primitive tokens.
- WCAG contrast: 4.5:1 body text, 3:1 large text + UI components.
- Never use color alone to convey meaning — pair with icon, text, or pattern.
- Dark mode: semantic tokens decouple light/dark from component code.
Grid + Layout
- 4px or 8px base unit.
- 12-column grid for desktop.
- Consistent gutters per breakpoint.
- Whitespace is functional — generous spacing improves readability and trust.
Visual Hierarchy
Establish importance order via size, color, contrast, spacing, position, typography weight. Apply Gestalt principles:
- Proximity: grouped items perceived as related.
- Similarity: consistent styling implies consistent function.
- Continuity: aligned elements scan as a flow.
- Closure: implied shapes complete in perception.
- Figure-ground: foreground vs background separation drives focus.
- Common region: containers (cards, boxes) group implicitly.
Elevation
Consistent shadow scale (sm → xl). Shadows encode hierarchy, not decoration.
Interaction Design
Micro-interactions
Trigger → Rules → Feedback → Loops. Visible feedback within 100ms keeps users oriented.
States
Design every state: default, hover, focus, active, disabled, loading, error, success, empty. Skipping any state = bug.
Transitions
150–300ms. Ease-out on enter, ease-in on exit. Motion supports comprehension, never decoration alone.
Affordances
Interactive elements must look interactive. Clear clickability, editability, draggability cues.
Fitts's Law
Larger targets faster to acquire; nearer targets faster still. Touch targets ≥44×44px; WCAG 2.2 minimum 24×24px.
Error Prevention
Constraints over confirmations. Undo over warnings. Inline validation on blur, not on every keystroke.
Progressive Disclosure
Essentials first. Details on demand. Reduces cognitive load.
Loading
Skeletons over spinners. Optimistic UI for predictable success. Progress indicators when >1s.
Design Systems (Atomic Design + Tokens)
Atomic Design
Atoms (tokens, icons, buttons) → Molecules (input groups, cards) → Organisms (headers, forms) → Templates → Pages.
Design Tokens (3 tiers)
- Primitive: raw values (
blue-500: #3B82F6).
- Semantic: purpose-mapped (
color-primary: {blue-500}, color-error: {red-500}).
- Component: component-scoped (
button-bg: {color-primary}).
Token categories: color, spacing, typography, elevation, border-radius, motion duration + easing.
Component Specs
Document props, variants, sizes, all states, accessibility requirements, usage guidelines, do/don't examples. Every component has anatomy + behavior + a11y + code example.
Versioning
Semantic versioning per release. Changelog every update. Breaking changes require migration guide.
Accessibility (WCAG 2.2 AA)
- Perceivable: alt text, captions, contrast (4.5:1 / 3:1), resizable to 200% without loss.
- Operable: full keyboard navigation, no traps, skip links, focus management, target ≥24×24px.
- Understandable: consistent navigation, predictable behavior, error suggestions, clear labels.
- Robust: valid HTML, ARIA only when native semantics insufficient. Test with NVDA, VoiceOver, JAWS.
- Focus: visible indicators ≥2px, logical tab order, trap inside modals, restore on close.
- ARIA: follow WAI-ARIA Authoring Practices for tabs, dialogs, menus, comboboxes, listboxes.
Responsive + Mobile-First
- Breakpoints: 320 (mobile), 640 (sm), 768 (md), 1024 (lg), 1280 (xl), 1536 (2xl).
- Fluid typography:
clamp(min, preferred, max) scales smoothly between breakpoints.
- Flexible layouts: CSS Grid for page layout; Flexbox for component layout. Avoid fixed widths.
- Content reflow: stack columns on mobile, expand on desktop. Never hide critical content on mobile.
- Touch vs pointer: larger targets, swipe gestures, bottom-reachable primary actions on mobile.
- Hover: enhances only — never gates functionality.
- Container queries: component-level responsiveness independent of viewport.
Platform Guidelines
Material Design 3
Dynamic color (user-themable palette derived from a seed), expressive motion, adaptive layouts. Primary reference for Android + cross-platform web.
Apple HIG
Clarity, deference, depth. SF Symbols for iconography. Primary reference for iOS + macOS. Respect platform conventions (swipe-back gesture, safe areas, status bar contrast).
Fluent Design
Depth, motion, material, scale. Reference for Windows surfaces.
Web Conventions
Underlined links, top-left logo → home, search/cart top-right. Violate only with deliberate cause.
Heuristics
Nielsen 10 (apply during review)
- Visibility of system status
- Match between system and real world
- User control + freedom (undo, exits)
- Consistency + standards
- Error prevention
- Recognition over recall
- Flexibility + efficiency (shortcuts for experts)
- Aesthetic + minimalist design
- Help users recognize, diagnose, recover from errors
- Help + documentation
Gestalt (apply during composition)
Proximity, similarity, continuity, closure, figure-ground, common region — see Visual Hierarchy.
Conversion-Centered Design
- Hierarchy directs action: primary CTA stands out via size, color, contrast, position, surrounding whitespace.
- Above the fold: clear headline, supporting subhead, visual, single primary CTA. One job per screen.
- Social proof: testimonials, ratings, logos, case studies — placed near decision points.
- Friction reduction: minimal form fields, progress indicators on multi-step forms, autofill support, one-click actions when safe.
- Trust signals: security badges, guarantees, transparent pricing, privacy assurances near conversion.
- Urgency + scarcity: only when genuine. Fabricated timers and fake stock counts are dark patterns.
- A/B testing: one variable at a time. Reach statistical significance before declaring a winner.
Design-to-Code Handoff
- Tokens → CSS variables:
--color-primary, --spacing-4, --font-size-lg.
- Component specs: every variant, every state, responsive behavior, animation timing.
- Spacing: multiples of base unit (4 or 8 px). No arbitrary values.
- Assets: SVG for icons, WebP/AVIF for photos, 1× + 2× raster fallbacks when needed.
- Animation specs: property, duration, easing, delay. Prefer CSS transitions over JS.
- Figma mappings: Auto Layout ↔ Flexbox, variants ↔ component props, tokens ↔ CSS variables, components ↔ Storybook stories.
Anti-Patterns
- Designing only the happy path — always specify empty, loading, error, edge-case states.
- Pixel-perfect obsession at the expense of responsive resilience.
- Ignoring platform conventions — users expect familiar patterns.
- Decorative complexity without purpose.
- Fixed layouts that break on unexpected screen sizes or content lengths.
- Color as the sole indicator — always pair with icon, text, or pattern.
- Tiny touch targets — frustrating for mobile + motor-impaired users.
- Inconsistent spacing + alignment — destroys visual rhythm and trust.
- Bypassing the design system with one-off values — creates unmaintainable UI.
When this applies
| Workflow |
Apply this knowledge |
Agent(ui-ux-designer) invocation |
Auto-loaded |
/feature-design Wave 2 UX-FLOW |
Spawned designer loads this |
/architecture (UX-FLOW step) |
Architect references for IA + flows |
/seo-review (accessibility section) |
SEO reviewer references WCAG checks |
/content-creation (visual direction) |
Content designer references tokens + hierarchy |
/code-review (UI changes) |
Reviewer checks tokens + states + a11y |
Integration
- Consumed by:
ui-ux-designer (primary), frontend-engineer (implementation handoff), content-designer (visual direction), seo-engineer (a11y + Core Web Vitals), content-writer (UI microcopy).
- External references: WCAG 2.2, Material Design 3, Apple HIG, Microsoft Fluent, Nielsen Norman Group heuristics, WAI-ARIA Authoring Practices.
1---2name: design-system-patterns3description: Use this skill when designing UI, defining or auditing a design system, reviewing UX deliverables, specifying components, evaluating accessibility, or producing redlines and tokens for engineering handoff — the UI/UX knowledge base covering user research, personas, jobs-to-be-done, user journeys, usability testing, information architecture, wireframing, prototyping, visual design, typography, color theory, grid systems, visual hierarchy, micro-interactions, animation, design systems, atomic design, design tokens, Figma workflows, WCAG 2.2 accessibility, responsive and mobile-first design, Material Design 3, Apple HIG, Nielsen heuristics, Gestalt principles, conversion-centered design, and design-to-code handoff.4---56# Design System Patterns78Human-centered design knowledge: user research, IA, visual + interaction design, design systems, accessibility, responsive behavior, platform guidelines, and design-to-code handoff. Combines cognitive psychology (Gestalt, Nielsen heuristics) with platform conventions (Material 3, Apple HIG) to produce accessible, conversion-optimized interfaces. Use this knowledge when applying the `ui-ux-designer` role or any workflow that needs UX rigor.910## User Research1112Design Thinking phases: Empathize → Define → Ideate → Prototype → Test.1314### Personas + Jobs-to-Be-Done15- **Personas**: evidence-based, not invented. Capture goals, frustrations, context, technical proficiency.16- **JTBD**: frame features as the job a user hires the product to do. Reduces feature inventory bias.1718### User Journeys19End-to-end touchpoints with emotions, pain points, and opportunities mapped per stage. Reveals friction invisible at the single-screen level.2021### Research Methods22Interviews, contextual inquiry, card sorting, tree testing, surveys, A/B testing, heatmaps. Choose by question: discovery (interviews), structure (card sort), validation (A/B).2324### Usability Testing25Task-based, think-aloud protocol. 5 users surface ~85% of issues (Nielsen). Test on real devices, not desktop simulations.2627## Information Architecture2829- **Content hierarchy**: most important first. Progressive disclosure for complexity.30- **Navigation**: global, local, breadcrumbs, contextual. Cap top-level items at 7±2.31- **Mental models**: match user expectations, not org chart. Validate via card sorting.32- **Wayfinding**: user always knows where they are, where they can go, how to return.33- **Search**: prominent on content-heavy sites; autocomplete + filters + facets.34- **Scan patterns**: F-pattern for text-heavy pages; Z-pattern for landing pages.3536## Visual Design3738### Typography39- Maximum 2 typefaces per system.40- Type scale ratio 1.2–1.5 (modular scale).41- Line height 1.4–1.6 for body text.42- Line length 45–75 characters for readability.4344### Color45- 60-30-10 rule (dominant / secondary / accent).46- Semantic status colors (success, warning, error, info) mapped to primitive tokens.47- WCAG contrast: 4.5:1 body text, 3:1 large text + UI components.48- Never use color alone to convey meaning — pair with icon, text, or pattern.49- Dark mode: semantic tokens decouple light/dark from component code.5051### Grid + Layout52- 4px or 8px base unit.53- 12-column grid for desktop.54- Consistent gutters per breakpoint.55- Whitespace is functional — generous spacing improves readability and trust.5657### Visual Hierarchy58Establish importance order via size, color, contrast, spacing, position, typography weight. Apply Gestalt principles:59- **Proximity**: grouped items perceived as related.60- **Similarity**: consistent styling implies consistent function.61- **Continuity**: aligned elements scan as a flow.62- **Closure**: implied shapes complete in perception.63- **Figure-ground**: foreground vs background separation drives focus.64- **Common region**: containers (cards, boxes) group implicitly.6566### Elevation67Consistent shadow scale (sm → xl). Shadows encode hierarchy, not decoration.6869## Interaction Design7071### Micro-interactions72Trigger → Rules → Feedback → Loops. Visible feedback within 100ms keeps users oriented.7374### States75Design every state: default, hover, focus, active, disabled, loading, error, success, empty. Skipping any state = bug.7677### Transitions78150–300ms. Ease-out on enter, ease-in on exit. Motion supports comprehension, never decoration alone.7980### Affordances81Interactive elements must look interactive. Clear clickability, editability, draggability cues.8283### Fitts's Law84Larger targets faster to acquire; nearer targets faster still. Touch targets ≥44×44px; WCAG 2.2 minimum 24×24px.8586### Error Prevention87Constraints over confirmations. Undo over warnings. Inline validation on blur, not on every keystroke.8889### Progressive Disclosure90Essentials first. Details on demand. Reduces cognitive load.9192### Loading93Skeletons over spinners. Optimistic UI for predictable success. Progress indicators when >1s.9495## Design Systems (Atomic Design + Tokens)9697### Atomic Design98Atoms (tokens, icons, buttons) → Molecules (input groups, cards) → Organisms (headers, forms) → Templates → Pages.99100### Design Tokens (3 tiers)101- **Primitive**: raw values (`blue-500: #3B82F6`).102- **Semantic**: purpose-mapped (`color-primary: {blue-500}`, `color-error: {red-500}`).103- **Component**: component-scoped (`button-bg: {color-primary}`).104105Token categories: color, spacing, typography, elevation, border-radius, motion duration + easing.106107### Component Specs108Document props, variants, sizes, all states, accessibility requirements, usage guidelines, do/don't examples. Every component has anatomy + behavior + a11y + code example.109110### Versioning111Semantic versioning per release. Changelog every update. Breaking changes require migration guide.112113## Accessibility (WCAG 2.2 AA)114115- **Perceivable**: alt text, captions, contrast (4.5:1 / 3:1), resizable to 200% without loss.116- **Operable**: full keyboard navigation, no traps, skip links, focus management, target ≥24×24px.117- **Understandable**: consistent navigation, predictable behavior, error suggestions, clear labels.118- **Robust**: valid HTML, ARIA only when native semantics insufficient. Test with NVDA, VoiceOver, JAWS.119- **Focus**: visible indicators ≥2px, logical tab order, trap inside modals, restore on close.120- **ARIA**: follow WAI-ARIA Authoring Practices for tabs, dialogs, menus, comboboxes, listboxes.121122## Responsive + Mobile-First123124- **Breakpoints**: 320 (mobile), 640 (sm), 768 (md), 1024 (lg), 1280 (xl), 1536 (2xl).125- **Fluid typography**: `clamp(min, preferred, max)` scales smoothly between breakpoints.126- **Flexible layouts**: CSS Grid for page layout; Flexbox for component layout. Avoid fixed widths.127- **Content reflow**: stack columns on mobile, expand on desktop. Never hide critical content on mobile.128- **Touch vs pointer**: larger targets, swipe gestures, bottom-reachable primary actions on mobile.129- **Hover**: enhances only — never gates functionality.130- **Container queries**: component-level responsiveness independent of viewport.131132## Platform Guidelines133134### Material Design 3135Dynamic color (user-themable palette derived from a seed), expressive motion, adaptive layouts. Primary reference for Android + cross-platform web.136137### Apple HIG138Clarity, deference, depth. SF Symbols for iconography. Primary reference for iOS + macOS. Respect platform conventions (swipe-back gesture, safe areas, status bar contrast).139140### Fluent Design141Depth, motion, material, scale. Reference for Windows surfaces.142143### Web Conventions144Underlined links, top-left logo → home, search/cart top-right. Violate only with deliberate cause.145146## Heuristics147148### Nielsen 10 (apply during review)1491. Visibility of system status1502. Match between system and real world1513. User control + freedom (undo, exits)1524. Consistency + standards1535. Error prevention1546. Recognition over recall1557. Flexibility + efficiency (shortcuts for experts)1568. Aesthetic + minimalist design1579. Help users recognize, diagnose, recover from errors15810. Help + documentation159160### Gestalt (apply during composition)161Proximity, similarity, continuity, closure, figure-ground, common region — see Visual Hierarchy.162163## Conversion-Centered Design164165- **Hierarchy directs action**: primary CTA stands out via size, color, contrast, position, surrounding whitespace.166- **Above the fold**: clear headline, supporting subhead, visual, single primary CTA. One job per screen.167- **Social proof**: testimonials, ratings, logos, case studies — placed near decision points.168- **Friction reduction**: minimal form fields, progress indicators on multi-step forms, autofill support, one-click actions when safe.169- **Trust signals**: security badges, guarantees, transparent pricing, privacy assurances near conversion.170- **Urgency + scarcity**: only when genuine. Fabricated timers and fake stock counts are dark patterns.171- **A/B testing**: one variable at a time. Reach statistical significance before declaring a winner.172173## Design-to-Code Handoff174175- **Tokens → CSS variables**: `--color-primary`, `--spacing-4`, `--font-size-lg`.176- **Component specs**: every variant, every state, responsive behavior, animation timing.177- **Spacing**: multiples of base unit (4 or 8 px). No arbitrary values.178- **Assets**: SVG for icons, WebP/AVIF for photos, 1× + 2× raster fallbacks when needed.179- **Animation specs**: property, duration, easing, delay. Prefer CSS transitions over JS.180- **Figma mappings**: Auto Layout ↔ Flexbox, variants ↔ component props, tokens ↔ CSS variables, components ↔ Storybook stories.181182## Anti-Patterns183184- Designing only the happy path — always specify empty, loading, error, edge-case states.185- Pixel-perfect obsession at the expense of responsive resilience.186- Ignoring platform conventions — users expect familiar patterns.187- Decorative complexity without purpose.188- Fixed layouts that break on unexpected screen sizes or content lengths.189- Color as the sole indicator — always pair with icon, text, or pattern.190- Tiny touch targets — frustrating for mobile + motor-impaired users.191- Inconsistent spacing + alignment — destroys visual rhythm and trust.192- Bypassing the design system with one-off values — creates unmaintainable UI.193194## When this applies195196| Workflow | Apply this knowledge |197|---|---|198| `Agent(ui-ux-designer)` invocation | Auto-loaded |199| `/feature-design` Wave 2 UX-FLOW | Spawned designer loads this |200| `/architecture` (UX-FLOW step) | Architect references for IA + flows |201| `/seo-review` (accessibility section) | SEO reviewer references WCAG checks |202| `/content-creation` (visual direction) | Content designer references tokens + hierarchy |203| `/code-review` (UI changes) | Reviewer checks tokens + states + a11y |204205## Integration206207- **Consumed by**: `ui-ux-designer` (primary), `frontend-engineer` (implementation handoff), `content-designer` (visual direction), `seo-engineer` (a11y + Core Web Vitals), `content-writer` (UI microcopy).208- **External references**: WCAG 2.2, Material Design 3, Apple HIG, Microsoft Fluent, Nielsen Norman Group heuristics, WAI-ARIA Authoring Practices.