figma-codegen
БесплатноБез исполняемых скриптовНе проверенGenerate framework-aware code from a Figma design. Reads the project's stack profile and emits code matching the existing framework…
от awdr74100★ 1 613 звёзд на GitHubОб этом скилле
figma-codegen
Turn a Figma selection into code that looks like the rest of the project: reuse the components and
tokens that already exist, only build what's genuinely missing. The grounded tools do the heavy
lifting so you are not guessing from a screenshot. This file is the router; deep detail lives in
references/ — load a reference when its step is in play.
When to use
- The user pastes a Figma URL/selection and asks for code ("code this", "build this component").
- The user wants to extend an existing component to match a Figma frame.
More than one Figma file open
Every tool result says so when it applies, so you do not have to check up front: with two or more
files connected and none claimed, results carry a MORE THAN ONE FIGMA FILE IS OPEN block naming
them. It matters because calls otherwise follow whichever file the user last touched, which changes
when they switch tabs — so a task can read one file and write to another and report success.
When you see it, claim the file before doing anything else: list_files names every connected file,
use_file({ fileName }) claims one for this session (use_file({ sessionId }) when two open files
share a name — Figma allows that, and x (Copy) is how it happens). Every later call then reaches
that file whatever is in front, including while its tab sits in the background. If the user has not
said which file, ask — do not guess from the names.
Workflow
Run the grounded tools against the selection, then generate — trust them over the rendered image.
get_design_context(detailfull,dedupeComponents: true) → the structural tree with tokens resolved to names (Primary/500,spacing/4), styles deduped intoglobalVars, and each instance'smainComponent/componentProperties. This is the layout + binding source of truth. KeepdedupeComponents: trueand don't depth-limit a subtree you'll build from. → How to read the tree, the per-node fidelity catalog (effects, per-side borders, stroke align, per-corner radius, blend, masks, gradients, image-fit, patterns, Figma Draw repeat groups / brush strokes / text on a path, auto-layout/grid, aspect-ratio, scroll/sticky, stack & stroke-space), Dev Mode annotations as ground truth, and grounding a page too big for one call:references/grounding.md.component_map→ every Figma component grouped to a local code component with astatus(high / medium / low / unmapped),candidate.filePath, andmatchedProps.high/medium: reuse that component (import fromcandidate.filePath), don't regenerate. Never invent a component namecomponent_mapdidn't report.candidate.ambiguousWith(a capped list of{ name, filePath }): the Figma name matched two or more code components nearly equally and the join couldn't confidently pick — a verify-me pick, not a confident reuse (the analogue oftoken_map'sambiguousWith). Check which of the winningcandidate+ these runner-ups is the right component for this context before importing (a wrong reuse is a silent visual bug), then record the confirmed one in the map file so the next run is certain. Absent when the pick was unambiguous.- Wire each entry's
instances[].props(resolved variant / boolean / text values) onto the reused component — one element per instance, with its own props. candidate.unmatchedProps: Figma axes the component has no prop for (a leading icon, arequiredflag, an active state) → surface as component-extension TODOs, never fake them with ad-hoc markup.unmapped: build it new in the project's style. For a repeated unmapped component (instanceCount > 1), build from its first instance's subtree; if that came backdeduped/truncated, drillget_design_contextoninstances[0].nodeIdonce — don't rebuild a repeated component by eye.- When you're emitting a component's own definition (its prop types, not just rendering it),
get_component_apion the component/instance returns the full property API — every VARIANT option and each BOOLEAN/TEXT/INSTANCE_SWAP prop with its default — so the prop space is grounded, not inferred from the instances you happened to see. - That API names the props; the tree names the layer each one drives. A sublayer inside a
COMPONENT or an INSTANCE carries
componentPropertyReferences({ characters | visible | mainComponent: "PropName#1:2" }). Wire that layer to the prop, not to what it happens to render:characters: "Label#1:2"is{props.label}, not the literal string in the design, andvisible: "Show Badge#3:4"renders conditionally. Without it you emit the right markup with no props at all — every instance frozen to whatever the one you looked at said.
token_map→ every Figma variable joined to a project token w
Установить figma-codegen в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл figma-codegen?
Generate framework-aware code from a Figma design. Reads the project's stack profile and emits code matching the existing framework (React/Vue/Svelte/Next/etc.) and styling (Tailwind/CSS/CSS-in-JS), reusing existing components and design tokens instead of regenerating from scratch. Triggers whenever the user wants a Figma design turned into code — e.g. 'code this design', 'implement this frame', 'build this screen/component', 'turn this Figma into React/Vue', 'convert this design to code' — or whenever a Figma URL or the current Figma selection appears alongside a coding request. Works for full screens, single sections, or one component.
Как установить скилл figma-codegen?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл figma-codegen запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic