setup-design-system
Skill14 starsChanged 9 months agoMITView on GitHub
Initialize the design system or create new UI components with accessibility, Tailwind/shadcn integration, and documentation. Use when setting up the initial design system, adding component categories, or creating complex UI components that need design review.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- build-apiSkill
- build-featureSkill
- gtm-reviewSkill
- hotfixSkill
- plan-featureSkill
- review-codeSkill
- security-auditSkill
- submit-prSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 18 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Ensure we are on a feature branch based on the latest main:
- Distinctive: line 19
If on main, create a new feature branch:
- Very specific: line 25
If already on a feature branch, rebase onto latest origin/main:
- Distinctive: line 31
If the working tree is dirty, stash before rebasing:
- Distinctive: line 39
If the working tree is clean, rebase directly:
- Distinctive: line 47
Check if a design system already exists:
- Very specific: line 49
Look for packages/ui/ directory structure
- Very specific: line 50
Check for shadcn/ui configuration (components.json)
- Very specific: line 51
Check Tailwind configuration (src/index.css for @theme directives in v4, or tailwind.config.* for v3)
- Distinctive: line 53
Check for design tokens (colors, spacing, typography definitions)
- Distinctive: line 58
If extending: what components or patterns are needed?
- Distinctive: line 64
If initializing the design system or making significant structural changes, activate a Product Council subset:
- Distinctive: line 132
Read the existing patterns and conventions before adding new components.
- Distinctive: line 144
Props interface: All configurable options with TypeScript types
- Distinctive: line 161
Every component must include:
- Distinctive: line 176
Props test: All variants and prop combinations render correctly
- Distinctive: line 184
After all components are built, run a comprehensive accessibility audit:
- Distinctive: line 191
Color contrast: All text meets contrast ratios
- Distinctive: line 193
Screen reader: All interactive elements announced correctly
- Distinctive: line 204
Consistency: All components follow the same patterns
- Distinctive: line 214
Document the design system:
- Distinctive: line 223
Commit with conventional commit format:
- Very specific: line 250
Recommended: Run /review-code for multi-perspective quality and accessibility review before submitting
- Very specific: line 252
If this is standalone design system work: Run /review-code → /submit-pr
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Design System Workflow
Initialize or extend the project's design system with properly accessible, consistent UI components using Tailwind CSS and shadcn/ui.
Step 0: Verify Feature Branch
Ensure we are on a feature branch based on the latest main:
git fetch origin mainIf on main, create a new feature branch:
git checkout -b feature/design-system origin/mainIf already on a feature branch, rebase onto latest origin/main:
git status --porcelainIf the working tree is dirty, stash before rebasing:
git stash push -m "setup-design-system: stash before rebase"
git rebase origin/main
git stash popIf the working tree is clean, rebase directly:
git rebase origin/mainStep 1: Assess Current State
Check if a design system already exists:
- Look for
packages/ui/directory structure - Check for shadcn/ui configuration (
components.json) - Check Tailwind configuration (
src/index.cssfor@themedirectives in v4, ortailwind.config.*for v3) - Identify existing components and their patterns
- Check for design tokens (colors, spacing, typography definitions)
Ask the user:
- Initializing a new design system or extending the existing one?
- If extending: what components or patterns are needed?
- Any brand guidelines, color palette, or Figma designs to reference?
- Dark mode support needed?
Step 2: Product Council Design Review (for initialization or major changes)
If initializing the design system or making significant structural changes, activate a Product Council subset:
Model Selection: See the Model Selection section in README.md for mapping agent model specs to Task tool parameters.
Design Lead (Lead) — consult: ui-design
- Brand Identity: Color palette, typography, visual language
- Component Hierarchy: Primitives vs composed components
- Design Tokens: Token architecture (colors, spacing, typography, shadows)
- Recommendations: Design system structure and principles
Frontend Specialist — consult: frontend-mobile-development
- Technical Architecture: Component library structure, build pipeline
- Framework Integration: Vite + React 19 compatibility, tree-shaking
- Recommendations: Implementation patterns, tooling choices
Product Strategist
- User-Facing Priorities: Which components are needed first?
- Brand Consistency: Does this align with product vision?
- Recommendations: Prioritization of design system investment
CHECKPOINT: Present the design system architecture proposal to the user. Wait for approval of structure and token definitions before building.
Step 3: Design System Infrastructure
If initializing a new design system:
Invoke /ui-design:design-system-setup for initialization guidance.
Set up the foundation:
Design Tokens
- Color palette (primary, secondary, neutral, semantic: success/warning/error/info)
- Typography scale (font families, sizes, weights, line heights)
- Spacing scale (consistent spacing values: 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64)
- Border radii (none, sm, md, lg, xl, full)
- Shadows (sm, md, lg, xl)
- Breakpoints (sm, md, lg, xl, 2xl)
Tailwind Configuration
Using /frontend-mobile-development:tailwind-design-system:
- Extend the Tailwind theme with design tokens
- Configure shadcn/ui with project-specific theme colors
- Set up CSS custom properties for runtime theming
- Configure dark mode strategy (class-based or media-query)
Component Structure
packages/ui/src/
├── components/
│ ├── primitives/ # Button, Input, Badge, Label, Switch
│ ├── layout/ # Container, Grid, Stack, Spacer, Divider
│ ├── navigation/ # Navbar, Sidebar, Breadcrumb, Tabs
│ ├── feedback/ # Alert, Toast, Modal, Dialog, Skeleton
│ ├── data-display/ # Card, Table, List, Avatar, Tooltip
│ └── forms/ # Form, FormField, Select, Checkbox, Radio
├── tokens/ # Design token definitions
├── hooks/ # Shared UI hooks (useMediaQuery, useTheme)
└── utils/ # UI utilities (cn, cva variants)If extending an existing design system:
Read the existing patterns and conventions before adding new components. Match the established API patterns.
Step 4: Build Components
For each component needed, follow this process:
4a. Component Design
Invoke /ui-design:create-component for guided component creation.
Define the component API:
- Props interface: All configurable options with TypeScript types
- Variants: Size, color, and style variants (using cva or tailwind-variants)
- Default values: Sensible defaults that work out-of-the-box
- Composition: How it works with child components
4b. Implementation
Build each component with:
- Full TypeScript typing (no
anytypes) - Tailwind CSS styling with shadcn/ui patterns
React.forwardReffor ref forwardingclassNameprop merged withcn()utility for style overrides- Responsive behavior using Tailwind breakpoints
4c. Accessibility
Every component must include:
- Semantic HTML elements (button, nav, dialog, etc.)
- ARIA attributes (aria-label, aria-describedby, role, etc.)
- Keyboard navigation (Tab, Enter, Escape, Arrow keys as appropriate)
- Focus management (visible focus ring, focus trap for modals)
- Screen reader announcements for dynamic content
- Color contrast meeting WCAG AA (4.5:1 for text, 3:1 for large text)
- Touch target minimum size (44x44px for interactive elements)
4d. Tests
For each component, write:
- Render test: Component renders without errors
- Props test: All variants and prop combinations render correctly
- Interaction test: Click, hover, keyboard interactions work
- Accessibility test: ARIA attributes present, keyboard nav works
CHECKPOINT: After each component (or batch of related components), present the implementation to the user for visual review. Show the component API, variants, and accessibility features.
Step 5: Accessibility Audit
After all components are built, run a comprehensive accessibility audit:
Invoke /ui-design:accessibility-audit on all new/modified components.
Check for:
- WCAG 2.1 AA compliance (minimum standard)
- Color contrast: All text meets contrast ratios
- Keyboard navigation: Complete keyboard operability
- Screen reader: All interactive elements announced correctly
- Focus management: Logical focus order, visible focus indicators
- Motion: Respect
prefers-reduced-motionmedia query - Touch targets: Minimum 44x44px on mobile
CHECKPOINT: Present accessibility audit findings. User approves the accessibility posture or requests changes.
Step 6: Design Review
Invoke /ui-design:design-review to review the overall design system for:
- Consistency: All components follow the same patterns
- Naming: Props, variants, and CSS classes follow conventions
- API patterns: Consistent prop interfaces across components
- Visual coherence: Components look like they belong together
- Completeness: Common use cases are covered
Address any findings from the review.
Step 7: Documentation
Document the design system:
- Component catalog: Each component with props table, usage examples, and do/don't patterns
- Design tokens: Complete reference of colors, typography, spacing
- Accessibility guide: Per-component accessibility notes and testing instructions
- Getting started: How to import and use components in the app
Step 8: Commit
Commit with conventional commit format:
For new design system:
feat(ui): initialize design system with core componentsFor new components:
feat(ui): add <component-name> componentFor design token changes:
feat(ui): update design tokens for <change-description>Step 9: Hand Off — STOP Here
[!CAUTION] This skill's work is done. Do NOT proceed to create a pull request, push to remote, or run a code review. Those are separate skills with their own workflows and checkpoints.
Present the next step to the user:
- Recommended: Run
/review-codefor multi-perspective quality and accessibility review before submitting - If building a feature that uses these components: Continue with
/build-featureto implement the feature, then run/review-code - If this is standalone design system work: Run
/review-code→/submit-pr
[!TIP] Pipeline:
/plan-feature→/build-featureor/build-api→/review-code→/submit-pr
/setup-design-systemcan be run at any point in the pipeline or independently. You are here — proceed to/review-codewhen ready.
Do not push the branch, create a PR, or invoke /submit-pr from within this skill.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

