
Design System Patterns
FreeBuild scalable design systems with ease.
Free · Opens the source repo
What Design System Patterns does
Design System Patterns provides a structured approach to creating and maintaining design systems that ensure consistency and scalability across web and mobile applications. This skill focuses on three core areas: design tokens, theming infrastructure, and component architecture. By utilizing these principles, developers and designers can establish a solid foundation for their UI elements, enhancing the overall user experience.
The skill emphasizes the importance of design tokens, which serve as the building blocks for UI design. These tokens can represent colors, typography, spacing, and other design elements in a way that is both reusable and adaptable. By implementing a clear hierarchy of tokens—primitive, semantic, and component tokens—users can create a well-organized design system that is easy to maintain and scale.
The theming infrastructure component of this skill allows for dynamic theme switching, enabling applications to adapt to user preferences such as light or dark modes. This is achieved through CSS custom properties and theme context providers in frameworks like React. Additionally, the skill supports multi-brand theming systems, making it suitable for applications that require distinct branding.
Lastly, the component architecture section provides guidance on building robust component libraries. This includes patterns for compound components, polymorphic components, and responsive design variants. By following these best practices, users can create components that are not only functional but also align with their design system's overall aesthetic and usability goals.
When to use it
Use this skill when you need to create a design system from scratch, implement theme switching, or build a component library.
When not to use it
This skill may not be suitable for projects that do not require a design system or those with very simple UI needs.
What you can build with it
Creating a Design Token Library
Use this skill to define and organize design tokens for colors, typography, and spacing, ensuring consistency across your application.
Implementing Theme Switching
Leverage the theming infrastructure to enable dynamic light/dark mode switching in your application, enhancing user experience.
Building a Component Library
Utilize the component architecture guidelines to develop a robust library of reusable UI components that adhere to your design system.
How to install Design System Patterns
View source1. Install with the skills CLI
npx skills add wshobson/agents/design-system-patterns --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by wshobsonDesign System Patterns
Master design system architecture to create consistent, maintainable, and scalable UI foundations across web and mobile applications.
When to Use This Skill
- Creating design tokens for colors, typography, spacing, and shadows
- Implementing light/dark theme switching with CSS custom properties
- Building multi-brand theming systems
- Architecting component libraries with consistent APIs
- Establishing design-to-code workflows with Figma tokens
- Creating semantic token hierarchies (primitive, semantic, component)
- Setting up design system documentation and guidelines
Core Capabilities
1. Design Tokens
- Primitive tokens (raw values: colors, sizes, fonts)
- Semantic tokens (contextual meaning: text-primary, surface-elevated)
- Component tokens (specific usage: button-bg, card-border)
- Token naming conventions and organization
- Multi-platform token generation (CSS, iOS, Android)
2. Theming Infrastructure
- CSS custom properties architecture
- Theme context providers in React
- Dynamic theme switching
- System preference detection (prefers-color-scheme)
- Persistent theme storage
- Reduced motion and high contrast modes
3. Component Architecture
- Compound component patterns
- Polymorphic components (as prop)
- Variant and size systems
- Slot-based composition
- Headless UI patterns
- Style props and responsive variants
4. Token Pipeline
- Figma to code synchronization
- Style Dictionary configuration
- Token transformation and formatting
- CI/CD integration for token updates
Quick Start
// Design tokens with CSS custom properties
const tokens = {
colors: {
// Primitive tokens
gray: {
50: "#fafafa",
100: "#f5f5f5",
900: "#171717",
},
blue: {
500: "#3b82f6",
600: "#2563eb",
},
},
// Semantic tokens (reference primitives)
semantic: {
light: {
"text-primary": "var(--color-gray-900)",
"text-secondary": "var(--color-gray-600)",
"surface-default": "var(--color-white)",
"surface-elevated": "var(--color-gray-50)",
"border-default": "var(--color-gray-200)",
"interactive-primary": "var(--color-blue-500)",
},
dark: {
"text-primary": "var(--color-gray-50)",
"text-secondary": "var(--color-gray-400)",
"surface-default": "var(--color-gray-900)",
"surface-elevated": "var(--color-gray-800)",
"border-default": "var(--color-gray-700)",
"interactive-primary": "var(--color-blue-400)",
},
},
};
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices
- Name Tokens by Purpose: Use semantic names (text-primary) not visual descriptions (dark-gray)
- Maintain Token Hierarchy: Primitives > Semantic > Component tokens
- Document Token Usage: Include usage guidelines with token definitions
- Version Tokens: Treat token changes as API changes with semver
- Test Theme Combinations: Verify all themes work with all components
- Automate Token Pipeline: CI/CD for Figma-to-code synchronization
- Provide Migration Paths: Deprecate tokens gradually with clear alternatives
Common Issues
- Token Sprawl: Too many tokens without clear hierarchy
- Inconsistent Naming: Mixed conventions (camelCase vs kebab-case)
- Missing Dark Mode: Tokens that don't adapt to theme changes
- Hardcoded Values: Using raw values instead of tokens
- Circular References: Tokens referencing each other in loops
- Platform Gaps: Tokens missing for some platforms (web but not mobile)
Frequently asked questions about Design System Patterns
Similar skills
Design System
Streamline design token management and presentation generation.
Visual Style
Create and apply portable visual design systems effortlessly.
Paperclip Design Guide
Build consistent, reusable UI components with ease.
Design Brief
Transform vague design requests into structured specs.
Token Map
Automate Figma and code token mapping to design systems.
Kami Landing
Create professional single-page documents effortlessly.
