figma-code-connect-components
Skill0 starsChanged 8 months agoMITView on GitHub
Connects Figma design components to code components using Code Connect mapping tools. 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. For canvas writes via `use_figma`, use `figma-use`. Requires Figma MCP server connection.
- Reads credentials
6 other projects use a version of this, 4 of them edited.
Adopted by
Most recently taken up by
- belentani7/manus-ai-skill-packedited, first seen Sep 12, 2026
- ulises-jeremias/agent-toolkitedited, first seen Aug 31, 2026
- tutti-os/skillsedited, first seen Jul 9, 2026
- jhy0285/monofieldtheir own version, first seen May 29, 2026
- HiAi-gg/hiai-opencodetheir own version, first seen May 22, 2026
- openai/skillsedited, first seen Mar 4, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 4
- openai/skills★ 28k55% same
- ulises-jeremias/agent-toolkit★ 1854% same
- belentani7/manus-ai-skill-pack★ 055% same
- tutti-os/skills★ 055% same
Wrote their own version · 2
- HiAi-gg/hiai-opencode★ 18same name
- jhy0285/monofield★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- skills/react-best-practices/AGENTS.mdAGENTS.md
- accessibilitySkill
- adr-writerSkill
- automatic-code-reviewSkill
- component-visualizerSkill
- create-tasksSkill
- dsai-componentsSkill
- dsai-figmaSkill
- dsai-stylingSkill
- dsai-toolsSkill
- figma-create-design-system-rulesSkill
- figma-create-new-fileSkill
- figma-generate-designSkill
- figma-generate-librarySkill
- figma-implement-designSkill
- figma-useSkill
- miro-mcpSkill
- nodejsSkill
- playwright-skillSkill
- prismaSkill
- react-best-practicesSkill
- reactSkill
- route-testerSkill
- setupSkill
- skill-creatorSkill
- skill-developerSkill
- sync-schemasSkill
- task-checkSkill
- web-design-guidelinesSkill
- writing-testsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. 18 are common, 4 are distinctive, and 7 are very specific to this project.
18
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Use this skill for get_code_connect_suggestions + send_code_connect_mappings workflows.
- Common: line 23
If the task requires writing to the Figma canvas with Plugin API scripts, switch to figma-use.
- Common: line 24
If the task is building or updating a full-page screen in Figma from code or a description, switch to figma-generate-design.
- Common: line 25
If the task is implementing product code from Figma, switch to figma-implement-design.
- Very specific: line 30
Before proceeding, verify the Figma MCP server is connected by checking if Figma MCP tools (e.g., get_code_connect_suggestions) are …
- Distinctive: line 31
If the tools are not available, the Figma MCP server may not be enabled.
- Very specific: line 34
OR when using figma-desktop MCP: User can select a node directly in the Figma desktop app (no URL required)
- Very specific: line 45
Call get_code_connect_suggestions to identify all unmapped components in a single operation.
- Common: line 54
IMPORTANT: When extracting the node ID from a Figma URL, convert the format:
- Common: line 71
If the tool returns "No published components found in this selection" → inform the user and stop.
- Common: line 72
If the tool returns "All component instances in this selection are already connected to code via Code Connect" → inform the user that …
- Common: line 92
Search for component files with matching names
- Common: line 93
Read candidate files to check structure and props
- Common: line 98
Default values that match Figma defaults
- Common: line 101
If multiple candidates are equally good, pick the one with the closest prop-interface match and document your reasoning in a 1-2 sentence …
- Very specific: line 105
If Figma component is "PrimaryButton", search for Button.tsx, PrimaryButton.tsx, Button.jsx
- Very specific: line 106
Check DSAI component paths: src/client/components/ui/ (DSAI components installed via dsai add — these ARE the implementation files)
- Very specific: line 108
Look for variant props like variant, size, color that match Figma variants
- Common: line 129
Ask the user to confirm which component to use or provide the correct path
- Common: line 167
Provide a summary: after processing:
- Common: line 187
Don't just ask the user for the file path - actively search their codebase to find matching components.
- Common: line 191
When comparing Figma components to code components, look beyond just names.
- Common: line 199
When offering to create a mapping, clearly explain:
- Common: line 208
If multiple components could match, present options rather than guessing.
- Common: line 212
If you can't find an exact match, provide helpful next steps:
- Common: line 216
Ask for user guidance
- Distinctive: line 234
When invoking this skill with arguments:
- Distinctive: line 243
If invoked without arguments, the skill will prompt for the full Figma URL and extract the file key and node ID automatically.
- Distinctive: line 264
Use the session ID to maintain an audit trail of when components were connected and why.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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_mappingsworkflows. - If the task requires writing to the Figma canvas with Plugin API scripts, switch to figma-use.
- If the task is building or updating a full-page screen in Figma from code or a description, switch to figma-generate-design.
- If the task is implementing product code from Figma, switch to figma-implement-design.
Prerequisites
- Figma MCP server must be connected and accessible
- Before proceeding, verify the Figma MCP server is connected by checking if Figma MCP tools (e.g.,
get_code_connect_suggestions) are available. - If the tools are not available, the Figma MCP server may not be enabled. Guide the user to enable the Figma MCP server that is included with the plugin. They may need to restart their MCP client afterward.
- Before proceeding, verify the Figma MCP server is connected by checking if Figma MCP tools (e.g.,
- 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-idparameter. Code Connect mapping will fail without it.
- IMPORTANT: The Figma URL must include the
- OR when using
figma-desktopMCP: 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
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-2from URL, then convert to1:2for 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 with:
- Component name
- Node ID
- Component properties (JSON with prop names and values)
- A thumbnail image of the component (for visual inspection)
Step 2: Scan Codebase for Matching Components
For each unmapped component returned by get_code_connect_suggestions, search the codebase for a matching code component.
What to look for:
- Component names that match or are similar to the Figma component name
- Component structure that aligns with the Figma hierarchy
- Props that correspond to Figma properties (variants, text, styles)
- Files in typical component directories (
src/components/,components/,ui/, etc.)
Search strategy:
- Search for component files with matching names
- Read candidate files to check structure and props
- Compare the code component's props with the Figma component properties returned in Step 1
- Detect the programming language (TypeScript, JavaScript) and framework (React, Vue, etc.)
- Identify the best match based on structural similarity, weighing:
- Prop names and their correspondence to Figma properties
- Default values that match Figma defaults
- CSS classes or style objects
- Descriptive comments that clarify intent
- If multiple candidates are equally good, pick the one with the closest prop-interface match and document your reasoning in a 1-2 sentence comment before your tool call
Example search patterns:
- If Figma component is "PrimaryButton", search for
Button.tsx,PrimaryButton.tsx,Button.jsx - Check DSAI component paths:
src/client/components/ui/(DSAI components installed viadsai add— these ARE the implementation files) - Also check
src/client/components/for app-specific wrapper components - Look for variant props like
variant,size,colorthat match Figma variants - DSAI components use
forwardRef+displayNameand have props in separate.types.tsfiles
Step 3: Present Matches to User
Present your findings and let the user choose which mappings to create. The user can accept all, some, or none of the suggested mappings.
Present matches in this format:
The following components match the design:
- [ComponentName](path/to/component): DesignComponentName at nodeId [nodeId](figmaUrl?node-id=X-Y)
- [AnotherComponent](path/to/another): AnotherDesign at nodeId [nodeId2](figmaUrl?node-id=X-Y)
Would you like to connect these components? You can accept all, select specific ones, or skip.If no exact match is found for a component:
- Show the 2 closest candidates
- Explain the differences
- Ask the user to confirm which component to use or provide the correct path
If the user declines all mappings, inform them and stop. No further tool calls are needed.
Step 4: Create Code Connect Mappings
Once the user confirms their selections, call send_code_connect_mappings with only the accepted mappings. This tool handles batch creation of all mappings in a single call.
Example:
send_code_connect_mappings(
fileKey=":fileKey",
nodeId="1:2",
mappings=[
{ nodeId: "1:2", componentName: "Button", source: "src/components/Button.tsx", label: "React" },
{ nodeId: "1:5", componentName: "Card", source: "src/components/Card.tsx", label: "React" }
]
)Key parameters for each mapping:
nodeId: The Figma node ID (with colon format:1:2)componentName: Name of the component to connect (e.g., "Button", "Card")source: Path to the code component file (relative to project root)label: The framework or language label for this Code Connect mapping. For this project, always use"React". Valid values include:- Web: 'React', 'Web Components', 'Vue', 'Svelte', 'Storybook', 'Javascript'
- iOS: 'Swift UIKit', 'Objective-C UIKit', 'SwiftUI'
- Android: 'Compose', 'Java', 'Kotlin', 'Android XML Layout'
- Cross-platform: 'Flutter'
- Docs: 'Markdown'
After the call:
- On success: the tool confirms the mappings were created
- On error: the tool reports which specific mappings failed and why (e.g., "Component is already mapped to code", "Published component not found", "Insufficient permissions")
Provide a summary after processing:
Code Connect Summary:
- Successfully connected: 3
- Button (1:2) → src/components/Button.tsx
- Card (1:5) → src/components/Card.tsx
- Input (1:8) → src/components/Input.tsx
- Could not connect: 1
- CustomWidget (1:10) - No matching component found in codebaseExamples
See code-connect-scenarios.md for detailed scenarios including connecting a single button, handling multiple components with partial selection, and creating components that don't yet exist.
Best Practices
Proactive Component Discovery
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.
Accurate Structure Matching
When comparing Figma components to code components, look beyond just names. Check that:
- Props align (variant types, size options, etc.)
- Component hierarchy matches (nested elements)
- The component serves the same purpose
Clear Communication
When offering to create a mapping, clearly explain:
- What you found
- Why it's a good match
- What the mapping will do
- How props will be connected
Handle Ambiguity
If multiple components could match, present options rather than guessing. Let the user make the final decision about which component to connect.
Graceful Degradation
If you can't find an exact match, provide helpful next steps:
- Show close candidates
- Suggest component creation
- Ask for user guidance
Common Issues and Solutions
See troubleshooting.md for solutions to common Code Connect problems including unpublished components, plan restrictions, missing components, permission issues, and URL format errors.
Understanding Code Connect
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.
Arguments
When invoking this skill with arguments:
$0or$ARGUMENTS[0]- Figma file key (extracted from URL:https://figma.com/design/:fileKey/:fileName)- The skill uses this to identify which Figma file contains the component
- Example:
/code-connect-components abc123
$1or$ARGUMENTS[1]- Node ID of the specific Figma component to connect- Format:
1-2(from?node-id=1-2in Figma URL) - Example:
/code-connect-components abc123 10-25
- Format:
If invoked without arguments, the skill will prompt for the full Figma URL and extract the file key and node ID automatically.
Session Tracking
This skill uses ${CLAUDE_SESSION_ID} to track Code Connect mapping sessions:
// Each mapping is logged with session context
const sessionId = process.env.CLAUDE_SESSION_ID;
console.log(
`[${sessionId}] Creating Code Connect mapping: ${fileKey}#${nodeId} → ${componentPath}`,
);This allows correlation between:
- Code Connect file creation (
.figma.tsx) - The specific Figma component being mapped
- Git commits containing the mapping
- Future updates when the component or mapping changes
Use the session ID to maintain an audit trail of when components were connected and why.
Additional Resources
For more information about Code Connect:
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

