Generic Design System
Design system reference adapting to any project's visual language.
Research First for New Systems
When creating a NEW design system (not following an existing one):
Skill(ui-research) # Research modern patterns first
References:
When to Use This Skill
Use for:
- Implementing UI components
- Choosing colors or typography
- Creating animations or transitions
- Ensuring visual consistency
- Setting up design tokens
- Reviewing design system compliance
Don't use when:
- UX flow design → use
generic-ux-designer
- Feature architecture → use
generic-feature-developer
- Code quality review → use
generic-code-reviewer
Design System Architecture
When to Build vs Reference
| Situation |
Action |
| Existing design system |
Follow it strictly |
| No design system |
Use this skill to establish foundations |
| Partial system |
Identify gaps, extend consistently |
Token Organization
| Layer |
Example |
Purpose |
| Primitive |
--color-blue-500 |
Raw values |
| Semantic |
--color-primary |
Meaning |
| Component |
--button-background |
Context |
Decision: Use semantic tokens in code, primitive tokens as foundation only.
Consistency Decision Tree
- Component exists? → Use existing pattern
- Similar exists? → Adapt existing (don't create competing pattern)
- New category? → Propose to user, document reasoning
Color System
Every project should define:
- Primary, Secondary, Accent
- Background, Foreground, Muted
- Destructive, Success, Warning
Contrast Requirements
| Use Case |
Minimum |
| Body text |
4.5:1 (AA) |
| Large text |
3:1 (AA) |
| UI components |
3:1 (AA) |
Typography
Font Stack
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--font-mono: "SF Mono", Monaco, "Courier New", monospace;
Type Scale
| Name |
Size |
Use |
| sm |
14px |
Secondary text |
| base |
16px |
Body text |
| lg |
18px |
Lead paragraphs |
| xl |
20px |
Section headers |
| 2xl |
24px |
Page headers |
Spacing System
Base unit: 4px or 8px
| Token |
4px Base |
Use |
| 1 |
4px |
Tight spacing |
| 2 |
8px |
Default gap |
| 4 |
16px |
Card padding |
| 6 |
24px |
Page margins |
Animation
GPU-Accelerated Only
DO animate: transform, opacity
AVOID: width, height, top, left, margin, padding
Duration
| Token |
Duration |
Use |
| fast |
100ms |
Micro-interactions |
| DEFAULT |
200ms |
Most transitions |
| slow |
300ms |
Complex animations |
Timing
--ease-default: cubic-bezier(0.4, 0, 0.2, 1);
--ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
Components
Component States
| State |
Visual Treatment |
Example |
| Default |
Base styling |
Normal button |
| Hover |
Subtle feedback |
Lighter/darker bg |
| Active |
Pressed state |
Scaled down slightly |
| Focus |
Visible outline |
2px ring, offset |
| Disabled |
Reduced opacity |
50% opacity, no pointer |
| Loading |
Spinner/skeleton |
Button with spinner |
| Error |
Destructive color |
Red border/text |
Touch Targets
- Minimum: 44x44px (WCAG 2.1 AAA)
- Spacing: 8px between adjacent targets
- Mobile: Consider 48x48px for primary actions
Buttons
| Variant |
Use |
Min Size |
| Primary |
Main actions |
44x44px |
| Secondary |
Alternative actions |
44x44px |
| Ghost |
Subtle actions |
44x44px |
| Destructive |
Delete actions |
44x44px |
Form Inputs
- Clear focus states (2px visible ring)
- Error states with messages
- Label always visible
- Required indicator
Modals
- Focus trapped inside
- Escape to close
- Dark overlay (50-70% opacity)
Responsive Breakpoints
| Token |
Min Width |
| sm |
640px |
| md |
768px |
| lg |
1024px |
| xl |
1280px |
Dark Mode
:root {
--background: #ffffff;
--foreground: #000000;
}
[data-theme="dark"] {
--background: #000000;
--foreground: #ffffff;
}
See Also
- Design Patterns - Atomic Design, tokens, component docs
- Code Review Standards - Accessibility checks
generic-ux-designer - For UX flow and research decisions
- Project
CLAUDE.md - Project-specific design constraints
READ references when:
- Setting up new design system → DESIGN_PATTERNS.md (full structure)
- Complex component patterns → DESIGN_PATTERNS.md (Atomic Design section)
1---2name: generic-design-system3description: Complete design system reference for any project - colors, typography, spacing, components, animations. Adapts to project theme and tech stack. Use when implementing UI, choosing colors, creating animations, or ensuring brand consistency. For new design systems, use ui-research skill first.4---5
6# Generic Design System
7
8Design system reference adapting to any project's visual language.
9
10## Research First for New Systems
11
12When creating a NEW design system (not following an existing one):
13
14```
15Skill(ui-research) # Research modern patterns first
16```
17
18**References:**
19
20- [UI Inspiration Sources](../_shared/UI_INSPIRATION_SOURCES.md) - Research sources
21- [Design Patterns](../_shared/DESIGN_PATTERNS.md) - Visual tokens
22
23## When to Use This Skill
24
25**Use for:**
26
27- Implementing UI components
28- Choosing colors or typography
29- Creating animations or transitions
30- Ensuring visual consistency
31- Setting up design tokens
32- Reviewing design system compliance
33
34**Don't use when:**
35
36- UX flow design → use `generic-ux-designer`
37- Feature architecture → use `generic-feature-developer`
38- Code quality review → use `generic-code-reviewer`
39
40## Design System Architecture
41
42### When to Build vs Reference
43
44| Situation | Action |
45| ---------------------- | --------------------------------------- |
46| Existing design system | Follow it strictly |
47| No design system | Use this skill to establish foundations |
48| Partial system | Identify gaps, extend consistently |
49
50### Token Organization
51
52| Layer | Example | Purpose |
53| --------- | --------------------- | ---------- |
54| Primitive | `--color-blue-500` | Raw values |
55| Semantic | `--color-primary` | Meaning |
56| Component | `--button-background` | Context |
57
58**Decision:** Use semantic tokens in code, primitive tokens as foundation only.
59
60### Consistency Decision Tree
61
621. **Component exists?** → Use existing pattern
632. **Similar exists?** → Adapt existing (don't create competing pattern)
643. **New category?** → Propose to user, document reasoning
65
66## Color System
67
68**Every project should define:**
69
70- Primary, Secondary, Accent
71- Background, Foreground, Muted
72- Destructive, Success, Warning
73
74### Contrast Requirements
75
76| Use Case | Minimum |
77| ------------- | ---------- |
78| Body text | 4.5:1 (AA) |
79| Large text | 3:1 (AA) |
80| UI components | 3:1 (AA) |
81
82## Typography
83
84### Font Stack
85
86```css
87--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
88--font-mono: "SF Mono", Monaco, "Courier New", monospace;
89```
90
91### Type Scale
92
93| Name | Size | Use |
94| ---- | ---- | --------------- |
95| sm | 14px | Secondary text |
96| base | 16px | Body text |
97| lg | 18px | Lead paragraphs |
98| xl | 20px | Section headers |
99| 2xl | 24px | Page headers |
100
101## Spacing System
102
103**Base unit:** 4px or 8px
104
105| Token | 4px Base | Use |
106| ----- | -------- | ------------- |
107| 1 | 4px | Tight spacing |
108| 2 | 8px | Default gap |
109| 4 | 16px | Card padding |
110| 6 | 24px | Page margins |
111
112## Animation
113
114### GPU-Accelerated Only
115
116**DO animate:** `transform`, `opacity`
117**AVOID:** `width`, `height`, `top`, `left`, `margin`, `padding`
118
119### Duration
120
121| Token | Duration | Use |
122| ------- | -------- | ------------------ |
123| fast | 100ms | Micro-interactions |
124| DEFAULT | 200ms | Most transitions |
125| slow | 300ms | Complex animations |
126
127### Timing
128
129```css
130--ease-default: cubic-bezier(0.4, 0, 0.2, 1);
131--ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
132```
133
134## Components
135
136### Component States
137
138| State | Visual Treatment | Example |
139| -------- | ----------------- | ----------------------- |
140| Default | Base styling | Normal button |
141| Hover | Subtle feedback | Lighter/darker bg |
142| Active | Pressed state | Scaled down slightly |
143| Focus | Visible outline | 2px ring, offset |
144| Disabled | Reduced opacity | 50% opacity, no pointer |
145| Loading | Spinner/skeleton | Button with spinner |
146| Error | Destructive color | Red border/text |
147
148### Touch Targets
149
150- **Minimum:** 44x44px (WCAG 2.1 AAA)
151- **Spacing:** 8px between adjacent targets
152- **Mobile:** Consider 48x48px for primary actions
153
154### Buttons
155
156| Variant | Use | Min Size |
157| ----------- | ------------------- | -------- |
158| Primary | Main actions | 44x44px |
159| Secondary | Alternative actions | 44x44px |
160| Ghost | Subtle actions | 44x44px |
161| Destructive | Delete actions | 44x44px |
162
163### Form Inputs
164
165- Clear focus states (2px visible ring)
166- Error states with messages
167- Label always visible
168- Required indicator
169
170### Modals
171
172- Focus trapped inside
173- Escape to close
174- Dark overlay (50-70% opacity)
175
176## Responsive Breakpoints
177
178| Token | Min Width |
179| ----- | --------- |
180| sm | 640px |
181| md | 768px |
182| lg | 1024px |
183| xl | 1280px |
184
185## Dark Mode
186
187```css
188:root {
189 --background: #ffffff;
190 --foreground: #000000;
191}
192[data-theme="dark"] {
193 --background: #000000;
194 --foreground: #ffffff;
195}
196```
197
198## See Also
199
200- [Design Patterns](./../_shared/DESIGN_PATTERNS.md) - Atomic Design, tokens, component docs
201- [Code Review Standards](./../_shared/CODE_REVIEW_STANDARDS.md) - Accessibility checks
202- `generic-ux-designer` - For UX flow and research decisions
203- Project `CLAUDE.md` - Project-specific design constraints
204
205**READ references when:**
206
207- Setting up new design system → DESIGN_PATTERNS.md (full structure)
208- Complex component patterns → DESIGN_PATTERNS.md (Atomic Design section)