Your AI design
pipeline, ready to ship.
Follow these 5 steps to connect Figma, Claude, and Cursor into a pipeline that connects your design system to production-ready code - automatically.
Your design system becomes the code.
Not a reference doc someone interprets. Not a handoff that gets lost in translation. The actual working code - generated directly from your Figma design system, on-brand from line one.
Structure Your Figma File for AI
Before variables, before tokens, before any of the tools - your Figma file needs to be organized in a way AI can actually navigate. A messy file produces messy code. A structured file produces clean, accurate components from the first prompt.
The three tiers everything lives in
How to name your pages
Page names are the only label Claude can read without opening anything. Use number prefixes so it instantly knows what tier it's in - no analysis needed.
-- Skip these (human-only, AI ignores them) -- 00 Cover ─── -- Foundations: one page per category -- 01 Foundations - Color 01 Foundations - Typography 01 Foundations - Spacing & Grid 01 Foundations - Elevation & Radius ─── -- Components: grouped by function -- 02 Components - Actions 02 Components - Inputs 02 Components - Navigation 02 Components - Feedback ─── -- Patterns: composed from components -- 03 Patterns - Forms 03 Patterns - Lists & Tables 03 Patterns - Cards & Content ─── -- Pages: full screens -- 04 Pages - Dashboard 04 Pages - Settings 04 Pages - Onboarding ─── -- Skip these too (human-only) -- 99 Documentation 99 Changelog 99 Playground
How to structure each component
Every component on a page should follow the same internal structure. This consistency is what lets Claude generate clean, prop-driven code instead of hard-coded div soup.
Section: Button
├── Frame: Button - Component Set
│ └── All variants organized by property:
│ ├── Size: sm | md | lg
│ ├── Variant: primary | secondary | ghost | destructive
│ ├── State: default | hover | active | disabled | focused
│ └── Icon: none | leading | trailing
│
├── Frame: Button - Anatomy
│ └── Labeled parts: icon slot, label, padding, border radius
│
├── Frame: Button - Specs
│ └── Exact measurements and token assignments per state
│
└── Frame: Button - Usage Examples
└── Real examples in context: in a form, in a toolbar, as a CTA
Build a Design System AI Can Actually Use
Before AI can generate UI that looks like your product, it needs to know your rules. Not just colors and fonts - but what those colors and fonts mean. This is the foundation everything else depends on.
Figma Variables work the same way - instead of giving AI a raw color like
#22c55e, you tell it "this is your primary button color, and it happens to be green." Now AI knows where to use it, when to use it, and when not to.Without this: AI guesses. Components look reasonable but feel off-brand - every one needs manual correction. With this: AI works from the same rulebook your team uses. Output is on-brand from line one.
Setting up Variables in Figma
-
1Open your Figma file. Go to Local Variables in the top right toolbar (or press
⌘+Option+V). -
2Create two collections: Primitives and Semantics. Think of Primitives as your palette, Semantics as your decisions.
-
3In Primitives, add all your raw values. Use forward-slash naming:
color/brand/500,spacing/16. Never use these directly in components. -
4In Semantics, create aliases that reference primitives. Example:
color/text/primary→ referencescolor/neutral/900. These are what AI uses. -
5Publish the library: Assets panel → your library name → Publish. Your library and working file must live in the same Figma workspace.
-
6In your working file, go to Assets → Libraries and enable your published library. Test it by dragging a component onto the canvas to confirm the connection.
tokens.json follows this exact two-layer structure. You can use it as a reference for naming conventions and which semantic tokens to create - or import it directly into a tokens plugin like Tokens Studio.Give Claude Direct Access to Your Figma File
Right now Claude and Figma don't know each other exist. This step connects them using something called MCP - think of it as a live bridge that lets Claude read your design file directly, without you having to copy-paste anything between apps.
-
1Download and install Claude Desktop from claude.ai/download
-
2Get your Figma API token - this is a password that lets Claude read your Figma files. Go to Figma → Account Settings → Personal Access Tokens → Generate new token. Give it read access to files and dev resources. Copy it somewhere safe.
-
3In Claude Desktop: Settings → Developer → Edit Config. This opens a config file - don't worry, you just need to paste one block of code into it. Copy the code below and replace
YOUR_TOKEN_HEREwith the token you just generated.
{
"mcpServers": {
"figma": {
"command": "npx",
"args": [
"-y",
"figma-developer-mcp",
"--figma-api-key=YOUR_TOKEN_HERE"
]
}
}
}
-
4Save the config file and fully restart Claude Desktop (quit from the menu bar, reopen).
-
5Test the connection by typing this into Claude: "What Figma skills do you have access to?" If it worked, Claude lists tools like
search_design_systemandget_variable_defs. If not, restart Claude Desktop and try again. -
6Confirm Claude can actually read your variables by asking: "List the tokens in my Figma file at [YOUR FILE URL]." Claude should return token names like
color/text/primaryandspacing/component/mdwith their values. If it can't, your library may not be published or connected to the file.
Give Claude Its Standing Orders
Claude reads your design system and drafts component structure - but it needs to know your rules first. This step gives Claude a permanent briefing so every conversation starts from the same foundation. Cursor is where the final code gets written. Claude is where the thinking happens.
-
1In Claude Desktop or Claude.ai, find Projects in the left sidebar and click New Project. Name it something like "UI Pipeline" or your product name. Projects keep all your AI conversations organized in one place.
-
2Inside the project, click Project Instructions. Open the
system-prompt.txtfile from this kit, select all, and paste it in. That's it - Claude now knows your design rules. -
3Every conversation you start inside this Project automatically inherits these instructions. You never have to re-explain your design system to Claude again.
system-prompt.txt - update it to match how your project is organized. Everything else works out of the box.Set Up Cursor - Where Code Gets Written
Cursor is a code editor with AI built in. It's where the components Claude designs actually get written, cleaned up, and saved. Think of Claude as the architect and Cursor as the builder - they work together, but Cursor is where the final file lives.
-
1Download and install Cursor from cursor.com. It looks like a normal code editor - open your project folder in it the same way you would any app.
-
2Take the
cursor-rules.txtfile from this kit and rename it to.cursorrules- note the dot at the start and no file extension. Drop it in the root folder of your project. Cursor reads this file automatically every time it runs. -
3Create a folder called
tokensat the root of your project. Placetokens.jsoninside it. You'll also need to generate atokens.cssfile from it - see the callout below. -
4In Cursor settings, make sure the AI model is set to Claude Sonnet. The rules file is written specifically for this model.
-
5Important habit: After Cursor generates something that works, click Accept on all the changes before moving on. This saves your progress - if something breaks later, you can always roll back to the last accepted state.
Generate CSS variables
tokens.css is generated from tokens.json using any design token transformer or simple script. The result is a CSS file containing custom properties that components reference directly. Place it at /tokens/tokens.css alongside tokens.json and commit both to your repo.
--color-text-primary: #111827;
--spacing-component-md: 12px;
--radius-card: 16px;
}
tokens.css using a tool like Style Dictionary, or ask Cursor to write the conversion script for you. The kit assumes tokens.css exists before components are generated.Generate Your First Component
Everything is connected. Claude reads your Figma design system and drafts component structure. Cursor takes that draft and produces final, production-ready code referencing your tokens. Here's how to run it end to end.
Step 1 - Ask Claude to read your design system
Step 2 - Ask Cursor to write the final code
-
1Open Claude Desktop with Figma MCP active. Copy your Figma file URL from the browser and use the prompt above. You'll see Claude working through your design system in real time - reading components, pulling variables, building the screen.
-
2Check Figma. If the screen was built using real library components, you'll see them listed by name in the left panel - not generic "Frame" or "Rectangle" layers. Try switching color modes to confirm everything updates correctly.
-
3Claude's output is a draft - bring it into Cursor to finalize. Ask Cursor to refine the code, replace any hardcoded values with CSS custom properties from tokens.css, add missing states, and integrate with your project structure. Accept changes after each step.
-
4Save and commit to GitHub. That's your first AI-generated, on-brand component - shipped.
You're set up to ship faster.
Your design system is now something AI can actually use. Every component your team generates from here will be on-brand, consistent, and ready to commit - without anyone manually correcting it.