npx skills add ...
npx skills add openai/skills --skill figma-create-design-system-rules
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.
npx skills add openai/skills --skill figma-create-design-system-rules
This skill helps you generate custom design system rules tailored to your project's specific needs. These rules guide AI coding agents to produce consistent, high-quality code when implementing Figma designs, ensuring that your team's conventions, component patterns, and architectural decisions are followed automatically.
| Agent | Rule File |
|---|---|
| Claude Code | CLAUDE.md |
| Codex CLI | AGENTS.md |
| Cursor | .cursor/rules/figma-design-system.mdc |
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:
Once defined, these rules dramatically reduce repetitive prompting and ensure consistent output across all Figma implementation tasks.
Use this skill when:
Follow these steps in order. Do not skip steps.
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.
Before finalizing rules, analyze the project to understand existing patterns:
Component Organization:
src/components/, app/ui/, lib/components/)Styling Approach:
Component Patterns:
Architecture Decisions:
Based on your codebase analysis, create a comprehensive set of rules. Include:
Detect which AI coding agent the user is working with and save the generated rules to the corresponding file:
| Agent | Rule File | Notes |
|---|---|---|
| Claude Code | CLAUDE.md in project root | Markdown format. Can also use .claude/rules/figma-design-system.md for modular organization. |
| Codex CLI | AGENTS.md in project root | Markdown format. Append as a new section if file already exists. 32 KiB combined size limit. |
| Cursor | .cursor/rules/figma-design-system.mdc | Markdown with YAML frontmatter (description, globs, alwaysApply). |
If unsure which agent the user is working with, check for existing rule files in the project or ask the user.
For Cursor, wrap the rules with YAML frontmatter:
Customize the globs pattern to match the directories where Figma-derived code will live in the project (e.g., "src/**/*.tsx" or ["src/components/**", "src/pages/**"]).
After saving, the rules will be automatically loaded by the agent and applied to all Figma implementation tasks.
After creating rules:
Component Discovery:
Design Token Usage:
Styling Approach:
Component Patterns:
Import Conventions:
Code Quality:
Accessibility:
Performance:
Testing:
User says: "Create design system rules for my React project"
Actions:
create_design_system_rules(clientLanguages="typescript,javascript", clientFrameworks="react")Result: The agent now consistently follows the project's conventions when implementing Figma designs.
User says: "Set up Figma rules for my Vue app"
Actions:
create_design_system_rules(clientLanguages="typescript,javascript", clientFrameworks="vue")Result: The agent now correctly translates Figma designs to Vue components using the project's design token system.
User says: "Generate rules for our design system library"
Actions:
create_design_system_rules(clientLanguages="typescript", clientFrameworks="react")Result: Entire team follows consistent patterns when adding components from Figma to the design system.
Don't try to capture every rule upfront. Start with the most important conventions and add rules as you encounter inconsistencies.
Instead of: "Use the design system"
Write: "Always use Button components from src/components/ui/Button.tsx with variant prop ('primary' | 'secondary' | 'ghost')"
Each rule should tell the agent exactly what to do, not just what to avoid.
Good: "Colors are defined in src/theme/colors.ts - import and use these constants"
Bad: "Don't hardcode colors"
Prefix rules that must never be violated with "IMPORTANT:" to ensure the agent prioritizes them.
When rules seem arbitrary, explain the reasoning:
Cause: Rules may be too vague or not properly loaded by the agent. Solution:
Cause: Contradictory or overlapping rules. Solution:
Cause: Excessive rules increase context size and processing time. Solution:
Cause: Codebase changes but rules don't. Solution:
Design system rules transform how AI coding agents work with your Figma designs:
Before rules:
After rules:
The time invested in creating good rules pays off exponentially across every Figma implementation task.