
figma-design-md-generator
Generate DESIGN.md and SKILL.md files from Figma design systems for AI-assisted development
- Installs
- 123
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/reason-machines/design-skills --skill figma-design-md-generator- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads figma-design-md-generator automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Figma DESIGN.md Generator
Skill by ara.so — Design Skills collection.
A Figma plugin that extracts local style guidelines, variables, and component families from Figma files and generates DESIGN.md and SKILL.md files. These outputs provide AI tools (Claude Code, Cursor, Codex) with structured design-system blueprints for building consistent interfaces.
What It Does
The plugin reads Figma's local styles and variables—colors, typography, spacing, radius, effects, grids, and component sets—and converts them into editable markdown files following the TypeUI DESIGN.md format.
Key capabilities:
- Auto-extracts color tokens (paint styles + variables)
- Auto-extracts typography tokens (text styles + scales)
- Auto-extracts spacing, radius, motion tokens
- Auto-extracts effect styles (shadows, blur)
- Auto-extracts grid styles and component families
- Generates human-editable
DESIGN.md(reference documentation) - Generates AI-optimized
SKILL.md(agent instructions)
Installation
As a Figma Plugin (Development Mode)
-
Clone the repository:
git clone https://github.com/bergside/design-md-figma.git cd design-md-figma -
Install dependencies:
npm install -
Build the plugin:
npm run build -
Import into Figma Desktop:
- Open Figma Desktop
- Go to Plugins → Development → Import plugin from manifest...
- Select
manifest.jsonfrom the project directory - Run Design MD Skill Generator from the plugins menu
Development Workflow
# Watch mode for live development
npm run watch
# Type checking
npm run typecheck
# Production build
npm run build
Key Plugin Actions
| Action | Description |
|---|---|
| Auto-extract | Reads local styles and variables from active Figma file |
| Generate DESIGN.md | Creates design-guideline markdown from extracted signals |
| Generate SKILL.md | Creates agent-ready markdown with implementation rules |
| Toggle view | Switches between DESIGN.md and SKILL.md in editor |
| Refresh | Re-runs extraction for current file state |
| Download | Saves generated output as .md file |
Plugin Architecture
Main Entry Points
code.ts – Plugin backend (runs in Figma sandbox):
figma.showUI(__html__, { width: 800, height: 600 });
// Listen for extraction requests
figma.ui.onmessage = (msg) => {
if (msg.type === 'extract-styles') {
const styles = extractLocalStyles();
const variables = extractVariables();
const components = extractComponentFamilies();
figma.ui.postMessage({
type: 'extraction-complete',
data: { styles, variables, components }
});
}
};
function extractLocalStyles() {
const paintStyles = figma.getLocalPaintStyles();
const textStyles = figma.getLocalTextStyles();
const effectStyles = figma.getLocalEffectStyles();
const gridStyles = figma.getLocalGridStyles();
return {
colors: paintStyles.map(s => ({
name: s.name,
type: s.paints[0]?.type,
value: paintToHex(s.paints[0])
})),
typography: textStyles.map(s => ({
name: s.name,
fontFamily: s.fontName.family,
fontSize: s.fontSize,
lineHeight: s.lineHeight
})),
effects: effectStyles.map(s => ({
name: s.name,
effects: s.effects
})),
grids: gridStyles.map(s => ({
name: s.name,
layoutGrids: s.layoutGrids
}))
};
}
function extractVariables() {
const collections = figma.variables.getLocalVariableCollections();
return collections.map(collection => ({
name: collection.name,
modes: collection.modes,
variables: collection.variableIds.map(id => {
const variable = figma.variables.getVariableById(id);
return {
name: variable?.name,
resolvedType: variable?.resolvedType,
valuesByMode: variable?.valuesByMode
};
})
}));
}
function extractComponentFamilies() {
const components = figma.root.findAll(node =>
node.type === 'COMPONENT_SET'
) as ComponentSetNode[];
return components.map(comp => ({
name: comp.name,
variantCount: comp.children.length,
properties: Object.keys(comp.componentPropertyDefinitions || {})
}));
}
ui.html – Plugin UI (React-based):
// Send extraction request
window.parent.postMessage(
{ pluginMessage: { type: 'extract-styles' } },
'*'
);
// Receive extraction results
window.onmessage = (event) => {
const msg = event.data.pluginMessage;
if (msg.type === 'extraction-complete') {
const designMd = generateDesignMd(msg.data);
const skillMd = generateSkillMd(msg.data);
setDesignContent(designMd);
setSkillContent(skillMd);
}
};
Generated File Structure
DESIGN.md Format
# Design System – [File Name]
## Source
- **File**: [Figma file name]
- **Page**: [Current page]
- **Extracted**: [ISO timestamp]
## Variable Collections
- **Collection Name** (2 modes: Light, Dark)
## Color Tokens
| Token | Value | Type |
|-------|-------|------|
| primary/500 | #3B82F6 | solid |
| neutral/900 | #111827 | solid |
## Typography Tokens
| Token | Font Family | Size | Line Height | Weight |
|-------|-------------|------|-------------|--------|
| heading/xl | Inter | 32px | 1.2 | 700 |
| body/md | Inter | 16px | 1.5 | 400 |
## Spacing Tokens
| Token | Value |
|-------|-------|
| spacing/xs | 4px |
| spacing/md | 16px |
## Component Families
- Button (variants: 8)
- Input (variants: 6)
- Card (variants: 4)
SKILL.md Format
# AI Design System Agent – [File Name]
## Mission
Implement UI components that strictly follow the extracted design system from [File Name].
## Brand
- **Product**: [Inferred from file]
- **Audience**: [Inferred context]
- **Surface**: Web/Mobile
## Style Foundations
### Colors
- Primary: #3B82F6
- Semantic: Success (#10B981), Error (#EF4444)
### Typography
- Heading scale: 32/24/20/16px
- Body scale: 16/14/12px
- Font stack: Inter, system-ui, sans-serif
## Accessibility
- WCAG 2.2 AA contrast (4.5:1 text, 3:1 UI)
- Minimum touch target: 44×44px
- Focus indicators required
## Rules: Do
- Use extracted color tokens exactly
- Apply typography tokens for all text
- Respect spacing scale for layout
- Implement all component variants
## Rules: Don't
- Don't invent new colors outside token set
- Don't use arbitrary font sizes
- Don't skip accessibility requirements
Common Usage Patterns
Extract and Download
// In plugin code
async function extractAndGenerate() {
// Extract all design tokens
const styles = extractLocalStyles();
const variables = extractVariables();
const components = extractComponentFamilies();
// Generate markdown
const designMd = formatDesignMd({ styles, variables, components });
const skillMd = formatSkillMd({ styles, variables, components });
// Send to UI for download
figma.ui.postMessage({
type: 'download-ready',
designMd,
skillMd
});
}
Convert Paint to Hex
function paintToHex(paint: Paint): string {
if (paint.type === 'SOLID') {
const r = Math.round(paint.color.r * 255);
const g = Math.round(paint.color.g * 255);
const b = Math.round(paint.color.b * 255);
return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`.toUpperCase();
}
return 'gradient';
}
Format Typography Token
function formatTypographyToken(style: TextStyle) {
const lineHeight = style.lineHeight.unit === 'PIXELS'
? `${style.lineHeight.value}px`
: style.lineHeight.value;
return {
name: style.name,
fontFamily: style.fontName.family,
fontSize: `${style.fontSize}px`,
fontWeight: style.fontWeight,
lineHeight,
letterSpacing: style.letterSpacing
};
}
Extract Component Variants
function extractComponentVariants(componentSet: ComponentSetNode) {
const variants = componentSet.children.map(child => {
if (child.type === 'COMPONENT') {
return {
name: child.name,
properties: child.variantProperties || {}
};
}
}).filter(Boolean);
return {
family: componentSet.name,
count: variants.length,
variants
};
}
Using Generated Files with AI Tools
Claude Code / Cursor
- Place
DESIGN.mdandSKILL.mdin project root - Reference in agent context:
@SKILL.md implement a button component following the design system
Prompt Engineering
Using the design tokens in DESIGN.md, create a React component
for [Component Name] that:
- Uses color tokens from primary palette
- Applies typography token heading/md
- Respects spacing/md for padding
- Implements all variants listed in Component Families
Configuration
The plugin reads Figma's native structures—no external configuration required. All extraction is based on:
- Local paint styles
- Local text styles
- Local effect styles
- Local grid styles
- Variable collections
- Component sets in current file
Troubleshooting
No Styles Extracted
Problem: Plugin returns empty DESIGN.md
Solution: Ensure you have local styles created in Figma. Shared library styles are not extracted—only local file styles.
// Check for local styles
const paintStyles = figma.getLocalPaintStyles();
if (paintStyles.length === 0) {
console.warn('No local paint styles found in this file');
}
Variables Not Showing
Problem: Variable collections missing from output
Solution: Verify variables are created as local collections, not external libraries.
const collections = figma.variables.getLocalVariableCollections();
console.log('Found collections:', collections.length);
Build Errors
Problem: TypeScript compilation fails
Solution: Ensure Figma plugin types are installed:
npm install --save-dev @figma/plugin-typings
Update tsconfig.json:
{
"compilerOptions": {
"types": ["@figma/plugin-typings"]
}
}
Plugin Won't Load
Problem: "Failed to load manifest" error
Solution: Check manifest.json structure:
{
"name": "Design MD Skill Generator",
"id": "YOUR_PLUGIN_ID",
"api": "1.0.0",
"main": "code.js",
"ui": "ui.html",
"editorType": ["figma"]
}
Best Practices
-
Run extraction on finalized designs – Ensure your local styles and variables are complete before generating files
-
Name tokens consistently – Use
/separators for token hierarchy (e.g.,color/primary/500) -
Version control generated files – Commit
DESIGN.mdandSKILL.mdalongside design system code -
Update after design changes – Re-run extraction when design tokens change
-
Combine with component library – Use generated files as source of truth for design token implementation
Resources
FAQ
What does the figma-design-md-generator skill do?
Generate DESIGN.md and SKILL.md files from Figma design systems for AI-assisted development
How do I install figma-design-md-generator?
Run npx skills add https://github.com/reason-machines/design-skills --skill figma-design-md-generator in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/figma-design-md-generator/ (personal) or .claude/skills/figma-design-md-generator/ (project).
Which AI agents can use figma-design-md-generator?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is figma-design-md-generator safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains figma-design-md-generator?
It is published by reason-machines in reason-machines/design-skills. It has 123 recorded installs.
More from reason-machines/design-skills
awesome-claude-design
reason-machines/design-skills
Use ready-to-use DESIGN.md files to scaffold complete design systems in Claude Design with colors, typography, components, and UI kits
design-md-chrome-extractor
reason-machines/design-skills
Chrome extension that extracts design systems from websites and generates DESIGN.md or SKILL.md files for AI coding agents using TypeUI format
design-md-format
reason-machines/design-skills
Create and validate DESIGN.md files that give AI coding agents structured understanding of design systems through machine-readable tokens and human-readable rationale.
open-codesign-ai-design
reason-machines/design-skills
Use Open CoDesign to generate prototypes, slides, and PDFs from prompts with Claude, GPT, Gemini, or local models
open-design-ai-prototyping
reason-machines/design-skills
Open the skill to read its SKILL.md instructions.
diagram-design-editorial
reason-machines/design-skills
Create editorial-quality diagrams in HTML + SVG matching your brand — architecture, flowcharts, sequences, timelines, quadrants, and 9 more types.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.