/claude2figma:figma-preflightfrom claude2figma
Preflight check for Figma design sessions: verifies MCP connection, reads CLAUDE.md, audits libraries, and loads a Token Map of styles/variables/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.
Run at the start of every design session. Do NOT start design work until all steps pass.
Prerequisite: Load figma-use skill before any use_figma call.
Run these two in parallel:
mcp__figma__whoami. Must return user email and plan. Fail → stop, re-authenticate.Parse fileKey from the Figma URL, then run in parallel:
get_metadata with extracted nodeId and fileKey. Must return file name and pages.get_libraries with fileKey. Store subscribed libraries as Library Registry (name, libraryKey, description). These enable search_design_system to find library styles and components during design work.Combine all three inventories in one script:
const textStyles = await figma.getLocalTextStylesAsync();
const paintStyles = await figma.getLocalPaintStylesAsync();
const collections = await figma.variables.getLocalVariableCollectionsAsync();
const variables = await figma.variables.getLocalVariablesAsync();
const grouped = {};
for (const v of variables) {
const key = v.resolvedType;
if (!grouped[key]) grouped[key] = [];
grouped[key].push({ name: v.name, scopes: v.scopes });
}
const components = {};
for (const page of figma.root.children) {
await figma.setCurrentPageAsync(page);
const sets = page.findAll(n => n.type === "COMPONENT_SET");
const solos = page.findAll(n => n.type === "COMPONENT" && n.parent.type !== "COMPONENT_SET");
if (sets.length > 0 || solos.length > 0) {
components[page.name] = {
sets: sets.map(c => c.name),
solos: solos.map(c => c.name).slice(0, 15),
};
}
}
return {
textStyles: textStyles.map(s => s.name),
paintStyles: paintStyles.map(s => s.name),
collections: collections.map(c => c.name),
variableCount: variables.length,
byType: Object.fromEntries(
Object.entries(grouped).map(([type, vars]) => [type, vars.map(v => v.name)])
),
components
};
Store names only in context. IDs are looked up on-demand during design work. Library styles/variables are discovered via search_design_system.
After Step C, derive a semantic index from variables grouped by scopes:
| Role | Scope | Example names |
|---|---|---|
| Background fill | FRAME_FILL, SHAPE_FILL | background/surface, color/neutral-100 |
| Text color | TEXT_FILL | text/primary, color/neutral-900 |
| Border / stroke | STROKE_COLOR | border/default, color/neutral-300 |
| Gap | GAP | gap/sm, spacing/xxs |
| Padding | PADDING | padding/md, spacing/section-xl |
| Border radius | CORNER_RADIUS | radius/sm, radius/full |
✅ MCP Connection — [name] ([email]) · [plan]
✅ CLAUDE.md — Font: [primary] / [code] · Goal: [goal]
✅ Figma File — [file name] · [N] pages
✅ Libraries — [N] connected: [names]
✅ Styles — [N] text + [N] paint
✅ Variables — [N] across [N] collections
✅ Components — [N] sets across [N] pages
── Token Map ──────────────────────────────
Background : [names]
Text : [names]
Border : [names]
Gap : [names]
Padding : [names]
Radius : [names]
────────────────────────────────────────────
Ready to design.
If any step fails, output ❌ with error and stop.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub senlindesign/claude2figma --plugin claude2figma4 skills in this plugin
/component-rulesTriggers when building any UI element in Figma — 'create a card', 'build a nav', 'add a section', 'make a component'. Enforces library-first component lookup, correct Auto Layout structure, and semantic node naming. For visual property binding (colors, text styles, spacing values), defer to figma-style-binding./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