This skill should be used when the user asks to create design system rules, generate rules for my project, set up design rules, or customize design system guidelines. It generates custom design system rules for the codebase to establish project-specific conventions for Figma-to-code workflows.
From hugin-coworknpx claudepluginhub michelve/hugin-marketplace --plugin hugin-coworkThis skill uses the workspace's default tool permissions.
examples/framework-examples.mdreferences/best-practices-and-issues.mdreferences/rule-categories.mdSearches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Guides agent creation for Claude Code plugins with file templates, frontmatter specs (name, description, model), triggering examples, system prompts, and best practices.
This skill uses extended thinking for system-wide design pattern analysis. ultrathink
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 |
| GitHub Copilot | .github/instructions/figma-design-system.instructions.md |
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.
create_design_system_rules) are available.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:
- 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]`
- 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
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
- 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
- [Add any unique architectural patterns]
- [Add any special import requirements]
- [Add any testing requirements]
- [Add any accessibility standards]
- [Add any performance considerations]
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). |
| GitHub Copilot | .github/instructions/figma-design-system.instructions.md | Markdown with YAML frontmatter (applyTo glob, optional description). |
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:
---
description: Rules for implementing Figma designs using the Figma MCP server. Covers component organization, styling conventions, design tokens, asset handling, and the required Figma-to-code workflow.
globs: "src/components/**"
alwaysApply: false
---
[Generated rules here]
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/**"]).
For GitHub Copilot, wrap the rules with YAML frontmatter:
---
applyTo: "src/client/components/**"
description: Rules for implementing Figma designs into this project. Covers component organization, styling conventions, design tokens, and the required Figma-to-code workflow.
---
[Generated rules here]
Customize the applyTo pattern to match the component directories in the project. For this project use src/client/components/**.
After saving, the rules will be automatically loaded by the agent and applied to all Figma implementation tasks.
After creating rules:
See reference/rule-categories.md for essential, recommended, and optional rule templates with code examples.
See examples/framework-examples.md for complete walkthroughs (React+Tailwind, Vue+CSS, Design System Team).
See reference/best-practices-and-issues.md for best practices, common issues, and understanding design system rules.
When invoking this skill with arguments:
$0 or $ARGUMENTS[0] - Optional output path for the generated rules file
.claude/rules/design-system.md if not specified/create-design-system-rules docs/figma-rules.mdIf invoked without arguments, the skill will save rules to the default location and prompt for any configuration decisions during execution.
This skill uses ${CLAUDE_SESSION_ID} to track design system rule generation sessions:
// Each rule generation is logged with session context
const sessionId = process.env.CLAUDE_SESSION_ID;
console.log(`[${sessionId}] Generating design system rules from Figma file: ${fileKey}`);
This allows correlation between:
Use the session ID to understand which design system setup led to specific project conventions.