Design System Generator
Overview
This skill generates a project-specific DESIGN_SYSTEM.md that enforces consistent UI/UX across:
- SPAs (React/Vue/Svelte/Angular)
- Traditional server-rendered sites (Laravel, Rails, Django, WordPress, etc.)
- Hybrid systems (admin + marketing + docs)
The design system must be component-based, portable, and practical for real implementation.
Run this skill in the main conversation. Do not spawn subagents, agent teams, or
delegated parallel workers unless the user explicitly approves the proposed
count and scope after being told that doing so can increase usage. Ask again
before expanding an approved scope.
Interactive Workflow
Required Questions
Ask these questions before generating the document:
1. Project type: SPA / Traditional / Hybrid
2. Primary framework(s): React/Vue/Svelte/Angular/None + backend/framework
3. Existing UI/template/design system already in use? (yes/no)
4. CSS approach preference:
a) Tailwind/utility-first
b) SCSS/SASS
c) CSS Modules
d) styled-components/emotion
e) Component library (MUI/Ant/etc.)
5. Do you need light mode only, light+dark, or multi-theme?
6. Accessibility target (recommend WCAG AA) and keyboard support expectations
7. Browser/device support constraints
8. i18n/RTL requirements (if any)
9. Do you want design tokens exported? (CSS vars / JSON / both)
Reply examples:
- Short: `1a 2b 3no 4a 5b 6aa 7modern 8no 9both`
- Detailed: `SPA with Vue 3, no existing design system, using Tailwind, light+dark theme, WCAG AA, modern browsers only, no RTL, export both CSS vars and JSON`
Optional Questions (ask only if relevant)
- Figma link or brand guide?
- Multi-tenant theming?
- Mobile app alignment?
Decision Policy
Rule 1: Prefer existing stack
If the project already uses a template or styling system, adapt to it.
Rule 2: Choose one best-fit direction
Do not provide 3-5 "options" unless the user requests comparison. Pick one approach and commit.
Rule 3: Source of truth before invention
Before generating or updating DESIGN_SYSTEM.md, inspect existing UI source of truth:
- project instructions (
AGENTS.md, CLAUDE.md, equivalent)
- existing design docs, screenshots, prototypes, brand notes, and component docs
- shared components, wrappers, layouts, forms, tables, modals, navigation, and state components
- theme config, Tailwind config, CSS variables, global CSS, tokens, custom classes, animations, and transitions
Do not invent tokens, classes, wrappers, animation rules, or component architecture when a project-owned source already defines them.
Safe Defaults
- React SPA: TailwindCSS + shadcn/ui (Radix primitives) + CSS variables tokens
- Vue SPA: TailwindCSS + headless components + CSS variables tokens
- Angular: Angular Material OR Tailwind + CDK (based on preference)
- Traditional: SCSS or PostCSS layered architecture (tokens/base/components/utilities), optional bundler
Output Files
Primary
Optional (only if user wants)
design-tokens.json
tokens.css
- Sample component snippets
Non-Negotiables (must appear in DESIGN_SYSTEM.md)
Accessibility
- Visible focus states
- Keyboard navigation for interactive elements
- Contrast targets (WCAG AA recommended)
- Reduced motion support
- Semantic HTML first; ARIA only when necessary
Performance / Production
- Hashed asset filenames + manifest mapping (cache busting)
- Minify CSS/JS for production
- Image optimization pipeline (including SVG optimization)
- Font loading strategy (
font-display: swap, limit weights)
Source of Truth / Reuse
- Reusable component and wrapper rules
- Token ownership and generated-token policy
- Animation, transition, and custom class policy
- No one-off visual styles when a token, utility, wrapper, or component exists
UI Verification
- Playwright/browser screenshot workflow
- Element or region screenshots before full-page screenshots
- Before/after screenshot comparison when visual output changes
- Ambiguous user images require labeled annotated copies before coding
Document Style
DESIGN_SYSTEM.md is a team artifact:
- Do not mention "AI", "assistant", "model", or "prompt"
- Use clear "Do/Don't" guidance
- Keep readable in ~10-15 minutes
DESIGN_SYSTEM.md Required Structure
Generate a tailored document using this structure:
- Scope
- Design principles (3-5 bullet max)
- Supported platforms & constraints
- Design tokens
- Color system
- Typography
- Spacing/layout
- Radius/borders/shadows
- Motion
- UI foundations
- Base styles/reset
- Focus/interaction states
- Iconography
- Component architecture
- Portability across SPA + Traditional
- Naming + folder conventions
- Required states (hover/focus/disabled/loading/error)
- Component inventory (minimum viable list)
- CSS strategy & tooling
- SPA path vs Traditional path
- Production build & asset strategy
- dist structure
- Manifest requirement
- Optimization checklist
- Accessibility checklist (ship gate)
- Visual QA and screenshot workflow
- Examples (token usage + one component example)
SPA vs Traditional Guidance
SPA guidance must include:
- Recommended bundler (Vite/Webpack/Rollup) aligned with stack
- CSS strategy (Tailwind/CSS Modules/SCSS)
- Component library decision (if any)
- Theming mechanism (CSS variables recommended)
Traditional guidance must include:
- SCSS/PostCSS architecture:
- tokens layer
- base layer
- components layer
- utilities layer
- Recommendation for bundling (optional but encouraged)
- Manifest strategy so server templates reference hashed assets
Required Manifest Guidance (Cache Busting)
Include an explicit section stating:
- Build output must produce a manifest mapping logical asset names to hashed filenames
- Server must read manifest to include assets
- Avoid stale browser caches in production
Agent-Doc Patch Snippet (Required Output)
After generating DESIGN_SYSTEM.md, also output a short patch snippet to add to AGENTS.md and/or CLAUDE.md:
## Design System
All UI components and pages must follow `DESIGN_SYSTEM.md`:
- Use design tokens (no hardcoded colors/sizes).
- Reuse shared components, wrappers, utilities, and motion rules before creating new ones.
- Implement component states (hover/focus/disabled/loading/error).
- For UI changes, capture the target element/region before full-page screenshots.
- Meet accessibility and performance requirements.
Reference Files
Before generating DESIGN_SYSTEM.md, read these reference files:
- Template:
TEMPLATE_DESIGN_SYSTEM.md - Use this as the base structure for generation
- Example CSS tokens:
examples/tokens.css - Reference for CSS variable token format
- Example JSON tokens:
examples/design-tokens.json - Reference for JSON token export format
- Example manifest:
examples/manifest.example.json - Reference for asset manifest structure
- AGENTS.md patch:
examples/AGENTS.patch.md - The exact snippet to add to AGENTS.md/CLAUDE.md
Acceptance Criteria
DESIGN_SYSTEM.md is tailored to the user's stack and constraints
- Contains token rules, component state rules, accessibility gates, and production/manifest rules
- Contains source-of-truth, reusable component, custom class, animation, transition, and visual QA rules
- Avoids "AI" language entirely in the generated docs
- Recommends a single coherent approach (unless user asked for alternatives)
- Includes an
AGENTS.md / CLAUDE.md patch snippet referencing DESIGN_SYSTEM.md
This skill is part of the awesome-ai-agent-skills community library.
1---2name: design-system-generator3description: Coordinator-routed specialist for generating or substantially updating DESIGN_SYSTEM.md and its durable token, component, accessibility, motion, visual-QA, and asset rules. Use after project-development-mindset routes that primary deliverable here, or directly when explicitly invoked or installed standalone. Do not use for one-off UI implementation, visual polish, screenshot matching, or consuming an existing design system.4---5
6# Design System Generator
7
8## Overview
9
10This skill generates a project-specific **`DESIGN_SYSTEM.md`** that enforces consistent UI/UX across:
11- SPAs (React/Vue/Svelte/Angular)
12- Traditional server-rendered sites (Laravel, Rails, Django, WordPress, etc.)
13- Hybrid systems (admin + marketing + docs)
14
15The design system must be **component-based**, portable, and practical for real implementation.
16
17Run this skill in the main conversation. Do not spawn subagents, agent teams, or
18delegated parallel workers unless the user explicitly approves the proposed
19count and scope after being told that doing so can increase usage. Ask again
20before expanding an approved scope.
21
22## Interactive Workflow
23
24### Required Questions
25
26Ask these questions before generating the document:
27
28```
291. Project type: SPA / Traditional / Hybrid
30
312. Primary framework(s): React/Vue/Svelte/Angular/None + backend/framework
32
333. Existing UI/template/design system already in use? (yes/no)
34
354. CSS approach preference:
36 a) Tailwind/utility-first
37 b) SCSS/SASS
38 c) CSS Modules
39 d) styled-components/emotion
40 e) Component library (MUI/Ant/etc.)
41
425. Do you need light mode only, light+dark, or multi-theme?
43
446. Accessibility target (recommend WCAG AA) and keyboard support expectations
45
467. Browser/device support constraints
47
488. i18n/RTL requirements (if any)
49
509. Do you want design tokens exported? (CSS vars / JSON / both)
51
52Reply examples:
53- Short: `1a 2b 3no 4a 5b 6aa 7modern 8no 9both`
54- Detailed: `SPA with Vue 3, no existing design system, using Tailwind, light+dark theme, WCAG AA, modern browsers only, no RTL, export both CSS vars and JSON`
55```
56
57### Optional Questions (ask only if relevant)
58
59- Figma link or brand guide?
60- Multi-tenant theming?
61- Mobile app alignment?
62
63## Decision Policy
64
65### Rule 1: Prefer existing stack
66If the project already uses a template or styling system, adapt to it.
67
68### Rule 2: Choose one best-fit direction
69Do not provide 3-5 "options" unless the user requests comparison. Pick one approach and commit.
70
71### Rule 3: Source of truth before invention
72Before generating or updating `DESIGN_SYSTEM.md`, inspect existing UI source of truth:
73- project instructions (`AGENTS.md`, `CLAUDE.md`, equivalent)
74- existing design docs, screenshots, prototypes, brand notes, and component docs
75- shared components, wrappers, layouts, forms, tables, modals, navigation, and state components
76- theme config, Tailwind config, CSS variables, global CSS, tokens, custom classes, animations, and transitions
77
78Do not invent tokens, classes, wrappers, animation rules, or component architecture when a project-owned source already defines them.
79
80### Safe Defaults
81
82- **React SPA**: TailwindCSS + shadcn/ui (Radix primitives) + CSS variables tokens
83- **Vue SPA**: TailwindCSS + headless components + CSS variables tokens
84- **Angular**: Angular Material OR Tailwind + CDK (based on preference)
85- **Traditional**: SCSS or PostCSS layered architecture (tokens/base/components/utilities), optional bundler
86
87## Output Files
88
89### Primary
90- `DESIGN_SYSTEM.md`
91
92### Optional (only if user wants)
93- `design-tokens.json`
94- `tokens.css`
95- Sample component snippets
96
97## Non-Negotiables (must appear in DESIGN_SYSTEM.md)
98
99### Accessibility
100- Visible focus states
101- Keyboard navigation for interactive elements
102- Contrast targets (WCAG AA recommended)
103- Reduced motion support
104- Semantic HTML first; ARIA only when necessary
105
106### Performance / Production
107- Hashed asset filenames + manifest mapping (cache busting)
108- Minify CSS/JS for production
109- Image optimization pipeline (including SVG optimization)
110- Font loading strategy (`font-display: swap`, limit weights)
111
112### Source of Truth / Reuse
113- Reusable component and wrapper rules
114- Token ownership and generated-token policy
115- Animation, transition, and custom class policy
116- No one-off visual styles when a token, utility, wrapper, or component exists
117
118### UI Verification
119- Playwright/browser screenshot workflow
120- Element or region screenshots before full-page screenshots
121- Before/after screenshot comparison when visual output changes
122- Ambiguous user images require labeled annotated copies before coding
123
124## Document Style
125
126`DESIGN_SYSTEM.md` is a **team artifact**:
127- Do not mention "AI", "assistant", "model", or "prompt"
128- Use clear "Do/Don't" guidance
129- Keep readable in ~10-15 minutes
130
131## DESIGN_SYSTEM.md Required Structure
132
133Generate a tailored document using this structure:
134
1351. **Scope**
1362. **Design principles** (3-5 bullet max)
1373. **Supported platforms & constraints**
1384. **Design tokens**
139 - Color system
140 - Typography
141 - Spacing/layout
142 - Radius/borders/shadows
143 - Motion
1445. **UI foundations**
145 - Base styles/reset
146 - Focus/interaction states
147 - Iconography
1486. **Component architecture**
149 - Portability across SPA + Traditional
150 - Naming + folder conventions
151 - Required states (hover/focus/disabled/loading/error)
1527. **Component inventory** (minimum viable list)
1538. **CSS strategy & tooling**
154 - SPA path vs Traditional path
1559. **Production build & asset strategy**
156 - dist structure
157 - Manifest requirement
158 - Optimization checklist
15910. **Accessibility checklist** (ship gate)
16011. **Visual QA and screenshot workflow**
16112. **Examples** (token usage + one component example)
162
163## SPA vs Traditional Guidance
164
165### SPA guidance must include:
166- Recommended bundler (Vite/Webpack/Rollup) aligned with stack
167- CSS strategy (Tailwind/CSS Modules/SCSS)
168- Component library decision (if any)
169- Theming mechanism (CSS variables recommended)
170
171### Traditional guidance must include:
172- SCSS/PostCSS architecture:
173 - tokens layer
174 - base layer
175 - components layer
176 - utilities layer
177- Recommendation for bundling (optional but encouraged)
178- Manifest strategy so server templates reference hashed assets
179
180## Required Manifest Guidance (Cache Busting)
181
182Include an explicit section stating:
183- Build output must produce a manifest mapping logical asset names to hashed filenames
184- Server must read manifest to include assets
185- Avoid stale browser caches in production
186
187## Agent-Doc Patch Snippet (Required Output)
188
189After generating `DESIGN_SYSTEM.md`, also output a short patch snippet to add to `AGENTS.md` and/or `CLAUDE.md`:
190
191```markdown
192## Design System
193All UI components and pages must follow `DESIGN_SYSTEM.md`:
194- Use design tokens (no hardcoded colors/sizes).
195- Reuse shared components, wrappers, utilities, and motion rules before creating new ones.
196- Implement component states (hover/focus/disabled/loading/error).
197- For UI changes, capture the target element/region before full-page screenshots.
198- Meet accessibility and performance requirements.
199```
200
201## Reference Files
202
203Before generating `DESIGN_SYSTEM.md`, read these reference files:
204
205- **Template**: `TEMPLATE_DESIGN_SYSTEM.md` - Use this as the base structure for generation
206- **Example CSS tokens**: `examples/tokens.css` - Reference for CSS variable token format
207- **Example JSON tokens**: `examples/design-tokens.json` - Reference for JSON token export format
208- **Example manifest**: `examples/manifest.example.json` - Reference for asset manifest structure
209- **AGENTS.md patch**: `examples/AGENTS.patch.md` - The exact snippet to add to AGENTS.md/CLAUDE.md
210
211## Acceptance Criteria
212
213- `DESIGN_SYSTEM.md` is tailored to the user's stack and constraints
214- Contains token rules, component state rules, accessibility gates, and production/manifest rules
215- Contains source-of-truth, reusable component, custom class, animation, transition, and visual QA rules
216- Avoids "AI" language entirely in the generated docs
217- Recommends a single coherent approach (unless user asked for alternatives)
218- Includes an `AGENTS.md` / `CLAUDE.md` patch snippet referencing `DESIGN_SYSTEM.md`
219
220---
221
222*This skill is part of the awesome-ai-agent-skills community library.*