implement-figma-component
Installation
SKILL.md
Implement Figma Component
Figma's figma-design-to-code skill owns the MCP call protocol: the first get_design_context call and its screenshot, sparse responses, asset downloads, Code Connect, and component reuse. Load it first when it is available. This skill covers what it leaves out and what decides pixel fidelity: evidence beyond the selected node, values the reference code gets wrong, and measurement.
A get_design_context response renders one node, in one theme mode, at one size. Treat it as one sample of the design, not its specification.
Without Figma MCP access, work from supplied exports, specs, or screenshots; a URL alone is not evidence. Apply the same steps to whatever the evidence contains.
1. Inventory the design
- Call
get_metadataon the selected node. Its root tag classifies it:<symbol>is a component, and a variant when its name readsProperty=Value, …;<instance>is a placed copy of a component;<frame>and<section>are layout. - Call
get_metadataon the enclosing section or page (withoutnodeIdit lists the pages). Find:- the component set: the
<frame>whose children are the variant<symbol>s. A variant's design context contains that variant alone, and its prop types list one value per property. The set's design context contains every variant. The "Component descriptions" block of a response names the set's node ID when the component has a description. - sibling frames that show the component in another theme mode, breakpoint, or state, such as frames named "Dark", "Mobile", or "Error".
- the component set: the
- Fetch the design context of the component set (or of each variant in scope) and of every sibling frame in scope.
get_variable_defsand thevar()fallbacks resolve in the queried node's mode, so query a node rendered in each mode the app supports. - Map the variant and component properties to the code API:
- Interaction states (Hover, Pressed, Focus, Disabled) become
:hover,:active,:focus-visible, and:disabledor ARIA state styles. The reference code models them as astateprop; keep states out of the public API. - Other variant properties (variant, size, tone) become props. TEXT properties become text props or children, BOOLEAN properties optional parts, INSTANCE_SWAP properties slots.
- Interaction states (Hover, Pressed, Focus, Disabled) become