figma-code-connect-components
Connects Figma design components to code components using Code Connect mapping tools. Use when user says "code connect", "connect this component to code", "map this component", "link component to code", "create code connect mapping", or wants to establish mappings between Figma designs and code implementations. For canvas writes via `use_figma`, use `figma-use`.
Why we recommend it: Connects Figma design components to code components using Code Connect mapping, analyzing design structure and establishing design-code consistency mappings.
Needs (stated): Node.js
Inspect before use
Read the source instructions and check the requirements before you install this skill.
SKILL.md
The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.
--- name: figma-code-connect-components description: Connects Figma design components to code components using Code Connect mapping tools. Use when user says "code connect", "connect this component to code", "map this component", "link component to code", "create code connect mapping", or wants to establish mappings between Figma designs and code implementations. For canvas writes via `use_figma`, use `figma-use`. --- # Code Connect Components ## Overview 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. ## Skill Boundaries - Use this skill for `get_code_connect_suggestions` + `send_code_connect_mappings` workflows. - If the task requires writing to the Figma canvas with Plugin API scripts, switch to [figma-use](../figma-use/SKILL.md). - If the task is building or updating a full-page screen in Figma from code or a description, switch to [figma-generate-design](../figma-generate-design/SKILL.md). - If the task is implementing product code from Figma, switch to [figma-implement-design](../figma-implement-design/SKILL.md). ## Prerequisites - Figma MCP server must be connected and accessible - User must provide a Figma URL with node ID: `https://figma.com/design/:fileKey/:fileName?node-id=1-2` - **IMPORTANT:** The Figma URL must include the `node-id` parameter. Code Connect mapping will fail without it. - **OR** when using `figma-desktop` MCP: User can select a node directly in the Figma desktop app (no URL required) - **IMPORTANT:** The Figma component must be published to a team library. Code Connect only works with published components or component sets. - **IMPORTANT:** Code Connect is only available on Organization and Enterprise plans. - Access to the project codebase for component scanning ## Required Workflow **Follow these steps in order. Do not skip steps.** ### Step 1: Get Code Connect Suggestions Call `get_code_connect_suggestions` to identify all unmapped components in a single operation. This tool automatically: - Fetches component info from the Figma scenegraph - Identifies published components in the selection - Checks existing Code Connect mappings and filters out already-connected components - Returns component names, properties, and thumbnail images for each unmapped component #### Option A: Using `figma-desktop` MCP (no URL provided) If the `figma-desktop` MCP server is connected and the user has NOT provided a Figma URL, immediately call `get_code_connect_suggestions`. No URL parsing is needed — the desktop MCP server automatically uses the currently selected node from the open Figma file. **Note:** The user must have the Figma desktop app open with a node selected. `fileKey` is not passed as a parameter — the server uses the currently open file. #### Option B: When a Figma URL is provided Parse the URL to extract `fileKey` and `nodeId`, then call `get_code_connect_suggestions`. **IMPORTANT:** When extracting the node ID from a Figma URL, convert the format: - URL format uses hyphens: `node-id=1-2` - Tool expects colons: `nodeId=1:2` **Parse the Figma URL:** - URL format: `https://figma.com/design/:fileKey/:fileName?node-id=1-2` - Extract file key: `:fileKey` (segment after `/design/`) - Extract node ID: `1-2` from URL, then convert to `1:2` for the tool ``` get_code_connect_suggestions(fileKey=":fileKey", nodeId="1:2") ``` **Handle the response:** - If the tool returns **"No published components found in this selection"** → inform the user and stop. The components may need to be published to a team library first. - If the tool returns **"All component instances in this selection are already connected to code via Code Connect"** → inform the user that everything is already mapped. - Otherwise, the response contains a list of unmapped components, each wiRead the full source on GitHub (opens external page)