figma-handoff
Skill1 starsChanged 47 days agoMITView on GitHub
Design-to-code handoff workflow using Figma MCP — extract design context, map to project components, and generate production code. Use when asked to 'implement this Figma design', 'convert design to code', 'build from Figma', or given a figma.com URL to implement. Do NOT use for creating Figma designs, managing Figma files, or non-implementation design feedback.
In this repository16 other files it gives its agents.
- agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- examples/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- skills/figma-handoff/AGENTS.mdAGENTS.md
- skills/github-pr-review/AGENTS.mdAGENTS.md
- skills/gmail-workflow/AGENTS.mdAGENTS.md
- skills/skill-compliance-checklist/AGENTS.mdAGENTS.md
- skills/skill-compliance-checklist/references/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- github-pr-reviewSkill
- gmail-workflowSkill
- skill-compliance-checklistSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Follow these steps in order for every Figma-to-code handoff.
- Very specific: line 38
Use get_screenshot to capture a visual reference of the target frame or component.
- Very specific: line 39
Use get_design_context to extract:
- Very specific: line 45
Use get_variable_defs to extract design token definitions (colours, spacing, typography scales).
- Very specific: line 46
Use get_code_connect_map to check for existing component-to-code mappings.
- Distinctive: line 72
Use mapped project tokens rather than raw Figma values.
- Distinctive: line 74
Add appropriate accessibility attributes (ARIA labels, semantic HTML, keyboard navigation).
- Distinctive: line 86
If a Preview MCP is available, use it for live visual comparison.
- Distinctive: line 111
Ask for the Figma URL or node reference.
- Very specific: line 113
Check existing components — reuse Button and Container if available.
- Distinctive: line 127
Adapt to the project stack: Never default to React + Tailwind.
- Distinctive: line 128
Reuse existing components: Check the project's component library before creating new components.
- Distinctive: line 129
Verify visually: Always compare generated output against the Figma screenshot.
- Distinctive: line 130
Respect design tokens: Use the project's token system rather than hardcoding raw values from Figma.
- Distinctive: line 132
Register Code Connect mappings: after successful handoffs to improve future workflows.
- Distinctive: line 133
Include accessibility: Every generated component should have appropriate semantic HTML, ARIA attributes, and keyboard interaction support.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Figma Handoff Skill
Companion skill for the Figma MCP server. Provides a structured design-to-code handoff workflow that extracts design context, maps it to existing project conventions, and generates production-ready code adapted to the project stack.
Available MCP Tools
This skill coordinates the following Figma MCP tools:
get_design_context— Extract design tokens, layout, and component information from a Figma nodeget_screenshot— Capture a visual screenshot of a Figma frame or componentget_metadata— Retrieve file and node metadataget_code_connect_map— Get existing Code Connect mappings between Figma components and codeget_code_connect_suggestions— Get suggested Code Connect mappingsadd_code_connect_map— Register a new Code Connect mappingsend_code_connect_mappings— Send finalised mappingsget_variable_defs— Extract design token variable definitionsget_figjam— Extract content from FigJam boards
Instructions
Multi-MCP Coordination Pattern
Follow these steps in order for every Figma-to-code handoff.
Step 1: Extract Design Context via Figma MCP
- Parse the Figma URL to extract the file key and node ID.
- Use
get_screenshotto capture a visual reference of the target frame or component. - Use
get_design_contextto extract:- Layout structure (auto-layout direction, spacing, padding, alignment)
- Typography (font family, size, weight, line height, letter spacing)
- Colours (fills, strokes, effects — with hex/RGBA values)
- Dimensions (width, height, constraints, responsiveness hints)
- Component variants and states
- Use
get_variable_defsto extract design token definitions (colours, spacing, typography scales). - Use
get_code_connect_mapto check for existing component-to-code mappings.
Step 2: Analyse Project Stack and Existing Components
- Identify the project's frontend framework (React, Vue, Svelte, Next.js, etc.).
- Locate the project's component library and design token files.
- Catalogue existing components that may be reusable for the design.
- Identify the styling approach (CSS Modules, Tailwind, styled-components, SCSS, etc.).
- Note naming conventions, file structure patterns, and export styles.
Step 3: Map Design Tokens to Project Tokens
- Compare Figma design tokens against the project's existing token system.
- Map Figma colour variables to project colour tokens (e.g., Figma
primary-500to project--colour-primary). - Map Figma spacing values to project spacing scale (e.g., Figma
16pxto projectspace-4). - Map Figma typography styles to project typography tokens.
- Flag any design tokens that do not have a project equivalent — these may need to be added.
Step 4: Generate Code Adapted to Project Conventions
- Reuse existing components wherever possible. Do not recreate components that already exist in the project.
- Generate code using the project's established patterns:
- Correct framework syntax (JSX, SFC, Svelte markup, etc.)
- Project's styling approach (not defaulting to Tailwind unless the project uses it)
- Project's state management patterns
- Project's file and folder conventions
- Use mapped project tokens rather than raw Figma values.
- Include responsive behaviour based on Figma's auto-layout and constraint settings.
- Add appropriate accessibility attributes (ARIA labels, semantic HTML, keyboard navigation).
- Include component props/types matching the project's type system.
Step 5: Visual Verification
- Compare the generated code output against the Figma screenshot from Step 1.
- Check for:
- Layout accuracy (spacing, alignment, stacking)
- Colour fidelity (correct tokens mapped)
- Typography accuracy (correct font, size, weight)
- Responsive behaviour (breakpoint handling)
- Note any discrepancies between the design and implementation.
- If a Preview MCP is available, use it for live visual comparison.
Error Handling
| Error | Response |
| Invalid Figma URL | Verify the URL format. A valid Figma design URL follows the pattern figma.com/design/<file_key>/<file_name>?node-id=<node_id>. Ask the user to confirm the URL and ensure it points to a specific frame or component. |
| MCP disconnected | Inform the user that the Figma MCP server is not connected. Suggest reconnecting via the MCP configuration or restarting Claude Code. Check that the Figma authentication token is valid. |
| No Code Connect mappings | Proceed without mappings. Use get_code_connect_suggestions to identify potential mappings. After generating code, offer to register new mappings via add_code_connect_map for future handoffs. |
| Insufficient design context | If get_design_context returns incomplete data, fall back to get_screenshot for visual reference and manually interpret the design. Inform the user about any assumptions made. |
| Project stack not identified | Ask the user to specify the framework, styling approach, and component library. Check for package.json, framework config files, or existing component files. |
Examples
"Build this page from figma.com/design/abc123/MyApp?node-id=42:100"
- Extract file key
abc123and node ID42:100from the URL. - Capture screenshot and extract design context.
- Analyse the project — identify it as a Next.js project using CSS Modules.
- Map Figma tokens to the project's
styles/tokens.cssvariables. - Generate page component reusing existing
Button,Card, andHeadercomponents. - Present code with a side-by-side comparison note against the Figma screenshot.
"Implement the hero section from Figma"
- Ask for the Figma URL or node reference.
- Extract the hero section's design context (background, typography, CTA button, image).
- Check existing components — reuse
ButtonandContainerif available. - Generate a
HeroSectioncomponent following project conventions. - Include responsive styles based on Figma's auto-layout settings.
"Convert this Figma component to match our design system"
- Extract the Figma component's design context and variants.
- Analyse the project's existing design system components.
- Map the Figma component to the closest existing component or create a new one.
- Generate code with all variants, states, and prop types.
- Register the Code Connect mapping via
add_code_connect_map.
Important
- Adapt to the project stack. Never default to React + Tailwind. Always detect and match the project's actual framework and styling approach.
- Reuse existing components. Check the project's component library before creating new components. Duplication degrades maintainability.
- Verify visually. Always compare generated output against the Figma screenshot. Note any deviations.
- Respect design tokens. Use the project's token system rather than hardcoding raw values from Figma.
- Coordinate with other skills. This skill works alongside frontend-design skills for complex implementations. Use the project's existing patterns as the source of truth.
- Register Code Connect mappings after successful handoffs to improve future workflows.
- Include accessibility. Every generated component should have appropriate semantic HTML, ARIA attributes, and keyboard interaction support.
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.

