A spec-driven skill that treats a Figma design as the source of truth and produces a React component API specification before any implementation begins.
Given a Figma URL, the skill analyzes the component's variants, properties, and structure, then outputs a proposed-api.md — a TypeScript props interface with a full mapping table from Figma properties to React props. No code is generated. The spec comes first.
- Fetches the Figma design context and variable definitions via the Figma MCP server
- Analyzes all variant properties, boolean toggles, text layers, instance swaps, and structural differences across variants
- Proposes a React component API: props interface, type definitions, variant-to-prop mappings, and usage examples
- Documents any deviation from the Figma structure with explicit rationale
The output is a human-readable contract that a developer (or a follow-up build skill) implements against — not production code.
Jumping straight from Figma to code often leads to prop APIs that don't reflect design intent, missed variants, or components that need breaking changes after the first review. This skill separates the what (the spec) from the how (the implementation), so the API is agreed on before a line of component code is written.
- A Figma file with a component or frame you want to implement
- The Figma MCP server connected to your AI agent (see below)
- A Figma personal access token — get one from Figma → Account Settings → Personal Access Tokens
This skill uses the Figma MCP server, not a Figma plugin. The AI agent reads directly from your Figma file through the MCP connection — no plugin panel or Figma Community install required.
- Go to Claude.ai → Settings → Integrations
- Find Figma and click Connect
- Authorize with your Figma account
Add to your Claude config file (~/.claude.json or claude_desktop_config.json):
{
"mcpServers": {
"figma": {
"url": "https://mcp.figma.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_FIGMA_ACCESS_TOKEN"
}
}
}
}Add to .vscode/mcp.json:
{
"servers": {
"figma": {
"type": "sse",
"url": "https://mcp.figma.com/sse",
"headers": {
"Authorization": "Bearer YOUR_FIGMA_ACCESS_TOKEN"
}
}
}
}- Clone the repo
git clone https://github.com/bitovi/design-react-api.git
cd design-react-api- Add
SKILL.mdto your AI agent's skills directory. For Claude Code, place it under.github/skills/in your project.
Paste a Figma URL and ask the agent to design the React component API:
"Design a React component from this Figma: https://figma.com/design/abc123/DesignSystem?node-id=100-200"
"Analyze this Figma component and propose a props API before we build it."
"What should the React API look like for this Figma component?"
.temp/design-components/{component-name}/
├── design-context.md # Raw Figma data + source URL
└── proposed-api.md # Proposed props interface, variant mappings, usage examples
Example proposed-api.md content:
interface ButtonProps {
// Mapped from Figma variant "Size"
size?: 'sm' | 'md' | 'lg';
// Mapped from Figma variant "Type"
variant?: 'primary' | 'secondary' | 'outline';
// Mapped from Figma boolean "Disabled"
disabled?: boolean;
// Mapped from Figma text layer "Label"
children: React.ReactNode;
// Mapped from Figma instance "Icon"
icon?: React.ReactNode;
}Pseudo-states like hover, pressed, and focused are excluded from props and documented as handled by CSS/Tailwind.
get_design_context— Fetch component structure, variants, and propertiesget_variable_defs— Resolve design tokens to semantic names across modes (light/dark/brand)
Contributions are welcome.
- Fork the repo
- Create a branch:
git checkout -b feature/your-improvement - Make your changes to
SKILL.md - Test against at least one multi-variant Figma component
- Open a pull request with a description of what changed and why