--- name: figma-mcp description: Convert Figma designs into production-ready code using MCP server tools. Use this skill when users provide Figma URLs, request design-to-code conversion, ask to implement Figma mockups, or need to extract design tokens and system values from Figma files. Works with frames, components, and entire design files to generate HTML, CSS, React, or other frontend code. --- # Figma MCP ## Overview This skill enables accurate design-to-code conversion by leveraging Figma's MCP (Model Context Protocol) server to access structured design data directly from Figma files. Unlike screenshot-based approaches, the Figma MCP provides semantic information about every design element including exact spacing, colors, typography, component hierarchy, and design system tokens, resulting in significantly more accurate code generation. ## When to Use This Skill Trigger this skill when users: - Provide Figma URLs (file links or frame selection links) - Request converting/implementing Figma designs into code - Ask to "build this from Figma" or "implement this design" - Need to extract design tokens, variables, or design system values - Want to update existing code to match a Figma design - Mention maintaining design-to-code consistency ## Workflow ### Step 1: Receive Figma Design Reference When a user provides a Figma URL or requests design implementation: 1. **Identify the Figma link type**: - File URL: `https://www.figma.com/file/[FILE_KEY]/...` - Frame selection: `https://www.figma.com/file/[FILE_KEY]/...?node-id=[NODE_ID]` - Design URL: `https://www.figma.com/design/[FILE_KEY]/...` 2. **Confirm access**: - Verify the Figma MCP server is configured and accessible - If not configured, reference `references/setup-guide.md` for setup instructions ### Step 2: Fetch Design Data Using MCP Tools Use the available Figma MCP tools to retrieve structured design data: **Key MCP Tools Available:** - **get_figma_data** - Fetch complete design data for a file or specific frame - **get_figma_variables** - Extract design tokens (colors, spacing, typography) - **get_figma_components** - Retrieve component definitions and instances - **get_figma_styles** - Access text, color, and effect styles **Best Practice:** Start with `get_figma_data` for the specific frame or node the user referenced. This provides the complete structure, layout data, and styling information. **Example workflow:** ``` User: "Implement this Figma design: [Figma URL with node-id]" 1. Extract file_key and node_id from URL 2. Call get_figma_data with file_key and node_id parameters 3. Receive structured JSON with: - Element hierarchy (frames, groups, components) - Layout properties (position, size, constraints, auto-layout) - Styling (fills, strokes, effects, typography) - Component instances and variants - Design tokens and variables ``` ### Step 3: Analyze Design Structure Before generating code, analyze the fetched design data: 1. **Identify component hierarchy**: - What are the main containers/sections? - Which elements are reusable components? - How does the layout flow (flex, grid, absolute)? 2. **Extract design system values**: - Colors (fills, strokes, backgrounds) - Typography (font families, sizes, weights, line heights) - Spacing (padding, margins, gaps) - Borders, shadows, effects 3. **Determine layout approach**: - Auto-layout frames → Flexbox or CSS Grid - Absolute positioning → CSS absolute/relative positioning - Constraints → Responsive behavior ### Step 4: Generate Code Generate production-ready code based on the design data: **Code generation principles:** 1. **Use semantic HTML**: - Frames → `
`, `
`, `
`, etc. - Text → `

-

`, `

`, `` - Buttons → `