/claude2figma:component-rulesfrom claude2figma
Builds UI elements in Figma with library-first component lookup, correct Auto Layout, and semantic node naming. Activates when creating cards, navs, sections, or components.
Ships in claude2figma. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Governs how Claude constructs UI in Figma. Supplements figma-generate-design. For visual property binding, defer to figma-style-binding.
Before building anything, resolve the component source in this order:
1. search_design_system → importComponentByKeyAsync → createInstance()
2. Local file scan → createInstance()
3. Build from scratch — ONLY if nothing matches
Never rebuild primitives the DS provides: Button, Input, Checkbox, Toggle, Badge, Tag, Avatar, Icon, Tab, Breadcrumb, Toast, Alert, Spinner.
// Library import
const comp = await figma.importComponentByKeyAsync("key_from_search");
const instance = comp.createInstance();
parent.appendChild(instance);
// For component sets (variants)
const set = await figma.importComponentSetByKeyAsync("key");
const instance = set.defaultVariant.createInstance();
Every container must use Auto Layout. Property order matters:
layoutMode FIRST ("VERTICAL" or "HORIZONTAL")layoutSizingHorizontal / layoutSizingVertical AFTER appendChildlayoutMode BEFORE any setBoundVariable call| Goal | primaryAxisSizing | counterAxisSizing | layoutSizingH | layoutSizingV |
|---|---|---|---|---|
| Hug both | AUTO | AUTO | HUG | HUG |
| Fixed card | FIXED | FIXED | FIXED | FIXED |
| Full-width section | AUTO | FIXED | FILL | HUG |
Name every node semantically with slash hierarchy. Never leave defaults.
Card / Container Card / Title Card / Body Card / Action Row
Hero / Background Nav / Link Group Button / Primary
One section per use_figma call. Validate via screenshot after each step. Return all created/mutated node IDs:
return { created: { card: card.id, title: title.id } };
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
figma, ui-design, component-library, auto-layout, design-system, semantic-naming
npx claudepluginhub senlindesign/claude2figma --plugin claude2figma4 skills in this plugin
/figma-preflightTriggers on 'let's start', 'begin', 'preflight', 'start the session', or when a Figma file URL is first shared. Verifies MCP connection, reads CLAUDE.md, audits connected libraries, and loads a Token Map of all Styles and Variables — required before any design work./figma-style-bindingTriggers on any visual property change in Figma — creating text, setting colors, adjusting spacing/padding/gap/radius. Enforces that ALL values bind to Figma Styles or Variables, never hardcoded. Includes post-write QA verification./reference-interpreterTriggers when user shares a screenshot, image, URL, or design description — or says 'analyze this', 'make a brief', 'interpret this reference'. Outputs a structured Design Brief mapping visual intent to design system tokens. Waits for 'confirmed' before designing.Other plugins' skills for the same job