Figma implement design skill

Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation).

by davila7·MIT license·★ 32,299 Stars on the repo·GitHub ↗

Use now

Files of Figma implement design

davila7/main1 file shown
SKILL.md
Show the full text266 lines

Implement Design

Overview

This skill provides a structured workflow for translating Figma designs into production-ready code with pixel-perfect accuracy. It ensures consistent integration with the Figma MCP server, proper use of design tokens, and 1:1 visual parity with designs.

Prerequisites

  • Figma MCP server must be connected and accessible
  • User must provide a Figma URL in the format: https://figma.com/design/:fileKey/:fileName?node-id=1-2
    • :fileKey is the file key
    • 1-2 is the node ID (the specific component or frame to implement)
  • OR when using figma-desktop MCP: User can select a node directly in the Figma desktop app (no URL required)
  • Project should have an established design system or component library (preferred)

Required Workflow

Follow these steps in order. Do not skip steps.

Step 0: Set up Figma MCP (if not already configured)

If any MCP call fails because Figma MCP is not connected, pause and set it up:

  1. Add the Figma MCP:
    • codex mcp add figma --url https://mcp.figma.com/mcp
  2. Enable remote MCP client:
    • Set [features].rmcp_client = true in config.toml or run codex --enable rmcp_client
  3. Log in with OAuth:
    • codex mcp login figma

After successful login, the user will have to restart codex. You should finish your answer and tell them so when they try again they can continue with Step 1.

Step 1: Get Node ID
Option A: Parse from Figma URL

When the user provides a Figma URL, extract the file key and node ID to pass as arguments to MCP tools.

URL format: https://figma.com/design/:fileKey/:fileName?node-id=1-2

Extract:

  • File key: :fileKey (the segment after /design/)
  • Node ID: 1-2 (the value of the node-id query parameter)

Note: When using the local desktop MCP (figma-desktop), fileKey is not passed as a parameter to tool calls. The server automatically uses the currently open file, so only nodeId is needed.

Example:

  • URL: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15
  • File key: kL9xQn2VwM8pYrTb4ZcHjF
  • Node ID: 42-15
Option B: Use Current Selection from Figma Desktop App (figma-desktop MCP only)

When using the figma-desktop MCP and the user has NOT provided a URL, the tools automatically use the currently selected node from the open Figma file in the desktop app.

Note: Selection-based prompting only works with the figma-desktop MCP server. The remote server requires a link to a frame or layer to extract context. The user must have the Figma desktop app open with a node selected.

Step 2: Fetch Design Context

Run get_design_context with the extracted file key and node ID.

get_design_context(fileKey=":fileKey", nodeId="1-2")

This provides the structured data including:

  • Layout properties (Auto Layout, constraints, sizing)
  • Typography specifications
  • Color values and design tokens
  • Component structure and variants
  • Spacing and padding values

If the response is too large or truncated:

  1. Run get_metadata(fileKey=":fileKey", nodeId="1-2") to get the high-level node map
  2. Identify the specific child nodes needed from the metadata
  3. Fetch individual child nodes with get_design_context(fileKey=":fileKey", nodeId=":childNodeId")
Step 3: Capture Visual Reference

Run get_screenshot with the same file key and node ID for a visual reference.

get_screenshot(fileKey=":fileKey", nodeId="1-2")

This screenshot serves as the source of truth for visual validation. Keep it accessible throughout implementation.

Step 4: Download Required Assets

Download any assets (images, icons, SVGs) returned by the Figma MCP server.

IMPORTANT: Follow these asset rules:

  • If the Figma MCP server returns a localhost source for an image or SVG, use that source directly
  • DO NOT import or add new icon packages - all assets should come from the Figma payload
  • DO NOT use or create placeholders if a localhost source is provided
  • Assets are served through the Figma MCP server's built-in assets endpoint
Step 5: Translate to Project Conventions

Translate the Figma output into this project's framework, styles, and conventions.

Key principles:

  • Treat the Figma MCP output (typically React + Tailwind) as a representation of design and behavior, not as final code style
  • Replace Tailwind utility classes with the project's preferred utilities or design system tokens
  • Reuse existing components (buttons, inputs, typography, icon wrappers) instead of duplicating functionality
  • Use the project's color system, typography scale, and spacing tokens consistently
  • Respect existing routing, state management, and data-fetch patterns
Step 6: Achieve 1:1 Visual Parity

Strive for pixel-perfect visual parity with the Figma design.

Guidelines:

  • Prioritize Figma fidelity to match designs exactly
  • Avoid hardcoded values - use design tokens from Figma where available
  • When conflicts arise between design system tokens and Figma specs, prefer design system tokens but adjust spacing or sizes minimally to match visuals
  • Follow WCAG requirements for accessibility
  • Add component documentation as needed
Step 7: Validate Against Figma

Before marking complete, validate the final UI against the Figma screenshot.

Validation checklist:

  • Layout matches (spacing, alignment, sizing)
  • Typography matches (font, size, weight, line height)
  • Colors match exactly
  • Interactive states work as designed (hover, active, disabled)
  • Responsive behavior follows Figma constraints
  • Assets render correctly
  • Accessibility standards met

Implementation Rules

Component Organization
  • Place UI components in the project's designated design system directory
  • Follow the project's component naming conventions
  • Avoid inline styles unless truly necessary for dynamic values
Design System Integration
  • ALWAYS use components from the project's design system when possible
  • Map Figma design tokens to project design tokens
  • When a matching component exists, extend it rather than creating a new one
  • Document any new components added to the design system
Code Quality
  • Avoid hardcoded values - extract to constants or design tokens
  • Keep components composable and reusable
  • Add TypeScript types for component props
  • Include JSDoc comments for exported components

Examples

Example 1: Implementing a Button Component

User says: "Implement this Figma button component: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"

Actions:

  1. Parse URL to extract fileKey=kL9xQn2VwM8pYrTb4ZcHjF and nodeId=42-15
  2. Run get_design_context(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")
  3. Run get_screenshot(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15") for visual reference
  4. Download any button icons from the assets endpoint
  5. Check if project has existing button component
  6. If yes, extend it with new variant; if no, create new component using project conventions
  7. Map Figma colors to project design tokens (e.g., primary-500, primary-hover)
  8. Validate against screenshot for padding, border radius, typography

Result: Button component matching Figma design, integrated with project design system.

Example 2: Building a Dashboard Layout

User says: "Build this dashboard: https://figma.com/design/pR8mNv5KqXzGwY2JtCfL4D/Dashboard?node-id=10-5"

Actions:

  1. Parse URL to extract fileKey=pR8mNv5KqXzGwY2JtCfL4D and nodeId=10-5
  2. Run get_metadata(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5") to understand the page structure
  3. Identify main sections from metadata (header, sidebar, content area, cards) and their child node IDs
  4. Run get_design_context(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId=":childNodeId") for each major section
  5. Run get_screenshot(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5") for the full page
  6. Download all assets (logos, icons, charts)
  7. Build layout using project's layout primitives
  8. Implement each section using existing components where possible
  9. Validate responsive behavior against Figma constraints

Result: Complete dashboard matching Figma design with responsive layout.

Best Practices

Always Start with Context

Never implement based on assumptions. Always fetch get_design_context and get_screenshot first.

Incremental Validation

Validate frequently during implementation, not just at the end. This catches issues early.

Document Deviations

If you must deviate from the Figma design (e.g., for accessibility or technical constraints), document why in code comments.

Reuse Over Recreation

Always check for existing components before creating new ones. Consistency across the codebase is more important than exact Figma replication.

Design System First

When in doubt, prefer the project's design system patterns over literal Figma translation.

Common Issues and Solutions

Issue: Figma output is truncated

Cause: The design is too complex or has too many nested layers to return in a single response. Solution: Use get_metadata to get the node structure, then fetch specific nodes individually with get_design_context.

Issue: Design doesn't match after implementation

Cause: Visual discrepancies between the implemented code and the original Figma design. Solution: Compare side-by-side with the screenshot from Step 3. Check spacing, colors, and typography values in the design context data.

Issue: Assets not loading

Cause: The Figma MCP server's assets endpoint is not accessible or the URLs are being modified. Solution: Verify the Figma MCP server's assets endpoint is accessible. The server serves assets at localhost URLs. Use these directly without modification.

Issue: Design token values differ from Figma

Cause: The project's design system tokens have different values than those specified in the Figma design. Solution: When project tokens differ from Figma values, prefer project tokens for consistency but adjust spacing/sizing to maintain visual fidelity.

Understanding Design Implementation

The Figma implementation workflow establishes a reliable process for translating designs to code:

For designers: Confidence that implementations will match their designs with pixel-perfect accuracy. For developers: A structured approach that eliminates guesswork and reduces back-and-forth revisions. For teams: Consistent, high-quality implementations that maintain design system integrity.

By following this workflow, you ensure that every Figma design is implemented with the same level of care and attention to detail.

Additional Resources

1---
2name: "figma-implement-design"
3description: "Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma specs. Requires a working Figma MCP server connection."
4author: openai
5---
6 
7 
8# Implement Design
9 
10## Overview
11 
12This skill provides a structured workflow for translating Figma designs into production-ready code with pixel-perfect accuracy. It ensures consistent integration with the Figma MCP server, proper use of design tokens, and 1:1 visual parity with designs.
13 
14## Prerequisites
15 
16- Figma MCP server must be connected and accessible
17- User must provide a Figma URL in the format: `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
18 - `:fileKey` is the file key
19 - `1-2` is the node ID (the specific component or frame to implement)
20- **OR** when using `figma-desktop` MCP: User can select a node directly in the Figma desktop app (no URL required)
21- Project should have an established design system or component library (preferred)
22 
23## Required Workflow
24 
25**Follow these steps in order. Do not skip steps.**
26 
27### Step 0: Set up Figma MCP (if not already configured)
28 
29If any MCP call fails because Figma MCP is not connected, pause and set it up:
30 
311. Add the Figma MCP:
32 - `codex mcp add figma --url https://mcp.figma.com/mcp`
332. Enable remote MCP client:
34 - Set `[features].rmcp_client = true` in `config.toml` **or** run `codex --enable rmcp_client`
353. Log in with OAuth:
36 - `codex mcp login figma`
37 
38After successful login, the user will have to restart codex. You should finish your answer and tell them so when they try again they can continue with Step 1.
39 
40### Step 1: Get Node ID
41 
42#### Option A: Parse from Figma URL
43 
44When the user provides a Figma URL, extract the file key and node ID to pass as arguments to MCP tools.
45 
46**URL format:** `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
47 
48**Extract:**
49 
50- **File key:** `:fileKey` (the segment after `/design/`)
51- **Node ID:** `1-2` (the value of the `node-id` query parameter)
52 
53**Note:** When using the local desktop MCP (`figma-desktop`), `fileKey` is not passed as a parameter to tool calls. The server automatically uses the currently open file, so only `nodeId` is needed.
54 
55**Example:**
56 
57- URL: `https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15`
58- File key: `kL9xQn2VwM8pYrTb4ZcHjF`
59- Node ID: `42-15`
60 
61#### Option B: Use Current Selection from Figma Desktop App (figma-desktop MCP only)
62 
63When using the `figma-desktop` MCP and the user has NOT provided a URL, the tools automatically use the currently selected node from the open Figma file in the desktop app.
64 
65**Note:** Selection-based prompting only works with the `figma-desktop` MCP server. The remote server requires a link to a frame or layer to extract context. The user must have the Figma desktop app open with a node selected.
66 
67### Step 2: Fetch Design Context
68 
69Run `get_design_context` with the extracted file key and node ID.
70 
71```
72get_design_context(fileKey=":fileKey", nodeId="1-2")
73```
74 
75This provides the structured data including:
76 
77- Layout properties (Auto Layout, constraints, sizing)
78- Typography specifications
79- Color values and design tokens
80- Component structure and variants
81- Spacing and padding values
82 
83**If the response is too large or truncated:**
84 
851. Run `get_metadata(fileKey=":fileKey", nodeId="1-2")` to get the high-level node map
862. Identify the specific child nodes needed from the metadata
873. Fetch individual child nodes with `get_design_context(fileKey=":fileKey", nodeId=":childNodeId")`
88 
89### Step 3: Capture Visual Reference
90 
91Run `get_screenshot` with the same file key and node ID for a visual reference.
92 
93```
94get_screenshot(fileKey=":fileKey", nodeId="1-2")
95```
96 
97This screenshot serves as the source of truth for visual validation. Keep it accessible throughout implementation.
98 
99### Step 4: Download Required Assets
100 
101Download any assets (images, icons, SVGs) returned by the Figma MCP server.
102 
103**IMPORTANT:** Follow these asset rules:
104 
105- If the Figma MCP server returns a `localhost` source for an image or SVG, use that source directly
106- DO NOT import or add new icon packages - all assets should come from the Figma payload
107- DO NOT use or create placeholders if a `localhost` source is provided
108- Assets are served through the Figma MCP server's built-in assets endpoint
109 
110### Step 5: Translate to Project Conventions
111 
112Translate the Figma output into this project's framework, styles, and conventions.
113 
114**Key principles:**
115 
116- Treat the Figma MCP output (typically React + Tailwind) as a representation of design and behavior, not as final code style
117- Replace Tailwind utility classes with the project's preferred utilities or design system tokens
118- Reuse existing components (buttons, inputs, typography, icon wrappers) instead of duplicating functionality
119- Use the project's color system, typography scale, and spacing tokens consistently
120- Respect existing routing, state management, and data-fetch patterns
121 
122### Step 6: Achieve 1:1 Visual Parity
123 
124Strive for pixel-perfect visual parity with the Figma design.
125 
126**Guidelines:**
127 
128- Prioritize Figma fidelity to match designs exactly
129- Avoid hardcoded values - use design tokens from Figma where available
130- When conflicts arise between design system tokens and Figma specs, prefer design system tokens but adjust spacing or sizes minimally to match visuals
131- Follow WCAG requirements for accessibility
132- Add component documentation as needed
133 
134### Step 7: Validate Against Figma
135 
136Before marking complete, validate the final UI against the Figma screenshot.
137 
138**Validation checklist:**
139 
140- [ ] Layout matches (spacing, alignment, sizing)
141- [ ] Typography matches (font, size, weight, line height)
142- [ ] Colors match exactly
143- [ ] Interactive states work as designed (hover, active, disabled)
144- [ ] Responsive behavior follows Figma constraints
145- [ ] Assets render correctly
146- [ ] Accessibility standards met
147 
148## Implementation Rules
149 
150### Component Organization
151 
152- Place UI components in the project's designated design system directory
153- Follow the project's component naming conventions
154- Avoid inline styles unless truly necessary for dynamic values
155 
156### Design System Integration
157 
158- ALWAYS use components from the project's design system when possible
159- Map Figma design tokens to project design tokens
160- When a matching component exists, extend it rather than creating a new one
161- Document any new components added to the design system
162 
163### Code Quality
164 
165- Avoid hardcoded values - extract to constants or design tokens
166- Keep components composable and reusable
167- Add TypeScript types for component props
168- Include JSDoc comments for exported components
169 
170## Examples
171 
172### Example 1: Implementing a Button Component
173 
174User says: "Implement this Figma button component: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"
175 
176**Actions:**
177 
1781. Parse URL to extract fileKey=`kL9xQn2VwM8pYrTb4ZcHjF` and nodeId=`42-15`
1792. Run `get_design_context(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")`
1803. Run `get_screenshot(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")` for visual reference
1814. Download any button icons from the assets endpoint
1825. Check if project has existing button component
1836. If yes, extend it with new variant; if no, create new component using project conventions
1847. Map Figma colors to project design tokens (e.g., `primary-500`, `primary-hover`)
1858. Validate against screenshot for padding, border radius, typography
186 
187**Result:** Button component matching Figma design, integrated with project design system.
188 
189### Example 2: Building a Dashboard Layout
190 
191User says: "Build this dashboard: https://figma.com/design/pR8mNv5KqXzGwY2JtCfL4D/Dashboard?node-id=10-5"
192 
193**Actions:**
194 
1951. Parse URL to extract fileKey=`pR8mNv5KqXzGwY2JtCfL4D` and nodeId=`10-5`
1962. Run `get_metadata(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5")` to understand the page structure
1973. Identify main sections from metadata (header, sidebar, content area, cards) and their child node IDs
1984. Run `get_design_context(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId=":childNodeId")` for each major section
1995. Run `get_screenshot(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5")` for the full page
2006. Download all assets (logos, icons, charts)
2017. Build layout using project's layout primitives
2028. Implement each section using existing components where possible
2039. Validate responsive behavior against Figma constraints
204 
205**Result:** Complete dashboard matching Figma design with responsive layout.
206 
207## Best Practices
208 
209### Always Start with Context
210 
211Never implement based on assumptions. Always fetch `get_design_context` and `get_screenshot` first.
212 
213### Incremental Validation
214 
215Validate frequently during implementation, not just at the end. This catches issues early.
216 
217### Document Deviations
218 
219If you must deviate from the Figma design (e.g., for accessibility or technical constraints), document why in code comments.
220 
221### Reuse Over Recreation
222 
223Always check for existing components before creating new ones. Consistency across the codebase is more important than exact Figma replication.
224 
225### Design System First
226 
227When in doubt, prefer the project's design system patterns over literal Figma translation.
228 
229## Common Issues and Solutions
230 
231### Issue: Figma output is truncated
232 
233**Cause:** The design is too complex or has too many nested layers to return in a single response.
234**Solution:** Use `get_metadata` to get the node structure, then fetch specific nodes individually with `get_design_context`.
235 
236### Issue: Design doesn't match after implementation
237 
238**Cause:** Visual discrepancies between the implemented code and the original Figma design.
239**Solution:** Compare side-by-side with the screenshot from Step 3. Check spacing, colors, and typography values in the design context data.
240 
241### Issue: Assets not loading
242 
243**Cause:** The Figma MCP server's assets endpoint is not accessible or the URLs are being modified.
244**Solution:** Verify the Figma MCP server's assets endpoint is accessible. The server serves assets at `localhost` URLs. Use these directly without modification.
245 
246### Issue: Design token values differ from Figma
247 
248**Cause:** The project's design system tokens have different values than those specified in the Figma design.
249**Solution:** When project tokens differ from Figma values, prefer project tokens for consistency but adjust spacing/sizing to maintain visual fidelity.
250 
251## Understanding Design Implementation
252 
253The Figma implementation workflow establishes a reliable process for translating designs to code:
254 
255**For designers:** Confidence that implementations will match their designs with pixel-perfect accuracy.
256**For developers:** A structured approach that eliminates guesswork and reduces back-and-forth revisions.
257**For teams:** Consistent, high-quality implementations that maintain design system integrity.
258 
259By following this workflow, you ensure that every Figma design is implemented with the same level of care and attention to detail.
260 
261## Additional Resources
262 
263- [Figma MCP Server Documentation](https://developers.figma.com/docs/figma-mcp-server/)
264- [Figma MCP Server Tools and Prompts](https://developers.figma.com/docs/figma-mcp-server/tools-and-prompts/)
265- [Figma Variables and Design Tokens](https://help.figma.com/hc/en-us/articles/15339657135383-Guide-to-variables-in-Figma)
266 

Discussion

Alternatives

ImpeccableUse when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.Design & UI · Apache-2.0Apple designApple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.Design & UI · MITBuilding AnimationsBuild an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations.Design & UI · MITBreakRenders a component you choose in every state and scenario on a temporary page and stress tests it.Design & UI · MIT