PluginBench
Skill
Official
Review
Audit score 70

figma-create-design-system-rules

figma/mcp-server-guide

Generate custom design system rules to guide AI agents in implementing Figma designs consistently with your project's conventions.

What is figma-create-design-system-rules?

This skill creates project-specific design system rules that encode your team's component patterns, styling conventions, and architectural decisions. Use it when starting a new Figma-to-code workflow, onboarding an AI agent to an existing project, or standardizing design implementation practices across your team.

  • Generates custom design system rules tailored to your codebase and team conventions
  • Supports multiple AI agents (Claude Code, Cursor, Codex CLI) with agent-specific rule file formats
  • Analyzes component organization, styling approaches, naming conventions, and architecture patterns
  • Creates rules for component placement, naming, styling, design tokens, and asset handling
  • Defines required Figma MCP integration workflows to ensure consistent Figma-to-code translation
  • Encodes project-specific patterns to reduce repetitive prompting and ensure consistent AI output

How to install figma-create-design-system-rules

npx skills add https://github.com/figma/mcp-server-guide --skill figma-create-design-system-rules
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
Claude Code
Cursor
Windsurf
Cline

How to use figma-create-design-system-rules

  1. 1.Call the Figma MCP server's create_design_system_rules tool with your project's clientLanguages and clientFrameworks parameters
  2. 2.Analyze your codebase to document component organization, styling approach, naming conventions, and architecture decisions
  3. 3.Generate project-specific rules covering component placement, naming, styling, design tokens, and Figma MCP integration workflows
  4. 4.Save the generated rules to the appropriate file for your AI agent (CLAUDE.md for Claude Code, .cursor/rules/figma-design-system.mdc for Cursor, or AGENTS.md for Codex CLI)
  5. 5.Share the rules file with your team and AI agents to ensure consistent Figma-to-code implementation

Use cases

Good for
  • Starting a new project that will use Figma designs with AI-assisted implementation
  • Onboarding an AI coding agent to an existing project with established component patterns
  • Standardizing Figma-to-code workflows across a team to ensure consistency
  • Updating or refining existing design system conventions as your project evolves
  • Establishing guidelines for how design tokens, colors, and typography should be applied in code
Who it's for
  • Design system maintainers setting up AI-assisted workflows
  • Development teams using Figma with Claude Code, Cursor, or Codex CLI
  • Project leads standardizing component implementation practices
  • Teams onboarding new developers or AI agents to projects with established patterns

figma-create-design-system-rules FAQ

What rule file format should I use?

Use CLAUDE.md for Claude Code, .cursor/rules/figma-design-system.mdc for Cursor (with YAML frontmatter), or AGENTS.md for Codex CLI. Check your project for existing rule files or ask which agent you're using.

Do I need to analyze my entire codebase?

No, focus on understanding key patterns: where components live, how they're named, what styling approach is used, where design tokens are defined, and any special architectural patterns your team follows.

Can I update rules after creating them?

Yes, update the rule files whenever your project conventions change, new patterns emerge, or you want to refine guidance for AI agents. Existing rules can be appended or replaced.

What if my project doesn't have established conventions yet?

Use this skill to establish conventions. The tool will help you define component organization, naming, styling, and token usage patterns that your team can follow going forward.

How do design system rules help with Figma implementation?

Rules encode your team's expertise so AI agents automatically follow your conventions, use existing components, apply design tokens correctly, and respect your architecture—reducing manual corrections and ensuring consistency.

Full instructions (SKILL.md)

Source of truth, from figma/mcp-server-guide.


name: figma-create-design-system-rules description: 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. disable-model-invocation: false

Create Design System Rules

Overview

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.

Supported Rule Files

AgentRule File
Claude CodeCLAUDE.md
Codex CLIAGENTS.md
Cursor.cursor/rules/figma-design-system.mdc

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 an AI coding agent 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 the Appropriate Rule File

Detect which AI coding agent the user is working with and save the generated rules to the corresponding file:

AgentRule FileNotes
Claude CodeCLAUDE.md in project rootMarkdown format. Can also use .claude/rules/figma-design-system.md for modular organization.
Codex CLIAGENTS.md in project rootMarkdown format. Append as a new section if file already exists. 32 KiB combined size limit.
Cursor.cursor/rules/figma-design-system.mdcMarkdown 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:

---
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/**"]).

After saving, the rules will be automatically loaded by the agent and applied to all Figma implementation tasks.

Step 5: Validate and Iterate

After creating rules:

  1. Test with a simple Figma component implementation
  2. Verify the agent follows the rules correctly
  3. Refine any rules that aren't working as expected
  4. Share with team members for feedback
  5. 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:

  1. Run create_design_system_rules(clientLanguages="typescript,javascript", clientFrameworks="react")
  2. Analyze codebase structure
  3. 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.js` theme.colors
- Spacing uses Tailwind's default scale
- Custom components go in `src/components/ui/`

## Asset Rules

- IMPORTANT: Use localhost sources from Figma MCP server directly
- Store static assets in `public/assets/`
- DO NOT install new icon libraries
  1. Save to the appropriate rule file for the user's agent
  2. Test with a simple button implementation

Result: The agent now consistently follows the project's conventions when implementing Figma designs.

Example 2: Vue + Custom CSS Project

User says: "Set up Figma rules for my Vue app"

Actions:

  1. Run create_design_system_rules(clientLanguages="typescript,javascript", clientFrameworks="vue")
  2. Discover that project uses CSS modules and a custom design token system
  3. Generate rules:
# Figma MCP Integration Rules

## Component Organization

- Components are in `src/components/`
- Composables are in `src/composables/`
- Vue SFC structure: <script setup>, <template>, <style scoped>

## Design Tokens

- IMPORTANT: All colors defined in `src/styles/tokens.css` as CSS variables
- Use `var(--color-primary)`, `var(--color-secondary)`, etc.
- Spacing: `var(--space-xs)` through `var(--space-xl)`
- Typography: `var(--text-sm)` through `var(--text-2xl)`

## Figma Implementation Flow

1. Run get_design_context and get_screenshot
2. Translate React output to Vue 3 Composition API
3. Map Figma colors to CSS variables in `src/styles/tokens.css`
4. Use CSS Modules for component styles
5. Check for existing components in `src/components/` before creating new ones

## Styling Rules

- Use CSS Modules (`.module.css` files)
- IMPORTANT: Reference design tokens, never hardcode values
- Scoped styles with CSS modules
  1. Save to the appropriate rule file for the user's agent
  2. Validate with a card component

Result: The agent now correctly translates Figma designs to Vue components using the project's design token system.

Example 3: Design System Team

User says: "Generate rules for our design system library"

Actions:

  1. Run create_design_system_rules(clientLanguages="typescript", clientFrameworks="react")
  2. Analyze the monorepo structure with design system package
  3. Generate comprehensive rules:
# Design System Rules

## Repository Structure

- Design system components: `packages/design-system/src/components/`
- Documentation: `packages/docs/`
- Design tokens: `packages/tokens/src/`

## Component Development

- IMPORTANT: All components must be in `packages/design-system/src/components/`
- Component file structure: `ComponentName/index.tsx`, `ComponentName.stories.tsx`, `ComponentName.test.tsx`
- Export all components from `packages/design-system/src/index.ts`

## Design Tokens

- Colors: `packages/tokens/src/colors.ts`
- Typography: `packages/tokens/src/typography.ts`
- Spacing: `packages/tokens/src/spacing.ts`
- IMPORTANT: Never hardcode values - import from tokens package

## Documentation Requirements

- Add Storybook story for every component
- Include JSDoc with @example
- Document all props with descriptions
- Add accessibility notes

## Figma Integration

1. Get design context and screenshot from Figma
2. Map Figma tokens to design system tokens
3. Create or extend component in design system package
4. Add Storybook stories showing all variants
5. Validate against Figma screenshot
6. Update documentation
  1. Save to the appropriate rule file and share with team
  2. Add to team documentation

Result: Entire team follows consistent patterns when adding components from Figma to the design system.

Best Practices

Start Simple, Iterate

Don't try to capture every rule upfront. Start with the most important conventions and add rules as you encounter inconsistencies.

Be Specific

Instead of: "Use the design system" Write: "Always use Button components from src/components/ui/Button.tsx with variant prop ('primary' | 'secondary' | 'ghost')"

Make Rules Actionable

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"

Use IMPORTANT for Critical Rules

Prefix rules that must never be violated with "IMPORTANT:" to ensure the agent prioritizes them.

- IMPORTANT: Never expose API keys in client-side code
- IMPORTANT: Always sanitize user input before rendering

Document the Why

When rules seem arbitrary, explain the reasoning:

- Place all data-fetching in server components (reduces client bundle size and improves performance)
- Use absolute imports with `@/` alias (makes refactoring easier and prevents broken relative paths)

Common Issues and Solutions

Issue: The agent isn't following the rules

Cause: Rules may be too vague or not properly loaded by the agent. Solution:

  • Make rules more specific and actionable
  • Verify rules are saved in the correct configuration file
  • Restart your agent or IDE to reload rules
  • Add "IMPORTANT:" prefix to critical rules

Issue: Rules conflict with each other

Cause: Contradictory or overlapping rules. Solution:

  • Review all rules for conflicts
  • Establish a clear priority hierarchy
  • Remove redundant rules
  • Consolidate related rules into single, clear statements

Issue: Too many rules increase latency

Cause: Excessive rules increase context size and processing time. Solution:

  • Focus on the 20% of rules that solve 80% of consistency issues
  • Remove overly specific rules that rarely apply
  • Combine related rules
  • Use progressive disclosure (basic rules first, advanced rules in linked files)

Issue: Rules become outdated as project evolves

Cause: Codebase changes but rules don't. Solution:

  • Schedule periodic rule reviews (monthly or quarterly)
  • Update rules when architectural decisions change
  • Version control your rule files
  • Document rule changes in commit messages

Understanding Design System Rules

Design system rules transform how AI coding agents work with your Figma designs:

Before rules:

  • The agent makes assumptions about component structure
  • Inconsistent styling approaches across implementations
  • Hardcoded values that don't match design tokens
  • Components created in random locations
  • Repetitive explanations of project conventions

After rules:

  • The agent automatically follows your conventions
  • Consistent component structure and styling
  • Proper use of design tokens from the start
  • Components organized correctly
  • Zero repetitive prompting

The time invested in creating good rules pays off exponentially across every Figma implementation task.

Additional Resources

Related skills

More from figma/mcp-server-guide and the wider catalog.

FIfigma-create-new-file logo

figma-create-new-file

Official
figma/mcp-server-guide

Create new Figma files (design, FigJam, or Slides) before using other Figma tools.

2.0k installsAudited
FIfigma-generate-design logo

figma-generate-design

Official
figma/mcp-server-guide

Build and update Figma screens from design systems, code, or descriptions.

3.4k installs
FIfigma-generate-diagram logo

figma-generate-diagram

Official
figma/mcp-server-guide

MANDATORY prerequisite — load this skill BEFORE every `generate_diagram` tool call. NEVER call `generate_diagram` directly without loading this skill first. Trigger whenever the user asks to create, generate, draw, render, sketch, or build a diagram — flowchart, architecture diagram, sequence diagram, ERD or entity-relationship diagram, state diagram or state machine, gantt chart, or timeline. Also trigger when the user mentions Mermaid syntax or wants a system architecture, decision tree, dependency graph, API call flow, auth handshake, schema, or pipeline visualized in FigJam. Routes to type-specific guidance, sets universal Mermaid constraints, and tells you when to use a different diagram type or skip the tool entirely (mindmaps, pie charts, class diagrams, etc.).

833 installsAudited
FIfigma-generate-library logo

figma-generate-library

Official
figma/mcp-server-guide

Build professional-grade design systems in Figma from code, orchestrating tokens, components, and theming across structured phases.

2.3k installs
FIfigma-implement-design logo

figma-implement-design

Official
figma/mcp-server-guide

Translate Figma designs into production-ready code with pixel-perfect visual fidelity.

4.0k installs
FIfigma-use logo

figma-use

Official
figma/mcp-server-guide

Mandatory prerequisite for executing Figma Plugin API code via use_figma tool calls.

4.7k installsAudited