Work With Design Systems
Inspect, build, or extend Figma design systems from Claude Code. Read-only audits with WCAG checks and component scoring, build mode with variable bindings and slots, optional Phase 6 sync to tokens.css + AI rules.
Ask AI about Work With Design Systems
Powered by Claude Β· Grounded in docs
I know everything about Work With Design Systems. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
work-with-design-systems
A Claude skill for working with Figma design systems β two modes in one place: inspect (read-only audits with WCAG checks, component scoring, handoff docs) and build (creating components, fixing foundations, adding slots, writing descriptions). Build mode optionally extends to Phase 6 (sync to code) β generates tokens.css, an audit script, and AI rules file for your codebase.
Works with Claude Code, Cursor, and Codex.
What's new in v2.0
This is a major release. The skill was previously called generate-design-system and only handled building. Now it covers the full lifecycle: inspect existing files, decide what to build or fix, optionally export to code. Between inspect and build, the skill always pauses for your decision. Phase 6 is OFF by default and only triggers on explicit request.
Migration from v1.x: see CHANGELOG for the migration note. Repo URL has changed but old links redirect automatically.
Highlights:
- Two modes β inspect (read-only) and build (write), with mandatory pause between
- Phase 6 β sync to code (optional, off by default) β generates
tokens.csswith three-layer indirection, AI rules file (Claude Code / Cursor / Codex), and CI-ready audit script. Closes the design-to-code loop. - Slots support for compound components (Card, Modal, Dialog) β replaces detach patterns
- Mandatory structured component descriptions β Figma MCP passes them to agents as context
- Six audit modules β token compliance (with severity tiers), interactive states, WCAG accessibility, detached instances, naming quality, component descriptions
- Weighted readiness scoring β score each component 0β100 (errors weighted 1.0, warnings 0.3)
- Three export formats β markdown, JSON, AI prompt for code generation
- Patterns guide β how to document composition patterns in Figma (and optionally export them as spec files to repo)
- Story-to-variant parity check when codebase has Storybook
- Auto-rename suggestion when generic layer names exceed 20%
What it does
The skill auto-detects mode from your request (or asks if unclear).
Inspect mode β read-only. Runs audit modules:
- Module 1 β Token compliance. Variable binding coverage. Errors: unbound fills, strokes, padding, gaps, corner radii. Warnings: raw opacity, blur radius, animation durations. Text nodes without text styles flagged separately.
- Module 2 β Interactive states. Compares variants against expected state matrices per component type. Missing states (Pressed on Button, Error on Input) listed with full expected set.
- Module 3 β Accessibility. Computed WCAG 2.1 AA checks. Color contrast (4.5:1 normal, 3:1 large). Touch target (44Γ44px minimum for interactive). Font size warnings <12px, errors <10px. Focus indicator presence.
- Module 4 β Detached instances. Scans all pages for frames matching component names but not instances. Reports with page, parent path, node ID.
- Module 5 β Naming quality. Flags generic Figma auto-names (Frame 47, Rectangle 3) inside components.
- Module 6 β Component descriptions. Generates structured documentation per component (PURPOSE, BEHAVIOR, COMPOSITION, USAGE, CODE NOTES). Uses reasoning rather than computation.
Score formula:
Score = (tokens_errors Γ 2 + tokens_warnings Γ 0.6 + states Γ 3 + accessibility Γ 1 + naming Γ 0.5) / 7.1 Γ 100
State coverage weighted heaviest because missing states cause the most downstream breakage in generated code.
After inspect, the skill ALWAYS pauses with the report and waits for your decision before any changes.
Build mode β write. Six-phase workflow (Phase 6 optional):
- Phase 1 β Discovery. Analyzes codebase or collects specs from scratch. Accepts .md brand guidelines, .json tokens (W3C DTCG, Tokens Studio), screenshots, URLs. If file exists, runs quick health check (not full audit β for that, use inspect mode). Recommends path: build in place, new file, hybrid, code export only.
- Phase 2 β Foundations. Variable collections (3-tier or flat domain-based β both supported). Light/Dark modes (and multi-brand). Text styles, effect styles. Sets codeSyntax.WEB on every variable. Skipped when foundations exist and pass health check.
- Phase 3 β File structure. Standard pages: Cover, Getting Started, Foundations, one per component group, Patterns (optional), Utilities. Reusable Page Title component. Component pages use fixed-width (996px) wrapper. Skipped when documentation pages not required.
- Phase 4 β Components. Suggests core 10, you confirm. For atoms (Button, Input, Checkbox), full variant matrices with all states, Auto Layout, variable bindings, TEXT properties. For compound (Card, Modal, Dialog), runs slot decision β named slots replace detach patterns. Writes structured description for every public component. Validates after each component. Optional Phase 4d documents composition patterns.
- Phase 5 β QA. Validation script checks for missing collections, ALL_SCOPES violations, hardcoded fills, missing Auto Layout, Light/Dark coverage, missing descriptions, missing slot decisions. Builds test page to verify composability. Closes with optional Phase 6 prompt.
- Phase 6 β Sync to code (optional, OFF by default). Generates
tokens.csswith three-layer indirection (upstream β project aliases with fallback β components reference aliases), CI-ready Node.js audit script, and AI rules file (.claude/rules/design-system.md,.cursor/rules/design-system.mdc, orAGENTS.mdsection). Light/Dark via[data-theme],@media (prefers-color-scheme), or both. Triggers only on explicit user request.
The skill pauses between phases for your review.
File structure
work-with-design-systems/
βββ SKILL.md # Core instructions
βββ README.md
βββ CHANGELOG.md
βββ LICENSE
β
βββ references/
β βββ inspect/ # Inspect mode reference docs
β β βββ overview.md
β β βββ token-compliance.md
β β βββ interactive-states.md
β β βββ accessibility.md
β β βββ detached-instances.md
β β βββ naming-quality.md
β β βββ component-descriptions.md
β β βββ readiness-scoring.md
β β βββ report-templates.md
β β
β βββ build/ # Build mode reference docs
β βββ token-taxonomy.md
β βββ component-spec.md
β βββ naming-conventions.md
β βββ framework-mappings.md
β βββ slots-guide.md
β βββ component-description-template.md
β βββ patterns-guide.md # Composition patterns in Figma
β βββ code-export.md # Phase 6 β tokens.css, audit, AI rules
β
βββ scripts/
β βββ inspect/ # Inspect mode scripts (read-only)
β β βββ inventory.js
β β βββ audit-tokens.js # With severity tiers
β β βββ audit-states.js
β β βββ audit-accessibility.js
β β βββ audit-detached.js
β β βββ audit-naming.js
β β
β βββ build/ # Build mode scripts (write)
β βββ validate-design-system.js # Final QA validation
β βββ exportTokensToCSS.js # Phase 6a β read variables for export
β βββ fixHardcodedToTokens.js # Fuzzy auto-fix for inspect β build flow
β
βββ assets/
βββ file-structure-template.md
Reference and script files load on demand. Inspect mode loads references/inspect/ and scripts/inspect/. Build mode loads references/build/ and scripts/build/. Phase 6 specifically loads code-export.md and exportTokensToCSS.js. Critical rules in SKILL.md apply to all modes.
Installation
Claude Code
# Copy into your project
cp -r work-with-design-systems/ .claude/skills/work-with-design-systems/
# Or install globally (available across all projects)
cp -r work-with-design-systems/ ~/.claude/skills/work-with-design-systems/
# Or clone directly
git clone https://github.com/natdexterra/work-with-design-systems.git .claude/skills/work-with-design-systems
Then invoke with /work-with-design-systems in Claude Code chat.
Cursor
cp -r work-with-design-systems/ .cursor/skills/work-with-design-systems/
Codex
cp -r work-with-design-systems/ skills/work-with-design-systems/
Compatibility
The skill is a set of Markdown and JavaScript files β not tied to any specific IDE. Confirmed working with:
- Claude Code (terminal and VS Code extension)
- Cursor
- Codex
Phase 6 (sync to code) requires file write access. Available in Claude Code, Cursor, Codex, and similar MCP clients with file tools. When run from Claude.ai web/mobile, Phase 6 outputs file contents inline for manual saving.
Prerequisites
- Figma MCP server connected (remote server recommended)
- The
figma-useskill installed (comes with the Figma plugin for Claude Code and Cursor)
Usage
Inspect β full audit
/work-with-design-systems
Audit my design system file for quality issues.
The skill inventories the file, runs all six modules, produces a full report, then stops and waits for your decision.
Inspect β narrow scope
/work-with-design-systems
Check WCAG compliance on Button and Input only.
Only Module 3 runs on the specified components.
Inspect β pre-handoff documentation
/work-with-design-systems
Generate component documentation for developer handoff.
Modules 1 and 6 run. Output: markdown + JSON bundle with structured component specs.
Build β from scratch
/work-with-design-systems
Create a design system for a fintech product.
Brand color: #6366F1 (indigo). Font: Inter.
Need Light and Dark modes.
Build mode, full build path. Asks to confirm colors, spacing, component list before building.
You can feed it .md brand guidelines or .json tokens (W3C DTCG, Tokens Studio) instead of typing specs.
Build β from existing codebase
/work-with-design-systems
Sync our component library to Figma.
Tokens: tailwind.config.ts
Components: src/components/ui/
Reads token files and component props, maps to Figma Variables and component variants. Reads Storybook stories if present.
Build β extending an existing file
/work-with-design-systems
Variables and text styles are set up in [Figma file URL].
Need to build 7 components with proper bindings.
Health check on variables, then builds components β no need to recreate foundations.
Build β adding slots to existing components
/work-with-design-systems
Our Card component keeps getting detached because users need different inner content.
Add slots to it.
Reads current Card structure, proposes slot positions based on detach patterns, updates in place. Existing instances continue to work. Phase 6 not offered (retrofit scope).
Build β end-to-end with code export
/work-with-design-systems
Create a design system for fintech app, indigo primary, Inter, Light+Dark β
and generate tokens.css and CLAUDE.md when done.
Full build path through Phase 5, then proceeds directly to Phase 6 (because user opted in upfront). Outputs tokens.css with three-layer indirection, .claude/rules/design-system.md with component list and token reference, scripts/token-audit.js for CI.
Code export only
/work-with-design-systems
My Figma DS is solid. Just generate tokens.css and CLAUDE.md for my repo.
Phase 1c health check on variables. If foundations are valid (scopes set, codeSyntax present), skips Phases 2-5 and runs Phase 6 directly. If foundations are broken, refuses and recommends fixing them first.
Inspect β build (most common)
/work-with-design-systems
I have a 6-month-old Figma file. Need to figure out what's broken and fix what's worth fixing.
Runs inspect first, presents report, pauses for your decision on what to fix. Then enters build mode with your scoped instructions.
Supported frameworks
references/build/framework-mappings.md contains token extraction patterns for:
- React + Tailwind CSS (including shadcn/ui with
cva) - React + CSS Modules / styled-components
- Vue 2/3 with any CSS approach
- Svelte
- Angular
- W3C Design Tokens (DTCG JSON format)
- Tokens Studio format
For unsupported setups, the skill falls back to collecting specs manually.
Supported inputs
When starting from scratch:
| Input | Format |
|---|---|
| Brand guidelines | .md file |
| Design tokens | .json (W3C DTCG or Tokens Studio format) |
| Visual references | Screenshots, URLs |
| Verbal spec | Colors, fonts, spacing values in chat |
| Codebase | Tailwind config, CSS variables, theme files, component directories |
| Storybook | .stories.{ts,tsx,js,jsx,mdx} files for variant parity check |
Phase 6 outputs
When Phase 6 runs, you get:
| File | Path | Purpose |
|---|---|---|
tokens.css | Project root or src/styles/ | All design tokens with three-layer indirection |
| AI rules | .claude/rules/design-system.md (Claude Code) | Read by AI agent at session start |
| AI rules | .cursor/rules/design-system.mdc (Cursor) | Same, Cursor format |
| AI rules | ## Design system section in AGENTS.md (Codex) | Same, with start/end markers |
| Audit script | scripts/token-audit.js | CI-ready, exit code 1 on hardcoded values |
| Patterns (opt) | specs/patterns/*.md | Hardik Pandya-style composition specs |
The audit script flags errors (hardcoded colors, raw spacing, raw radii) separately from warnings (raw transition durations, z-index values). CI pipelines exit on errors but allow warnings.
Design decisions
Why two modes in one skill? A common workflow is inspect β decide β build. Splitting into two skills means manual switching and broken context between sessions. One skill with explicit modes preserves the flow while still enforcing read-only safety in inspect.
Why mandatory pause between inspect and build? Inspect mode's value is producing a report you can act on. Auto-chaining to build defeats the purpose β you'd never see the report. The pause is the core guarantee.
Why is Phase 6 off by default? Phase 6 writes files outside Figma. That's a different scope than the rest of the skill. Auto-running it on every build would be intrusive and break retrofit scenarios (slot retrofit shouldn't regenerate tokens.css and overwrite the user's audit script). The default offer at end of QA gives users opt-in opportunity without forcing it.
Why three-layer indirection in tokens.css? Layer 1 holds upstream design system tokens (Atlaskit, Material, Carbon β if used). Layer 2 holds project aliases that reference Layer 1 with raw values as fallback (var(--ds-text, #292A2E)). Components only reference Layer 2. If upstream renames a token, you fix one alias. If upstream is unreachable, the fallback keeps the project running.
Why scoped AI rules paths? Top-level CLAUDE.md, AGENTS.md, and full .cursor/rules are user-managed files often containing custom instructions for the project. Overwriting them is destructive. Scoped paths (.claude/rules/design-system.md, etc.) live alongside other rules and don't conflict.
Why weighted scoring? A Button missing its Pressed state breaks user interaction more severely than a generic layer name. State gaps score Γ3, token errors Γ2, accessibility Γ1, naming Γ0.5. Token warnings score Γ0.6 (less than errors but not zero).
Why slots over detach? Detached frames are structurally invisible to agents and to inspect mode. Slots give explicit dropzones for variable content while keeping the component intact. Figma added slots in March 2026 specifically for this.
Why mandatory descriptions? Figma MCP reads component descriptions and passes them to consuming agents as context. A component without description forces the agent to guess everything from visual structure. Descriptions are the single highest-leverage thing you can add to a design system for AI quality.
Why 3-tier tokens (when used)? Primitives hold raw values. Semantic tokens alias primitives and carry meaning (color/bg/primary instead of color/blue-500). Components bind to Semantic only. Switching Light/Dark requires zero component changes β you swap the Semantic layer. For single-brand or rebuilds, flat domain-based collections (Colors, Spacing, Radius) are equally valid. The skill supports both.
Why explicit variable scopes? Default ALL_SCOPES pollutes every property picker. A spacing variable showing up in the color picker is confusing.
Why states before default? Most incomplete design systems ship a "happy path" Button and forget Disabled, Error, Loading. Component spec requires all states upfront.
Why codeSyntax on every variable? Without codeSyntax.WEB, agents using get_design_context get raw Figma variable names instead of CSS token names. Setting it on creation means the design-to-code bridge works from day one. Phase 6 also depends on codeSyntax β the audit refuses to run without it.
Why TEXT component properties? Without them, changing a button label from "Label" to "Submit" reverts on component update. TEXT properties with componentPropertyReferences preserve overrides.
Why fixed-width page wrappers? Without fixed width (996px), small components like Toggle produce narrow pages (350px) while large ones produce wide pages. Fixed width keeps all component pages visually consistent.
Why flexible component lists? Real design systems rarely match a generic "core 10". A fintech DS might need Date Picker and Stepper but not Avatar. The skill suggests defaults but defers to actual inventory.
Why split inspect/build into subfolders? Large reference files don't all need to load at once. Inspect mode reads references/inspect/ only. Build mode reads references/build/ only. Phase 6 specifically loads code-export.md. Critical rules in SKILL.md apply to all modes.
Why this matters: closed loop Figma β code
The skill closes the design-to-code loop end-to-end. Figma side: components, tokens, slots, descriptions all properly structured for get_design_context to return clean CSS token names. Code side (Phase 6): tokens.css mirrors Figma exactly with three-layer indirection, AI rules tell the agent in the IDE which tokens exist and where to look up component specs, audit script catches drift. An AI agent reading a design via MCP and writing code in the IDE picks the same tokens both ways. No fabrication, no drift between sessions.
Customization
Fork and adapt. Common changes:
- Different core components: Edit list in SKILL.md Phase 4a and add specs to
references/build/component-spec.md - Different spacing scale: Edit defaults in
references/build/token-taxonomy.md - Company-specific naming: Edit
references/build/naming-conventions.md - Additional audit checks: Add new module to
references/inspect/and matching script toscripts/inspect/. Update SKILL.md inspect workflow. - Single framework: Remove irrelevant sections from
references/build/framework-mappings.md - Different Phase 6 output paths: Edit defaults in
references/build/code-export.md
Related skills
| Skill | When to use |
|---|---|
figma-generate-library | Official Figma skill with similar build workflow, integrated with Figma's tooling |
figma-generate-design | Building screens FROM a design system (not building the system itself) |
figma-implement-design | Generating code FROM Figma designs (page-level, not token-level) |
figma-create-design-system-rules | Creating top-level CLAUDE.md rules for an existing system |
figma-code-connect-components | Linking Figma components to code via Code Connect |
Resources
- Figma: Create skills for the MCP server
- Figma: Skills for MCP
- Figma slots in design systems (Nathan Curtis)
- How to build a design system in Figma (2026)
- Expose your design system to LLMs (Hardik Pandya) β inspiration for Phase 6 architecture
License
MIT β see LICENSE.
