Design System Starter
Overview
This skill provides comprehensive guidance for building robust, scalable design systems that ensure visual consistency, improve development velocity, and create exceptional user experiences.
When to use this skill:
- Creating a new design system from scratch
- Evolving or refactoring existing design systems
- Establishing design token standards
- Defining component architecture
- Creating design documentation
- Ensuring accessibility compliance (WCAG 2.1)
- Implementing theming and dark mode
Bundled Resources:
references/design-tokens.md - Complete token definitions
references/component-patterns.md - Architecture patterns
references/component-examples.md - Full component implementations
references/theming.md - Theme and dark mode patterns
templates/design-tokens-template.json - W3C design token format
templates/component-template.tsx - React component template
// Example: Design token structure
const tokens = {
colors: {
primary: { base: "#0066cc", hover: "#0052a3" },
semantic: { success: "#28a745", error: "#dc3545" }
},
spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px" }
};
checklists/design-system-checklist.md - Design system audit checklist
Design System Philosophy
A design system is more than a component library. It includes:
| Layer |
Description |
Examples |
| Design Tokens |
Foundational design decisions |
Colors, spacing, typography |
| Components |
Reusable UI building blocks |
Button, Input, Card, Modal |
| Patterns |
Common UX solutions |
Forms, Navigation, Layouts |
| Guidelines |
Rules and best practices |
Accessibility, naming, APIs |
| Documentation |
How to use everything |
Storybook, usage examples |
Core Principles
- Consistency Over Creativity - Predictable patterns reduce cognitive load
- Accessible by Default - WCAG 2.1 Level AA compliance minimum
- Scalable and Maintainable - Design tokens enable global changes
- Developer-Friendly - Clear API contracts and documentation
References
Design Tokens
See: references/design-tokens.md
Key topics covered:
- Color scales (primitive 50-950, semantic tokens)
- Typography system (font families, sizes, weights, line heights)
- Spacing scale (4px base system)
- Border radius and shadow tokens
- W3C design token format
- Tailwind
@theme integration
Quick Reference - Token Categories:
| Category |
Examples |
Scale |
| Colors |
blue.500, text.primary, feedback.error |
50-950 |
| Typography |
fontSize.base, fontWeight.semibold |
xs-5xl |
| Spacing |
spacing.4, spacing.8 |
0-24 (4px base) |
| Border Radius |
borderRadius.md, borderRadius.full |
none-full |
| Shadows |
shadow.sm, shadow.lg |
xs-xl |
Component Patterns
See: references/component-patterns.md
Key topics covered:
- Atomic Design methodology (Atoms -> Pages)
- Props best practices (predictable names, sensible defaults)
- Composition over configuration
- Compound component pattern
- Polymorphic components
- CVA variant pattern
See: references/component-examples.md for full implementations.
Quick Reference - Atomic Design:
| Level |
Description |
Examples |
| Atoms |
Indivisible primitives |
Button, Input, Label, Icon |
| Molecules |
Simple compositions |
FormField, SearchBar, Card |
| Organisms |
Complex compositions |
Navigation, Modal, DataTable |
| Templates |
Page layouts |
DashboardLayout, AuthLayout |
| Pages |
Specific instances |
HomePage, SettingsPage |
Theming
See: references/theming.md
Key topics covered:
- Theme structure and TypeScript interfaces
- Dark mode implementation approaches
- Tailwind
@theme directive (recommended)
- Tailwind dark mode variant
- Styled Components ThemeProvider
- Theme toggle component
- System preference detection
Quick Reference - Dark Mode Approaches:
| Approach |
Best For |
Complexity |
Tailwind @theme |
New projects |
Low |
Tailwind dark: variant |
Quick implementation |
Low |
| CSS Variables |
Framework-agnostic |
Medium |
| ThemeProvider |
CSS-in-JS apps |
Medium |
Accessibility Guidelines
WCAG 2.1 Level AA Requirements
| Requirement |
Threshold |
Tools |
| Normal text contrast |
4.5:1 minimum |
WebAIM Contrast Checker |
| Large text contrast |
3:1 minimum |
|
| UI components |
3:1 minimum |
|
Essential Patterns
- Keyboard Navigation: All interactive elements must be keyboard accessible
- Focus Management: Use focus traps in modals, maintain logical focus order
- Semantic HTML: Use
<button>, <nav>, <main> instead of generic divs
- ARIA Attributes:
aria-label, aria-expanded, aria-controls, aria-live
- Screen Readers: Provide meaningful labels, announce dynamic content
Quick Start Checklist
When creating a new design system:
Current Implementation (January 2026):
- All colors defined in
frontend/src/styles/tokens.css using @theme directive
- Components use Tailwind utilities:
bg-primary, text-text-primary, border-border
- DO NOT use CSS variables in className:
bg-[var(--color-primary)]
Design System Workflow
1. Design Phase
- Audit existing patterns and identify inconsistencies
- Define design tokens (colors, typography, spacing)
- Create component inventory
- Design in Figma (create component library)
2. Development Phase
- Set up tooling (Storybook, TypeScript, testing)
- Implement tokens (CSS variables or theme config)
- Build atoms first, then compose upward
- Document as you go
3. Adoption Phase
- Create migration guide for teams
- Provide codemods to automate migrations
- Run workshops to train teams
- Gather feedback and iterate
4. Maintenance Phase
- Version semantically (major/minor/patch)
- Define deprecation strategy
- Maintain changelog
- Monitor adoption across products
Integration with Agents
| Agent |
Usage |
| Rapid UI Designer |
Uses tokens for consistent interfaces, references components |
| Frontend UI Developer |
Implements components following patterns |
| Code Quality Reviewer |
Validates design system adherence |
Skill Version: 1.0.0
Last Updated: 2025-10-31
Maintained by: AI Agent Hub Team
Related Skills
a11y-testing - Automated accessibility testing to validate WCAG compliance of design system components
focus-management - Keyboard focus patterns for accessible interactive widgets in design systems
type-safety-validation - End-to-end type safety with Zod for design token schemas and component props
react-server-components-framework - React 19 patterns for server-rendered design system components
Key Decisions
| Decision |
Choice |
Rationale |
| Token Format |
W3C Design Tokens |
Industry standard, tool-agnostic, supports theming |
| Component Architecture |
Atomic Design |
Scalable hierarchy from atoms to pages |
| Styling Approach |
Tailwind @theme directive |
Native CSS variable integration, zero runtime |
| Variant Management |
CVA (Class Variance Authority) |
Type-safe variants, composable styles |
| Documentation |
Storybook |
Interactive component playground, visual testing |
Capability Details
design-tokens
Keywords: design tokens, css variables, theme, colors, spacing
Solves:
- Create design token system
- Color palette
- Typography scale
component-architecture
Keywords: component library, atomic design, atoms, molecules
Solves:
- Structure component library
- Compound components
- Variants
accessibility
Keywords: a11y, wcag, aria, keyboard navigation, focus
Solves:
- WCAG 2.1 AA compliance
- ARIA attributes
- Keyboard support
theming
Keywords: theme, dark mode, light mode, color scheme
Solves:
- Implement dark/light mode
- Theme switching
- CSS custom properties
1---2name: design-system-starter-23description: Use this skill when creating or evolving design systems for applications. Provides design token structures, component architecture patterns, documentation templates, and accessibility guidelines. Ensures consistent, scalable, and accessible UI design across products.4---5
6# Design System Starter
7
8## Overview
9
10This skill provides comprehensive guidance for building robust, scalable design systems that ensure visual consistency, improve development velocity, and create exceptional user experiences.
11
12**When to use this skill:**
13- Creating a new design system from scratch
14- Evolving or refactoring existing design systems
15- Establishing design token standards
16- Defining component architecture
17- Creating design documentation
18- Ensuring accessibility compliance (WCAG 2.1)
19- Implementing theming and dark mode
20
21**Bundled Resources:**
22- `references/design-tokens.md` - Complete token definitions
23- `references/component-patterns.md` - Architecture patterns
24- `references/component-examples.md` - Full component implementations
25- `references/theming.md` - Theme and dark mode patterns
26- `templates/design-tokens-template.json` - W3C design token format
27- `templates/component-template.tsx` - React component template
28
29```typescript
30// Example: Design token structure
31const tokens = {
32 colors: {
33 primary: { base: "#0066cc", hover: "#0052a3" },
34 semantic: { success: "#28a745", error: "#dc3545" }
35 },
36 spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px" }
37};
38```
39- `checklists/design-system-checklist.md` - Design system audit checklist
40
41---
42
43## Design System Philosophy
44
45A design system is more than a component library. It includes:
46
47| Layer | Description | Examples |
48|-------|-------------|----------|
49| **Design Tokens** | Foundational design decisions | Colors, spacing, typography |
50| **Components** | Reusable UI building blocks | Button, Input, Card, Modal |
51| **Patterns** | Common UX solutions | Forms, Navigation, Layouts |
52| **Guidelines** | Rules and best practices | Accessibility, naming, APIs |
53| **Documentation** | How to use everything | Storybook, usage examples |
54
55### Core Principles
56
571. **Consistency Over Creativity** - Predictable patterns reduce cognitive load
582. **Accessible by Default** - WCAG 2.1 Level AA compliance minimum
593. **Scalable and Maintainable** - Design tokens enable global changes
604. **Developer-Friendly** - Clear API contracts and documentation
61
62---
63
64## References
65
66### Design Tokens
67**See: `references/design-tokens.md`**
68
69Key topics covered:
70- Color scales (primitive 50-950, semantic tokens)
71- Typography system (font families, sizes, weights, line heights)
72- Spacing scale (4px base system)
73- Border radius and shadow tokens
74- W3C design token format
75- Tailwind `@theme` integration
76
77**Quick Reference - Token Categories:**
78
79| Category | Examples | Scale |
80|----------|----------|-------|
81| Colors | `blue.500`, `text.primary`, `feedback.error` | 50-950 |
82| Typography | `fontSize.base`, `fontWeight.semibold` | xs-5xl |
83| Spacing | `spacing.4`, `spacing.8` | 0-24 (4px base) |
84| Border Radius | `borderRadius.md`, `borderRadius.full` | none-full |
85| Shadows | `shadow.sm`, `shadow.lg` | xs-xl |
86
87---
88
89### Component Patterns
90**See: `references/component-patterns.md`**
91
92Key topics covered:
93- Atomic Design methodology (Atoms -> Pages)
94- Props best practices (predictable names, sensible defaults)
95- Composition over configuration
96- Compound component pattern
97- Polymorphic components
98- CVA variant pattern
99
100**See: `references/component-examples.md`** for full implementations.
101
102**Quick Reference - Atomic Design:**
103
104| Level | Description | Examples |
105|-------|-------------|----------|
106| Atoms | Indivisible primitives | Button, Input, Label, Icon |
107| Molecules | Simple compositions | FormField, SearchBar, Card |
108| Organisms | Complex compositions | Navigation, Modal, DataTable |
109| Templates | Page layouts | DashboardLayout, AuthLayout |
110| Pages | Specific instances | HomePage, SettingsPage |
111
112---
113
114### Theming
115**See: `references/theming.md`**
116
117Key topics covered:
118- Theme structure and TypeScript interfaces
119- Dark mode implementation approaches
120- Tailwind `@theme` directive (recommended)
121- Tailwind dark mode variant
122- Styled Components ThemeProvider
123- Theme toggle component
124- System preference detection
125
126**Quick Reference - Dark Mode Approaches:**
127
128| Approach | Best For | Complexity |
129|----------|----------|------------|
130| Tailwind `@theme` | New projects | Low |
131| Tailwind `dark:` variant | Quick implementation | Low |
132| CSS Variables | Framework-agnostic | Medium |
133| ThemeProvider | CSS-in-JS apps | Medium |
134
135---
136
137## Accessibility Guidelines
138
139### WCAG 2.1 Level AA Requirements
140
141| Requirement | Threshold | Tools |
142|-------------|-----------|-------|
143| Normal text contrast | 4.5:1 minimum | WebAIM Contrast Checker |
144| Large text contrast | 3:1 minimum | |
145| UI components | 3:1 minimum | |
146
147### Essential Patterns
148
149- **Keyboard Navigation**: All interactive elements must be keyboard accessible
150- **Focus Management**: Use focus traps in modals, maintain logical focus order
151- **Semantic HTML**: Use `<button>`, `<nav>`, `<main>` instead of generic divs
152- **ARIA Attributes**: `aria-label`, `aria-expanded`, `aria-controls`, `aria-live`
153- **Screen Readers**: Provide meaningful labels, announce dynamic content
154
155---
156
157## Quick Start Checklist
158
159When creating a new design system:
160
161- [ ] Define design principles and values
162- [ ] Establish design token structure (colors, typography, spacing)
163- [ ] Create primitive color palette (50-950 scale)
164- [ ] Define semantic color tokens (brand, text, background, feedback)
165- [ ] Set typography scale and font families
166- [ ] Establish spacing scale (4px or 8px base)
167- [ ] **Use Tailwind `@theme` directive** to define tokens
168- [ ] **Components use Tailwind utilities** (`bg-primary`, `text-text-primary`)
169- [ ] Design atomic components (Button, Input, Label, etc.)
170- [ ] Implement theming system (light/dark mode)
171- [ ] Ensure WCAG 2.1 Level AA compliance
172- [ ] Set up documentation (Storybook or similar)
173- [ ] Create usage examples for each component
174- [ ] Establish versioning and release strategy
175
176**Current Implementation (January 2026):**
177- All colors defined in `frontend/src/styles/tokens.css` using `@theme` directive
178- Components use Tailwind utilities: `bg-primary`, `text-text-primary`, `border-border`
179- DO NOT use CSS variables in className: `bg-[var(--color-primary)]`
180
181---
182
183## Design System Workflow
184
185### 1. Design Phase
186- Audit existing patterns and identify inconsistencies
187- Define design tokens (colors, typography, spacing)
188- Create component inventory
189- Design in Figma (create component library)
190
191### 2. Development Phase
192- Set up tooling (Storybook, TypeScript, testing)
193- Implement tokens (CSS variables or theme config)
194- Build atoms first, then compose upward
195- Document as you go
196
197### 3. Adoption Phase
198- Create migration guide for teams
199- Provide codemods to automate migrations
200- Run workshops to train teams
201- Gather feedback and iterate
202
203### 4. Maintenance Phase
204- Version semantically (major/minor/patch)
205- Define deprecation strategy
206- Maintain changelog
207- Monitor adoption across products
208
209---
210
211## Integration with Agents
212
213| Agent | Usage |
214|-------|-------|
215| **Rapid UI Designer** | Uses tokens for consistent interfaces, references components |
216| **Frontend UI Developer** | Implements components following patterns |
217| **Code Quality Reviewer** | Validates design system adherence |
218
219---
220
221**Skill Version**: 1.0.0
222**Last Updated**: 2025-10-31
223**Maintained by**: AI Agent Hub Team
224
225## Related Skills
226
227- `a11y-testing` - Automated accessibility testing to validate WCAG compliance of design system components
228- `focus-management` - Keyboard focus patterns for accessible interactive widgets in design systems
229- `type-safety-validation` - End-to-end type safety with Zod for design token schemas and component props
230- `react-server-components-framework` - React 19 patterns for server-rendered design system components
231
232## Key Decisions
233
234| Decision | Choice | Rationale |
235|----------|--------|-----------|
236| Token Format | W3C Design Tokens | Industry standard, tool-agnostic, supports theming |
237| Component Architecture | Atomic Design | Scalable hierarchy from atoms to pages |
238| Styling Approach | Tailwind `@theme` directive | Native CSS variable integration, zero runtime |
239| Variant Management | CVA (Class Variance Authority) | Type-safe variants, composable styles |
240| Documentation | Storybook | Interactive component playground, visual testing |
241
242## Capability Details
243
244### design-tokens
245**Keywords:** design tokens, css variables, theme, colors, spacing
246**Solves:**
247- Create design token system
248- Color palette
249- Typography scale
250
251### component-architecture
252**Keywords:** component library, atomic design, atoms, molecules
253**Solves:**
254- Structure component library
255- Compound components
256- Variants
257
258### accessibility
259**Keywords:** a11y, wcag, aria, keyboard navigation, focus
260**Solves:**
261- WCAG 2.1 AA compliance
262- ARIA attributes
263- Keyboard support
264
265### theming
266**Keywords:** theme, dark mode, light mode, color scheme
267**Solves:**
268- Implement dark/light mode
269- Theme switching
270- CSS custom properties