bitovi/ai-enablement-prompts/figma-design-react
Claude Code and agent skill by bitovi/ai-enablement-prompts
- community
Checking that the SKILL.md file is still in the repository.
Design React components from Figma files. Use when given a Figma URL to analyze a design and propose React component architecture, props API, and variant handling. Outputs design analysis and suggested API - does not build components. Also triggers on phrases like "analyze this Figma", "what props should this component have", "design the API for this", "plan this component from Figma".
Install
npx vskill@latest install bitovi/ai-enablement-prompts/figma-design-reactSKILL.md
Skill: Design React Components from Figma
This skill analyzes Figma designs and proposes React component architecture and props APIs. It helps bridge the gap between design and implementation by providing clear specifications before coding begins.
When to Use
- User provides a Figma URL and wants to understand how to implement it as React
- Planning component architecture before implementation
- Determining what props a component should have based on Figma variants
- Deciding if a Figma component should be one or multiple React components
What This Skill Does NOT Do
- Build or implement the actual React components
- Generate production code
- Create Code Connect mappings (use
figma-connect-componentfor that) - Sync existing components with Figma (use
figma-component-syncfor that)
Required Inputs
- Figma URL: Full URL like
https://figma.com/design/{fileKey}/{fileName}?node-id={nodeId}
Design Principle
Follow FIGMA structure exactly
When designing component APIs from Figma:
- DO NOT use any other component library as a reference
- DO NOT impose external component patterns or best practices
- DO use the Figma design as the single source of truth for component structure
- DO match the exact component hierarchy, variant structure, and prop organization shown in Figma
The component API should mirror how the design is structured in Figma, not how a component library would implement it. If Figma shows variants that change DOM structure, layout, or element ordering, the component API should reflect those structural changes through props.
Example:
- If Figma shows a Type="Mobile" variant with vertical button layout and Type="Desktop" with horizontal layout
- Then the component should have a
typeprop that controls both layout structure and alignment - NOT separate props like
buttonLayout="vertical"andtextAlign="center"which would deviate from the Figma structure
Workflow Overview
Required Flow
Follow this sequence exactly:
- Create a todo list using
manage_todo_listbefore doing any work, then mark each itemin-progressbefore starting andcompletedimmediately after finishing:
``javascript manage_todo_list({ todoList: [ { id: 1, title: 'Parse URL and fetch design context', status: 'not-started' }, { id: 2, title: 'Fetch variable definitions', status: 'not-started' }, { id: 3, title: 'Take screenshot for visual reference', status: 'not-started' }, { id: 4, title: 'Save design context to .temp/', status: 'not-started' }, { id: 5, title: 'Analyze variants and component structure', status: 'not-started' }, { id: 6, title: 'Propose component API', status: 'not-started' }, ] }) ``
- Run `get_design_context` first to fetch the structured representation for the exact node(s).
- If the response is too large or truncated, run
get_metadatato get the high-level node map and then re-fetch only the required node(s) withget_design_context.
- Run `get_variable_defs` with the same
fileKeyto resolve design token names to their semantic meaning across modes (light, dark, brand). Use this to understand what each token represents so the proposed API notes can reference the correct project CSS variables rather than hardcoded hex fallbacks.
- Run `get_screenshot` for a visual reference of the node variant being implemented.
- Only after you have `get_design_context`, `get_variable_defs`, and `get_screenshot`,, download any assets needed and start implementation.
- Translate the output into this project's conventions, styles and framework. Reuse the project's color tokens, components, and typography wherever possible.
- Validate against Figma for 1:1 look and behavior before marking complete.
Step-by-Step Instructions
Step 1: Parse Figma URL and Fetch Design Context
Extract from the URL:
fileKey: The ID after/design/(or after/branch/if on a branch)nodeId: Fromnode-id=query param (convert123-456→123:456)
Call mcp_figma_get_design_context with:
nodeId: The extracted node IDfileKey: The extracted file key
Step 2: Fetch Variable Definitions
Call mcp_figma_get_variable_defs with:
fileKey: The extracted file key
This returns all design tokens and their values across every mode (e.g. light/dark, brand themes). Cross-reference the token names found in the get_design_context output against the project's CSS variables in src/index.css. Include any relevant token-to-project-variable mappings as notes in proposed-api.md rather than as a separate file.
Step 3: Create Output Directory and Save Design Context
Create the output directory:
Where {COMPONENT_NAME} is derived from the Figma component name (kebab-case).
Save the design context to .temp/design-components/{COMPONENT_NAME}/design-context.md even if the response was sparse metadata, truncated, or required multiple sub-node fetches. Append additional get_design_context responses as needed:
Step 3: Analyze Figma Design
Extract and analyze:
- Variants and Variant Options
- List all variant properties (e.g., Size, State, Type)
- List all options for each variant (e.g., Size: Small, Medium, Large)
- Note how variants affect component structure, not just styling
- Does the variant change element ordering?
- Does it change flex direction or layout?
- Does it add/remove elements?
- Does it change text alignment or button positioning?
- Component Properties
- Boolean properties (e.g., "Has Icon", "Show Label")
- String properties (e.g., "Label Text")
- Instance swap properties (e.g., "Icon")
- Nested Components
- Child component instances
- Repeated elements
- Text Layers
- Configurable text content
- Alignment changes across variants
- Structural Differences
- Document how the DOM structure changes between variants
- Child Component Configurability Assessment
When the parent component contains nested child component instances (e.g., a Dialog containing Buttons), critically evaluate whether those child components should be configurable by the user.
Common Design Pattern Gap: Designers may focus on the parent component's variants without considering that child component instances might need different configurations based on the use case. For example:
- An
AlertDialogmight always show the same "Cancel" and "Delete" buttons in Figma - But in actual usage, different dialogs need different button variants (destructive vs. primary), labels, and actions
When to Recommend Configurable Child Props:
Consider making child components configurable if:
- The child has multiple variants in its own component set (e.g., Button has primary/destructive/outline variants)
- Different use cases would require different child configurations
- The child component's content or behavior naturally varies (button labels, icons, actions)
- The design shows only one variant but others exist and are relevant
How to Handle in API Design:
Instead of hardcoding child components, provide render prop or component prop patterns:
```typescript interface AlertDialogProps { title: string; description: string;
// Allow users to pass configured child instances actionButton?: React.ReactNode; cancelButton?: React.ReactNode;
// OR use render props for full control renderActions?: (props: { onClose: () => void }) => React.ReactNode; } ```
Example Usage: ``tsx <AlertDialog title="Delete item?" description="This action cannot be undone." actionButton={ <Button variant="destructive" size="default"> Delete </Button> } cancelButton={ <Button variant="outline" size="default"> Cancel </Button> } /> ``
Document in Proposed API:
When recommending configurable child components, explain:
- Why the child should be configurable (use case flexibility)
- What the Figma design shows vs. what's needed in practice
- Whether to use component props, render props, or both
- Default behavior if props are not provided
Example Documentation: ```markdown ### Design Consideration: Configurable Buttons
Figma shows: Fixed "Cancel" and "Delete" buttons with specific variants
Recommended approach: Make buttons configurable via props
Rationale: Different alert dialogs need different button configurations:
- Destructive actions (delete, remove) need
variant="destructive" - Confirmations need
variant="primary" - Button labels vary by context ("Delete", "Remove", "Confirm", etc.)
The Figma design represents one use case, but the component should support flexible button configurations to handle all dialog scenarios. ```
Step 3b: Identify the Interaction Model
Before proposing any API, explicitly answer: Is this component stateless, internally stateful, or externally controlled?
| Model | Description | Example | |
|---|---|---|---|
| Stateless | No state pure display | Badge, Avatar, Divider | |
| Internally stateful | Component owns its open/closed state | Accordion with no controlled prop | |
| Externally controlled | Consumer drives state via props | Checkbox with checked + onCheckedChange | |
| Hybrid | Supports both (uncontrolled default + optional controlled) | Select with defaultValue and value |
Document this explicitly in proposed-api.md. It determines which props are required, which are optional, and whether default* variants are needed.
Complexity budget: If the proposed API would have more than 8 props OR the component contains 3+ structurally distinct sub-layouts, evaluate whether to split into multiple components before writing the interface.
Step 4: Propose Component API
Based on the analysis, create .temp/design-components/{COMPONENT_NAME}/proposed-api.md:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingfigma/figma-design-react/SKILL.md
Popularity
- Repository stars
- 112
- Repository forks
- 61
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bitovi/ai-enablement-prompts/figma-design-react)