create-design-system-rules
Generates custom design rules and architectural conventions to streamline Figma implementation.
Install
mkdir -p .claude/skills/create-design-system-rules && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11280" && unzip -o skill.zip -d .claude/skills/create-design-system-rules && rm skill.zipInstalls to .claude/skills/create-design-system-rules
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Generates custom design system rules for the user's codebase. Use when user says "create design system rules", "generate rules for my project", "set up design rules", "customize design system guidelines", or wants to establish project-specific conventions for Figma-to-code workflows. Requires Figma MCP server connection.Key capabilities
- →Generate custom design system rules for a codebase
- →Encode unwritten design system knowledge into project rules
- →Define component naming and structure conventions
- →Specify styling approach and design token usage
- →Establish Figma MCP integration rules
- →Analyze codebase for existing patterns
How it works
This skill generates custom design system rules by first calling a Figma MCP server tool to get a foundational template. It then requires analysis of the codebase to create complete, project-specific rules.
Inputs & outputs
When to use create-design-system-rules
- →Create design system rules
- →Define component naming patterns
- →Setup project-specific styling guidelines
- →Standardize Figma-to-code workflows
About this skill
Create Design System Rules
Overview
This skill helps you generate custom design system rules tailored to your project's specific needs. These rules guide Claude to produce consistent, high-quality code when implementing Figma designs, ensuring that your team's conventions, component patterns, and architectural decisions are followed automatically.
Related documentation:
- agents.md - Full tool reference and agent capabilities
- rule.md - Example of project-level integration rules
- implement-design - Implement Figma designs as code
- code-connect-components - Connect Figma components to code
What Are Design System Rules?
Design system rules are project-level instructions that encode the "unwritten knowledge" of your codebase - the kind of expertise that experienced developers know and would pass on to new team members:
- Which layout primitives and components to use
- Where component files should be located
- How components should be named and structured
- What should never be hardcoded
- How to handle design tokens and styling
- Project-specific architectural patterns
Once defined, these rules dramatically reduce repetitive prompting and ensure consistent output across all Figma implementation tasks.
Prerequisites
- Figma MCP server must be connected and accessible
- Access to the project codebase for analysis
- Understanding of your team's component conventions (or willingness to establish them)
When to Use This Skill
Use this skill when:
- Starting a new project that will use Figma designs
- Onboarding Claude to an existing project with established patterns
- Standardizing Figma-to-code workflows across your team
- Updating or refining existing design system conventions
- Users explicitly request: "create design system rules", "set up Figma guidelines", "customize rules for my project"
Required Workflow
Follow these steps in order. Do not skip steps.
Step 1: Run the Create Design System Rules Tool
Call the Figma MCP server's create_design_system_rules tool to get the foundational prompt and template.
Parameters:
clientLanguages: Comma-separated list of languages used in the project (e.g., "typescript,javascript", "python", "javascript")clientFrameworks: Framework being used (e.g., "react", "vue", "svelte", "angular", "unknown")
This tool returns guidance and a template for creating design system rules.
Structure your design system rules following the template format provided in the tool's response.
Step 2: Analyze the Codebase
Before finalizing rules, analyze the project to understand existing patterns:
Component Organization:
- Where are UI components located? (e.g.,
src/components/,app/ui/,lib/components/) - Is there a dedicated design system directory?
- How are components organized? (by feature, by type, flat structure)
Styling Approach:
- What CSS framework or approach is used? (Tailwind, CSS Modules, styled-components, etc.)
- Where are design tokens defined? (CSS variables, theme files, config files)
- Are there existing color, typography, or spacing tokens?
Component Patterns:
- What naming conventions are used? (PascalCase, kebab-case, prefixes)
- How are component props typically structured?
- Are there common composition patterns?
Architecture Decisions:
- How is state management handled?
- What routing system is used?
- Are there specific import patterns or path aliases?
Step 3: Generate Project-Specific Rules
Based on your codebase analysis, create a comprehensive set of rules. Include:
General Component Rules
- IMPORTANT: Always use components from `[YOUR_PATH]` when possible
- Place new UI components in `[COMPONENT_DIRECTORY]`
- Follow `[NAMING_CONVENTION]` for component names
- Components must export as `[EXPORT_PATTERN]`
Styling Rules
- Use `[CSS_FRAMEWORK/APPROACH]` for styling
- Design tokens are defined in `[TOKEN_LOCATION]`
- IMPORTANT: Never hardcode colors - always use tokens from `[TOKEN_FILE]`
- Spacing values must use the `[SPACING_SYSTEM]` scale
- Typography follows the scale defined in `[TYPOGRAPHY_LOCATION]`
Figma MCP Integration Rules
## Figma MCP Integration Rules
These rules define how to translate Figma inputs into code for this project and must be followed for every Figma-driven change.
### Required Flow (do not skip)
1. Run get_design_context first to fetch the structured representation for the exact node(s)
2. If the response is too large or truncated, run get_metadata to get the high-level node map, then re-fetch only the required node(s) with get_design_context
3. Run get_screenshot for a visual reference of the node variant being implemented
4. Only after you have both get_design_context and get_screenshot, download any assets needed and start implementation
5. Translate the output (usually React + Tailwind) into this project's conventions, styles, and framework
6. Validate against Figma for 1:1 look and behavior before marking complete
### Implementation Rules
- Treat the Figma MCP output (React + Tailwind) as a representation of design and behavior, not as final code style
- Replace Tailwind utility classes with `[YOUR_STYLING_APPROACH]` when applicable
- Reuse existing components from `[COMPONENT_PATH]` instead of duplicating functionality
- Use the project's color system, typography scale, and spacing tokens consistently
- Respect existing routing, state management, and data-fetch patterns
- Strive for 1:1 visual parity with the Figma design
- Validate the final UI against the Figma screenshot for both look and behavior
Asset Handling Rules
## Asset Handling
- The Figma MCP server provides an assets endpoint which can serve image and SVG assets
- IMPORTANT: If the Figma MCP server returns a localhost source for an image or SVG, use that source directly
- IMPORTANT: DO NOT import/add new icon packages - all assets should be in the Figma payload
- IMPORTANT: DO NOT use or create placeholders if a localhost source is provided
- Store downloaded assets in `[ASSET_DIRECTORY]`
Project-Specific Conventions
## Project-Specific Conventions
- [Add any unique architectural patterns]
- [Add any special import requirements]
- [Add any testing requirements]
- [Add any accessibility standards]
- [Add any performance considerations]
Step 4: Save Rules to CLAUDE.md
Guide the user to save the generated rules to the CLAUDE.md file in their project root:
# MCP Servers
## Figma MCP Server Rules
[Paste generated rules here]
After saving, the rules will be automatically loaded by Claude Code and applied to all Figma implementation tasks.
Step 5: Validate and Iterate
After creating rules:
- Test with a simple Figma component implementation
- Verify Claude follows the rules correctly
- Refine any rules that aren't working as expected
- Share with team members for feedback
- Update rules as the project evolves
Rule Categories and Examples
Essential Rules (Always Include)
Component Discovery:
- UI components are located in `src/components/ui/`
- Feature components are in `src/components/features/`
- Layout primitives are in `src/components/layout/`
Design Token Usage:
- Colors are defined as CSS variables in `src/styles/tokens.css`
- Never hardcode hex colors - use `var(--color-*)` tokens
- Spacing uses the 4px base scale: `--space-1` (4px), `--space-2` (8px), etc.
Styling Approach:
- Use Tailwind utility classes for styling
- Custom styles go in component-level CSS modules
- Theme customization is in `tailwind.config.js`
Recommended Rules (Highly Valuable)
Component Patterns:
- All components must accept a `className` prop for composition
- Variant props should use union types: `variant: 'primary' | 'secondary'`
- Icon components should accept `size` and `color` props
Import Conventions:
- Use path aliases: `@/components`, `@/styles`, `@/utils`
- Group imports: React, third-party, internal, types
- No relative imports beyond parent directory
Code Quality:
- Add JSDoc comments for exported components
- Include PropTypes or TypeScript types for all props
- Extract magic numbers to named constants
Optional Rules (Project-Specific)
Accessibility:
- All interactive elements must have aria-labels
- Color contrast must meet WCAG AA standards
- Keyboard navigation required for all interactions
Performance:
- Lazy load images with the `Image` component from `@/components/Image`
- Use React.memo for components that receive complex props
- Icons should be SVG components, not icon fonts
Testing:
- Include unit tests for new components in `__tests__/` directory
- Use Testing Library queries (getByRole, getByLabelText)
- Test all interactive states and variants
Examples
Example 1: React + Tailwind Project
User says: "Create design system rules for my React project"
Actions:
- Run
create_design_system_rules(clientLanguages="typescript,javascript", clientFrameworks="react") - Analyze codebase structure
- Generate rules:
# Figma MCP Integration Rules
## Component Organization
- UI components are in `src/components/ui/`
- Page components are in `src/app/`
- Use Tailwind for styling
## Figma Implementation Flow
1. Run get_design_context for the node
2. Run get_screenshot for visual reference
3. Map Figma colors to Tailwind colors defined in `tailwind.config.js`
4. Reuse components from `src/components/ui/` when possible
5. Validate against screenshot before completing
## Styling Rules
- IMPORTANT: Use Tailwind utility classes, not inline styles
- Colors are defined in `tailwind.config.j
---
*Content truncated.*
When not to use it
- →When Figma MCP server is not connected or accessible
- →When there is no access to the project codebase for analysis
- →When the user does not want to establish project-specific conventions
Prerequisites
Limitations
- →Figma MCP server must be connected and accessible
- →Access to the project codebase for analysis is required
- →Rules may become outdated as project evolves
How it compares
This skill provides a structured process for generating project-specific design system rules by integrating with Figma MCP and requiring codebase analysis, unlike manually defining rules.
Compared to similar skills
create-design-system-rules side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| create-design-system-rules (this skill) | 0 | 5mo | No flags | Advanced |
| ui-designer | 4 | 2mo | Review | Intermediate |
| figma-integration | 0 | 4mo | Review | Intermediate |
| ckm:design | 0 | 4mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by diegosouzapw
View all by diegosouzapw →You might also like
ui-designer
daymade
Extract design systems from reference UI images and generate implementation-ready UI design prompts. Use when users provide UI screenshots/mockups and want to create consistent designs, generate design systems, or build MVP UIs matching reference aesthetics.
figma-integration
bigeasyfreeman
> Pulls design specs, component inventories, and screen states from Figma into the PRD and Build Brief pipeline. Validates that PRD screen specifications match actual Figma mocks. Extracts design tokens, spacing, and component names so coding agents produce pixel-accurate impleme
ckm:design
akshh229
Comprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG, Gemini 3.1 Pro), soci
penpot-uiux-design
github
Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library".
stitch-ui-design
sickn33
Expert guide for creating effective prompts for Google Stitch AI UI design tool. Use when user wants to design UI/UX in Stitch, create app interfaces, generate mobile/web designs, or needs help crafting Stitch prompts. Covers prompt structure, specificity techniques, iteration strategies, and design-to-code workflows for Stitch by Google.
ui-design-system
davila7
UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.