[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-figma-figma-generate-library":3,"mdc-sz585t-key":37,"related-org-figma-figma-generate-library":3460,"related-repo-figma-figma-generate-library":3622},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":32,"sourceUrl":35,"mdContent":36},"figma-generate-library","build Figma design systems from code","Build or update a professional-grade design system in Figma from a codebase. Use when the user wants to create variables\u002Ftokens, build component libraries, create individual components with proper variant sets and variable bindings, set up theming (light\u002Fdark modes), document foundations, or reconcile gaps between code and Figma. Also use when the user asks to create or generate any component in Figma — even a single one — since components require proper variable foundations, variant states, and design token bindings to be production-quality. This skill teaches WHAT to build and in WHAT ORDER — it complements the `figma-use` skill which teaches HOW to call the Plugin API. Both skills should be loaded together.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"figma","Figma","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ffigma.png",[12,16,19,22,23],{"name":13,"slug":14,"type":15},"Documentation","documentation","tag",{"name":17,"slug":18,"type":15},"Design System","design-system",{"name":20,"slug":21,"type":15},"UI Components","ui-components",{"name":9,"slug":8,"type":15},{"name":24,"slug":25,"type":15},"Design","design",1805,"https:\u002F\u002Fgithub.com\u002Ffigma\u002Fmcp-server-guide","2026-07-31T05:52:28.587088",null,164,[],{"repoUrl":27,"stars":26,"forks":30,"topics":33,"description":34},[],"A guide on how to use the Figma MCP server","https:\u002F\u002Fgithub.com\u002Ffigma\u002Fmcp-server-guide\u002Ftree\u002FHEAD\u002Fskills\u002Ffigma-generate-library","---\nname: figma-generate-library\ndescription: \"Build or update a professional-grade design system in Figma from a codebase. Use when the user wants to create variables\u002Ftokens, build component libraries, create individual components with proper variant sets and variable bindings, set up theming (light\u002Fdark modes), document foundations, or reconcile gaps between code and Figma. Also use when the user asks to create or generate any component in Figma — even a single one — since components require proper variable foundations, variant states, and design token bindings to be production-quality. This skill teaches WHAT to build and in WHAT ORDER — it complements the `figma-use` skill which teaches HOW to call the Plugin API. Both skills should be loaded together.\"\ndisable-model-invocation: false\n---\n\n# Design System Builder — Figma MCP Skill\n\nBuild professional-grade design systems in Figma that match code. This skill orchestrates multi-phase workflows across 20–100+ `use_figma` calls, enforcing quality patterns from real-world design systems (Material 3, Polaris, Figma UI3, Simple DS).\n\n**Prerequisites**: The `figma-use` skill MUST also be loaded for every `use_figma` call. It provides Plugin API syntax rules (return pattern, page reset, ID return, font loading, color range). This skill provides design system domain knowledge and workflow orchestration.\n\n**Always include `figma-generate-library` in the comma-separated `skillNames` parameter when calling `use_figma` as part of this skill. If this skill was loaded via an MCP resource, you MUST prefix the name with `resource:` (e.g. `resource:figma-generate-library`).** This is a logging parameter — it does not affect execution.\n\n---\n\n## 1. The One Rule That Matters Most\n\nFor every phase, follow this communication contract.\n\nBefore starting a phase:\n- Post a user-facing checklist titled `Phase N Checklist`.\n- Include every task\u002Fsubtask that will be attempted in that phase.\n- Include the phase exit criteria.\n- Do not begin mutating work for the phase until this checklist has been posted.\n- If the phase requires explicit approval, ask for approval after the checklist and wait.\n\nDuring execution:\n- Before each major subsection, post a short update naming the exact section being worked on, using this format:\n  `Working on Phase N.X: \u003Csection name>`\n- Keep updates concise, but make the current work visible.\n- When a subsection completes, mark it as completed in the running checklist if the interface supports checklist\u002Fstatus updates; otherwise mention completion in the next progress update.\n\nAt the end of each phase:\n- Post a `Phase N Summary` with:\n  - Completed tasks\n  - Created or changed Figma objects\n  - Validations performed\n  - Decisions or conflicts resolved\n  - Remaining risks or follow-ups\n- Then show the required phase artifact for that phase and continue automatically.\n- Only ask for explicit approval after Phase 0 or if a genuine decision fork arises (see [Section 6](#6-decision-forks)). For Phases 1–4, the default is to continue automatically after the summary.\n\n### Stable Task IDs\n\nUse one task ID format everywhere: `P{phase}.{step}`.\n\nRules:\n- Use lettered step IDs only: `P0.a`, `P0.b`, `P1.a`, `P3.d`.\n- Do not use plain bullet points for task lists.\n- Every phase checklist, progress update, validation note, and phase summary MUST reference the same task IDs\n\n**No setup exception:** Creating a new Figma file, importing a library, creating pages, variables, collections, styles, or components all count as creation\u002Fmutation. Do not treat any of them as harmless setup.\n\n**This is NEVER a one-shot task.** Building a design system requires 20–100+ `use_figma` calls across multiple phases, with mandatory progress between them. Any attempt to create everything in one call WILL produce broken, incomplete, or unrecoverable results. Break every operation to the smallest useful unit, validate, get feedback, proceed.\n\n---\n\n## 2. Mandatory Workflow\n\nWork through the phases in order. Do not move to the next phase until the current phase's required actions and acceptance checks are complete. If a phase cannot pass, stop and report the blocker. Do not approximate, skip, or defer a failed phase unless the user explicitly approves the limitation. No best-effort substitutions. No quiet approximations. No handoff with missing source truth, missing visual truth, fake assets, approximate typography, broken interactions, or unverified states.\n\n### Phase 0: DISCOVERY (always first — no `use_figma` writes yet)\n\n- [ ] 0a. Analyze codebase → extract tokens, components, naming conventions\n- [ ] 0b. Inspect Figma file → pages, variables, components, styles, existing conventions\n- [ ] 0c. Search subscribed libraries → use `search_design_system` for reusable assets\n- [ ] 0d. Lock v1 scope → exact token set + component list recorded before any creation\n- [ ] 0e. Map code → Figma → every conflict (code disagrees with Figma) resolved and recorded\n- [ ] 0f. Print a **gap analysis** to chat: what exists in code but not Figma, what exists in Figma but not code, and every conflict from 0e with its resolution\n\n### Phase 1: FOUNDATIONS (tokens first — always before components)\n\n- [ ] 1a. Create variable collections and modes\n- [ ] 1b. Create primitive variables (raw values, 1 mode)\n- [ ] 1c. Create semantic variables (aliased to primitives, mode-aware)\n- [ ] 1d. Set scopes on ALL variables (never `ALL_SCOPES`)\n- [ ] 1e. Set code syntax on ALL variables\n- [ ] 1f. Create effect styles (shadows) and text styles (typography)\n- [ ] 1g. Print a **variable summary** to chat: N collections, M variables, K modes, broken down by collection\n- [ ] 1h. Print the **style list** to chat: every effect style and text style created, with names\n- [ ] Exit criteria met: every token from the agreed plan exists, all scopes set, all code syntax set\n\n### Phase 2: FILE STRUCTURE (before components)\n\n- [ ] 2a. Create page skeleton: Cover → Getting Started → Foundations → --- → Components → --- → Utilities\n- [ ] 2b. Create foundations documentation pages (color swatches, type specimens, spacing bars)\n- [ ] 2c. Capture a `get_screenshot` of every foundations page and print the **page list** to chat alongside the screenshots\n- [ ] Exit criteria met: all planned pages exist, foundations docs are navigable\n\n### Phase 3: COMPONENTS (one at a time — never batch)\n\nFor EACH component (in dependency order: atoms before molecules), run the checklist below. Finish the current component before starting the next.\n\n- [ ] 3a. Create dedicated page\n- [ ] 3b. Build base component with auto-layout + full variable bindings\n- [ ] 3c. Create all variant combinations (`combineAsVariants` + grid layout)\n- [ ] 3d. Add component properties (TEXT, BOOLEAN, INSTANCE_SWAP)\n- [ ] 3e. Link properties to child nodes\n- [ ] 3f. Add page documentation (title, description, usage notes)\n- [ ] 3g. Validate: `get_metadata` (structure) + `get_screenshot` (visual)\n- [ ] 3h. Optional: lightweight Code Connect mapping while context is fresh\n- [ ] Exit criteria met: variant count correct, all bindings verified, screenshot looks right\n\n### Phase 4: INTEGRATION + QA (final pass)\n\n- [ ] 4a. Finalize all Code Connect mappings\n- [ ] 4b. Accessibility audit (contrast, min touch targets, focus visibility)\n- [ ] 4c. Naming audit (no duplicates, no unnamed nodes, consistent casing)\n- [ ] 4d. Unresolved bindings audit (no hardcoded fills\u002Fstrokes remaining)\n- [ ] 4e. Final review screenshots of every page\n\n---\n\n## 3. Critical Rules\n\n**Plugin API basics** (from use_figma skill — enforced here too):\n- Use `return` to send data back (auto-serialized). Do NOT wrap in IIFE or call closePlugin.\n- Return ALL created\u002Fmutated node IDs in every return value\n- Page context resets each call — always `await figma.setCurrentPageAsync(page)` at start. **Call it at most once per script**: each component or doc page is its own `use_figma` call. Never loop over `figma.root.children` and switch pages inside a mutating script — split that work into one focused call per target page (see [figma-use → gotchas.md → Set current page once per `use_figma` call](..\u002Ffigma-use\u002Freferences\u002Fgotchas.md#set-current-page-once-per-use_figma-call--split-multi-page-work-across-calls))\n- `figma.notify()` throws — never use it\n- Colors are 0–1 range, not 0–255\n- Font MUST be loaded before any text write: `await figma.loadFontAsync({family, style})`. Use `await figma.listAvailableFontsAsync()` to discover available fonts and verify exact style strings — if a load fails, query available fonts to find the correct name or a fallback.\n\n**Design system rules**:\n1. **Variables BEFORE components** — components bind to variables. No token = no component.\n2. **Inspect before creating** — run read-only `use_figma` to discover existing conventions. Match them.\n3. **One page per component** *(default)* — exception: tightly related families (e.g., Input + helpers) may share a page with clear section separation.\n4. **Bind visual properties to variables** *(default)* — fills, strokes, padding, radius, gap. Exceptions: intentionally fixed geometry (icon pixel-grid sizes, static dividers).\n5. **Scopes on every variable** — NEVER leave as `ALL_SCOPES`. Background: `FRAME_FILL, SHAPE_FILL`. Text: `TEXT_FILL`. Border: `STROKE_COLOR`. Spacing: `GAP`. Radii: `CORNER_RADIUS`. Primitives: `[]` (hidden).\n6. **Code syntax on every variable** — WEB syntax MUST use the `var()` wrapper: `var(--color-bg-primary)`, not `--color-bg-primary`. Use the actual CSS variable name from the codebase. ANDROID\u002FiOS do NOT use a wrapper.\n7. **Alias semantics to primitives** — `{ type: 'VARIABLE_ALIAS', id: primitiveVar.id }`. Never duplicate raw values in semantic layer.\n8. **Position variants after combineAsVariants** — they stack at (0,0). Manually grid-layout + resize.\n9. **INSTANCE_SWAP for icons** — never create a variant per icon. Cap variant matrices: if Size × Style × State > 30 combinations, split into sub-component.\n10. **Deterministic naming** — use consistent, unique node names for idempotent cleanup and resumability. Track created node IDs via return values and the state ledger.\n11. **No destructive cleanup** — cleanup scripts identify nodes by name convention or returned IDs, not by guessing.\n12. **Validate before proceeding** — never build on unvalidated work. `get_metadata` after every create, `get_screenshot` after each component.\n13. **NEVER parallelize `use_figma` calls** — Figma state mutations must be strictly sequential. Even if your tool supports parallel calls, never run two use_figma calls simultaneously.\n14. **Never hallucinate Node IDs** — always read IDs from the state ledger returned by previous calls. Never reconstruct or guess an ID from memory.\n15. **Use the helper scripts** — embed scripts from `scripts\u002F` into your use_figma calls. Don't write 200-line inline scripts from scratch.\n\n---\n\n## 4. State Management (Required for Long Workflows)\n\n> Do not store workflow state on Figma objects. Use deterministic names for discovery and exact returned IDs in the state ledger. Put human-readable component purpose and usage guidance in the component or component-set `description`.\n\n| Entity type | Stable identity | How to check existence |\n|-------------|----------------|----------------------|\n| Pages and frames | Deterministic name + state-ledger ID | `figma.root.children.find(p => p.name === pageName)` or `await figma.getNodeByIdAsync(id)` |\n| Components and component sets | Variant\u002Fset name + state-ledger ID | `page.findOne(n => n.name === name)` or `await figma.getNodeByIdAsync(id)` |\n| Variables | Name within collection | `(await figma.variables.getLocalVariablesAsync()).find(v => v.name === name && v.variableCollectionId === collId)` |\n| Styles | Name | `getLocalTextStyles().find(s => s.name === name)` |\n\nRecord every returned ID in the state ledger immediately after creation. Never use a fuzzy lookup to authorize deletion.\n\n**State persistence**: Do NOT rely solely on conversation context for the state ledger. Write it to disk:\n```\n\u002Ftmp\u002Fdesign-system-state-{RUN_ID}.json\n```\nRe-read this file at the start of every turn. In long workflows, conversation context will be truncated — the file is the source of truth.\n\nMaintain a state ledger tracking:\n```json\n{\n  \"runId\": \"ds-build-2024-001\",\n  \"phase\": \"phase3\",\n  \"step\": \"component-button\",\n  \"entities\": {\n    \"collections\": { \"primitives\": \"id:...\", \"color\": \"id:...\" },\n    \"variables\": { \"color\u002Fbg\u002Fprimary\": \"id:...\", \"spacing\u002Fsm\": \"id:...\" },\n    \"pages\": { \"Cover\": \"id:...\", \"Button\": \"id:...\" },\n    \"components\": { \"Button\": \"id:...\" }\n  },\n  \"pendingValidations\": [\"Button:screenshot\"],\n  \"completedSteps\": [\"phase0\", \"phase1\", \"phase2\", \"component-avatar\"]\n}\n```\n\n**Idempotency check** before every create: query by name + state ledger ID. If exists, skip or update — never duplicate.\n\n**Resume protocol**: at session start or after context truncation, run a read-only `use_figma` to scan all pages, components, variables, and styles by name to reconstruct the `{key → id}` map. Then re-read the state file from disk if available.\n\n**Continuation prompt** (give this to the user when resuming in a new chat):\n> \"I'm continuing a design system build. Run ID: {RUN_ID}. Load the figma-generate-library skill and resume from the last completed step.\"\n\n---\n\n## 5. Library Discovery and search_design_system — Reuse Decision Matrix\n\nSearch FIRST in Phase 0, then again immediately before each component creation.\n\n**Start with `get_libraries`** to understand what libraries are available before searching blindly:\n\n```\n\u002F\u002F Discover all libraries accessible to the file\nget_libraries({ fileKey })\n\u002F\u002F Returns:\n\u002F\u002F   libraries_added_to_file: [{ name, libraryKey, description, source }, ...]\n\u002F\u002F   libraries_available_to_add: [{ name, libraryKey, description, source }, ...]\n\u002F\u002F   libraries_available_to_add_next_offset: number | null\n```\n\nUse the returned `libraryKey` values to scope searches to specific libraries via `includeLibraryKeys`. This avoids noisy results when many libraries are available.\n\nIf `libraries_available_to_add_next_offset` is non-null, more org libraries are available — call `get_libraries` again with `offset` set to that value. Org libraries page in batches of 20; community UI kits only appear on the first page.\n\n```\n\u002F\u002F Search across all libraries (default)\nsearch_design_system({ query, fileKey, includeComponents: true, includeVariables: true, includeStyles: true })\n\n\u002F\u002F Search within a specific library only\nsearch_design_system({ query, fileKey, includeLibraryKeys: [\"lk-abc123...\"], includeComponents: true })\n```\n\n**Reuse if** all of these are true:\n- Component property API matches your needs (same variant axes, compatible types)\n- Token binding model is compatible (uses same or aliasable variables)\n- Naming conventions match the target file\n- Component is editable (not locked in a remote library you don't own)\n\n**Rebuild if** any of these:\n- API incompatibility (different property names, wrong variant model)\n- Token model incompatible (hardcoded values, different variable schema)\n- Ownership issue (can't modify the library)\n\n**Wrap if** visual match but API incompatible:\n- Import the library component as a nested instance inside a new wrapper component\n- Expose a clean API on the wrapper\n\n**Priority order**: local existing → subscribed library import → unsubscribed UI Kit library from `libraries_available_to_add` (icons especially) → create new.\n\n---\n\n## 6. Decision Forks\n\nAsk the user when paths fork — when two or more reasonable answers exist and no clear winner comes from the codebase, the Figma file, or the locked plan. Don't silently default. Present each option with its tradeoff and your recommendation; pick only after the user steers.\n\n**When NOT to ask:** if exactly one path is clearly correct from the source of truth (code, Figma file, agreed plan), take it. This section is for genuine ambiguity, not for offloading every decision.\n\n| Fork situation | What to surface | Example ask |\n|---|---|---|\n| Code ≠ Figma on a token, component, or value | Both versions side by side, with provenance (file\u002Fline vs node) | \"Code says `--color-bg-primary = #FFFFFF`, Figma has `color\u002Fbg\u002Fprimary = #FAFAFA`. Which wins?\" |\n| Subscribed library has a close-but-not-exact match | Library component summary + gap list | \"Library has `Button` with no `loading` state. Reuse + wrap locally, or rebuild from scratch?\" |\n| Scope ambiguity at plan-lock (0d) | What's clearly in, what's clearly out, what's ambiguous | \"Spec lists `Button` and `Input`; `Field` is referenced but not defined. In or out of v1?\" |\n\n**If the user rejects an option you already built on:** fix before moving on. Never build on rejected work.\n\n---\n\n## 7. Naming Conventions\n\nMatch existing file conventions. If starting fresh:\n\n**Variables** (slash-separated):\n```\ncolor\u002Fbg\u002Fprimary     color\u002Ftext\u002Fsecondary    color\u002Fborder\u002Fdefault\nspacing\u002Fxs  spacing\u002Fsm  spacing\u002Fmd  spacing\u002Flg  spacing\u002Fxl  spacing\u002F2xl\nradius\u002Fnone  radius\u002Fsm  radius\u002Fmd  radius\u002Flg  radius\u002Ffull\ntypography\u002Fbody\u002Ffont-size    typography\u002Fheading\u002Fline-height\n```\n\n**Primitives**: `blue\u002F50` → `blue\u002F900`, `gray\u002F50` → `gray\u002F900`\n\n**Component names**: `Button`, `Input`, `Card`, `Avatar`, `Badge`, `Checkbox`, `Toggle`\n\n**Variant names**: `Property=Value, Property=Value` — e.g., `Size=Medium, Style=Primary, State=Default`\n\n**Page separators**: `---` (most common) or `——— COMPONENTS ———`\n\n> Full naming reference: [naming-conventions.md](references\u002Fnaming-conventions.md)\n\n---\n\n## 8. Token Architecture\n\n| Complexity | Pattern |\n|-----------|---------|\n| \u003C 50 tokens | Single collection, 2 modes (Light\u002FDark) |\n| 50–200 tokens | **Standard**: Primitives (1 mode) + Color semantic (Light\u002FDark) + Spacing (1 mode) + Typography (1 mode) |\n| 200+ tokens | **Advanced**: Multiple semantic collections, 4–8 modes (Light\u002FDark × Contrast × Brand). See M3 pattern in [token-creation.md](references\u002Ftoken-creation.md) |\n\nStandard pattern (recommended starting point):\n```\nCollection: \"Primitives\"    modes: [\"Value\"]\n  blue\u002F500 = #3B82F6, gray\u002F900 = #111827, ...\n\nCollection: \"Color\"         modes: [\"Light\", \"Dark\"]\n  color\u002Fbg\u002Fprimary → Light: alias Primitives\u002Fwhite, Dark: alias Primitives\u002Fgray-900\n  color\u002Ftext\u002Fprimary → Light: alias Primitives\u002Fgray-900, Dark: alias Primitives\u002Fwhite\n\nCollection: \"Spacing\"       modes: [\"Value\"]\n  spacing\u002Fxs = 4, spacing\u002Fsm = 8, spacing\u002Fmd = 16, ...\n```\n\n---\n\n## 9. Per-Phase Anti-Patterns\n\n**Phase 0 anti-patterns:**\n- ❌ Starting to create anything before scope is locked with user\n- ❌ Ignoring existing file conventions and imposing new ones\n- ❌ Skipping `search_design_system` before planning component creation\n\n**Phase 1 anti-patterns:**\n- ❌ Using `ALL_SCOPES` on any variable\n- ❌ Duplicating raw values in semantic layer instead of aliasing\n- ❌ Not setting code syntax (breaks Dev Mode and round-tripping)\n- ❌ Creating component tokens before agreeing on token taxonomy\n\n**Phase 2 anti-patterns:**\n- ❌ Skipping the cover page or foundations docs\n- ❌ Putting multiple unrelated components on one page\n\n**Phase 3 anti-patterns:**\n- ❌ Creating components before foundations exist\n- ❌ Hardcoding any fill\u002Fstroke\u002Fspacing\u002Fradius value in a component\n- ❌ Creating a variant per icon (use INSTANCE_SWAP instead)\n- ❌ Not positioning variants after combineAsVariants (they all stack at 0,0)\n- ❌ Building variant matrix > 30 without splitting (variant explosion)\n- ❌ Importing remote components then immediately detaching them\n\n**General anti-patterns:**\n- ❌ Retrying a failed script without understanding the error first\n- ❌ Using name-prefix matching for cleanup (deletes user-owned nodes)\n- ❌ Building on unvalidated work from the previous step\n- ❌ Parallelizing use_figma calls (always sequential)\n- ❌ Guessing\u002Fhallucinating node IDs from memory (always read from state ledger)\n- ❌ Writing massive inline scripts instead of using the provided helper scripts\n- ❌ Starting Phase 3 because the user said \"build the button\" without completing Phases 0-2\n\n---\n\n## 10. Reference Docs\n\nLoad on demand — each reference is authoritative for its phase:\n\nUse your file reading tool to read these docs when needed. Do not assume their contents from the filename.\n\n| Doc | Phase | Required \u002F Optional | Load when |\n|-----|-------|---------------------|-----------|\n| [discovery-phase.md](references\u002Fdiscovery-phase.md) | 0 | **Required** | Starting any build — codebase analysis + Figma inspection |\n| [token-creation.md](references\u002Ftoken-creation.md) | 1 | **Required** | Creating variables, collections, modes, styles |\n| [documentation-creation.md](references\u002Fdocumentation-creation.md) | 2 | Required | Creating cover page, foundations docs, swatches |\n| [component-creation.md](references\u002Fcomponent-creation.md) | 3 | **Required** | Creating any component or variant |\n| [code-connect-setup.md](references\u002Fcode-connect-setup.md) | 3–4 | Required | Setting up Code Connect or variable code syntax |\n| [naming-conventions.md](references\u002Fnaming-conventions.md) | Any | Optional | Naming anything — variables, pages, variants, styles |\n| [error-recovery.md](references\u002Ferror-recovery.md) | Any | **Required on error** | Script fails, multi-step workflow recovery, cleanup of abandoned workflow state |\n\n---\n\n## 11. Scripts\n\nReusable Plugin API helper functions. Embed in `use_figma` calls:\n\n| Script | Purpose |\n|--------|---------|\n| [inspectFileStructure.js](scripts\u002FinspectFileStructure.js) | Discover all pages, components, variables, styles; returns full inventory |\n| [createVariableCollection.js](scripts\u002FcreateVariableCollection.js) | Create a named collection with modes; returns `{collectionId, modeIds}` |\n| [createSemanticTokens.js](scripts\u002FcreateSemanticTokens.js) | Create aliased semantic variables from a token map |\n| [createComponentWithVariants.js](scripts\u002FcreateComponentWithVariants.js) | Build a component set from a variant matrix; handles grid layout |\n| [bindVariablesToComponent.js](scripts\u002FbindVariablesToComponent.js) | Bind design tokens to all component visual properties |\n| [createDocumentationPage.js](scripts\u002FcreateDocumentationPage.js) | Create a page with title + description + section structure |\n| [validateCreation.js](scripts\u002FvalidateCreation.js) | Verify created nodes match expected counts, names, structure |\n| [cleanupOrphans.js](scripts\u002FcleanupOrphans.js) | Remove only the exact node, variable, and collection IDs supplied from the state ledger |\n",{"data":38,"body":40},{"name":4,"description":6,"disable-model-invocation":39},false,{"type":41,"children":42},"root",[43,52,67,93,141,145,152,157,162,200,205,229,234,297,304,316,321,368,378,395,398,404,409,422,500,506,613,619,674,680,685,793,799,848,851,857,867,974,984,1274,1277,1283,1299,1434,1439,1449,1461,1466,1471,2132,2142,2167,2177,2185,2188,2194,2199,2215,2224,2245,2273,2282,2292,2315,2325,2343,2353,2366,2384,2387,2393,2398,2408,2543,2553,2556,2562,2567,2576,2585,2623,2678,2701,2724,2738,2741,2747,2824,2829,2838,2841,2847,2855,2880,2888,2918,2926,2939,2947,2980,2988,3026,3029,3035,3040,3045,3269,3272,3278,3290,3454],{"type":44,"tag":45,"props":46,"children":48},"element","h1",{"id":47},"design-system-builder-figma-mcp-skill",[49],{"type":50,"value":51},"text","Design System Builder — Figma MCP Skill",{"type":44,"tag":53,"props":54,"children":55},"p",{},[56,58,65],{"type":50,"value":57},"Build professional-grade design systems in Figma that match code. This skill orchestrates multi-phase workflows across 20–100+ ",{"type":44,"tag":59,"props":60,"children":62},"code",{"className":61},[],[63],{"type":50,"value":64},"use_figma",{"type":50,"value":66}," calls, enforcing quality patterns from real-world design systems (Material 3, Polaris, Figma UI3, Simple DS).",{"type":44,"tag":53,"props":68,"children":69},{},[70,76,78,84,86,91],{"type":44,"tag":71,"props":72,"children":73},"strong",{},[74],{"type":50,"value":75},"Prerequisites",{"type":50,"value":77},": The ",{"type":44,"tag":59,"props":79,"children":81},{"className":80},[],[82],{"type":50,"value":83},"figma-use",{"type":50,"value":85}," skill MUST also be loaded for every ",{"type":44,"tag":59,"props":87,"children":89},{"className":88},[],[90],{"type":50,"value":64},{"type":50,"value":92}," call. It provides Plugin API syntax rules (return pattern, page reset, ID return, font loading, color range). This skill provides design system domain knowledge and workflow orchestration.",{"type":44,"tag":53,"props":94,"children":95},{},[96,139],{"type":44,"tag":71,"props":97,"children":98},{},[99,101,106,108,114,116,121,123,129,131,137],{"type":50,"value":100},"Always include ",{"type":44,"tag":59,"props":102,"children":104},{"className":103},[],[105],{"type":50,"value":4},{"type":50,"value":107}," in the comma-separated ",{"type":44,"tag":59,"props":109,"children":111},{"className":110},[],[112],{"type":50,"value":113},"skillNames",{"type":50,"value":115}," parameter when calling ",{"type":44,"tag":59,"props":117,"children":119},{"className":118},[],[120],{"type":50,"value":64},{"type":50,"value":122}," as part of this skill. If this skill was loaded via an MCP resource, you MUST prefix the name with ",{"type":44,"tag":59,"props":124,"children":126},{"className":125},[],[127],{"type":50,"value":128},"resource:",{"type":50,"value":130}," (e.g. ",{"type":44,"tag":59,"props":132,"children":134},{"className":133},[],[135],{"type":50,"value":136},"resource:figma-generate-library",{"type":50,"value":138},").",{"type":50,"value":140}," This is a logging parameter — it does not affect execution.",{"type":44,"tag":142,"props":143,"children":144},"hr",{},[],{"type":44,"tag":146,"props":147,"children":149},"h2",{"id":148},"_1-the-one-rule-that-matters-most",[150],{"type":50,"value":151},"1. The One Rule That Matters Most",{"type":44,"tag":53,"props":153,"children":154},{},[155],{"type":50,"value":156},"For every phase, follow this communication contract.",{"type":44,"tag":53,"props":158,"children":159},{},[160],{"type":50,"value":161},"Before starting a phase:",{"type":44,"tag":163,"props":164,"children":165},"ul",{},[166,180,185,190,195],{"type":44,"tag":167,"props":168,"children":169},"li",{},[170,172,178],{"type":50,"value":171},"Post a user-facing checklist titled ",{"type":44,"tag":59,"props":173,"children":175},{"className":174},[],[176],{"type":50,"value":177},"Phase N Checklist",{"type":50,"value":179},".",{"type":44,"tag":167,"props":181,"children":182},{},[183],{"type":50,"value":184},"Include every task\u002Fsubtask that will be attempted in that phase.",{"type":44,"tag":167,"props":186,"children":187},{},[188],{"type":50,"value":189},"Include the phase exit criteria.",{"type":44,"tag":167,"props":191,"children":192},{},[193],{"type":50,"value":194},"Do not begin mutating work for the phase until this checklist has been posted.",{"type":44,"tag":167,"props":196,"children":197},{},[198],{"type":50,"value":199},"If the phase requires explicit approval, ask for approval after the checklist and wait.",{"type":44,"tag":53,"props":201,"children":202},{},[203],{"type":50,"value":204},"During execution:",{"type":44,"tag":163,"props":206,"children":207},{},[208,219,224],{"type":44,"tag":167,"props":209,"children":210},{},[211,213],{"type":50,"value":212},"Before each major subsection, post a short update naming the exact section being worked on, using this format:\n",{"type":44,"tag":59,"props":214,"children":216},{"className":215},[],[217],{"type":50,"value":218},"Working on Phase N.X: \u003Csection name>",{"type":44,"tag":167,"props":220,"children":221},{},[222],{"type":50,"value":223},"Keep updates concise, but make the current work visible.",{"type":44,"tag":167,"props":225,"children":226},{},[227],{"type":50,"value":228},"When a subsection completes, mark it as completed in the running checklist if the interface supports checklist\u002Fstatus updates; otherwise mention completion in the next progress update.",{"type":44,"tag":53,"props":230,"children":231},{},[232],{"type":50,"value":233},"At the end of each phase:",{"type":44,"tag":163,"props":235,"children":236},{},[237,278,283],{"type":44,"tag":167,"props":238,"children":239},{},[240,242,248,250],{"type":50,"value":241},"Post a ",{"type":44,"tag":59,"props":243,"children":245},{"className":244},[],[246],{"type":50,"value":247},"Phase N Summary",{"type":50,"value":249}," with:\n",{"type":44,"tag":163,"props":251,"children":252},{},[253,258,263,268,273],{"type":44,"tag":167,"props":254,"children":255},{},[256],{"type":50,"value":257},"Completed tasks",{"type":44,"tag":167,"props":259,"children":260},{},[261],{"type":50,"value":262},"Created or changed Figma objects",{"type":44,"tag":167,"props":264,"children":265},{},[266],{"type":50,"value":267},"Validations performed",{"type":44,"tag":167,"props":269,"children":270},{},[271],{"type":50,"value":272},"Decisions or conflicts resolved",{"type":44,"tag":167,"props":274,"children":275},{},[276],{"type":50,"value":277},"Remaining risks or follow-ups",{"type":44,"tag":167,"props":279,"children":280},{},[281],{"type":50,"value":282},"Then show the required phase artifact for that phase and continue automatically.",{"type":44,"tag":167,"props":284,"children":285},{},[286,288,295],{"type":50,"value":287},"Only ask for explicit approval after Phase 0 or if a genuine decision fork arises (see ",{"type":44,"tag":289,"props":290,"children":292},"a",{"href":291},"#6-decision-forks",[293],{"type":50,"value":294},"Section 6",{"type":50,"value":296},"). For Phases 1–4, the default is to continue automatically after the summary.",{"type":44,"tag":298,"props":299,"children":301},"h3",{"id":300},"stable-task-ids",[302],{"type":50,"value":303},"Stable Task IDs",{"type":44,"tag":53,"props":305,"children":306},{},[307,309,315],{"type":50,"value":308},"Use one task ID format everywhere: ",{"type":44,"tag":59,"props":310,"children":312},{"className":311},[],[313],{"type":50,"value":314},"P{phase}.{step}",{"type":50,"value":179},{"type":44,"tag":53,"props":317,"children":318},{},[319],{"type":50,"value":320},"Rules:",{"type":44,"tag":163,"props":322,"children":323},{},[324,358,363],{"type":44,"tag":167,"props":325,"children":326},{},[327,329,335,337,343,344,350,351,357],{"type":50,"value":328},"Use lettered step IDs only: ",{"type":44,"tag":59,"props":330,"children":332},{"className":331},[],[333],{"type":50,"value":334},"P0.a",{"type":50,"value":336},", ",{"type":44,"tag":59,"props":338,"children":340},{"className":339},[],[341],{"type":50,"value":342},"P0.b",{"type":50,"value":336},{"type":44,"tag":59,"props":345,"children":347},{"className":346},[],[348],{"type":50,"value":349},"P1.a",{"type":50,"value":336},{"type":44,"tag":59,"props":352,"children":354},{"className":353},[],[355],{"type":50,"value":356},"P3.d",{"type":50,"value":179},{"type":44,"tag":167,"props":359,"children":360},{},[361],{"type":50,"value":362},"Do not use plain bullet points for task lists.",{"type":44,"tag":167,"props":364,"children":365},{},[366],{"type":50,"value":367},"Every phase checklist, progress update, validation note, and phase summary MUST reference the same task IDs",{"type":44,"tag":53,"props":369,"children":370},{},[371,376],{"type":44,"tag":71,"props":372,"children":373},{},[374],{"type":50,"value":375},"No setup exception:",{"type":50,"value":377}," Creating a new Figma file, importing a library, creating pages, variables, collections, styles, or components all count as creation\u002Fmutation. Do not treat any of them as harmless setup.",{"type":44,"tag":53,"props":379,"children":380},{},[381,386,388,393],{"type":44,"tag":71,"props":382,"children":383},{},[384],{"type":50,"value":385},"This is NEVER a one-shot task.",{"type":50,"value":387}," Building a design system requires 20–100+ ",{"type":44,"tag":59,"props":389,"children":391},{"className":390},[],[392],{"type":50,"value":64},{"type":50,"value":394}," calls across multiple phases, with mandatory progress between them. Any attempt to create everything in one call WILL produce broken, incomplete, or unrecoverable results. Break every operation to the smallest useful unit, validate, get feedback, proceed.",{"type":44,"tag":142,"props":396,"children":397},{},[],{"type":44,"tag":146,"props":399,"children":401},{"id":400},"_2-mandatory-workflow",[402],{"type":50,"value":403},"2. Mandatory Workflow",{"type":44,"tag":53,"props":405,"children":406},{},[407],{"type":50,"value":408},"Work through the phases in order. Do not move to the next phase until the current phase's required actions and acceptance checks are complete. If a phase cannot pass, stop and report the blocker. Do not approximate, skip, or defer a failed phase unless the user explicitly approves the limitation. No best-effort substitutions. No quiet approximations. No handoff with missing source truth, missing visual truth, fake assets, approximate typography, broken interactions, or unverified states.",{"type":44,"tag":298,"props":410,"children":412},{"id":411},"phase-0-discovery-always-first-no-use_figma-writes-yet",[413,415,420],{"type":50,"value":414},"Phase 0: DISCOVERY (always first — no ",{"type":44,"tag":59,"props":416,"children":418},{"className":417},[],[419],{"type":50,"value":64},{"type":50,"value":421}," writes yet)",{"type":44,"tag":163,"props":423,"children":426},{"className":424},[425],"contains-task-list",[427,440,449,466,475,484],{"type":44,"tag":167,"props":428,"children":431},{"className":429},[430],"task-list-item",[432,438],{"type":44,"tag":433,"props":434,"children":437},"input",{"disabled":435,"type":436},true,"checkbox",[],{"type":50,"value":439}," 0a. Analyze codebase → extract tokens, components, naming conventions",{"type":44,"tag":167,"props":441,"children":443},{"className":442},[430],[444,447],{"type":44,"tag":433,"props":445,"children":446},{"disabled":435,"type":436},[],{"type":50,"value":448}," 0b. Inspect Figma file → pages, variables, components, styles, existing conventions",{"type":44,"tag":167,"props":450,"children":452},{"className":451},[430],[453,456,458,464],{"type":44,"tag":433,"props":454,"children":455},{"disabled":435,"type":436},[],{"type":50,"value":457}," 0c. Search subscribed libraries → use ",{"type":44,"tag":59,"props":459,"children":461},{"className":460},[],[462],{"type":50,"value":463},"search_design_system",{"type":50,"value":465}," for reusable assets",{"type":44,"tag":167,"props":467,"children":469},{"className":468},[430],[470,473],{"type":44,"tag":433,"props":471,"children":472},{"disabled":435,"type":436},[],{"type":50,"value":474}," 0d. Lock v1 scope → exact token set + component list recorded before any creation",{"type":44,"tag":167,"props":476,"children":478},{"className":477},[430],[479,482],{"type":44,"tag":433,"props":480,"children":481},{"disabled":435,"type":436},[],{"type":50,"value":483}," 0e. Map code → Figma → every conflict (code disagrees with Figma) resolved and recorded",{"type":44,"tag":167,"props":485,"children":487},{"className":486},[430],[488,491,493,498],{"type":44,"tag":433,"props":489,"children":490},{"disabled":435,"type":436},[],{"type":50,"value":492}," 0f. Print a ",{"type":44,"tag":71,"props":494,"children":495},{},[496],{"type":50,"value":497},"gap analysis",{"type":50,"value":499}," to chat: what exists in code but not Figma, what exists in Figma but not code, and every conflict from 0e with its resolution",{"type":44,"tag":298,"props":501,"children":503},{"id":502},"phase-1-foundations-tokens-first-always-before-components",[504],{"type":50,"value":505},"Phase 1: FOUNDATIONS (tokens first — always before components)",{"type":44,"tag":163,"props":507,"children":509},{"className":508},[425],[510,519,528,537,554,563,572,588,604],{"type":44,"tag":167,"props":511,"children":513},{"className":512},[430],[514,517],{"type":44,"tag":433,"props":515,"children":516},{"disabled":435,"type":436},[],{"type":50,"value":518}," 1a. Create variable collections and modes",{"type":44,"tag":167,"props":520,"children":522},{"className":521},[430],[523,526],{"type":44,"tag":433,"props":524,"children":525},{"disabled":435,"type":436},[],{"type":50,"value":527}," 1b. Create primitive variables (raw values, 1 mode)",{"type":44,"tag":167,"props":529,"children":531},{"className":530},[430],[532,535],{"type":44,"tag":433,"props":533,"children":534},{"disabled":435,"type":436},[],{"type":50,"value":536}," 1c. Create semantic variables (aliased to primitives, mode-aware)",{"type":44,"tag":167,"props":538,"children":540},{"className":539},[430],[541,544,546,552],{"type":44,"tag":433,"props":542,"children":543},{"disabled":435,"type":436},[],{"type":50,"value":545}," 1d. Set scopes on ALL variables (never ",{"type":44,"tag":59,"props":547,"children":549},{"className":548},[],[550],{"type":50,"value":551},"ALL_SCOPES",{"type":50,"value":553},")",{"type":44,"tag":167,"props":555,"children":557},{"className":556},[430],[558,561],{"type":44,"tag":433,"props":559,"children":560},{"disabled":435,"type":436},[],{"type":50,"value":562}," 1e. Set code syntax on ALL variables",{"type":44,"tag":167,"props":564,"children":566},{"className":565},[430],[567,570],{"type":44,"tag":433,"props":568,"children":569},{"disabled":435,"type":436},[],{"type":50,"value":571}," 1f. Create effect styles (shadows) and text styles (typography)",{"type":44,"tag":167,"props":573,"children":575},{"className":574},[430],[576,579,581,586],{"type":44,"tag":433,"props":577,"children":578},{"disabled":435,"type":436},[],{"type":50,"value":580}," 1g. Print a ",{"type":44,"tag":71,"props":582,"children":583},{},[584],{"type":50,"value":585},"variable summary",{"type":50,"value":587}," to chat: N collections, M variables, K modes, broken down by collection",{"type":44,"tag":167,"props":589,"children":591},{"className":590},[430],[592,595,597,602],{"type":44,"tag":433,"props":593,"children":594},{"disabled":435,"type":436},[],{"type":50,"value":596}," 1h. Print the ",{"type":44,"tag":71,"props":598,"children":599},{},[600],{"type":50,"value":601},"style list",{"type":50,"value":603}," to chat: every effect style and text style created, with names",{"type":44,"tag":167,"props":605,"children":607},{"className":606},[430],[608,611],{"type":44,"tag":433,"props":609,"children":610},{"disabled":435,"type":436},[],{"type":50,"value":612}," Exit criteria met: every token from the agreed plan exists, all scopes set, all code syntax set",{"type":44,"tag":298,"props":614,"children":616},{"id":615},"phase-2-file-structure-before-components",[617],{"type":50,"value":618},"Phase 2: FILE STRUCTURE (before components)",{"type":44,"tag":163,"props":620,"children":622},{"className":621},[425],[623,632,641,665],{"type":44,"tag":167,"props":624,"children":626},{"className":625},[430],[627,630],{"type":44,"tag":433,"props":628,"children":629},{"disabled":435,"type":436},[],{"type":50,"value":631}," 2a. Create page skeleton: Cover → Getting Started → Foundations → --- → Components → --- → Utilities",{"type":44,"tag":167,"props":633,"children":635},{"className":634},[430],[636,639],{"type":44,"tag":433,"props":637,"children":638},{"disabled":435,"type":436},[],{"type":50,"value":640}," 2b. Create foundations documentation pages (color swatches, type specimens, spacing bars)",{"type":44,"tag":167,"props":642,"children":644},{"className":643},[430],[645,648,650,656,658,663],{"type":44,"tag":433,"props":646,"children":647},{"disabled":435,"type":436},[],{"type":50,"value":649}," 2c. Capture a ",{"type":44,"tag":59,"props":651,"children":653},{"className":652},[],[654],{"type":50,"value":655},"get_screenshot",{"type":50,"value":657}," of every foundations page and print the ",{"type":44,"tag":71,"props":659,"children":660},{},[661],{"type":50,"value":662},"page list",{"type":50,"value":664}," to chat alongside the screenshots",{"type":44,"tag":167,"props":666,"children":668},{"className":667},[430],[669,672],{"type":44,"tag":433,"props":670,"children":671},{"disabled":435,"type":436},[],{"type":50,"value":673}," Exit criteria met: all planned pages exist, foundations docs are navigable",{"type":44,"tag":298,"props":675,"children":677},{"id":676},"phase-3-components-one-at-a-time-never-batch",[678],{"type":50,"value":679},"Phase 3: COMPONENTS (one at a time — never batch)",{"type":44,"tag":53,"props":681,"children":682},{},[683],{"type":50,"value":684},"For EACH component (in dependency order: atoms before molecules), run the checklist below. Finish the current component before starting the next.",{"type":44,"tag":163,"props":686,"children":688},{"className":687},[425],[689,698,707,724,733,742,751,775,784],{"type":44,"tag":167,"props":690,"children":692},{"className":691},[430],[693,696],{"type":44,"tag":433,"props":694,"children":695},{"disabled":435,"type":436},[],{"type":50,"value":697}," 3a. Create dedicated page",{"type":44,"tag":167,"props":699,"children":701},{"className":700},[430],[702,705],{"type":44,"tag":433,"props":703,"children":704},{"disabled":435,"type":436},[],{"type":50,"value":706}," 3b. Build base component with auto-layout + full variable bindings",{"type":44,"tag":167,"props":708,"children":710},{"className":709},[430],[711,714,716,722],{"type":44,"tag":433,"props":712,"children":713},{"disabled":435,"type":436},[],{"type":50,"value":715}," 3c. Create all variant combinations (",{"type":44,"tag":59,"props":717,"children":719},{"className":718},[],[720],{"type":50,"value":721},"combineAsVariants",{"type":50,"value":723}," + grid layout)",{"type":44,"tag":167,"props":725,"children":727},{"className":726},[430],[728,731],{"type":44,"tag":433,"props":729,"children":730},{"disabled":435,"type":436},[],{"type":50,"value":732}," 3d. Add component properties (TEXT, BOOLEAN, INSTANCE_SWAP)",{"type":44,"tag":167,"props":734,"children":736},{"className":735},[430],[737,740],{"type":44,"tag":433,"props":738,"children":739},{"disabled":435,"type":436},[],{"type":50,"value":741}," 3e. Link properties to child nodes",{"type":44,"tag":167,"props":743,"children":745},{"className":744},[430],[746,749],{"type":44,"tag":433,"props":747,"children":748},{"disabled":435,"type":436},[],{"type":50,"value":750}," 3f. Add page documentation (title, description, usage notes)",{"type":44,"tag":167,"props":752,"children":754},{"className":753},[430],[755,758,760,766,768,773],{"type":44,"tag":433,"props":756,"children":757},{"disabled":435,"type":436},[],{"type":50,"value":759}," 3g. Validate: ",{"type":44,"tag":59,"props":761,"children":763},{"className":762},[],[764],{"type":50,"value":765},"get_metadata",{"type":50,"value":767}," (structure) + ",{"type":44,"tag":59,"props":769,"children":771},{"className":770},[],[772],{"type":50,"value":655},{"type":50,"value":774}," (visual)",{"type":44,"tag":167,"props":776,"children":778},{"className":777},[430],[779,782],{"type":44,"tag":433,"props":780,"children":781},{"disabled":435,"type":436},[],{"type":50,"value":783}," 3h. Optional: lightweight Code Connect mapping while context is fresh",{"type":44,"tag":167,"props":785,"children":787},{"className":786},[430],[788,791],{"type":44,"tag":433,"props":789,"children":790},{"disabled":435,"type":436},[],{"type":50,"value":792}," Exit criteria met: variant count correct, all bindings verified, screenshot looks right",{"type":44,"tag":298,"props":794,"children":796},{"id":795},"phase-4-integration-qa-final-pass",[797],{"type":50,"value":798},"Phase 4: INTEGRATION + QA (final pass)",{"type":44,"tag":163,"props":800,"children":802},{"className":801},[425],[803,812,821,830,839],{"type":44,"tag":167,"props":804,"children":806},{"className":805},[430],[807,810],{"type":44,"tag":433,"props":808,"children":809},{"disabled":435,"type":436},[],{"type":50,"value":811}," 4a. Finalize all Code Connect mappings",{"type":44,"tag":167,"props":813,"children":815},{"className":814},[430],[816,819],{"type":44,"tag":433,"props":817,"children":818},{"disabled":435,"type":436},[],{"type":50,"value":820}," 4b. Accessibility audit (contrast, min touch targets, focus visibility)",{"type":44,"tag":167,"props":822,"children":824},{"className":823},[430],[825,828],{"type":44,"tag":433,"props":826,"children":827},{"disabled":435,"type":436},[],{"type":50,"value":829}," 4c. Naming audit (no duplicates, no unnamed nodes, consistent casing)",{"type":44,"tag":167,"props":831,"children":833},{"className":832},[430],[834,837],{"type":44,"tag":433,"props":835,"children":836},{"disabled":435,"type":436},[],{"type":50,"value":838}," 4d. Unresolved bindings audit (no hardcoded fills\u002Fstrokes remaining)",{"type":44,"tag":167,"props":840,"children":842},{"className":841},[430],[843,846],{"type":44,"tag":433,"props":844,"children":845},{"disabled":435,"type":436},[],{"type":50,"value":847}," 4e. Final review screenshots of every page",{"type":44,"tag":142,"props":849,"children":850},{},[],{"type":44,"tag":146,"props":852,"children":854},{"id":853},"_3-critical-rules",[855],{"type":50,"value":856},"3. Critical Rules",{"type":44,"tag":53,"props":858,"children":859},{},[860,865],{"type":44,"tag":71,"props":861,"children":862},{},[863],{"type":50,"value":864},"Plugin API basics",{"type":50,"value":866}," (from use_figma skill — enforced here too):",{"type":44,"tag":163,"props":868,"children":869},{},[870,883,888,937,948,953],{"type":44,"tag":167,"props":871,"children":872},{},[873,875,881],{"type":50,"value":874},"Use ",{"type":44,"tag":59,"props":876,"children":878},{"className":877},[],[879],{"type":50,"value":880},"return",{"type":50,"value":882}," to send data back (auto-serialized). Do NOT wrap in IIFE or call closePlugin.",{"type":44,"tag":167,"props":884,"children":885},{},[886],{"type":50,"value":887},"Return ALL created\u002Fmutated node IDs in every return value",{"type":44,"tag":167,"props":889,"children":890},{},[891,893,899,901,906,908,913,915,921,923,936],{"type":50,"value":892},"Page context resets each call — always ",{"type":44,"tag":59,"props":894,"children":896},{"className":895},[],[897],{"type":50,"value":898},"await figma.setCurrentPageAsync(page)",{"type":50,"value":900}," at start. ",{"type":44,"tag":71,"props":902,"children":903},{},[904],{"type":50,"value":905},"Call it at most once per script",{"type":50,"value":907},": each component or doc page is its own ",{"type":44,"tag":59,"props":909,"children":911},{"className":910},[],[912],{"type":50,"value":64},{"type":50,"value":914}," call. Never loop over ",{"type":44,"tag":59,"props":916,"children":918},{"className":917},[],[919],{"type":50,"value":920},"figma.root.children",{"type":50,"value":922}," and switch pages inside a mutating script — split that work into one focused call per target page (see ",{"type":44,"tag":289,"props":924,"children":926},{"href":925},"..\u002Ffigma-use\u002Freferences\u002Fgotchas.md#set-current-page-once-per-use_figma-call--split-multi-page-work-across-calls",[927,929,934],{"type":50,"value":928},"figma-use → gotchas.md → Set current page once per ",{"type":44,"tag":59,"props":930,"children":932},{"className":931},[],[933],{"type":50,"value":64},{"type":50,"value":935}," call",{"type":50,"value":553},{"type":44,"tag":167,"props":938,"children":939},{},[940,946],{"type":44,"tag":59,"props":941,"children":943},{"className":942},[],[944],{"type":50,"value":945},"figma.notify()",{"type":50,"value":947}," throws — never use it",{"type":44,"tag":167,"props":949,"children":950},{},[951],{"type":50,"value":952},"Colors are 0–1 range, not 0–255",{"type":44,"tag":167,"props":954,"children":955},{},[956,958,964,966,972],{"type":50,"value":957},"Font MUST be loaded before any text write: ",{"type":44,"tag":59,"props":959,"children":961},{"className":960},[],[962],{"type":50,"value":963},"await figma.loadFontAsync({family, style})",{"type":50,"value":965},". Use ",{"type":44,"tag":59,"props":967,"children":969},{"className":968},[],[970],{"type":50,"value":971},"await figma.listAvailableFontsAsync()",{"type":50,"value":973}," to discover available fonts and verify exact style strings — if a load fails, query available fonts to find the correct name or a fallback.",{"type":44,"tag":53,"props":975,"children":976},{},[977,982],{"type":44,"tag":71,"props":978,"children":979},{},[980],{"type":50,"value":981},"Design system rules",{"type":50,"value":983},":",{"type":44,"tag":985,"props":986,"children":987},"ol",{},[988,998,1015,1033,1048,1113,1147,1165,1175,1185,1195,1205,1229,1246,1256],{"type":44,"tag":167,"props":989,"children":990},{},[991,996],{"type":44,"tag":71,"props":992,"children":993},{},[994],{"type":50,"value":995},"Variables BEFORE components",{"type":50,"value":997}," — components bind to variables. No token = no component.",{"type":44,"tag":167,"props":999,"children":1000},{},[1001,1006,1008,1013],{"type":44,"tag":71,"props":1002,"children":1003},{},[1004],{"type":50,"value":1005},"Inspect before creating",{"type":50,"value":1007}," — run read-only ",{"type":44,"tag":59,"props":1009,"children":1011},{"className":1010},[],[1012],{"type":50,"value":64},{"type":50,"value":1014}," to discover existing conventions. Match them.",{"type":44,"tag":167,"props":1016,"children":1017},{},[1018,1023,1025,1031],{"type":44,"tag":71,"props":1019,"children":1020},{},[1021],{"type":50,"value":1022},"One page per component",{"type":50,"value":1024}," ",{"type":44,"tag":1026,"props":1027,"children":1028},"em",{},[1029],{"type":50,"value":1030},"(default)",{"type":50,"value":1032}," — exception: tightly related families (e.g., Input + helpers) may share a page with clear section separation.",{"type":44,"tag":167,"props":1034,"children":1035},{},[1036,1041,1042,1046],{"type":44,"tag":71,"props":1037,"children":1038},{},[1039],{"type":50,"value":1040},"Bind visual properties to variables",{"type":50,"value":1024},{"type":44,"tag":1026,"props":1043,"children":1044},{},[1045],{"type":50,"value":1030},{"type":50,"value":1047}," — fills, strokes, padding, radius, gap. Exceptions: intentionally fixed geometry (icon pixel-grid sizes, static dividers).",{"type":44,"tag":167,"props":1049,"children":1050},{},[1051,1056,1058,1063,1065,1071,1073,1079,1081,1087,1089,1095,1097,1103,1105,1111],{"type":44,"tag":71,"props":1052,"children":1053},{},[1054],{"type":50,"value":1055},"Scopes on every variable",{"type":50,"value":1057}," — NEVER leave as ",{"type":44,"tag":59,"props":1059,"children":1061},{"className":1060},[],[1062],{"type":50,"value":551},{"type":50,"value":1064},". Background: ",{"type":44,"tag":59,"props":1066,"children":1068},{"className":1067},[],[1069],{"type":50,"value":1070},"FRAME_FILL, SHAPE_FILL",{"type":50,"value":1072},". Text: ",{"type":44,"tag":59,"props":1074,"children":1076},{"className":1075},[],[1077],{"type":50,"value":1078},"TEXT_FILL",{"type":50,"value":1080},". Border: ",{"type":44,"tag":59,"props":1082,"children":1084},{"className":1083},[],[1085],{"type":50,"value":1086},"STROKE_COLOR",{"type":50,"value":1088},". Spacing: ",{"type":44,"tag":59,"props":1090,"children":1092},{"className":1091},[],[1093],{"type":50,"value":1094},"GAP",{"type":50,"value":1096},". Radii: ",{"type":44,"tag":59,"props":1098,"children":1100},{"className":1099},[],[1101],{"type":50,"value":1102},"CORNER_RADIUS",{"type":50,"value":1104},". Primitives: ",{"type":44,"tag":59,"props":1106,"children":1108},{"className":1107},[],[1109],{"type":50,"value":1110},"[]",{"type":50,"value":1112}," (hidden).",{"type":44,"tag":167,"props":1114,"children":1115},{},[1116,1121,1123,1129,1131,1137,1139,1145],{"type":44,"tag":71,"props":1117,"children":1118},{},[1119],{"type":50,"value":1120},"Code syntax on every variable",{"type":50,"value":1122}," — WEB syntax MUST use the ",{"type":44,"tag":59,"props":1124,"children":1126},{"className":1125},[],[1127],{"type":50,"value":1128},"var()",{"type":50,"value":1130}," wrapper: ",{"type":44,"tag":59,"props":1132,"children":1134},{"className":1133},[],[1135],{"type":50,"value":1136},"var(--color-bg-primary)",{"type":50,"value":1138},", not ",{"type":44,"tag":59,"props":1140,"children":1142},{"className":1141},[],[1143],{"type":50,"value":1144},"--color-bg-primary",{"type":50,"value":1146},". Use the actual CSS variable name from the codebase. ANDROID\u002FiOS do NOT use a wrapper.",{"type":44,"tag":167,"props":1148,"children":1149},{},[1150,1155,1157,1163],{"type":44,"tag":71,"props":1151,"children":1152},{},[1153],{"type":50,"value":1154},"Alias semantics to primitives",{"type":50,"value":1156}," — ",{"type":44,"tag":59,"props":1158,"children":1160},{"className":1159},[],[1161],{"type":50,"value":1162},"{ type: 'VARIABLE_ALIAS', id: primitiveVar.id }",{"type":50,"value":1164},". Never duplicate raw values in semantic layer.",{"type":44,"tag":167,"props":1166,"children":1167},{},[1168,1173],{"type":44,"tag":71,"props":1169,"children":1170},{},[1171],{"type":50,"value":1172},"Position variants after combineAsVariants",{"type":50,"value":1174}," — they stack at (0,0). Manually grid-layout + resize.",{"type":44,"tag":167,"props":1176,"children":1177},{},[1178,1183],{"type":44,"tag":71,"props":1179,"children":1180},{},[1181],{"type":50,"value":1182},"INSTANCE_SWAP for icons",{"type":50,"value":1184}," — never create a variant per icon. Cap variant matrices: if Size × Style × State > 30 combinations, split into sub-component.",{"type":44,"tag":167,"props":1186,"children":1187},{},[1188,1193],{"type":44,"tag":71,"props":1189,"children":1190},{},[1191],{"type":50,"value":1192},"Deterministic naming",{"type":50,"value":1194}," — use consistent, unique node names for idempotent cleanup and resumability. Track created node IDs via return values and the state ledger.",{"type":44,"tag":167,"props":1196,"children":1197},{},[1198,1203],{"type":44,"tag":71,"props":1199,"children":1200},{},[1201],{"type":50,"value":1202},"No destructive cleanup",{"type":50,"value":1204}," — cleanup scripts identify nodes by name convention or returned IDs, not by guessing.",{"type":44,"tag":167,"props":1206,"children":1207},{},[1208,1213,1215,1220,1222,1227],{"type":44,"tag":71,"props":1209,"children":1210},{},[1211],{"type":50,"value":1212},"Validate before proceeding",{"type":50,"value":1214}," — never build on unvalidated work. ",{"type":44,"tag":59,"props":1216,"children":1218},{"className":1217},[],[1219],{"type":50,"value":765},{"type":50,"value":1221}," after every create, ",{"type":44,"tag":59,"props":1223,"children":1225},{"className":1224},[],[1226],{"type":50,"value":655},{"type":50,"value":1228}," after each component.",{"type":44,"tag":167,"props":1230,"children":1231},{},[1232,1244],{"type":44,"tag":71,"props":1233,"children":1234},{},[1235,1237,1242],{"type":50,"value":1236},"NEVER parallelize ",{"type":44,"tag":59,"props":1238,"children":1240},{"className":1239},[],[1241],{"type":50,"value":64},{"type":50,"value":1243}," calls",{"type":50,"value":1245}," — Figma state mutations must be strictly sequential. Even if your tool supports parallel calls, never run two use_figma calls simultaneously.",{"type":44,"tag":167,"props":1247,"children":1248},{},[1249,1254],{"type":44,"tag":71,"props":1250,"children":1251},{},[1252],{"type":50,"value":1253},"Never hallucinate Node IDs",{"type":50,"value":1255}," — always read IDs from the state ledger returned by previous calls. Never reconstruct or guess an ID from memory.",{"type":44,"tag":167,"props":1257,"children":1258},{},[1259,1264,1266,1272],{"type":44,"tag":71,"props":1260,"children":1261},{},[1262],{"type":50,"value":1263},"Use the helper scripts",{"type":50,"value":1265}," — embed scripts from ",{"type":44,"tag":59,"props":1267,"children":1269},{"className":1268},[],[1270],{"type":50,"value":1271},"scripts\u002F",{"type":50,"value":1273}," into your use_figma calls. Don't write 200-line inline scripts from scratch.",{"type":44,"tag":142,"props":1275,"children":1276},{},[],{"type":44,"tag":146,"props":1278,"children":1280},{"id":1279},"_4-state-management-required-for-long-workflows",[1281],{"type":50,"value":1282},"4. State Management (Required for Long Workflows)",{"type":44,"tag":1284,"props":1285,"children":1286},"blockquote",{},[1287],{"type":44,"tag":53,"props":1288,"children":1289},{},[1290,1292,1298],{"type":50,"value":1291},"Do not store workflow state on Figma objects. Use deterministic names for discovery and exact returned IDs in the state ledger. Put human-readable component purpose and usage guidance in the component or component-set ",{"type":44,"tag":59,"props":1293,"children":1295},{"className":1294},[],[1296],{"type":50,"value":1297},"description",{"type":50,"value":179},{"type":44,"tag":1300,"props":1301,"children":1302},"table",{},[1303,1327],{"type":44,"tag":1304,"props":1305,"children":1306},"thead",{},[1307],{"type":44,"tag":1308,"props":1309,"children":1310},"tr",{},[1311,1317,1322],{"type":44,"tag":1312,"props":1313,"children":1314},"th",{},[1315],{"type":50,"value":1316},"Entity type",{"type":44,"tag":1312,"props":1318,"children":1319},{},[1320],{"type":50,"value":1321},"Stable identity",{"type":44,"tag":1312,"props":1323,"children":1324},{},[1325],{"type":50,"value":1326},"How to check existence",{"type":44,"tag":1328,"props":1329,"children":1330},"tbody",{},[1331,1362,1390,1412],{"type":44,"tag":1308,"props":1332,"children":1333},{},[1334,1340,1345],{"type":44,"tag":1335,"props":1336,"children":1337},"td",{},[1338],{"type":50,"value":1339},"Pages and frames",{"type":44,"tag":1335,"props":1341,"children":1342},{},[1343],{"type":50,"value":1344},"Deterministic name + state-ledger ID",{"type":44,"tag":1335,"props":1346,"children":1347},{},[1348,1354,1356],{"type":44,"tag":59,"props":1349,"children":1351},{"className":1350},[],[1352],{"type":50,"value":1353},"figma.root.children.find(p => p.name === pageName)",{"type":50,"value":1355}," or ",{"type":44,"tag":59,"props":1357,"children":1359},{"className":1358},[],[1360],{"type":50,"value":1361},"await figma.getNodeByIdAsync(id)",{"type":44,"tag":1308,"props":1363,"children":1364},{},[1365,1370,1375],{"type":44,"tag":1335,"props":1366,"children":1367},{},[1368],{"type":50,"value":1369},"Components and component sets",{"type":44,"tag":1335,"props":1371,"children":1372},{},[1373],{"type":50,"value":1374},"Variant\u002Fset name + state-ledger ID",{"type":44,"tag":1335,"props":1376,"children":1377},{},[1378,1384,1385],{"type":44,"tag":59,"props":1379,"children":1381},{"className":1380},[],[1382],{"type":50,"value":1383},"page.findOne(n => n.name === name)",{"type":50,"value":1355},{"type":44,"tag":59,"props":1386,"children":1388},{"className":1387},[],[1389],{"type":50,"value":1361},{"type":44,"tag":1308,"props":1391,"children":1392},{},[1393,1398,1403],{"type":44,"tag":1335,"props":1394,"children":1395},{},[1396],{"type":50,"value":1397},"Variables",{"type":44,"tag":1335,"props":1399,"children":1400},{},[1401],{"type":50,"value":1402},"Name within collection",{"type":44,"tag":1335,"props":1404,"children":1405},{},[1406],{"type":44,"tag":59,"props":1407,"children":1409},{"className":1408},[],[1410],{"type":50,"value":1411},"(await figma.variables.getLocalVariablesAsync()).find(v => v.name === name && v.variableCollectionId === collId)",{"type":44,"tag":1308,"props":1413,"children":1414},{},[1415,1420,1425],{"type":44,"tag":1335,"props":1416,"children":1417},{},[1418],{"type":50,"value":1419},"Styles",{"type":44,"tag":1335,"props":1421,"children":1422},{},[1423],{"type":50,"value":1424},"Name",{"type":44,"tag":1335,"props":1426,"children":1427},{},[1428],{"type":44,"tag":59,"props":1429,"children":1431},{"className":1430},[],[1432],{"type":50,"value":1433},"getLocalTextStyles().find(s => s.name === name)",{"type":44,"tag":53,"props":1435,"children":1436},{},[1437],{"type":50,"value":1438},"Record every returned ID in the state ledger immediately after creation. Never use a fuzzy lookup to authorize deletion.",{"type":44,"tag":53,"props":1440,"children":1441},{},[1442,1447],{"type":44,"tag":71,"props":1443,"children":1444},{},[1445],{"type":50,"value":1446},"State persistence",{"type":50,"value":1448},": Do NOT rely solely on conversation context for the state ledger. Write it to disk:",{"type":44,"tag":1450,"props":1451,"children":1455},"pre",{"className":1452,"code":1454,"language":50},[1453],"language-text","\u002Ftmp\u002Fdesign-system-state-{RUN_ID}.json\n",[1456],{"type":44,"tag":59,"props":1457,"children":1459},{"__ignoreMap":1458},"",[1460],{"type":50,"value":1454},{"type":44,"tag":53,"props":1462,"children":1463},{},[1464],{"type":50,"value":1465},"Re-read this file at the start of every turn. In long workflows, conversation context will be truncated — the file is the source of truth.",{"type":44,"tag":53,"props":1467,"children":1468},{},[1469],{"type":50,"value":1470},"Maintain a state ledger tracking:",{"type":44,"tag":1450,"props":1472,"children":1476},{"className":1473,"code":1474,"language":1475,"meta":1458,"style":1458},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"runId\": \"ds-build-2024-001\",\n  \"phase\": \"phase3\",\n  \"step\": \"component-button\",\n  \"entities\": {\n    \"collections\": { \"primitives\": \"id:...\", \"color\": \"id:...\" },\n    \"variables\": { \"color\u002Fbg\u002Fprimary\": \"id:...\", \"spacing\u002Fsm\": \"id:...\" },\n    \"pages\": { \"Cover\": \"id:...\", \"Button\": \"id:...\" },\n    \"components\": { \"Button\": \"id:...\" }\n  },\n  \"pendingValidations\": [\"Button:screenshot\"],\n  \"completedSteps\": [\"phase0\", \"phase1\", \"phase2\", \"component-avatar\"]\n}\n","json",[1477],{"type":44,"tag":59,"props":1478,"children":1479},{"__ignoreMap":1458},[1480,1492,1536,1574,1612,1638,1736,1827,1918,1976,1985,2029,2123],{"type":44,"tag":1481,"props":1482,"children":1485},"span",{"class":1483,"line":1484},"line",1,[1486],{"type":44,"tag":1481,"props":1487,"children":1489},{"style":1488},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[1490],{"type":50,"value":1491},"{\n",{"type":44,"tag":1481,"props":1493,"children":1495},{"class":1483,"line":1494},2,[1496,1501,1507,1512,1516,1521,1527,1531],{"type":44,"tag":1481,"props":1497,"children":1498},{"style":1488},[1499],{"type":50,"value":1500},"  \"",{"type":44,"tag":1481,"props":1502,"children":1504},{"style":1503},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1505],{"type":50,"value":1506},"runId",{"type":44,"tag":1481,"props":1508,"children":1509},{"style":1488},[1510],{"type":50,"value":1511},"\"",{"type":44,"tag":1481,"props":1513,"children":1514},{"style":1488},[1515],{"type":50,"value":983},{"type":44,"tag":1481,"props":1517,"children":1518},{"style":1488},[1519],{"type":50,"value":1520}," \"",{"type":44,"tag":1481,"props":1522,"children":1524},{"style":1523},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[1525],{"type":50,"value":1526},"ds-build-2024-001",{"type":44,"tag":1481,"props":1528,"children":1529},{"style":1488},[1530],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1532,"children":1533},{"style":1488},[1534],{"type":50,"value":1535},",\n",{"type":44,"tag":1481,"props":1537,"children":1539},{"class":1483,"line":1538},3,[1540,1544,1549,1553,1557,1561,1566,1570],{"type":44,"tag":1481,"props":1541,"children":1542},{"style":1488},[1543],{"type":50,"value":1500},{"type":44,"tag":1481,"props":1545,"children":1546},{"style":1503},[1547],{"type":50,"value":1548},"phase",{"type":44,"tag":1481,"props":1550,"children":1551},{"style":1488},[1552],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1554,"children":1555},{"style":1488},[1556],{"type":50,"value":983},{"type":44,"tag":1481,"props":1558,"children":1559},{"style":1488},[1560],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1562,"children":1563},{"style":1523},[1564],{"type":50,"value":1565},"phase3",{"type":44,"tag":1481,"props":1567,"children":1568},{"style":1488},[1569],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1571,"children":1572},{"style":1488},[1573],{"type":50,"value":1535},{"type":44,"tag":1481,"props":1575,"children":1577},{"class":1483,"line":1576},4,[1578,1582,1587,1591,1595,1599,1604,1608],{"type":44,"tag":1481,"props":1579,"children":1580},{"style":1488},[1581],{"type":50,"value":1500},{"type":44,"tag":1481,"props":1583,"children":1584},{"style":1503},[1585],{"type":50,"value":1586},"step",{"type":44,"tag":1481,"props":1588,"children":1589},{"style":1488},[1590],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1592,"children":1593},{"style":1488},[1594],{"type":50,"value":983},{"type":44,"tag":1481,"props":1596,"children":1597},{"style":1488},[1598],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1600,"children":1601},{"style":1523},[1602],{"type":50,"value":1603},"component-button",{"type":44,"tag":1481,"props":1605,"children":1606},{"style":1488},[1607],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1609,"children":1610},{"style":1488},[1611],{"type":50,"value":1535},{"type":44,"tag":1481,"props":1613,"children":1615},{"class":1483,"line":1614},5,[1616,1620,1625,1629,1633],{"type":44,"tag":1481,"props":1617,"children":1618},{"style":1488},[1619],{"type":50,"value":1500},{"type":44,"tag":1481,"props":1621,"children":1622},{"style":1503},[1623],{"type":50,"value":1624},"entities",{"type":44,"tag":1481,"props":1626,"children":1627},{"style":1488},[1628],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1630,"children":1631},{"style":1488},[1632],{"type":50,"value":983},{"type":44,"tag":1481,"props":1634,"children":1635},{"style":1488},[1636],{"type":50,"value":1637}," {\n",{"type":44,"tag":1481,"props":1639,"children":1641},{"class":1483,"line":1640},6,[1642,1647,1653,1657,1661,1666,1670,1676,1680,1684,1688,1693,1697,1702,1706,1711,1715,1719,1723,1727,1731],{"type":44,"tag":1481,"props":1643,"children":1644},{"style":1488},[1645],{"type":50,"value":1646},"    \"",{"type":44,"tag":1481,"props":1648,"children":1650},{"style":1649},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1651],{"type":50,"value":1652},"collections",{"type":44,"tag":1481,"props":1654,"children":1655},{"style":1488},[1656],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1658,"children":1659},{"style":1488},[1660],{"type":50,"value":983},{"type":44,"tag":1481,"props":1662,"children":1663},{"style":1488},[1664],{"type":50,"value":1665}," {",{"type":44,"tag":1481,"props":1667,"children":1668},{"style":1488},[1669],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1671,"children":1673},{"style":1672},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1674],{"type":50,"value":1675},"primitives",{"type":44,"tag":1481,"props":1677,"children":1678},{"style":1488},[1679],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1681,"children":1682},{"style":1488},[1683],{"type":50,"value":983},{"type":44,"tag":1481,"props":1685,"children":1686},{"style":1488},[1687],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1689,"children":1690},{"style":1523},[1691],{"type":50,"value":1692},"id:...",{"type":44,"tag":1481,"props":1694,"children":1695},{"style":1488},[1696],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1698,"children":1699},{"style":1488},[1700],{"type":50,"value":1701},",",{"type":44,"tag":1481,"props":1703,"children":1704},{"style":1488},[1705],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1707,"children":1708},{"style":1672},[1709],{"type":50,"value":1710},"color",{"type":44,"tag":1481,"props":1712,"children":1713},{"style":1488},[1714],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1716,"children":1717},{"style":1488},[1718],{"type":50,"value":983},{"type":44,"tag":1481,"props":1720,"children":1721},{"style":1488},[1722],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1724,"children":1725},{"style":1523},[1726],{"type":50,"value":1692},{"type":44,"tag":1481,"props":1728,"children":1729},{"style":1488},[1730],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1732,"children":1733},{"style":1488},[1734],{"type":50,"value":1735}," },\n",{"type":44,"tag":1481,"props":1737,"children":1739},{"class":1483,"line":1738},7,[1740,1744,1749,1753,1757,1761,1765,1770,1774,1778,1782,1786,1790,1794,1798,1803,1807,1811,1815,1819,1823],{"type":44,"tag":1481,"props":1741,"children":1742},{"style":1488},[1743],{"type":50,"value":1646},{"type":44,"tag":1481,"props":1745,"children":1746},{"style":1649},[1747],{"type":50,"value":1748},"variables",{"type":44,"tag":1481,"props":1750,"children":1751},{"style":1488},[1752],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1754,"children":1755},{"style":1488},[1756],{"type":50,"value":983},{"type":44,"tag":1481,"props":1758,"children":1759},{"style":1488},[1760],{"type":50,"value":1665},{"type":44,"tag":1481,"props":1762,"children":1763},{"style":1488},[1764],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1766,"children":1767},{"style":1672},[1768],{"type":50,"value":1769},"color\u002Fbg\u002Fprimary",{"type":44,"tag":1481,"props":1771,"children":1772},{"style":1488},[1773],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1775,"children":1776},{"style":1488},[1777],{"type":50,"value":983},{"type":44,"tag":1481,"props":1779,"children":1780},{"style":1488},[1781],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1783,"children":1784},{"style":1523},[1785],{"type":50,"value":1692},{"type":44,"tag":1481,"props":1787,"children":1788},{"style":1488},[1789],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1791,"children":1792},{"style":1488},[1793],{"type":50,"value":1701},{"type":44,"tag":1481,"props":1795,"children":1796},{"style":1488},[1797],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1799,"children":1800},{"style":1672},[1801],{"type":50,"value":1802},"spacing\u002Fsm",{"type":44,"tag":1481,"props":1804,"children":1805},{"style":1488},[1806],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1808,"children":1809},{"style":1488},[1810],{"type":50,"value":983},{"type":44,"tag":1481,"props":1812,"children":1813},{"style":1488},[1814],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1816,"children":1817},{"style":1523},[1818],{"type":50,"value":1692},{"type":44,"tag":1481,"props":1820,"children":1821},{"style":1488},[1822],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1824,"children":1825},{"style":1488},[1826],{"type":50,"value":1735},{"type":44,"tag":1481,"props":1828,"children":1830},{"class":1483,"line":1829},8,[1831,1835,1840,1844,1848,1852,1856,1861,1865,1869,1873,1877,1881,1885,1889,1894,1898,1902,1906,1910,1914],{"type":44,"tag":1481,"props":1832,"children":1833},{"style":1488},[1834],{"type":50,"value":1646},{"type":44,"tag":1481,"props":1836,"children":1837},{"style":1649},[1838],{"type":50,"value":1839},"pages",{"type":44,"tag":1481,"props":1841,"children":1842},{"style":1488},[1843],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1845,"children":1846},{"style":1488},[1847],{"type":50,"value":983},{"type":44,"tag":1481,"props":1849,"children":1850},{"style":1488},[1851],{"type":50,"value":1665},{"type":44,"tag":1481,"props":1853,"children":1854},{"style":1488},[1855],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1857,"children":1858},{"style":1672},[1859],{"type":50,"value":1860},"Cover",{"type":44,"tag":1481,"props":1862,"children":1863},{"style":1488},[1864],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1866,"children":1867},{"style":1488},[1868],{"type":50,"value":983},{"type":44,"tag":1481,"props":1870,"children":1871},{"style":1488},[1872],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1874,"children":1875},{"style":1523},[1876],{"type":50,"value":1692},{"type":44,"tag":1481,"props":1878,"children":1879},{"style":1488},[1880],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1882,"children":1883},{"style":1488},[1884],{"type":50,"value":1701},{"type":44,"tag":1481,"props":1886,"children":1887},{"style":1488},[1888],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1890,"children":1891},{"style":1672},[1892],{"type":50,"value":1893},"Button",{"type":44,"tag":1481,"props":1895,"children":1896},{"style":1488},[1897],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1899,"children":1900},{"style":1488},[1901],{"type":50,"value":983},{"type":44,"tag":1481,"props":1903,"children":1904},{"style":1488},[1905],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1907,"children":1908},{"style":1523},[1909],{"type":50,"value":1692},{"type":44,"tag":1481,"props":1911,"children":1912},{"style":1488},[1913],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1915,"children":1916},{"style":1488},[1917],{"type":50,"value":1735},{"type":44,"tag":1481,"props":1919,"children":1921},{"class":1483,"line":1920},9,[1922,1926,1931,1935,1939,1943,1947,1951,1955,1959,1963,1967,1971],{"type":44,"tag":1481,"props":1923,"children":1924},{"style":1488},[1925],{"type":50,"value":1646},{"type":44,"tag":1481,"props":1927,"children":1928},{"style":1649},[1929],{"type":50,"value":1930},"components",{"type":44,"tag":1481,"props":1932,"children":1933},{"style":1488},[1934],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1936,"children":1937},{"style":1488},[1938],{"type":50,"value":983},{"type":44,"tag":1481,"props":1940,"children":1941},{"style":1488},[1942],{"type":50,"value":1665},{"type":44,"tag":1481,"props":1944,"children":1945},{"style":1488},[1946],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1948,"children":1949},{"style":1672},[1950],{"type":50,"value":1893},{"type":44,"tag":1481,"props":1952,"children":1953},{"style":1488},[1954],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1956,"children":1957},{"style":1488},[1958],{"type":50,"value":983},{"type":44,"tag":1481,"props":1960,"children":1961},{"style":1488},[1962],{"type":50,"value":1520},{"type":44,"tag":1481,"props":1964,"children":1965},{"style":1523},[1966],{"type":50,"value":1692},{"type":44,"tag":1481,"props":1968,"children":1969},{"style":1488},[1970],{"type":50,"value":1511},{"type":44,"tag":1481,"props":1972,"children":1973},{"style":1488},[1974],{"type":50,"value":1975}," }\n",{"type":44,"tag":1481,"props":1977,"children":1979},{"class":1483,"line":1978},10,[1980],{"type":44,"tag":1481,"props":1981,"children":1982},{"style":1488},[1983],{"type":50,"value":1984},"  },\n",{"type":44,"tag":1481,"props":1986,"children":1988},{"class":1483,"line":1987},11,[1989,1993,1998,2002,2006,2011,2015,2020,2024],{"type":44,"tag":1481,"props":1990,"children":1991},{"style":1488},[1992],{"type":50,"value":1500},{"type":44,"tag":1481,"props":1994,"children":1995},{"style":1503},[1996],{"type":50,"value":1997},"pendingValidations",{"type":44,"tag":1481,"props":1999,"children":2000},{"style":1488},[2001],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2003,"children":2004},{"style":1488},[2005],{"type":50,"value":983},{"type":44,"tag":1481,"props":2007,"children":2008},{"style":1488},[2009],{"type":50,"value":2010}," [",{"type":44,"tag":1481,"props":2012,"children":2013},{"style":1488},[2014],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2016,"children":2017},{"style":1523},[2018],{"type":50,"value":2019},"Button:screenshot",{"type":44,"tag":1481,"props":2021,"children":2022},{"style":1488},[2023],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2025,"children":2026},{"style":1488},[2027],{"type":50,"value":2028},"],\n",{"type":44,"tag":1481,"props":2030,"children":2032},{"class":1483,"line":2031},12,[2033,2037,2042,2046,2050,2054,2058,2063,2067,2071,2075,2080,2084,2088,2092,2097,2101,2105,2109,2114,2118],{"type":44,"tag":1481,"props":2034,"children":2035},{"style":1488},[2036],{"type":50,"value":1500},{"type":44,"tag":1481,"props":2038,"children":2039},{"style":1503},[2040],{"type":50,"value":2041},"completedSteps",{"type":44,"tag":1481,"props":2043,"children":2044},{"style":1488},[2045],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2047,"children":2048},{"style":1488},[2049],{"type":50,"value":983},{"type":44,"tag":1481,"props":2051,"children":2052},{"style":1488},[2053],{"type":50,"value":2010},{"type":44,"tag":1481,"props":2055,"children":2056},{"style":1488},[2057],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2059,"children":2060},{"style":1523},[2061],{"type":50,"value":2062},"phase0",{"type":44,"tag":1481,"props":2064,"children":2065},{"style":1488},[2066],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2068,"children":2069},{"style":1488},[2070],{"type":50,"value":1701},{"type":44,"tag":1481,"props":2072,"children":2073},{"style":1488},[2074],{"type":50,"value":1520},{"type":44,"tag":1481,"props":2076,"children":2077},{"style":1523},[2078],{"type":50,"value":2079},"phase1",{"type":44,"tag":1481,"props":2081,"children":2082},{"style":1488},[2083],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2085,"children":2086},{"style":1488},[2087],{"type":50,"value":1701},{"type":44,"tag":1481,"props":2089,"children":2090},{"style":1488},[2091],{"type":50,"value":1520},{"type":44,"tag":1481,"props":2093,"children":2094},{"style":1523},[2095],{"type":50,"value":2096},"phase2",{"type":44,"tag":1481,"props":2098,"children":2099},{"style":1488},[2100],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2102,"children":2103},{"style":1488},[2104],{"type":50,"value":1701},{"type":44,"tag":1481,"props":2106,"children":2107},{"style":1488},[2108],{"type":50,"value":1520},{"type":44,"tag":1481,"props":2110,"children":2111},{"style":1523},[2112],{"type":50,"value":2113},"component-avatar",{"type":44,"tag":1481,"props":2115,"children":2116},{"style":1488},[2117],{"type":50,"value":1511},{"type":44,"tag":1481,"props":2119,"children":2120},{"style":1488},[2121],{"type":50,"value":2122},"]\n",{"type":44,"tag":1481,"props":2124,"children":2126},{"class":1483,"line":2125},13,[2127],{"type":44,"tag":1481,"props":2128,"children":2129},{"style":1488},[2130],{"type":50,"value":2131},"}\n",{"type":44,"tag":53,"props":2133,"children":2134},{},[2135,2140],{"type":44,"tag":71,"props":2136,"children":2137},{},[2138],{"type":50,"value":2139},"Idempotency check",{"type":50,"value":2141}," before every create: query by name + state ledger ID. If exists, skip or update — never duplicate.",{"type":44,"tag":53,"props":2143,"children":2144},{},[2145,2150,2152,2157,2159,2165],{"type":44,"tag":71,"props":2146,"children":2147},{},[2148],{"type":50,"value":2149},"Resume protocol",{"type":50,"value":2151},": at session start or after context truncation, run a read-only ",{"type":44,"tag":59,"props":2153,"children":2155},{"className":2154},[],[2156],{"type":50,"value":64},{"type":50,"value":2158}," to scan all pages, components, variables, and styles by name to reconstruct the ",{"type":44,"tag":59,"props":2160,"children":2162},{"className":2161},[],[2163],{"type":50,"value":2164},"{key → id}",{"type":50,"value":2166}," map. Then re-read the state file from disk if available.",{"type":44,"tag":53,"props":2168,"children":2169},{},[2170,2175],{"type":44,"tag":71,"props":2171,"children":2172},{},[2173],{"type":50,"value":2174},"Continuation prompt",{"type":50,"value":2176}," (give this to the user when resuming in a new chat):",{"type":44,"tag":1284,"props":2178,"children":2179},{},[2180],{"type":44,"tag":53,"props":2181,"children":2182},{},[2183],{"type":50,"value":2184},"\"I'm continuing a design system build. Run ID: {RUN_ID}. Load the figma-generate-library skill and resume from the last completed step.\"",{"type":44,"tag":142,"props":2186,"children":2187},{},[],{"type":44,"tag":146,"props":2189,"children":2191},{"id":2190},"_5-library-discovery-and-search_design_system-reuse-decision-matrix",[2192],{"type":50,"value":2193},"5. Library Discovery and search_design_system — Reuse Decision Matrix",{"type":44,"tag":53,"props":2195,"children":2196},{},[2197],{"type":50,"value":2198},"Search FIRST in Phase 0, then again immediately before each component creation.",{"type":44,"tag":53,"props":2200,"children":2201},{},[2202,2213],{"type":44,"tag":71,"props":2203,"children":2204},{},[2205,2207],{"type":50,"value":2206},"Start with ",{"type":44,"tag":59,"props":2208,"children":2210},{"className":2209},[],[2211],{"type":50,"value":2212},"get_libraries",{"type":50,"value":2214}," to understand what libraries are available before searching blindly:",{"type":44,"tag":1450,"props":2216,"children":2219},{"className":2217,"code":2218,"language":50},[1453],"\u002F\u002F Discover all libraries accessible to the file\nget_libraries({ fileKey })\n\u002F\u002F Returns:\n\u002F\u002F   libraries_added_to_file: [{ name, libraryKey, description, source }, ...]\n\u002F\u002F   libraries_available_to_add: [{ name, libraryKey, description, source }, ...]\n\u002F\u002F   libraries_available_to_add_next_offset: number | null\n",[2220],{"type":44,"tag":59,"props":2221,"children":2222},{"__ignoreMap":1458},[2223],{"type":50,"value":2218},{"type":44,"tag":53,"props":2225,"children":2226},{},[2227,2229,2235,2237,2243],{"type":50,"value":2228},"Use the returned ",{"type":44,"tag":59,"props":2230,"children":2232},{"className":2231},[],[2233],{"type":50,"value":2234},"libraryKey",{"type":50,"value":2236}," values to scope searches to specific libraries via ",{"type":44,"tag":59,"props":2238,"children":2240},{"className":2239},[],[2241],{"type":50,"value":2242},"includeLibraryKeys",{"type":50,"value":2244},". This avoids noisy results when many libraries are available.",{"type":44,"tag":53,"props":2246,"children":2247},{},[2248,2250,2256,2258,2263,2265,2271],{"type":50,"value":2249},"If ",{"type":44,"tag":59,"props":2251,"children":2253},{"className":2252},[],[2254],{"type":50,"value":2255},"libraries_available_to_add_next_offset",{"type":50,"value":2257}," is non-null, more org libraries are available — call ",{"type":44,"tag":59,"props":2259,"children":2261},{"className":2260},[],[2262],{"type":50,"value":2212},{"type":50,"value":2264}," again with ",{"type":44,"tag":59,"props":2266,"children":2268},{"className":2267},[],[2269],{"type":50,"value":2270},"offset",{"type":50,"value":2272}," set to that value. Org libraries page in batches of 20; community UI kits only appear on the first page.",{"type":44,"tag":1450,"props":2274,"children":2277},{"className":2275,"code":2276,"language":50},[1453],"\u002F\u002F Search across all libraries (default)\nsearch_design_system({ query, fileKey, includeComponents: true, includeVariables: true, includeStyles: true })\n\n\u002F\u002F Search within a specific library only\nsearch_design_system({ query, fileKey, includeLibraryKeys: [\"lk-abc123...\"], includeComponents: true })\n",[2278],{"type":44,"tag":59,"props":2279,"children":2280},{"__ignoreMap":1458},[2281],{"type":50,"value":2276},{"type":44,"tag":53,"props":2283,"children":2284},{},[2285,2290],{"type":44,"tag":71,"props":2286,"children":2287},{},[2288],{"type":50,"value":2289},"Reuse if",{"type":50,"value":2291}," all of these are true:",{"type":44,"tag":163,"props":2293,"children":2294},{},[2295,2300,2305,2310],{"type":44,"tag":167,"props":2296,"children":2297},{},[2298],{"type":50,"value":2299},"Component property API matches your needs (same variant axes, compatible types)",{"type":44,"tag":167,"props":2301,"children":2302},{},[2303],{"type":50,"value":2304},"Token binding model is compatible (uses same or aliasable variables)",{"type":44,"tag":167,"props":2306,"children":2307},{},[2308],{"type":50,"value":2309},"Naming conventions match the target file",{"type":44,"tag":167,"props":2311,"children":2312},{},[2313],{"type":50,"value":2314},"Component is editable (not locked in a remote library you don't own)",{"type":44,"tag":53,"props":2316,"children":2317},{},[2318,2323],{"type":44,"tag":71,"props":2319,"children":2320},{},[2321],{"type":50,"value":2322},"Rebuild if",{"type":50,"value":2324}," any of these:",{"type":44,"tag":163,"props":2326,"children":2327},{},[2328,2333,2338],{"type":44,"tag":167,"props":2329,"children":2330},{},[2331],{"type":50,"value":2332},"API incompatibility (different property names, wrong variant model)",{"type":44,"tag":167,"props":2334,"children":2335},{},[2336],{"type":50,"value":2337},"Token model incompatible (hardcoded values, different variable schema)",{"type":44,"tag":167,"props":2339,"children":2340},{},[2341],{"type":50,"value":2342},"Ownership issue (can't modify the library)",{"type":44,"tag":53,"props":2344,"children":2345},{},[2346,2351],{"type":44,"tag":71,"props":2347,"children":2348},{},[2349],{"type":50,"value":2350},"Wrap if",{"type":50,"value":2352}," visual match but API incompatible:",{"type":44,"tag":163,"props":2354,"children":2355},{},[2356,2361],{"type":44,"tag":167,"props":2357,"children":2358},{},[2359],{"type":50,"value":2360},"Import the library component as a nested instance inside a new wrapper component",{"type":44,"tag":167,"props":2362,"children":2363},{},[2364],{"type":50,"value":2365},"Expose a clean API on the wrapper",{"type":44,"tag":53,"props":2367,"children":2368},{},[2369,2374,2376,2382],{"type":44,"tag":71,"props":2370,"children":2371},{},[2372],{"type":50,"value":2373},"Priority order",{"type":50,"value":2375},": local existing → subscribed library import → unsubscribed UI Kit library from ",{"type":44,"tag":59,"props":2377,"children":2379},{"className":2378},[],[2380],{"type":50,"value":2381},"libraries_available_to_add",{"type":50,"value":2383}," (icons especially) → create new.",{"type":44,"tag":142,"props":2385,"children":2386},{},[],{"type":44,"tag":146,"props":2388,"children":2390},{"id":2389},"_6-decision-forks",[2391],{"type":50,"value":2392},"6. Decision Forks",{"type":44,"tag":53,"props":2394,"children":2395},{},[2396],{"type":50,"value":2397},"Ask the user when paths fork — when two or more reasonable answers exist and no clear winner comes from the codebase, the Figma file, or the locked plan. Don't silently default. Present each option with its tradeoff and your recommendation; pick only after the user steers.",{"type":44,"tag":53,"props":2399,"children":2400},{},[2401,2406],{"type":44,"tag":71,"props":2402,"children":2403},{},[2404],{"type":50,"value":2405},"When NOT to ask:",{"type":50,"value":2407}," if exactly one path is clearly correct from the source of truth (code, Figma file, agreed plan), take it. This section is for genuine ambiguity, not for offloading every decision.",{"type":44,"tag":1300,"props":2409,"children":2410},{},[2411,2432],{"type":44,"tag":1304,"props":2412,"children":2413},{},[2414],{"type":44,"tag":1308,"props":2415,"children":2416},{},[2417,2422,2427],{"type":44,"tag":1312,"props":2418,"children":2419},{},[2420],{"type":50,"value":2421},"Fork situation",{"type":44,"tag":1312,"props":2423,"children":2424},{},[2425],{"type":50,"value":2426},"What to surface",{"type":44,"tag":1312,"props":2428,"children":2429},{},[2430],{"type":50,"value":2431},"Example ask",{"type":44,"tag":1328,"props":2433,"children":2434},{},[2435,2469,2502],{"type":44,"tag":1308,"props":2436,"children":2437},{},[2438,2443,2448],{"type":44,"tag":1335,"props":2439,"children":2440},{},[2441],{"type":50,"value":2442},"Code ≠ Figma on a token, component, or value",{"type":44,"tag":1335,"props":2444,"children":2445},{},[2446],{"type":50,"value":2447},"Both versions side by side, with provenance (file\u002Fline vs node)",{"type":44,"tag":1335,"props":2449,"children":2450},{},[2451,2453,2459,2461,2467],{"type":50,"value":2452},"\"Code says ",{"type":44,"tag":59,"props":2454,"children":2456},{"className":2455},[],[2457],{"type":50,"value":2458},"--color-bg-primary = #FFFFFF",{"type":50,"value":2460},", Figma has ",{"type":44,"tag":59,"props":2462,"children":2464},{"className":2463},[],[2465],{"type":50,"value":2466},"color\u002Fbg\u002Fprimary = #FAFAFA",{"type":50,"value":2468},". Which wins?\"",{"type":44,"tag":1308,"props":2470,"children":2471},{},[2472,2477,2482],{"type":44,"tag":1335,"props":2473,"children":2474},{},[2475],{"type":50,"value":2476},"Subscribed library has a close-but-not-exact match",{"type":44,"tag":1335,"props":2478,"children":2479},{},[2480],{"type":50,"value":2481},"Library component summary + gap list",{"type":44,"tag":1335,"props":2483,"children":2484},{},[2485,2487,2492,2494,2500],{"type":50,"value":2486},"\"Library has ",{"type":44,"tag":59,"props":2488,"children":2490},{"className":2489},[],[2491],{"type":50,"value":1893},{"type":50,"value":2493}," with no ",{"type":44,"tag":59,"props":2495,"children":2497},{"className":2496},[],[2498],{"type":50,"value":2499},"loading",{"type":50,"value":2501}," state. Reuse + wrap locally, or rebuild from scratch?\"",{"type":44,"tag":1308,"props":2503,"children":2504},{},[2505,2510,2515],{"type":44,"tag":1335,"props":2506,"children":2507},{},[2508],{"type":50,"value":2509},"Scope ambiguity at plan-lock (0d)",{"type":44,"tag":1335,"props":2511,"children":2512},{},[2513],{"type":50,"value":2514},"What's clearly in, what's clearly out, what's ambiguous",{"type":44,"tag":1335,"props":2516,"children":2517},{},[2518,2520,2525,2527,2533,2535,2541],{"type":50,"value":2519},"\"Spec lists ",{"type":44,"tag":59,"props":2521,"children":2523},{"className":2522},[],[2524],{"type":50,"value":1893},{"type":50,"value":2526}," and ",{"type":44,"tag":59,"props":2528,"children":2530},{"className":2529},[],[2531],{"type":50,"value":2532},"Input",{"type":50,"value":2534},"; ",{"type":44,"tag":59,"props":2536,"children":2538},{"className":2537},[],[2539],{"type":50,"value":2540},"Field",{"type":50,"value":2542}," is referenced but not defined. In or out of v1?\"",{"type":44,"tag":53,"props":2544,"children":2545},{},[2546,2551],{"type":44,"tag":71,"props":2547,"children":2548},{},[2549],{"type":50,"value":2550},"If the user rejects an option you already built on:",{"type":50,"value":2552}," fix before moving on. Never build on rejected work.",{"type":44,"tag":142,"props":2554,"children":2555},{},[],{"type":44,"tag":146,"props":2557,"children":2559},{"id":2558},"_7-naming-conventions",[2560],{"type":50,"value":2561},"7. Naming Conventions",{"type":44,"tag":53,"props":2563,"children":2564},{},[2565],{"type":50,"value":2566},"Match existing file conventions. If starting fresh:",{"type":44,"tag":53,"props":2568,"children":2569},{},[2570,2574],{"type":44,"tag":71,"props":2571,"children":2572},{},[2573],{"type":50,"value":1397},{"type":50,"value":2575}," (slash-separated):",{"type":44,"tag":1450,"props":2577,"children":2580},{"className":2578,"code":2579,"language":50},[1453],"color\u002Fbg\u002Fprimary     color\u002Ftext\u002Fsecondary    color\u002Fborder\u002Fdefault\nspacing\u002Fxs  spacing\u002Fsm  spacing\u002Fmd  spacing\u002Flg  spacing\u002Fxl  spacing\u002F2xl\nradius\u002Fnone  radius\u002Fsm  radius\u002Fmd  radius\u002Flg  radius\u002Ffull\ntypography\u002Fbody\u002Ffont-size    typography\u002Fheading\u002Fline-height\n",[2581],{"type":44,"tag":59,"props":2582,"children":2583},{"__ignoreMap":1458},[2584],{"type":50,"value":2579},{"type":44,"tag":53,"props":2586,"children":2587},{},[2588,2593,2595,2601,2603,2609,2610,2616,2617],{"type":44,"tag":71,"props":2589,"children":2590},{},[2591],{"type":50,"value":2592},"Primitives",{"type":50,"value":2594},": ",{"type":44,"tag":59,"props":2596,"children":2598},{"className":2597},[],[2599],{"type":50,"value":2600},"blue\u002F50",{"type":50,"value":2602}," → ",{"type":44,"tag":59,"props":2604,"children":2606},{"className":2605},[],[2607],{"type":50,"value":2608},"blue\u002F900",{"type":50,"value":336},{"type":44,"tag":59,"props":2611,"children":2613},{"className":2612},[],[2614],{"type":50,"value":2615},"gray\u002F50",{"type":50,"value":2602},{"type":44,"tag":59,"props":2618,"children":2620},{"className":2619},[],[2621],{"type":50,"value":2622},"gray\u002F900",{"type":44,"tag":53,"props":2624,"children":2625},{},[2626,2631,2632,2637,2638,2643,2644,2650,2651,2657,2658,2664,2665,2671,2672],{"type":44,"tag":71,"props":2627,"children":2628},{},[2629],{"type":50,"value":2630},"Component names",{"type":50,"value":2594},{"type":44,"tag":59,"props":2633,"children":2635},{"className":2634},[],[2636],{"type":50,"value":1893},{"type":50,"value":336},{"type":44,"tag":59,"props":2639,"children":2641},{"className":2640},[],[2642],{"type":50,"value":2532},{"type":50,"value":336},{"type":44,"tag":59,"props":2645,"children":2647},{"className":2646},[],[2648],{"type":50,"value":2649},"Card",{"type":50,"value":336},{"type":44,"tag":59,"props":2652,"children":2654},{"className":2653},[],[2655],{"type":50,"value":2656},"Avatar",{"type":50,"value":336},{"type":44,"tag":59,"props":2659,"children":2661},{"className":2660},[],[2662],{"type":50,"value":2663},"Badge",{"type":50,"value":336},{"type":44,"tag":59,"props":2666,"children":2668},{"className":2667},[],[2669],{"type":50,"value":2670},"Checkbox",{"type":50,"value":336},{"type":44,"tag":59,"props":2673,"children":2675},{"className":2674},[],[2676],{"type":50,"value":2677},"Toggle",{"type":44,"tag":53,"props":2679,"children":2680},{},[2681,2686,2687,2693,2695],{"type":44,"tag":71,"props":2682,"children":2683},{},[2684],{"type":50,"value":2685},"Variant names",{"type":50,"value":2594},{"type":44,"tag":59,"props":2688,"children":2690},{"className":2689},[],[2691],{"type":50,"value":2692},"Property=Value, Property=Value",{"type":50,"value":2694}," — e.g., ",{"type":44,"tag":59,"props":2696,"children":2698},{"className":2697},[],[2699],{"type":50,"value":2700},"Size=Medium, Style=Primary, State=Default",{"type":44,"tag":53,"props":2702,"children":2703},{},[2704,2709,2710,2716,2718],{"type":44,"tag":71,"props":2705,"children":2706},{},[2707],{"type":50,"value":2708},"Page separators",{"type":50,"value":2594},{"type":44,"tag":59,"props":2711,"children":2713},{"className":2712},[],[2714],{"type":50,"value":2715},"---",{"type":50,"value":2717}," (most common) or ",{"type":44,"tag":59,"props":2719,"children":2721},{"className":2720},[],[2722],{"type":50,"value":2723},"——— COMPONENTS ———",{"type":44,"tag":1284,"props":2725,"children":2726},{},[2727],{"type":44,"tag":53,"props":2728,"children":2729},{},[2730,2732],{"type":50,"value":2731},"Full naming reference: ",{"type":44,"tag":289,"props":2733,"children":2735},{"href":2734},"references\u002Fnaming-conventions.md",[2736],{"type":50,"value":2737},"naming-conventions.md",{"type":44,"tag":142,"props":2739,"children":2740},{},[],{"type":44,"tag":146,"props":2742,"children":2744},{"id":2743},"_8-token-architecture",[2745],{"type":50,"value":2746},"8. Token Architecture",{"type":44,"tag":1300,"props":2748,"children":2749},{},[2750,2766],{"type":44,"tag":1304,"props":2751,"children":2752},{},[2753],{"type":44,"tag":1308,"props":2754,"children":2755},{},[2756,2761],{"type":44,"tag":1312,"props":2757,"children":2758},{},[2759],{"type":50,"value":2760},"Complexity",{"type":44,"tag":1312,"props":2762,"children":2763},{},[2764],{"type":50,"value":2765},"Pattern",{"type":44,"tag":1328,"props":2767,"children":2768},{},[2769,2782,2800],{"type":44,"tag":1308,"props":2770,"children":2771},{},[2772,2777],{"type":44,"tag":1335,"props":2773,"children":2774},{},[2775],{"type":50,"value":2776},"\u003C 50 tokens",{"type":44,"tag":1335,"props":2778,"children":2779},{},[2780],{"type":50,"value":2781},"Single collection, 2 modes (Light\u002FDark)",{"type":44,"tag":1308,"props":2783,"children":2784},{},[2785,2790],{"type":44,"tag":1335,"props":2786,"children":2787},{},[2788],{"type":50,"value":2789},"50–200 tokens",{"type":44,"tag":1335,"props":2791,"children":2792},{},[2793,2798],{"type":44,"tag":71,"props":2794,"children":2795},{},[2796],{"type":50,"value":2797},"Standard",{"type":50,"value":2799},": Primitives (1 mode) + Color semantic (Light\u002FDark) + Spacing (1 mode) + Typography (1 mode)",{"type":44,"tag":1308,"props":2801,"children":2802},{},[2803,2808],{"type":44,"tag":1335,"props":2804,"children":2805},{},[2806],{"type":50,"value":2807},"200+ tokens",{"type":44,"tag":1335,"props":2809,"children":2810},{},[2811,2816,2818],{"type":44,"tag":71,"props":2812,"children":2813},{},[2814],{"type":50,"value":2815},"Advanced",{"type":50,"value":2817},": Multiple semantic collections, 4–8 modes (Light\u002FDark × Contrast × Brand). See M3 pattern in ",{"type":44,"tag":289,"props":2819,"children":2821},{"href":2820},"references\u002Ftoken-creation.md",[2822],{"type":50,"value":2823},"token-creation.md",{"type":44,"tag":53,"props":2825,"children":2826},{},[2827],{"type":50,"value":2828},"Standard pattern (recommended starting point):",{"type":44,"tag":1450,"props":2830,"children":2833},{"className":2831,"code":2832,"language":50},[1453],"Collection: \"Primitives\"    modes: [\"Value\"]\n  blue\u002F500 = #3B82F6, gray\u002F900 = #111827, ...\n\nCollection: \"Color\"         modes: [\"Light\", \"Dark\"]\n  color\u002Fbg\u002Fprimary → Light: alias Primitives\u002Fwhite, Dark: alias Primitives\u002Fgray-900\n  color\u002Ftext\u002Fprimary → Light: alias Primitives\u002Fgray-900, Dark: alias Primitives\u002Fwhite\n\nCollection: \"Spacing\"       modes: [\"Value\"]\n  spacing\u002Fxs = 4, spacing\u002Fsm = 8, spacing\u002Fmd = 16, ...\n",[2834],{"type":44,"tag":59,"props":2835,"children":2836},{"__ignoreMap":1458},[2837],{"type":50,"value":2832},{"type":44,"tag":142,"props":2839,"children":2840},{},[],{"type":44,"tag":146,"props":2842,"children":2844},{"id":2843},"_9-per-phase-anti-patterns",[2845],{"type":50,"value":2846},"9. Per-Phase Anti-Patterns",{"type":44,"tag":53,"props":2848,"children":2849},{},[2850],{"type":44,"tag":71,"props":2851,"children":2852},{},[2853],{"type":50,"value":2854},"Phase 0 anti-patterns:",{"type":44,"tag":163,"props":2856,"children":2857},{},[2858,2863,2868],{"type":44,"tag":167,"props":2859,"children":2860},{},[2861],{"type":50,"value":2862},"❌ Starting to create anything before scope is locked with user",{"type":44,"tag":167,"props":2864,"children":2865},{},[2866],{"type":50,"value":2867},"❌ Ignoring existing file conventions and imposing new ones",{"type":44,"tag":167,"props":2869,"children":2870},{},[2871,2873,2878],{"type":50,"value":2872},"❌ Skipping ",{"type":44,"tag":59,"props":2874,"children":2876},{"className":2875},[],[2877],{"type":50,"value":463},{"type":50,"value":2879}," before planning component creation",{"type":44,"tag":53,"props":2881,"children":2882},{},[2883],{"type":44,"tag":71,"props":2884,"children":2885},{},[2886],{"type":50,"value":2887},"Phase 1 anti-patterns:",{"type":44,"tag":163,"props":2889,"children":2890},{},[2891,2903,2908,2913],{"type":44,"tag":167,"props":2892,"children":2893},{},[2894,2896,2901],{"type":50,"value":2895},"❌ Using ",{"type":44,"tag":59,"props":2897,"children":2899},{"className":2898},[],[2900],{"type":50,"value":551},{"type":50,"value":2902}," on any variable",{"type":44,"tag":167,"props":2904,"children":2905},{},[2906],{"type":50,"value":2907},"❌ Duplicating raw values in semantic layer instead of aliasing",{"type":44,"tag":167,"props":2909,"children":2910},{},[2911],{"type":50,"value":2912},"❌ Not setting code syntax (breaks Dev Mode and round-tripping)",{"type":44,"tag":167,"props":2914,"children":2915},{},[2916],{"type":50,"value":2917},"❌ Creating component tokens before agreeing on token taxonomy",{"type":44,"tag":53,"props":2919,"children":2920},{},[2921],{"type":44,"tag":71,"props":2922,"children":2923},{},[2924],{"type":50,"value":2925},"Phase 2 anti-patterns:",{"type":44,"tag":163,"props":2927,"children":2928},{},[2929,2934],{"type":44,"tag":167,"props":2930,"children":2931},{},[2932],{"type":50,"value":2933},"❌ Skipping the cover page or foundations docs",{"type":44,"tag":167,"props":2935,"children":2936},{},[2937],{"type":50,"value":2938},"❌ Putting multiple unrelated components on one page",{"type":44,"tag":53,"props":2940,"children":2941},{},[2942],{"type":44,"tag":71,"props":2943,"children":2944},{},[2945],{"type":50,"value":2946},"Phase 3 anti-patterns:",{"type":44,"tag":163,"props":2948,"children":2949},{},[2950,2955,2960,2965,2970,2975],{"type":44,"tag":167,"props":2951,"children":2952},{},[2953],{"type":50,"value":2954},"❌ Creating components before foundations exist",{"type":44,"tag":167,"props":2956,"children":2957},{},[2958],{"type":50,"value":2959},"❌ Hardcoding any fill\u002Fstroke\u002Fspacing\u002Fradius value in a component",{"type":44,"tag":167,"props":2961,"children":2962},{},[2963],{"type":50,"value":2964},"❌ Creating a variant per icon (use INSTANCE_SWAP instead)",{"type":44,"tag":167,"props":2966,"children":2967},{},[2968],{"type":50,"value":2969},"❌ Not positioning variants after combineAsVariants (they all stack at 0,0)",{"type":44,"tag":167,"props":2971,"children":2972},{},[2973],{"type":50,"value":2974},"❌ Building variant matrix > 30 without splitting (variant explosion)",{"type":44,"tag":167,"props":2976,"children":2977},{},[2978],{"type":50,"value":2979},"❌ Importing remote components then immediately detaching them",{"type":44,"tag":53,"props":2981,"children":2982},{},[2983],{"type":44,"tag":71,"props":2984,"children":2985},{},[2986],{"type":50,"value":2987},"General anti-patterns:",{"type":44,"tag":163,"props":2989,"children":2990},{},[2991,2996,3001,3006,3011,3016,3021],{"type":44,"tag":167,"props":2992,"children":2993},{},[2994],{"type":50,"value":2995},"❌ Retrying a failed script without understanding the error first",{"type":44,"tag":167,"props":2997,"children":2998},{},[2999],{"type":50,"value":3000},"❌ Using name-prefix matching for cleanup (deletes user-owned nodes)",{"type":44,"tag":167,"props":3002,"children":3003},{},[3004],{"type":50,"value":3005},"❌ Building on unvalidated work from the previous step",{"type":44,"tag":167,"props":3007,"children":3008},{},[3009],{"type":50,"value":3010},"❌ Parallelizing use_figma calls (always sequential)",{"type":44,"tag":167,"props":3012,"children":3013},{},[3014],{"type":50,"value":3015},"❌ Guessing\u002Fhallucinating node IDs from memory (always read from state ledger)",{"type":44,"tag":167,"props":3017,"children":3018},{},[3019],{"type":50,"value":3020},"❌ Writing massive inline scripts instead of using the provided helper scripts",{"type":44,"tag":167,"props":3022,"children":3023},{},[3024],{"type":50,"value":3025},"❌ Starting Phase 3 because the user said \"build the button\" without completing Phases 0-2",{"type":44,"tag":142,"props":3027,"children":3028},{},[],{"type":44,"tag":146,"props":3030,"children":3032},{"id":3031},"_10-reference-docs",[3033],{"type":50,"value":3034},"10. Reference Docs",{"type":44,"tag":53,"props":3036,"children":3037},{},[3038],{"type":50,"value":3039},"Load on demand — each reference is authoritative for its phase:",{"type":44,"tag":53,"props":3041,"children":3042},{},[3043],{"type":50,"value":3044},"Use your file reading tool to read these docs when needed. Do not assume their contents from the filename.",{"type":44,"tag":1300,"props":3046,"children":3047},{},[3048,3074],{"type":44,"tag":1304,"props":3049,"children":3050},{},[3051],{"type":44,"tag":1308,"props":3052,"children":3053},{},[3054,3059,3064,3069],{"type":44,"tag":1312,"props":3055,"children":3056},{},[3057],{"type":50,"value":3058},"Doc",{"type":44,"tag":1312,"props":3060,"children":3061},{},[3062],{"type":50,"value":3063},"Phase",{"type":44,"tag":1312,"props":3065,"children":3066},{},[3067],{"type":50,"value":3068},"Required \u002F Optional",{"type":44,"tag":1312,"props":3070,"children":3071},{},[3072],{"type":50,"value":3073},"Load when",{"type":44,"tag":1328,"props":3075,"children":3076},{},[3077,3107,3134,3160,3189,3215,3240],{"type":44,"tag":1308,"props":3078,"children":3079},{},[3080,3089,3094,3102],{"type":44,"tag":1335,"props":3081,"children":3082},{},[3083],{"type":44,"tag":289,"props":3084,"children":3086},{"href":3085},"references\u002Fdiscovery-phase.md",[3087],{"type":50,"value":3088},"discovery-phase.md",{"type":44,"tag":1335,"props":3090,"children":3091},{},[3092],{"type":50,"value":3093},"0",{"type":44,"tag":1335,"props":3095,"children":3096},{},[3097],{"type":44,"tag":71,"props":3098,"children":3099},{},[3100],{"type":50,"value":3101},"Required",{"type":44,"tag":1335,"props":3103,"children":3104},{},[3105],{"type":50,"value":3106},"Starting any build — codebase analysis + Figma inspection",{"type":44,"tag":1308,"props":3108,"children":3109},{},[3110,3117,3122,3129],{"type":44,"tag":1335,"props":3111,"children":3112},{},[3113],{"type":44,"tag":289,"props":3114,"children":3115},{"href":2820},[3116],{"type":50,"value":2823},{"type":44,"tag":1335,"props":3118,"children":3119},{},[3120],{"type":50,"value":3121},"1",{"type":44,"tag":1335,"props":3123,"children":3124},{},[3125],{"type":44,"tag":71,"props":3126,"children":3127},{},[3128],{"type":50,"value":3101},{"type":44,"tag":1335,"props":3130,"children":3131},{},[3132],{"type":50,"value":3133},"Creating variables, collections, modes, styles",{"type":44,"tag":1308,"props":3135,"children":3136},{},[3137,3146,3151,3155],{"type":44,"tag":1335,"props":3138,"children":3139},{},[3140],{"type":44,"tag":289,"props":3141,"children":3143},{"href":3142},"references\u002Fdocumentation-creation.md",[3144],{"type":50,"value":3145},"documentation-creation.md",{"type":44,"tag":1335,"props":3147,"children":3148},{},[3149],{"type":50,"value":3150},"2",{"type":44,"tag":1335,"props":3152,"children":3153},{},[3154],{"type":50,"value":3101},{"type":44,"tag":1335,"props":3156,"children":3157},{},[3158],{"type":50,"value":3159},"Creating cover page, foundations docs, swatches",{"type":44,"tag":1308,"props":3161,"children":3162},{},[3163,3172,3177,3184],{"type":44,"tag":1335,"props":3164,"children":3165},{},[3166],{"type":44,"tag":289,"props":3167,"children":3169},{"href":3168},"references\u002Fcomponent-creation.md",[3170],{"type":50,"value":3171},"component-creation.md",{"type":44,"tag":1335,"props":3173,"children":3174},{},[3175],{"type":50,"value":3176},"3",{"type":44,"tag":1335,"props":3178,"children":3179},{},[3180],{"type":44,"tag":71,"props":3181,"children":3182},{},[3183],{"type":50,"value":3101},{"type":44,"tag":1335,"props":3185,"children":3186},{},[3187],{"type":50,"value":3188},"Creating any component or variant",{"type":44,"tag":1308,"props":3190,"children":3191},{},[3192,3201,3206,3210],{"type":44,"tag":1335,"props":3193,"children":3194},{},[3195],{"type":44,"tag":289,"props":3196,"children":3198},{"href":3197},"references\u002Fcode-connect-setup.md",[3199],{"type":50,"value":3200},"code-connect-setup.md",{"type":44,"tag":1335,"props":3202,"children":3203},{},[3204],{"type":50,"value":3205},"3–4",{"type":44,"tag":1335,"props":3207,"children":3208},{},[3209],{"type":50,"value":3101},{"type":44,"tag":1335,"props":3211,"children":3212},{},[3213],{"type":50,"value":3214},"Setting up Code Connect or variable code syntax",{"type":44,"tag":1308,"props":3216,"children":3217},{},[3218,3225,3230,3235],{"type":44,"tag":1335,"props":3219,"children":3220},{},[3221],{"type":44,"tag":289,"props":3222,"children":3223},{"href":2734},[3224],{"type":50,"value":2737},{"type":44,"tag":1335,"props":3226,"children":3227},{},[3228],{"type":50,"value":3229},"Any",{"type":44,"tag":1335,"props":3231,"children":3232},{},[3233],{"type":50,"value":3234},"Optional",{"type":44,"tag":1335,"props":3236,"children":3237},{},[3238],{"type":50,"value":3239},"Naming anything — variables, pages, variants, styles",{"type":44,"tag":1308,"props":3241,"children":3242},{},[3243,3252,3256,3264],{"type":44,"tag":1335,"props":3244,"children":3245},{},[3246],{"type":44,"tag":289,"props":3247,"children":3249},{"href":3248},"references\u002Ferror-recovery.md",[3250],{"type":50,"value":3251},"error-recovery.md",{"type":44,"tag":1335,"props":3253,"children":3254},{},[3255],{"type":50,"value":3229},{"type":44,"tag":1335,"props":3257,"children":3258},{},[3259],{"type":44,"tag":71,"props":3260,"children":3261},{},[3262],{"type":50,"value":3263},"Required on error",{"type":44,"tag":1335,"props":3265,"children":3266},{},[3267],{"type":50,"value":3268},"Script fails, multi-step workflow recovery, cleanup of abandoned workflow state",{"type":44,"tag":142,"props":3270,"children":3271},{},[],{"type":44,"tag":146,"props":3273,"children":3275},{"id":3274},"_11-scripts",[3276],{"type":50,"value":3277},"11. Scripts",{"type":44,"tag":53,"props":3279,"children":3280},{},[3281,3283,3288],{"type":50,"value":3282},"Reusable Plugin API helper functions. Embed in ",{"type":44,"tag":59,"props":3284,"children":3286},{"className":3285},[],[3287],{"type":50,"value":64},{"type":50,"value":3289}," calls:",{"type":44,"tag":1300,"props":3291,"children":3292},{},[3293,3309],{"type":44,"tag":1304,"props":3294,"children":3295},{},[3296],{"type":44,"tag":1308,"props":3297,"children":3298},{},[3299,3304],{"type":44,"tag":1312,"props":3300,"children":3301},{},[3302],{"type":50,"value":3303},"Script",{"type":44,"tag":1312,"props":3305,"children":3306},{},[3307],{"type":50,"value":3308},"Purpose",{"type":44,"tag":1328,"props":3310,"children":3311},{},[3312,3329,3352,3369,3386,3403,3420,3437],{"type":44,"tag":1308,"props":3313,"children":3314},{},[3315,3324],{"type":44,"tag":1335,"props":3316,"children":3317},{},[3318],{"type":44,"tag":289,"props":3319,"children":3321},{"href":3320},"scripts\u002FinspectFileStructure.js",[3322],{"type":50,"value":3323},"inspectFileStructure.js",{"type":44,"tag":1335,"props":3325,"children":3326},{},[3327],{"type":50,"value":3328},"Discover all pages, components, variables, styles; returns full inventory",{"type":44,"tag":1308,"props":3330,"children":3331},{},[3332,3341],{"type":44,"tag":1335,"props":3333,"children":3334},{},[3335],{"type":44,"tag":289,"props":3336,"children":3338},{"href":3337},"scripts\u002FcreateVariableCollection.js",[3339],{"type":50,"value":3340},"createVariableCollection.js",{"type":44,"tag":1335,"props":3342,"children":3343},{},[3344,3346],{"type":50,"value":3345},"Create a named collection with modes; returns ",{"type":44,"tag":59,"props":3347,"children":3349},{"className":3348},[],[3350],{"type":50,"value":3351},"{collectionId, modeIds}",{"type":44,"tag":1308,"props":3353,"children":3354},{},[3355,3364],{"type":44,"tag":1335,"props":3356,"children":3357},{},[3358],{"type":44,"tag":289,"props":3359,"children":3361},{"href":3360},"scripts\u002FcreateSemanticTokens.js",[3362],{"type":50,"value":3363},"createSemanticTokens.js",{"type":44,"tag":1335,"props":3365,"children":3366},{},[3367],{"type":50,"value":3368},"Create aliased semantic variables from a token map",{"type":44,"tag":1308,"props":3370,"children":3371},{},[3372,3381],{"type":44,"tag":1335,"props":3373,"children":3374},{},[3375],{"type":44,"tag":289,"props":3376,"children":3378},{"href":3377},"scripts\u002FcreateComponentWithVariants.js",[3379],{"type":50,"value":3380},"createComponentWithVariants.js",{"type":44,"tag":1335,"props":3382,"children":3383},{},[3384],{"type":50,"value":3385},"Build a component set from a variant matrix; handles grid layout",{"type":44,"tag":1308,"props":3387,"children":3388},{},[3389,3398],{"type":44,"tag":1335,"props":3390,"children":3391},{},[3392],{"type":44,"tag":289,"props":3393,"children":3395},{"href":3394},"scripts\u002FbindVariablesToComponent.js",[3396],{"type":50,"value":3397},"bindVariablesToComponent.js",{"type":44,"tag":1335,"props":3399,"children":3400},{},[3401],{"type":50,"value":3402},"Bind design tokens to all component visual properties",{"type":44,"tag":1308,"props":3404,"children":3405},{},[3406,3415],{"type":44,"tag":1335,"props":3407,"children":3408},{},[3409],{"type":44,"tag":289,"props":3410,"children":3412},{"href":3411},"scripts\u002FcreateDocumentationPage.js",[3413],{"type":50,"value":3414},"createDocumentationPage.js",{"type":44,"tag":1335,"props":3416,"children":3417},{},[3418],{"type":50,"value":3419},"Create a page with title + description + section structure",{"type":44,"tag":1308,"props":3421,"children":3422},{},[3423,3432],{"type":44,"tag":1335,"props":3424,"children":3425},{},[3426],{"type":44,"tag":289,"props":3427,"children":3429},{"href":3428},"scripts\u002FvalidateCreation.js",[3430],{"type":50,"value":3431},"validateCreation.js",{"type":44,"tag":1335,"props":3433,"children":3434},{},[3435],{"type":50,"value":3436},"Verify created nodes match expected counts, names, structure",{"type":44,"tag":1308,"props":3438,"children":3439},{},[3440,3449],{"type":44,"tag":1335,"props":3441,"children":3442},{},[3443],{"type":44,"tag":289,"props":3444,"children":3446},{"href":3445},"scripts\u002FcleanupOrphans.js",[3447],{"type":50,"value":3448},"cleanupOrphans.js",{"type":44,"tag":1335,"props":3450,"children":3451},{},[3452],{"type":50,"value":3453},"Remove only the exact node, variable, and collection IDs supplied from the state ledger",{"type":44,"tag":3455,"props":3456,"children":3457},"style",{},[3458],{"type":50,"value":3459},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3461,"total":3621},[3462,3476,3491,3502,3513,3529,3537,3550,3572,3581,3597,3608],{"slug":3463,"name":3463,"fn":3464,"description":3465,"org":3466,"tags":3467,"stars":26,"repoUrl":27,"updatedAt":3475},"figma-code-connect","map Figma components to code snippets","Creates and maintains Figma Code Connect template files that map Figma components to code snippets. Use when the user mentions Code Connect, Figma component mapping, design-to-code translation, or asks to create\u002Fupdate .figma.ts or .figma.js files.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3468,3469,3470,3471,3474],{"name":24,"slug":25,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},"Frontend","frontend",{"name":20,"slug":21,"type":15},"2026-07-31T05:52:30.590302",{"slug":3477,"name":3477,"fn":3478,"description":3479,"org":3480,"tags":3481,"stars":26,"repoUrl":27,"updatedAt":3490},"figma-create-new-file","create new Figma or FigJam files","**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `create_new_file` tool call. NEVER call `create_new_file` directly without loading this skill first. Trigger whenever the user wants a new blank Figma file — a new design, FigJam, or Slides file — or when you need a fresh file before calling `use_figma`. Usage — \u002Ffigma-create-new-file [editorType] [fileName] (e.g. \u002Ffigma-create-new-file figjam My Whiteboard, \u002Ffigma-create-new-file slides Q3 Review)",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3482,3483,3484,3487],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3485,"slug":3486,"type":15},"Ideation","ideation",{"name":3488,"slug":3489,"type":15},"MCP","mcp","2026-04-06T18:11:46.464282",{"slug":3492,"name":3492,"fn":3493,"description":3494,"org":3495,"tags":3496,"stars":26,"repoUrl":27,"updatedAt":3501},"figma-design-to-code","implement Figma designs as code","**MANDATORY prerequisite** — you MUST invoke this skill BEFORE calling the `get_design_context` Figma MCP tool. You MUST trigger this skill whenever the user wants to implement, build, port, or code up a Figma design as code. Example prompts (not exhaustive) are 'implement this Figma design', 'build this screen from Figma', 'turn this Figma into code', 'design to code'. This skill provides critical instructions and steps to the agent on how to correctly implement Figma designs in code and must NOT be skipped.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3497,3498,3499,3500],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},{"name":20,"slug":21,"type":15},"2026-07-10T06:43:51.122606",{"slug":3503,"name":3503,"fn":3504,"description":3505,"org":3506,"tags":3507,"stars":26,"repoUrl":27,"updatedAt":3512},"figma-generate-design","translate code layouts into Figma","Use this skill alongside figma-use when the task involves translating an application page, view, or multi-section layout into Figma. Triggers: 'write to Figma', 'create in Figma from code', 'push page to Figma', 'take this app\u002Fpage and build it in Figma', 'create a screen', 'build a landing page in Figma', 'update the Figma screen to match code', 'convert this modal\u002Fdialog\u002Fdrawer\u002Fpanel to Figma'. This is the preferred workflow skill whenever the user wants to build or update a full page, modal, dialog, drawer, sidebar, panel, or any composed multi-section view in Figma from code or a description. Discovers design system components, variables, and styles from Code Connect files, existing screens, and library search, then imports them and assembles views incrementally section-by-section using design system tokens instead of hardcoded values.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3508,3509,3510,3511],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},{"name":20,"slug":21,"type":15},"2026-04-06T18:11:48.952023",{"slug":3514,"name":3514,"fn":3515,"description":3516,"org":3517,"tags":3518,"stars":26,"repoUrl":27,"updatedAt":3528},"figma-generate-diagram","generate flowcharts and architecture diagrams in Figma","MANDATORY prerequisite — load this skill BEFORE every `generate_diagram` tool call. NEVER call `generate_diagram` directly without loading this skill first. Trigger whenever the user asks to create, generate, draw, render, sketch, or build a diagram — flowchart, architecture diagram, sequence diagram, ERD or entity-relationship diagram, state diagram or state machine, gantt chart, or timeline. Also trigger when the user mentions Mermaid syntax or wants a system architecture, decision tree, dependency graph, API call flow, auth handshake, schema, or pipeline visualized in FigJam. Routes to type-specific guidance, sets universal Mermaid constraints, and tells you when to use a different diagram type or skip the tool entirely (mindmaps, pie charts, class diagrams, etc.).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3519,3522,3523,3526,3527],{"name":3520,"slug":3521,"type":15},"Architecture","architecture",{"name":24,"slug":25,"type":15},{"name":3524,"slug":3525,"type":15},"Diagrams","diagrams",{"name":9,"slug":8,"type":15},{"name":3488,"slug":3489,"type":15},"2026-04-28T05:43:52.834484",{"slug":4,"name":4,"fn":5,"description":6,"org":3530,"tags":3531,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3532,3533,3534,3535,3536],{"name":24,"slug":25,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":20,"slug":21,"type":15},{"slug":3538,"name":3538,"fn":3539,"description":3540,"org":3541,"tags":3542,"stars":26,"repoUrl":27,"updatedAt":3549},"figma-implement-motion","implement Figma animations in production code","Translates Figma motion and animations into production-ready application code. Use when implementing animation\u002Fmotion from a Figma design — user mentions \"implement this motion\", \"add animation from Figma\", \"animate this component\", provides a Figma URL whose node is animated, or when `get_design_context` returns motion data or instructs you to call `get_motion_context`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3543,3546,3547,3548],{"name":3544,"slug":3545,"type":15},"Animation","animation",{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},"2026-06-25T07:13:13.645254",{"slug":3551,"name":3551,"fn":3552,"description":3553,"org":3554,"tags":3555,"stars":26,"repoUrl":27,"updatedAt":3571},"figma-swiftui","translate between Figma designs and SwiftUI code","SwiftUI ↔ Figma translation. Use whenever the user mentions Swift, SwiftUI, iOS, iPhone, or iPad — in EITHER direction — translating a Figma design into SwiftUI (design → code), or pushing SwiftUI views \u002F screens \u002F tokens back into a Figma file (code → design). Triggers on phrases like 'implement this Figma design in SwiftUI', 'build this screen in Swift', 'push this SwiftUI view to Figma', 'mirror my Swift code in a Figma file', or whenever a Figma URL appears alongside `.swift` files \u002F an `.xcodeproj`. Routes to a direction-specific reference doc; loads alongside `figma-use` for the code → design path.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3556,3557,3558,3559,3562,3565,3568],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},{"name":3560,"slug":3561,"type":15},"iOS","ios",{"name":3563,"slug":3564,"type":15},"Mobile","mobile",{"name":3566,"slug":3567,"type":15},"SwiftUI","swiftui",{"name":3569,"slug":3570,"type":15},"Visual Design","visual-design","2026-06-09T07:16:28.204756",{"slug":83,"name":83,"fn":3573,"description":3574,"org":3575,"tags":3576,"stars":26,"repoUrl":27,"updatedAt":3580},"initialize Figma tool usage","**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context — e.g. create\u002Fedit\u002Fdelete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3577,3578,3579],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3488,"slug":3489,"type":15},"2026-07-31T05:52:29.57808",{"slug":3582,"name":3582,"fn":3583,"description":3584,"org":3585,"tags":3586,"stars":26,"repoUrl":27,"updatedAt":3596},"figma-use-figjam","use Figma tools in FigJam context","This skill helps agents use Figma's use_figma MCP tool in the FigJam context. Can be used alongside figma-use which has foundational context for using the use_figma tool.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3587,3590,3591,3594,3595],{"name":3588,"slug":3589,"type":15},"Collaboration","collaboration",{"name":24,"slug":25,"type":15},{"name":3592,"slug":3593,"type":15},"FigJam","figjam",{"name":9,"slug":8,"type":15},{"name":3488,"slug":3489,"type":15},"2026-04-28T05:43:51.600727",{"slug":3598,"name":3598,"fn":3599,"description":3600,"org":3601,"tags":3602,"stars":26,"repoUrl":27,"updatedAt":3607},"figma-use-motion","animate Figma nodes with motion tools","Motion \u002F animation context for the `use_figma` MCP tool — animating Figma nodes via manual keyframes, animation styles, easing, and timeline duration. Load alongside figma-use whenever a task involves adding, editing, or inspecting animation on a node.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3603,3604,3605,3606],{"name":3544,"slug":3545,"type":15},{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3488,"slug":3489,"type":15},"2026-06-25T07:13:12.398176",{"slug":3609,"name":3609,"fn":3610,"description":3611,"org":3612,"tags":3613,"stars":26,"repoUrl":27,"updatedAt":3620},"figma-use-slides","use Figma tools in Slides context","This skill helps agents use Figma's use_figma MCP tool in the Slides context. Can be used alongside figma-use which has foundational context for using the use_figma tool.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3614,3615,3616,3617],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3488,"slug":3489,"type":15},{"name":3618,"slug":3619,"type":15},"Presentations","presentations","2026-05-14T06:09:42.171824",14,{"items":3623,"total":3621},[3624,3632,3639,3646,3653,3661,3669],{"slug":3463,"name":3463,"fn":3464,"description":3465,"org":3625,"tags":3626,"stars":26,"repoUrl":27,"updatedAt":3475},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3627,3628,3629,3630,3631],{"name":24,"slug":25,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},{"name":20,"slug":21,"type":15},{"slug":3477,"name":3477,"fn":3478,"description":3479,"org":3633,"tags":3634,"stars":26,"repoUrl":27,"updatedAt":3490},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3635,3636,3637,3638],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3485,"slug":3486,"type":15},{"name":3488,"slug":3489,"type":15},{"slug":3492,"name":3492,"fn":3493,"description":3494,"org":3640,"tags":3641,"stars":26,"repoUrl":27,"updatedAt":3501},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3642,3643,3644,3645],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},{"name":20,"slug":21,"type":15},{"slug":3503,"name":3503,"fn":3504,"description":3505,"org":3647,"tags":3648,"stars":26,"repoUrl":27,"updatedAt":3512},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3649,3650,3651,3652],{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15},{"name":20,"slug":21,"type":15},{"slug":3514,"name":3514,"fn":3515,"description":3516,"org":3654,"tags":3655,"stars":26,"repoUrl":27,"updatedAt":3528},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3656,3657,3658,3659,3660],{"name":3520,"slug":3521,"type":15},{"name":24,"slug":25,"type":15},{"name":3524,"slug":3525,"type":15},{"name":9,"slug":8,"type":15},{"name":3488,"slug":3489,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":3662,"tags":3663,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3664,3665,3666,3667,3668],{"name":24,"slug":25,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":20,"slug":21,"type":15},{"slug":3538,"name":3538,"fn":3539,"description":3540,"org":3670,"tags":3671,"stars":26,"repoUrl":27,"updatedAt":3549},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3672,3673,3674,3675],{"name":3544,"slug":3545,"type":15},{"name":24,"slug":25,"type":15},{"name":9,"slug":8,"type":15},{"name":3472,"slug":3473,"type":15}]