Figma Design To Code Rules
Purpose
Help agents translate Figma into production code or compact repo rules without drifting into a generic Figma manual. This is a guardrail, not a canvas-editing skill or frontend course.
Use When
- The user provides a Figma URL, node selection, screenshot, or export context and wants code in the repo.
- The user asks to implement, review, or refactor a Figma-driven UI surface.
- The user asks to create or update
AGENTS.md, CLAUDE.md, or Cursor rules for Figma-to-code work.
- The task depends on design tokens, component mapping, screenshots, or visual comparison evidence.
Do Not Use When
- The user wants to edit nodes inside Figma itself; use
figma-use instead.
- The request is generic frontend design with no Figma source and no repo conventions to preserve.
- The task is pure screenshot QA with no implementation or rule-synthesis decision.
- Another more specific skill already owns the same surface.
Quick Start
- Classify the request first: implementation guidance or rules extraction.
- If it is implementation guidance and Figma MCP is available, fetch design context and a screenshot before giving code advice.
- If the design context is too large, use metadata to narrow the node set and fetch only the needed children.
- Reuse existing repo components, tokens, and styling conventions before inventing new ones.
- Keep asset handling local and use supplied Figma assets instead of new icon packages or stand-ins.
- If it is rules extraction, inspect the codebase conventions first and write the smallest ruleset that preserves them.
- End with the next verifier and the evidence captured.
Operating Constraints
- Treat Figma output as evidence, not final code style.
- Require both design context and screenshot evidence before implementation guidance when Figma MCP is available.
- If Figma MCP is unavailable, proceed from the available screenshot or export and state the missing design data explicitly.
- Do not guess at token mapping, spacing, or component reuse when the source data is incomplete.
- Preserve unrelated instructions when writing
AGENTS.md, CLAUDE.md, or Cursor rules; append or modularize instead of overwriting.
- Keep the fallback path explicit when MCP data is unavailable or truncated.
- Stay compact enough to behave like a guardrail, not a vendor tutorial.
Inputs This Skill Expects
- Figma URL, node selection, screenshot, or export context.
- Repository path or rule target when the task is rules extraction.
- Existing component, token, and styling conventions when translating to code or rules.
- Asset payloads returned by Figma when available.
Output Contract
- Implementation guidance: name the likely node or selection path, the design-context fields used, the screenshot evidence, the repo components or tokens reused, and any unavoidable deviations.
- Rules extraction: name the target rule file or family, the codebase conventions observed, and the smallest rule set that captures them.
- For both modes, include one concrete verification step and one rejected generic trope.
- Handoff: next verifier is the checker or implementer; evidence captured is a screenshot comparison, token mapping, or rule-file diff.
Procedure
- Classify the request as implementation guidance or rules extraction.
- For implementation guidance:
- get design context first
- if it is too large, use metadata to narrow the node set
- get a screenshot for the same target before coding guidance
- translate the result into project conventions instead of copying Tailwind or literal Figma output
- validate against the screenshot before marking complete
- For rules extraction:
- inspect the codebase conventions first
- identify the smallest rule file or rule family that should change
- encode the repo's real component, token, spacing, import, and testing conventions
- preserve unrelated instructions and avoid generic design-system prose
- Use Figma assets directly when provided; do not create stand-in icons or duplicate packages.
- Redirect any canvas-edit request to
figma-use instead of trying to edit Figma here.
- Stop when the current request has enough evidence to act; do not widen into a general design handbook.
Pitfalls And Gotchas
- Rejected trope: a generic Figma manual or broad frontend design course.
- Better alternative: one compact two-mode guardrail that separates implementation evidence from rule synthesis.
- Rejected trope: copying literal Figma output into code without repo conventions.
- Better alternative: map the design into the project's existing components and tokens first.
- Rejected trope: overwriting unrelated agent instructions while adding repo rules.
- Better alternative: append or modularize the new guidance.
- Rejected trope: pretending MCP data exists when the design context or screenshot is missing.
- Better alternative: say the task is blocked on missing design evidence or proceed with the explicit fallback.
Progressive Disclosure
Start with the smallest useful read of the request, then widen only enough to decide mode and evidence. Keep implementation guidance and rules extraction distinct, but do not split them into separate skills unless they genuinely need different owners. If the fallback path is all that is available, make that fact explicit instead of filling gaps with invented detail.
Verification Pattern
- Confirm the answer starts by classifying the request.
- Confirm implementation guidance cites both design context and screenshot evidence when MCP is available.
- Confirm rules extraction starts from existing repo conventions and produces the smallest useful rule delta.
- Confirm unrelated instructions are preserved instead of replaced.
- Confirm the answer ends with one concrete verifier artifact and one next step.
1---2name: figma-design-to-code-rules3description: Guardrail for translating Figma into code and compact repo rules with design-context-first evidence, screenshot validation, and repo-convention reuse.4---56# Figma Design To Code Rules78## Purpose9Help agents translate Figma into production code or compact repo rules without drifting into a generic Figma manual. This is a guardrail, not a canvas-editing skill or frontend course.1011### Use When12- The user provides a Figma URL, node selection, screenshot, or export context and wants code in the repo.13- The user asks to implement, review, or refactor a Figma-driven UI surface.14- The user asks to create or update `AGENTS.md`, `CLAUDE.md`, or Cursor rules for Figma-to-code work.15- The task depends on design tokens, component mapping, screenshots, or visual comparison evidence.1617### Do Not Use When18- The user wants to edit nodes inside Figma itself; use `figma-use` instead.19- The request is generic frontend design with no Figma source and no repo conventions to preserve.20- The task is pure screenshot QA with no implementation or rule-synthesis decision.21- Another more specific skill already owns the same surface.2223## Quick Start241. Classify the request first: implementation guidance or rules extraction.252. If it is implementation guidance and Figma MCP is available, fetch design context and a screenshot before giving code advice.263. If the design context is too large, use metadata to narrow the node set and fetch only the needed children.274. Reuse existing repo components, tokens, and styling conventions before inventing new ones.285. Keep asset handling local and use supplied Figma assets instead of new icon packages or stand-ins.296. If it is rules extraction, inspect the codebase conventions first and write the smallest ruleset that preserves them.307. End with the next verifier and the evidence captured.3132## Operating Constraints33- Treat Figma output as evidence, not final code style.34- Require both design context and screenshot evidence before implementation guidance when Figma MCP is available.35- If Figma MCP is unavailable, proceed from the available screenshot or export and state the missing design data explicitly.36- Do not guess at token mapping, spacing, or component reuse when the source data is incomplete.37- Preserve unrelated instructions when writing `AGENTS.md`, `CLAUDE.md`, or Cursor rules; append or modularize instead of overwriting.38- Keep the fallback path explicit when MCP data is unavailable or truncated.39- Stay compact enough to behave like a guardrail, not a vendor tutorial.4041## Inputs This Skill Expects42- Figma URL, node selection, screenshot, or export context.43- Repository path or rule target when the task is rules extraction.44- Existing component, token, and styling conventions when translating to code or rules.45- Asset payloads returned by Figma when available.4647## Output Contract48- Implementation guidance: name the likely node or selection path, the design-context fields used, the screenshot evidence, the repo components or tokens reused, and any unavoidable deviations.49- Rules extraction: name the target rule file or family, the codebase conventions observed, and the smallest rule set that captures them.50- For both modes, include one concrete verification step and one rejected generic trope.51- Handoff: next verifier is the checker or implementer; evidence captured is a screenshot comparison, token mapping, or rule-file diff.5253## Procedure541. Classify the request as implementation guidance or rules extraction.552. For implementation guidance:56 - get design context first57 - if it is too large, use metadata to narrow the node set58 - get a screenshot for the same target before coding guidance59 - translate the result into project conventions instead of copying Tailwind or literal Figma output60 - validate against the screenshot before marking complete613. For rules extraction:62 - inspect the codebase conventions first63 - identify the smallest rule file or rule family that should change64 - encode the repo's real component, token, spacing, import, and testing conventions65 - preserve unrelated instructions and avoid generic design-system prose664. Use Figma assets directly when provided; do not create stand-in icons or duplicate packages.675. Redirect any canvas-edit request to `figma-use` instead of trying to edit Figma here.686. Stop when the current request has enough evidence to act; do not widen into a general design handbook.6970## Pitfalls And Gotchas71- Rejected trope: a generic Figma manual or broad frontend design course.72- Better alternative: one compact two-mode guardrail that separates implementation evidence from rule synthesis.73- Rejected trope: copying literal Figma output into code without repo conventions.74- Better alternative: map the design into the project's existing components and tokens first.75- Rejected trope: overwriting unrelated agent instructions while adding repo rules.76- Better alternative: append or modularize the new guidance.77- Rejected trope: pretending MCP data exists when the design context or screenshot is missing.78- Better alternative: say the task is blocked on missing design evidence or proceed with the explicit fallback.7980## Progressive Disclosure81Start with the smallest useful read of the request, then widen only enough to decide mode and evidence. Keep implementation guidance and rules extraction distinct, but do not split them into separate skills unless they genuinely need different owners. If the fallback path is all that is available, make that fact explicit instead of filling gaps with invented detail.8283## Verification Pattern84- Confirm the answer starts by classifying the request.85- Confirm implementation guidance cites both design context and screenshot evidence when MCP is available.86- Confirm rules extraction starts from existing repo conventions and produces the smallest useful rule delta.87- Confirm unrelated instructions are preserved instead of replaced.88- Confirm the answer ends with one concrete verifier artifact and one next step.