Connects Figma design components to code components using Code Connect. Use when user says "code connect", "connect this component to code", "connect Figma to code", "map this component", "link component to code", "create code connect mapping", "add code connect", "connect design to code", or wants to establish mappings between Figma designs and code implementations. Requires Figma MCP server connection.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill helps you connect Figma design components to their corresponding code implementations using Figma's Code Connect feature. It analyzes the Figma design structure, searches your codebase for matching components, and establishes mappings that maintain design-code consistency.
https://figma.com/design/:fileKey/:fileName?node-id=1-2
node-id parameter. Code Connect mapping will fail without it.figma-desktop MCP: User can select a node directly in the Figma desktop app (no URL required)Follow these steps in order. Do not skip steps.
When the user provides a Figma URL with file key and node ID, first run get_metadata to fetch the node structure and identify all Figma components.
IMPORTANT: When extracting the node ID from a Figma URL, convert the format:
node-id=1-2nodeId=1:2Parse the Figma URL:
https://figma.com/design/:fileKey/:fileName?node-id=1-2:fileKey (segment after /design/)1-2 from URL, then convert to 1:2 for the toolNote: 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:
get_metadata(fileKey=":fileKey", nodeId="1:2")
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.
This returns:
<symbol> nodes as Figma components)Identify components: For each node or child node returned, if the type is <symbol>, that indicates it's a Figma component that can be code connected.
For each Figma component identified (nodes with type <symbol>), check if it's already code connected using get_code_connect_map.
Example:
get_code_connect_map(fileKey=":fileKey", nodeId="1:2")
If the component is already connected:
If not connected:
For components that are not yet code connected, run get_design_context to fetch detailed component structure.
Example:
get_design_context(fileKey=":fileKey", nodeId="1:2")
This returns:
Using the output from get_design_context, scan the codebase to find a component with similar structure.
What to look for:
src/components/, components/, ui/, etc.)Search strategy:
Example search patterns:
Button.tsx, PrimaryButton.tsx, Button.jsxsrc/components/, app/components/, lib/ui/variant, size, color that match Figma variantsPresent your findings to the user and offer to create the Code Connect mapping.
What to communicate:
Example message:
I found a matching component in your codebase:
- File: src/components/Button.tsx
- Component: Button
- Language: TypeScript/JavaScript
- Framework: React
Would you like me to create a Code Connect mapping for this component?
If no exact match is found:
If the user accepts, run add_code_connect_map to establish the connection.
Tool parameters:
add_code_connect_map(
nodeId="1:2",
source="src/components/Button.tsx",
componentName="Button",
clientLanguages="typescript,javascript",
clientFrameworks="react"
)
Key parameters:
nodeId: The Figma node ID (with colon format: 1:2)source: Path to the code component file (relative to project root)componentName: Name of the component to connect (e.g., "Button", "Card")clientLanguages: Comma-separated list of languages (e.g., "typescript,javascript", "javascript")clientFrameworks: Framework being used (e.g., "react", "vue", "svelte", "angular")label: The framework or language label for this Code Connect mapping. Valid values include:
After successfully connecting one component, return to Step 2 and repeat the process for all other un-connected Figma components identified in the node tree from Step 1.
Workflow for multiple components:
<symbol>Example summary:
Code Connect Summary:
- Total components found: 5
- Successfully connected: 3
- Button (1:2) → src/components/Button.tsx
- Card (1:5) → src/components/Card.tsx
- Input (1:8) → src/components/Input.tsx
- Already connected: 1
- Icon (1:3) → src/icons/Icon.tsx
- Could not connect: 1
- CustomWidget (1:10) - No matching component found in codebase
User says: "Connect this Figma button to my code: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"
Actions:
kL9xQn2VwM8pYrTb4ZcHjF, nodeId=42-15 (from URL)42-15 → 42:15get_metadata(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42:15") to get node structure<symbol> (Figma component), name is "Button"get_code_connect_map(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42:15") to check existing mappingsget_design_context(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42:15") to get detailed structurevariant (primary/secondary) and size (sm/md/lg) propertiessrc/components/Button.tsxButton.tsx and confirm it has variant and size propsadd_code_connect_map(nodeId="42:15", source="src/components/Button.tsx", componentName="Button", clientLanguages="typescript,javascript", clientFrameworks="react")Result: Figma button component is now connected to the code Button component.
User says: "Connect this card: https://figma.com/design/pR8mNv5KqXzGwY2JtCfL4D/Components?node-id=10-50"
Actions:
pR8mNv5KqXzGwY2JtCfL4D, nodeId=10-50 → convert to 10:50get_metadata(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10:50") to get node structure<symbol> (Figma component), name is "ProductCard"get_code_connect_map(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10:50") to check existing mappingsget_design_context(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10:50")src/components/Card.tsx (basic card)src/components/ProductCard.tsx (card with image and CTA)Which should I connect?"
add_code_connect_map(nodeId="10:50", source="src/components/ProductCard.tsx", componentName="ProductCard", clientLanguages="typescript,javascript", clientFrameworks="react")Result: User-selected ProductCard component is successfully connected to the Figma design.
User says: "Connect this icon: https://figma.com/design/8yJDMeWDyBz71EnMOSuUiw/Icons?node-id=5-20"
Actions:
8yJDMeWDyBz71EnMOSuUiw, nodeId=5-20 → convert to 5:20get_metadata(fileKey="8yJDMeWDyBz71EnMOSuUiw", nodeId="5:20") to get node structure<symbol> (Figma component), name is "CheckIcon"get_code_connect_map(fileKey="8yJDMeWDyBz71EnMOSuUiw", nodeId="5:20") to check existing mappingsget_design_context(fileKey="8yJDMeWDyBz71EnMOSuUiw", nodeId="5:20")src/icons/ directory with other iconsadd_code_connect_map(nodeId="5:20", source="src/icons/CheckIcon.tsx", componentName="CheckIcon", clientLanguages="typescript,javascript", clientFrameworks="react")Result: CheckIcon component is successfully connected to the Figma design.
Don't just ask the user for the file path — actively search their codebase to find matching components. This provides a better experience and catches potential mapping opportunities.
When comparing Figma components to code components, look beyond just names. Check that:
When offering to create a mapping, clearly explain:
If multiple components could match, present options rather than guessing. Let the user make the final decision about which component to connect.
If you can't find an exact match, provide helpful next steps:
Cause: The Figma component is not published to a team library. Code Connect only works with published components. Solution: The user needs to publish the component to a team library in Figma:
Cause: The codebase search did not find a component with a matching name or structure. Solution: Ask the user if the component exists under a different name or in a different location. They may need to create the component first, or it might be located in an unexpected directory.
Cause: The source file path is incorrect, the component doesn't exist at that location, or the componentName doesn't match the actual export. Solution: Verify the source path is correct and relative to the project root. Check that the component is properly exported from the file with the exact componentName specified.
Cause: The clientLanguages or clientFrameworks parameters don't match the actual component implementation.
Solution: Inspect the component file to verify the language (TypeScript, JavaScript) and framework (React, Vue, etc.). Update the parameters accordingly. For TypeScript React components, use clientLanguages="typescript,javascript" and clientFrameworks="react".
Cause: The Figma URL format is incorrect or missing the node-id parameter.
Solution: Verify the URL follows the required format: https://figma.com/design/:fileKey/:fileName?node-id=1-2. The node-id parameter is required. Also ensure you convert 1-2 to 1:2 when calling tools.
Cause: The codebase contains multiple components that could match the Figma component.
Solution: Present all candidates to the user with their file paths and let them choose which one to connect. Different components might be used in different contexts (e.g., Button.tsx vs LinkButton.tsx).
Code Connect establishes a bidirectional link between design and code:
For designers: See which code component implements a Figma component For developers: Navigate from Figma designs directly to the code that implements them For teams: Maintain a single source of truth for component mappings
The mapping you create helps keep design and code in sync by making these connections explicit and discoverable.
For more information about Code Connect: