figma-extract-tokens
Extract design tokens and variables from a Figma file to create or update a design system
What this skill does
# Extract Design Tokens from Figma
## Name
figma:figma-extract-tokens - Extract design tokens and variables from Figma files
## Synopsis
Extract design tokens (colors, spacing, typography, etc.) from Figma files and generate token files in various formats (CSS Custom Properties, TypeScript, JSON, Style Dictionary, Tailwind config).
## Description
You are tasked with extracting design tokens and variables from a Figma file using the Figma MCP server. This command analyzes Figma variables and variable collections to generate structured token files for your design system.
## Implementation
Connects to the Figma Desktop MCP server to access Figma variables API. Extracts all variable types (colors, numbers, strings, booleans) and organizes them into primitive and semantic token hierarchies. Supports multiple output formats and theming variations.
## Your Task
1. **Access the Figma File**:
- Use Figma MCP tools to access the current file
- If no file is open, ask the user to open one in Figma or provide a URL
2. **Extract Variables**:
- Get all color variables and their values
- Get spacing/sizing variables
- Get typography variables (font families, sizes, weights, line heights)
- Get any other variables (border radius, shadows, etc.)
- Organize by variable collections if they exist
3. **Analyze Token Structure**:
- Identify semantic tokens (primary, secondary, etc.)
- Note primitive tokens (specific values)
- Detect theming variations (light/dark modes)
- Check for token hierarchies and references
4. **Generate Token Files**:
- Ask the user what format they prefer:
- CSS Custom Properties
- JavaScript/TypeScript objects
- JSON
- Sass/SCSS variables
- Tailwind config
- Style Dictionary format
- Generate properly structured token files
- Include comments with Figma references
5. **Provide Documentation**:
- Create a mapping of token names to Figma variables
- Note any missing tokens that should be added
- Suggest token naming conventions if inconsistent
- Document how to use tokens in code
## Output Formats
### CSS Custom Properties
```css
/**
* Design Tokens - Extracted from Figma
* File: [Figma file name]
* Generated: [date]
*/
:root {
/* Colors - Primitives */
--color-blue-500: #3b82f6;
--color-gray-900: #111827;
/* Colors - Semantic */
--color-primary: var(--color-blue-500);
--color-text: var(--color-gray-900);
/* Spacing */
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
/* Typography */
--font-family-base: 'Inter', sans-serif;
--font-size-body: 1rem;
--line-height-body: 1.5;
}
```
### TypeScript/JavaScript
```typescript
/**
* Design Tokens - Extracted from Figma
* File: [Figma file name]
* Generated: [date]
*/
export const tokens = {
colors: {
primitives: {
blue500: '#3b82f6',
gray900: '#111827',
},
semantic: {
primary: '#3b82f6',
text: '#111827',
},
},
spacing: {
xs: '0.25rem',
sm: '0.5rem',
md: '1rem',
},
typography: {
fontFamily: {
base: "'Inter', sans-serif",
},
fontSize: {
body: '1rem',
},
lineHeight: {
body: 1.5,
},
},
} as const;
export type Tokens = typeof tokens;
```
### Style Dictionary Format
```json
{
"color": {
"primitive": {
"blue": {
"500": { "value": "#3b82f6" }
},
"gray": {
"900": { "value": "#111827" }
}
},
"semantic": {
"primary": { "value": "{color.primitive.blue.500}" },
"text": { "value": "{color.primitive.gray.900}" }
}
},
"spacing": {
"xs": { "value": "0.25rem" },
"sm": { "value": "0.5rem" },
"md": { "value": "1rem" }
}
}
```
## Best Practices
1. **Token Naming**:
- Use semantic names for application tokens (primary, secondary)
- Use descriptive names for primitive tokens (blue-500, spacing-md)
- Be consistent with naming conventions
- Use namespacing for organization
2. **Token Organization**:
- Group related tokens (colors, spacing, typography)
- Separate primitives from semantics
- Support theming with token references
- Document token purposes
3. **Token Values**:
- Preserve units from Figma (px, rem, em)
- Convert to appropriate format for target platform
- Include fallbacks for token references
- Validate values are valid CSS/code
4. **Maintenance**:
- Include Figma file reference for traceability
- Add generation timestamp
- Note any manual adjustments needed
- Document how to re-sync from Figma
## Additional Deliverables
After extracting tokens, also provide:
1. **Token Documentation**:
- Markdown file documenting each token category
- Usage examples for designers and developers
- Migration guide if updating existing tokens
2. **Integration Guide**:
- How to import tokens in the project
- How to use tokens in components
- How to extend or override tokens
3. **Validation**:
- Check for duplicate tokens
- Note any missing semantic tokens
- Identify unused variables in Figma
- Suggest token consolidation opportunities
## Notes
- If variable collections exist, extract them separately
- Note any Figma variables without values
- Identify color mode variations (light/dark)
- Suggest token additions for common use cases not covered
- Provide examples of using tokens in actual components
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.