[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openai-figma-use":3,"mdc-yh2yd2-key":33,"related-repo-openai-figma-use":7500,"related-org-openai-figma-use":7624},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":28,"sourceUrl":31,"mdContent":32},"figma-use","use Figma MCP tools","**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},"openai","OpenAI","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fopenai.png",[12,16,19],{"name":13,"slug":14,"type":15},"Agent Context","agent-context","tag",{"name":17,"slug":18,"type":15},"MCP","mcp",{"name":20,"slug":21,"type":15},"Figma","figma",3992,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins","2026-04-06T18:40:10.817228",null,465,[],{"repoUrl":23,"stars":22,"forks":26,"topics":29,"description":30},[],"OpenAI Plugins","https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins\u002Ftree\u002FHEAD\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use","---\nname: figma-use\ndescription: \"**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.\"\ndisable-model-invocation: false\n---\n\n# use_figma — Figma Plugin API Skill\n\nUse the `use_figma` tool to execute JavaScript in Figma files via the Plugin API. All detailed reference docs live in `references\u002F`.\n\n**Always include `figma-use` in the comma-separated `skillNames` parameter when calling `use_figma`. If this skill was loaded via an MCP resource, you MUST prefix the name with `resource:` (e.g. `resource:figma-use`).** This is a logging parameter used to track skill usage — it does not affect execution.\n\n**If Figma MCP tools appear as deferred tools, batch-load all their schemas in a single `ToolSearch` call** using the `select:` syntax — e.g. `ToolSearch query=\"select:use_figma,get_screenshot,get_metadata,create_new_file\"`. One round trip beats six.\n\n**If the task involves building or updating a full page, screen, or multi-section layout in Figma from code**, also load [figma-generate-design](..\u002Ffigma-generate-design\u002FSKILL.md). It provides the workflow for discovering design system components via `search_design_system`, importing them, and assembling screens incrementally. Both skills work together: this one for the API rules, that one for the screen-building workflow.\n\n**If the task involves creating or building a component in Figma** (even a single component), also load [figma-generate-library](..\u002Ffigma-generate-library\u002FSKILL.md). It provides the component creation workflow — variable foundations, variant sets, design token bindings — that `figma-use` alone doesn't cover.\n\nBefore anything, load [plugin-api-standalone.index.md](references\u002Fplugin-api-standalone.index.md) to understand what is possible. When you are asked to write plugin API code, use this context to grep [plugin-api-standalone.d.ts](references\u002Fplugin-api-standalone.d.ts) for relevant types, methods, and properties. This is the definitive source of truth for the API surface. It is a large typings file, so do not load it all at once, grep for relevant sections as needed.\n\nIMPORTANT: Whenever you work with design systems, start with [working-with-design-systems\u002Fwwds.md](references\u002Fworking-with-design-systems\u002Fwwds.md) to understand the key concepts, processes, and guidelines for working with design systems in Figma. Then load the more specific references for components, variables, text styles, and effect styles as needed.\n\n## 1. Critical Rules\n\n1.  **Use `return` to send data back.** The return value is JSON-serialized automatically (objects, arrays, strings, numbers). Do NOT call `figma.closePlugin()` or wrap code in an async IIFE — this is handled for you.\n2.  **Write plain JavaScript with top-level `await` and `return`.** Code is automatically wrapped in an async context. Do NOT wrap in `(async () => { ... })()`.\n3.  `figma.notify()` **throws \"not implemented\"** — never use it\n3a. `getPluginData()` \u002F `setPluginData()` are **not supported** in `use_figma` — do not use them. Use `getSharedPluginData()` \u002F `setSharedPluginData()` instead (these ARE supported), or track node IDs by returning them and passing them to subsequent calls.\n4.  `console.log()` is NOT returned — use `return` for output\n5.  **Work incrementally in small steps.** Break large operations into multiple `use_figma` calls. Validate after each step. This is the single most important practice for avoiding bugs.\n6.  Colors are **0–1 range** (not 0–255): `{r: 1, g: 0, b: 0}` = red\n7.  Fills\u002Fstrokes are **read-only arrays** — clone, modify, reassign\n8.  **Every text edit follows the canonical recipe: load font → `await` → mutate → return affected node IDs.** Skipping the load throws `Cannot write to node with unloaded font \"\u003Cfamily> \u003Cstyle>\"`. The rule covers more than `characters` — it applies to any operation on nodes with unloaded fonts (`appendChild`, `insertChild`, `setBoundVariable`, `setExplicitVariableModeForCollection`, `setValueForMode`, `findAll` callbacks touching text). When mutating existing text, load the node's *current* fonts via `getStyledTextSegments(['fontName'])`, not a hardcoded default. Inter is preloaded in most environments so other families surface this bug more often — the recipe is the same for every font. Use `await figma.listAvailableFontsAsync()` first if the style string is unverified. See [Canonical text-edit recipe](references\u002Fgotchas.md#canonical-text-edit-recipe-font-load--await--mutate--return-ids).\n9.  **Pages load incrementally** — use `await figma.setCurrentPageAsync(page)` to switch pages and load their content. The sync setter `figma.currentPage = page` does **NOT** work and will throw (see Page Rules below)\n10. `setBoundVariableForPaint` returns a **NEW** paint — must capture and reassign\n11. `createVariable` accepts collection **object or ID string** (object preferred)\n12. **`layoutSizingHorizontal\u002FVertical` is value-restricted by structural context — `FIXED` always works, `HUG` and `FILL` do not.** `'HUG'` is valid only on an auto-layout frame itself OR on a **TEXT** child of one. `'FILL'` is valid only on a child of an auto-layout frame that is also not absolute-positioned, not inside an immutable frame, and not a canvas-grid child. Practical consequence: append to an auto-layout parent FIRST, then set `HUG`\u002F`FILL` — a newly-created or unparented node can't satisfy the rule yet. The property itself exists on every `SceneNode`; the error is value-rejection, not \"no such property\". See [Gotchas](references\u002Fgotchas.md#layoutsizinghorizontallayoutsizingvertical-value-rules-fixed-hug-fill).\n12a. **Use auto-layout for containers that hold related children.** When children have a structural relationship — stacked, side-by-side, aligned, gapped, hugged — wrap them in `figma.createAutoLayout()`, not `figma.createFrame()` with absolute `x`\u002F`y`. Absolute coordinates govern where a container sits on the canvas; auto-layout governs how its children relate inside it. Skipping the container leaves no protection against text reflow, content changes, or overlap.\n12b. **`layoutSizing*` and `*AxisSizingMode` are different enums — don't cross them.** `layoutSizingHorizontal`\u002F`layoutSizingVertical` (set on a **child**) take `'FIXED'|'HUG'|'FILL'`; `primaryAxisSizingMode`\u002F`counterAxisSizingMode` (set on the **frame** itself) take `'FIXED'|'AUTO'`. So `layoutSizingVertical = 'AUTO'` is invalid (use `'HUG'`), and `counterAxisSizingMode = 'FILL'` throws `Expected 'FIXED' | 'AUTO', received 'FILL'` (use `'FIXED'`\u002F`'AUTO'`). Two more errors from the same setter — `Error: in set_layoutSizingHorizontal: node must be an auto-layout frame or a child of an auto-layout frame` and `Error: in set_layoutSizingHorizontal: FILL can only be set on children of auto-layout frames` — mean the node isn't in an auto-layout context yet; **recommendation: make the parent auto-layout (`figma.createAutoLayout()`) and `appendChild` the node before setting** (see Rule 12). See [Gotchas](references\u002Fgotchas.md#layoutsizing-vs-axissizingmode-two-different-sizing-enums).\n13. **Position new top-level nodes away from (0,0).** Nodes appended directly to the page default to (0,0). Scan `figma.currentPage.children` to find a clear position (e.g., to the right of the rightmost node). This only applies to page-level nodes — nodes nested inside other frames or auto-layout containers are positioned by their parent. See [Gotchas](references\u002Fgotchas.md).\n14. **On `use_figma` error, STOP. Do NOT immediately retry.** Failed scripts are **atomic** — if a script errors, it is not executed at all and no changes are made to the file. Read the error message carefully, fix the script, then retry. See [Error Recovery](#6-error-recovery--self-correction).\n15. **MUST `return` ALL created\u002Fmutated node IDs.** Whenever a script creates new nodes or mutates existing ones on the canvas, collect every affected node ID and return them in a structured object (e.g. `return { createdNodeIds: [...], mutatedNodeIds: [...] }`). This is essential for subsequent calls to reference, validate, or clean up those nodes.\n16. **Always set `variable.scopes` explicitly when creating variables.** The default `ALL_SCOPES` pollutes every property picker — almost never what you want. Use specific scopes like `[\"FRAME_FILL\", \"SHAPE_FILL\"]` for backgrounds, `[\"TEXT_FILL\"]` for text colors, `[\"GAP\"]` for spacing, etc. See [variable-patterns.md](references\u002Fvariable-patterns.md) for the full list.\n17. **`await` every Promise.** Never leave a Promise unawaited — unawaited async calls (e.g. `figma.loadFontAsync(...)` without `await`, or `figma.setCurrentPageAsync(page)` without `await`) will fire-and-forget, causing silent failures or race conditions. The script may return before the async operation completes, leading to missing data or half-applied changes.\n\n> For detailed WRONG\u002FCORRECT examples of each rule, see [Gotchas & Common Mistakes](references\u002Fgotchas.md).\n\n## 2. Page Rules (Critical)\n\n**Page context resets between `use_figma` calls** — `figma.currentPage` starts on the first page each time.\n\n### Switching pages\n\nUse `await figma.setCurrentPageAsync(page)` to switch pages and load their content. The sync setter `figma.currentPage = page` does **NOT work** — it throws `\"Setting figma.currentPage is not supported\"` in `use_figma`. Always use the async method.\n\n```js\n\u002F\u002F Switch to a specific page (loads its content)\nconst targetPage = figma.root.children.find((p) => p.name === \"My Page\");\nawait figma.setCurrentPageAsync(targetPage);\n\u002F\u002F targetPage.children is now populated\n```\n\n### Call `setCurrentPageAsync` at most once per `use_figma` invocation — fan multi-page work out in parallel\n\n**One script must switch pages at most once.** Never loop over `figma.root.children` and switch pages inside the loop.\n\nIf the work spans multiple pages, **split it into N `use_figma` calls (one per target page) and emit them in parallel** — a single assistant message containing N `use_figma` tool-use blocks. The harness runs them concurrently; each script sets `currentPage` exactly once.\n\n> **Explicit instruction:** when fanning out, you MUST issue the N tool calls in **one message**. Do not send them across multiple turns. Do not await one before issuing the next. Sequential per-page calls are slower than the in-loop pattern this rule replaces and waste the entire benefit of splitting.\n\n```js\n\u002F\u002F AVOID — switches pages N times in one script, reloads the file each time\nfor (const page of figma.root.children) {\n  await figma.setCurrentPageAsync(page);\n  \u002F\u002F ... touch this page ...\n}\n\n\u002F\u002F PREFER — read-only discovery call to get page IDs, then in the NEXT message\n\u002F\u002F emit N parallel use_figma tool calls (one per page), each setting currentPage once.\n```\n\nDefault to parallel fan-out for any multi-page work — reads and writes alike. See [gotchas.md → Set current page once per `use_figma` call](references\u002Fgotchas.md#set-current-page-once-per-use_figma-call--split-multi-page-work-into-parallel-calls) for the full rationale.\n\n### Across script runs\n\n`figma.currentPage` resets to the **first page** at the start of each `use_figma` call. If your workflow spans multiple calls and targets a non-default page, call `await figma.setCurrentPageAsync(page)` at the start of each invocation.\n\nYou can call `use_figma` multiple times to incrementally build on the file state, or to retrieve information before writing another script. For example, write a script to get metadata about existing nodes, `return` that data, then use it in a subsequent script to modify those nodes.\n\n## 3. `return` Is Your Output Channel\n\nThe agent sees **ONLY** the value you `return`. Everything else is invisible.\n\n- **Returning IDs (CRITICAL)**: Every script that creates or mutates canvas nodes **MUST** return all affected node IDs — e.g. `return { createdNodeIds: [...], mutatedNodeIds: [...] }`. This is a hard requirement, not optional.\n- **Progress reporting**: `return { createdNodeIds: [...], count: 5, errors: [] }`\n- **Error info**: Thrown errors are automatically captured and returned — just let them propagate or `throw` explicitly.\n- `console.log()` output is **never** returned to the agent\n- Always return actionable data (IDs, counts, status) so subsequent calls can reference created objects\n\n## 4. Editor Mode\n\n`use_figma` works in **design mode** (editorType `\"figma\"`, the default). FigJam (`\"figjam\"`) and Slides (`\"slides\"`) have different sets of available node types — most design nodes are blocked in FigJam, and FigJam-only nodes are blocked in Slides.\n\n**Tell the editor from the URL:** Design = `figma.com\u002Fdesign\u002F...`, FigJam = `figma.com\u002Fboard\u002F...`, Slides = `figma.com\u002Fslides\u002F...`. Confirm before assuming an API is available.\n\nAvailable in design mode: Rectangle, Frame, Component, Text, Ellipse, Star, Line, Vector, Polygon, BooleanOperation, Slice, Page, Section, TextPath.\n\n**Blocked** in design mode: Sticky, Connector, ShapeWithText, CodeBlock, Slide, SlideRow, SlideGrid, InteractiveSlideElement, Webpage.\n\nAvailable in Slides mode: Rectangle, Frame, Component, Text, Ellipse, Star, Line, Vector, Polygon, BooleanOperation, Slice, Section, TextPath, Slide, SlideRow, SlideGrid, InteractiveSlideElement.\n\n**Blocked** in Slides mode: Sticky, Connector, ShapeWithText, CodeBlock, Webpage, Page.\n\n**Design-only APIs (not just node types):** `figma.createPage()` is available only in Design files (`figma.com\u002Fdesign\u002F...`). In both FigJam (`figma.com\u002Fboard\u002F...`) and Slides (`figma.com\u002Fslides\u002F...`) it throws `TypeError: figma.createPage no such property 'createPage' on the figma global object`. Do not emit `figma.createPage()` in FigJam or Slides workflows.\n\n> **Slides note:** There is no dedicated read tool for Slides files yet. Use `use_figma` with read-only scripts for inspection (see Section 6 \"Inspect first\" pattern), and `get_screenshot` \u002F `await node.screenshot()` for visual context. For Slides-specific API guidance, load the [figma-use-slides](..\u002Ffigma-use-slides\u002FSKILL.md) skill.\n\n## 5. Efficient APIs — Prefer These Over Verbose Alternatives\n\nThese APIs reduce boilerplate, eliminate ordering errors, and compress token output. **Always prefer them over the verbose alternatives.**\n\n### `node.query(selector)` — CSS-like node search\n\nFind nodes within a subtree using CSS-like selectors. Replaces verbose `findAll` + filter loops.\n\n```js\n\u002F\u002F BEFORE — verbose traversal\nconst texts = frame.findAll(n => n.type === 'TEXT' && n.name === 'Title')\n\n\u002F\u002F AFTER — one-liner with query\nconst texts = frame.query('TEXT[name=Title]')\n```\n\n**Selector syntax:**\n- Type: `FRAME`, `TEXT`, `RECTANGLE`, `ELLIPSE`, `COMPONENT`, `INSTANCE`, `SECTION` (case-insensitive)\n- Attribute exact: `[name=Card]`, `[visible=true]`, `[opacity=0.5]`\n- Attribute substring: `[name*=art]` (contains), `[name^=Header]` (starts-with), `[name$=Nav]` (ends-with)\n- Dot-path traversal: `[fills.0.type=SOLID]`, `[fills.*.type=SOLID]` (wildcard index)\n- Instance matching: `[mainComponent=nodeId]`, `[mainComponent.name=Button]`\n- Combinators: `FRAME > TEXT` (direct child), `FRAME TEXT` (any descendant), `A + B` (adjacent sibling), `A ~ B` (general sibling)\n- Pseudo-classes: `:first-child`, `:last-child`, `:nth-child(2)`, `:not(TYPE)`, `:is(FRAME, RECTANGLE)`, `:where(TEXT, ELLIPSE)`\n- Node ID: `#nodeId` or bare GUID\n- Comma: `TEXT, RECTANGLE` (union)\n- Wildcard: `*` (any type)\n\n**QueryResult methods:**\n| Method | Description |\n|---|---|\n| `.length` | Number of matched nodes |\n| `.first()` | First matched node (or `null`) |\n| `.last()` | Last matched node (or `null`) |\n| `.toArray()` | Convert to regular array |\n| `.each(fn)` | Iterate with callback, returns `this` for chaining |\n| `.map(fn)` | Map to new array |\n| `.filter(fn)` | Filter to new QueryResult |\n| `.values(keys)` | Extract property values: `.values(['name', 'x', 'y'])` → `[{name, x, y}, ...]` |\n| `.set(props)` | Set properties on all matched nodes (see `node.set()` below) |\n| `.query(selector)` | Sub-query within matched nodes |\n| `for...of` | Iterable — works in `for` loops |\n\n**Scope:** `node.query()` searches within that node's subtree. To search the whole page: `figma.currentPage.query('...')`. There is no global `figma.query()`.\n\n**Examples:**\n```js\n\u002F\u002F Recolor all text inside cards\nfigma.currentPage.query('FRAME[name^=Card] TEXT').set({\n  fills: [{type: 'SOLID', color: {r: 0.2, g: 0.2, b: 0.8}}]\n})\n\n\u002F\u002F Get names and positions of all frames\nreturn figma.currentPage.query('FRAME').values(['name', 'x', 'y'])\n\n\u002F\u002F Find the first component named \"Button\"\nconst btn = figma.currentPage.query('COMPONENT[name=Button]').first()\n\n\u002F\u002F Find all instances of a specific component\nfigma.currentPage.query(`INSTANCE[mainComponent=${compId}]`)\n\n\u002F\u002F Find nodes with solid fills using dot-path traversal\nfigma.currentPage.query('[fills.0.type=SOLID]')\n```\n\n### `node.set(props)` — batch property updates\n\nSet multiple properties in one call. Returns `this` for chaining.\n\n```js\n\u002F\u002F BEFORE — one line per property\nframe.opacity = 0.5\nframe.cornerRadius = 8\nframe.name = \"Card\"\n\n\u002F\u002F AFTER — single call\nframe.set({ opacity: 0.5, cornerRadius: 8, name: \"Card\" })\n```\n\n**Priority key ordering:** `layoutMode` is always applied before other properties (like `width`\u002F`height`) regardless of object key order. This prevents the common bug where `resize()` behaves differently depending on whether `layoutMode` is set.\n\n**Width\u002Fheight handling:** `width` and `height` are routed through `node.resize()` automatically — setting `{ width: 200 }` calls `resize(200, currentHeight)`.\n\n**Chaining with query:**\n```js\n\u002F\u002F Find all rectangles named \"Divider\" and update them\nfigma.currentPage.query('RECTANGLE[name=Divider]').set({\n  fills: [{type: 'SOLID', color: {r: 0.9, g: 0.9, b: 0.9}}],\n  cornerRadius: 2\n})\n```\n\n### `figma.createAutoLayout(direction?, props?)` — auto-layout frames\n\nCreates a frame with auto-layout already enabled and both axes hugging content. **This is the default container whenever children have a structural relationship to each other (see Rule 12a).**\n\n```js\n\u002F\u002F BEFORE — manual setup, easy to get ordering wrong\nconst frame = figma.createFrame()\nframe.layoutMode = 'VERTICAL'\nframe.primaryAxisSizingMode = 'AUTO'\nframe.counterAxisSizingMode = 'AUTO'\nframe.layoutSizingHorizontal = 'HUG'\nframe.layoutSizingVertical = 'HUG'\n\n\u002F\u002F AFTER — one call, layout ready\nconst frame = figma.createAutoLayout('VERTICAL')\n```\n\nChildren can immediately use `layoutSizingHorizontal\u002FVertical = 'FILL'` after being appended — no need to set sizing modes manually.\n\nAccepts an optional props object as the first or second argument:\n```js\nfigma.createAutoLayout({ name: 'Card', itemSpacing: 12 })               \u002F\u002F HORIZONTAL + props\nfigma.createAutoLayout('VERTICAL', { name: 'Column', itemSpacing: 8 })  \u002F\u002F VERTICAL + props\n```\n\n### `node.placeholder` — shimmer overlay for AI-in-progress feedback\n\nSets a visual shimmer overlay on a node indicating work is in progress. **Always remove the shimmer when done** — leftover shimmers confuse users and indicate incomplete work.\n\n```js\n\u002F\u002F Mark as in-progress\nframe.placeholder = true\n\n\u002F\u002F ... build out the content ...\n\n\u002F\u002F MUST remove when done — never leave shimmers on finished nodes\nframe.placeholder = false\n```\n\nWhen building complex layouts, set `placeholder = true` on sections before populating them, then set `placeholder = false` on each section as it's completed.\n\n### `await node.screenshot(opts?)` — inline screenshots\n\nCapture a node as a PNG and return it inline in the response. Eliminates the need for a separate `get_screenshot` call.\n\n```js\n\u002F\u002F Take a screenshot of a frame (returned inline in the tool response)\nawait frame.screenshot()\n\n\u002F\u002F Custom scale (default auto-scales: 0.5x or capped so max dimension ≤ 1024px)\nawait frame.screenshot({ scale: 2 })\n\n\u002F\u002F Include overlapping content from sibling nodes\nawait frame.screenshot({ contentsOnly: false })\n```\n\n**When to use:** After creating or modifying nodes, call `screenshot()` to visually verify the result within the same script. No need for a separate `get_screenshot` call.\n\n**Auto-naming:** The image caption includes node metadata — `\"Card (300x150 at 0,60).png\"` — giving spatial context without parsing the image.\n\n**Default scaling:** Uses 0.5x scale, but automatically caps so the largest output dimension never exceeds 1024px. Explicit `{ scale: N }` bypasses the cap.\n\n## 6. Incremental Workflow (How to Avoid Bugs)\n\nThe most common cause of bugs is trying to do too much in a single `use_figma` call. **Work in small steps and validate after each one.**\n\n### Key rules\n\n- **At most 10 logical operations per `use_figma` call.** A \"logical operation\" is creating a node, setting its properties, and parenting it. If you need to create 20 nodes, split across 2-3 calls. **Slides override:** in Slides files, slides are isolated subtrees — the relevant limit is complexity per slide, not total nodes across slides. Building 3–5 new slides in one call is safe, and so is applying the same edit (e.g. adding a footer, recoloring a heading) across every slide in the deck in a single call. See [figma-use-slides](..\u002Ffigma-use-slides\u002FSKILL.md) for the deck-building workflow.\n- **Build top-down, starting with placeholders.** Create the outer structure first with `placeholder = true` on each section, then incrementally replace placeholders with real content in subsequent calls.\n\n### The pattern\n\n1. **Inspect first.** Before creating anything, run a read-only `use_figma` to discover what already exists in the file — pages, components, variables, naming conventions. Match what's there.\n2. **Build the skeleton.** Create the top-level structure with placeholder sections. Set `placeholder = true` on each section so the user sees progress.\n3. **Fill in sections incrementally.** In each subsequent call, populate one section and set its `placeholder = false` when done. Take a `screenshot()` to verify.\n4. **Return IDs from every call.** Always `return` created node IDs, variable IDs, collection IDs as objects (e.g. `return { createdNodeIds: [...] }`). You'll need these as inputs to subsequent calls.\n5. **Validate after each step.** Use `get_metadata` to verify structure (counts, names, hierarchy, positions). Use `await node.screenshot()` inline or `get_screenshot` after major milestones to catch visual issues.\n6. **Fix before moving on.** If validation reveals a problem, fix it before proceeding to the next step. Don't build on a broken foundation.\n\n### Suggested step order for complex tasks\n\n```\nStep 1: Inspect file — discover existing pages, components, variables, conventions\nStep 2: Create tokens\u002Fvariables (if needed)\n       → validate with get_metadata\nStep 3: Create individual components\n       → validate with get_metadata + get_screenshot\nStep 4: Compose layouts from component instances\n       → validate with get_screenshot\nStep 5: Final verification\n```\n\n### What to validate at each step\n\n| After... | Check with `get_metadata` | Check with `get_screenshot` |\n|---|---|---|\n| Creating variables | Collection count, variable count, mode names | — |\n| Creating components | Child count, variant names, property definitions | Variants visible, not collapsed, grid readable |\n| Binding variables | Node properties reflect bindings | Colors\u002Ftokens resolved correctly |\n| Composing layouts | Instance nodes have mainComponent, hierarchy correct | No cropped\u002Fclipped text, no overlapping elements, correct spacing |\n\n## 7. Error Recovery & Self-Correction\n\n**`use_figma` is atomic — failed scripts do not execute.** If a script errors, no changes are made to the file. The file remains in the same state as before the call. This means there are no partial nodes, no orphaned elements from the failed script, and retrying after a fix is safe.\n\n### When `use_figma` returns an error\n\n1. **STOP.** Do not immediately fix the code and retry.\n2. **Read the error message carefully.** Understand exactly what went wrong — wrong API usage, missing font, invalid property value, etc.\n3. **If the error is unclear**, call `get_metadata` or `get_screenshot` to understand the current file state.\n4. **Fix the script** based on the error message.\n5. **Retry** the corrected script.\n\n### Common self-correction patterns\n\n| Error message | Likely cause | How to fix |\n|---|---|---|\n| `\"not implemented\"` | Used `figma.notify()` | Remove it — use `return` for output |\n| `Error: in set_layoutSizingHorizontal: node must be an auto-layout frame or a child of an auto-layout frame` \u002F `Error: in set_layoutSizingHorizontal: FILL can only be set on children of auto-layout frames` \u002F `\"HUG can only be set on auto-layout frames or text children of auto-layout frames\"` \u002F `\"FILL cannot be set on absolute positioned auto-layout children\"` \u002F `\"FILL cannot be set on canvas grid children\"` | Tried to assign `HUG`\u002F`FILL` to a node whose structural context doesn't allow it (e.g. parent isn't auto-layout, ran before `appendChild`, non-text child trying to `HUG`, absolute-positioned child trying to `FILL`) | Make the parent auto-layout via `figma.createAutoLayout()`; `appendChild` first; reserve `HUG` for the auto-layout frame itself or for TEXT children; for absolute\u002Fimmutable\u002Fgrid children use `FIXED` + `resize()`. See [gotchas.md](references\u002Fgotchas.md#layoutsizinghorizontallayoutsizingvertical-value-rules-fixed-hug-fill) |\n| `\"Setting figma.currentPage is not supported\"` | Used sync page setter (`figma.currentPage = page`) which does NOT work | Use `await figma.setCurrentPageAsync(page)` — the only way to switch pages |\n| Property value out of range | Color channel > 1 (used 0–255 instead of 0–1) | Divide by 255 |\n| `\"Cannot read properties of null\"` | Node doesn't exist (wrong ID, wrong page) | Check page context, verify ID |\n| Script hangs \u002F no response | Infinite loop or unresolved promise | Check for `while(true)` or missing `await`; ensure code terminates |\n| `\"The node with id X does not exist\"` | Parent instance was implicitly detached by a child `detachInstance()`, changing IDs | Re-discover nodes by traversal from a stable (non-instance) parent frame |\n\n### When the script succeeds but the result looks wrong\n\n1. Call `get_metadata` to check structural correctness (hierarchy, counts, positions).\n2. Call `get_screenshot` to check visual correctness. Look closely for cropped\u002Fclipped text (line heights cutting off content) and overlapping elements — these are common and easy to miss.\n3. Identify the discrepancy — is it structural (wrong hierarchy, missing nodes) or visual (wrong colors, broken layout, clipped content)?\n4. Write a targeted fix script that modifies only the broken parts — don't recreate everything.\n\n> For the full validation workflow, see [Validation & Error Recovery](references\u002Fvalidation-and-recovery.md).\n\n## 8. Pre-Flight Checklist\n\nBefore submitting ANY `use_figma` call, verify:\n\n- [ ] Code uses `return` to send data back (NOT `figma.closePlugin()`)\n- [ ] Code is NOT wrapped in an async IIFE (auto-wrapped for you)\n- [ ] `return` value includes structured data with actionable info (IDs, counts)\n- [ ] NO usage of `figma.notify()` anywhere\n- [ ] NO usage of `console.log()` as output (use `return` instead)\n- [ ] All colors use 0–1 range (not 0–255)\n- [ ] Paint `color` objects use `{r, g, b}` only — no `a` field (opacity goes at the paint level: `{ type: 'SOLID', color: {...}, opacity: 0.5 }`)\n- [ ] Fills\u002Fstrokes are reassigned as new arrays (not mutated in place)\n- [ ] Page switches use `await figma.setCurrentPageAsync(page)` (sync setter `figma.currentPage = page` does NOT work)\n- [ ] `layoutSizingVertical\u002FHorizontal = 'FILL'` is set AFTER `parent.appendChild(child)`\n- [ ] Wrapping TEXT blocks set `textAutoResize = 'HEIGHT'` and an explicit width (`'FIXED'` + `resize()`) — NOT `FILL` alone, which the default `WIDTH_AND_HEIGHT` mode ignores, collapsing the node to a near-zero-width thread. Verify `node.width > 0`\n- [ ] Every text mutation follows the [canonical recipe](references\u002Fgotchas.md#canonical-text-edit-recipe-font-load--await--mutate--return-ids): `loadFontAsync` → `await` → mutate `characters`\u002Ffont\u002Fsize\u002Fetc. → return affected node IDs. Works for ANY font family\u002Fstyle, not just Inter (which only happens to be preloaded).\n- [ ] Style names have already been verified via `listAvailableFontsAsync()` — NOT guessed from memory (`\"SemiBold\"` vs `\"Semi Bold\"` is a common footgun)\n- [ ] For `FONT_FAMILY`-scoped variables: every value across every relevant mode is loaded before `setBoundVariable(\"fontFamily\", …)`, `setValueForMode`, or `setExplicitVariableModeForCollection`\n- [ ] `lineHeight`\u002F`letterSpacing` use `{unit, value}` format (not bare numbers)\n- [ ] `resize()` is called BEFORE setting sizing modes (resize resets them to FIXED)\n- [ ] For multi-step workflows: IDs from previous calls are passed as string literals (not variables)\n- [ ] New top-level nodes are positioned away from (0,0) to avoid overlapping existing content\n- [ ] Containers with structurally-related children use `figma.createAutoLayout()`, not absolute x\u002Fy (see Rule 12a)\n- [ ] ALL created\u002Fmutated node IDs are collected and included in the `return` value\n- [ ] Every async call (`loadFontAsync`, `setCurrentPageAsync`, `importComponentByKeyAsync`, etc.) is `await`ed — no fire-and-forget Promises\n\n## 9. Discover Conventions Before Creating\n\n**Always inspect the Figma file before creating anything.** Different files use different naming conventions, variable structures, and component patterns. Your code should match what's already there, not impose new conventions.\n\nWhen in doubt about any convention (naming, scoping, structure), check the Figma file first, then the user's codebase. Only fall back to common patterns when neither exists.\n\n### Quick inspection scripts\n\n**List all pages and top-level nodes:**\n```js\nconst pages = figma.root.children.map(p => `${p.name} id=${p.id} children=${p.children.length}`);\nreturn pages.join('\\n');\n```\n\n**List existing components across all pages:**\n\n`search_design_system` is an option for published components. For on-canvas components, use the two-step fan-out — **don't loop pages inside one script.**\n\nStep 1: one read-only `use_figma` to get page IDs:\n```js\nreturn figma.root.children.map(p => ({ id: p.id, name: p.name }));\n```\n\nStep 2: in the **next assistant turn, emit one `use_figma` per page in parallel** (a single message containing N tool-use blocks). Each runs:\n```js\nconst page = await figma.getNodeByIdAsync(PAGE_ID);\nawait figma.setCurrentPageAsync(page);\n\u002F\u002F findAllWithCriteria uses an indexed type lookup — hundreds of times faster\n\u002F\u002F than the findAll(n => n.type === '…') side-effect-in-predicate antipattern.\nconst matches = page.findAllWithCriteria({ types: ['COMPONENT', 'COMPONENT_SET'] });\nreturn matches.map(n => ({ page: page.name, name: n.name, type: n.type, id: n.id }));\n```\n\n**List existing variable collections and their conventions:**\n```js\nconst collections = await figma.variables.getLocalVariableCollectionsAsync();\nconst results = collections.map(c => ({\n  name: c.name, id: c.id,\n  varCount: c.variableIds.length,\n  modes: c.modes.map(m => m.name)\n}));\nreturn results;\n```\n\n## 10. Reference Docs\n\nLoad these as needed based on what your task involves:\n\n| Doc | When to load | What it covers |\n|-----|-------------|----------------|\n| [gotchas.md](references\u002Fgotchas.md) | Before any `use_figma` | Every known pitfall with WRONG\u002FCORRECT code examples — start with the [canonical text-edit recipe](references\u002Fgotchas.md#canonical-text-edit-recipe-font-load--await--mutate--return-ids) |\n| [common-patterns.md](references\u002Fcommon-patterns.md) | Need working code examples | Script scaffolds: shapes, text, auto-layout, variables, components, multi-step workflows |\n| [plugin-api-patterns.md](references\u002Fplugin-api-patterns.md) | Creating\u002Fediting nodes | Fills, strokes, Auto Layout, effects, grouping, cloning, styles |\n| [api-reference.md](references\u002Fapi-reference.md) | Need exact API surface | Node creation, variables API, core properties, what works and what doesn't |\n| [validation-and-recovery.md](references\u002Fvalidation-and-recovery.md) | Multi-step writes or error recovery | `get_metadata` vs `get_screenshot` workflow, mandatory error recovery steps |\n| [component-patterns.md](references\u002Fcomponent-patterns.md) | Creating components\u002Fvariants | combineAsVariants, component properties, INSTANCE_SWAP, variant layout, discovering existing components, metadata traversal |\n| [variable-patterns.md](references\u002Fvariable-patterns.md) | Creating\u002Fbinding variables | Collections, modes, scopes, aliasing, binding patterns, discovering existing variables |\n| [text-style-patterns.md](references\u002Ftext-style-patterns.md) | Creating\u002Fapplying text styles | Type ramps, font discovery via `listAvailableFontsAsync`, listing styles, applying styles to nodes |\n| [effect-style-patterns.md](references\u002Feffect-style-patterns.md) | Creating\u002Fapplying effect styles | Drop shadows, listing styles, applying styles to nodes |\n| [plugin-api-standalone.index.md](references\u002Fplugin-api-standalone.index.md) | Need to understand the full API surface | Index of all types, methods, and properties in the Plugin API |\n| [plugin-api-standalone.d.ts](references\u002Fplugin-api-standalone.d.ts) | Need exact type signatures | Full typings file — grep for specific symbols, don't load all at once |\n\n## 11. Snippet examples\n\nYou will see snippets throughout documentation here. These snippets contain useful plugin API code that can be repurposed. Use them as is, or as starter code as you go. If there are key concepts that are best documented as generic snippets, call them out and write to disk so you can reuse in the future.\n",{"data":34,"body":36},{"name":4,"description":6,"disable-model-invocation":35},false,{"type":37,"children":38},"root",[39,48,71,120,154,181,206,227,240,247,1094,1109,1115,1140,1147,1184,1369,1389,1407,1441,1461,1612,1631,1637,1668,1687,1700,1719,1803,1809,1850,1884,1889,1899,1904,1913,1965,2008,2014,2024,2036,2048,2240,2248,2519,2527,2792,2824,2832,3401,3413,3425,3627,3674,3719,3727,3943,3955,3965,4239,4252,4257,4429,4441,4453,4548,4569,4581,4593,4760,4784,4802,4820,4826,4843,4849,4898,4904,5032,5038,5048,5054,5162,5168,5183,5196,5263,5269,5586,5592,5627,5642,5648,5660,6141,6147,6157,6162,6168,6176,6376,6384,6399,6411,6531,6550,6886,6894,7183,7189,7194,7483,7489,7494],{"type":40,"tag":41,"props":42,"children":44},"element","h1",{"id":43},"use_figma-figma-plugin-api-skill",[45],{"type":46,"value":47},"text","use_figma — Figma Plugin API Skill",{"type":40,"tag":49,"props":50,"children":51},"p",{},[52,54,61,63,69],{"type":46,"value":53},"Use the ",{"type":40,"tag":55,"props":56,"children":58},"code",{"className":57},[],[59],{"type":46,"value":60},"use_figma",{"type":46,"value":62}," tool to execute JavaScript in Figma files via the Plugin API. All detailed reference docs live in ",{"type":40,"tag":55,"props":64,"children":66},{"className":65},[],[67],{"type":46,"value":68},"references\u002F",{"type":46,"value":70},".",{"type":40,"tag":49,"props":72,"children":73},{},[74,118],{"type":40,"tag":75,"props":76,"children":77},"strong",{},[78,80,85,87,93,95,100,102,108,110,116],{"type":46,"value":79},"Always include ",{"type":40,"tag":55,"props":81,"children":83},{"className":82},[],[84],{"type":46,"value":4},{"type":46,"value":86}," in the comma-separated ",{"type":40,"tag":55,"props":88,"children":90},{"className":89},[],[91],{"type":46,"value":92},"skillNames",{"type":46,"value":94}," parameter when calling ",{"type":40,"tag":55,"props":96,"children":98},{"className":97},[],[99],{"type":46,"value":60},{"type":46,"value":101},". If this skill was loaded via an MCP resource, you MUST prefix the name with ",{"type":40,"tag":55,"props":103,"children":105},{"className":104},[],[106],{"type":46,"value":107},"resource:",{"type":46,"value":109}," (e.g. ",{"type":40,"tag":55,"props":111,"children":113},{"className":112},[],[114],{"type":46,"value":115},"resource:figma-use",{"type":46,"value":117},").",{"type":46,"value":119}," This is a logging parameter used to track skill usage — it does not affect execution.",{"type":40,"tag":49,"props":121,"children":122},{},[123,136,138,144,146,152],{"type":40,"tag":75,"props":124,"children":125},{},[126,128,134],{"type":46,"value":127},"If Figma MCP tools appear as deferred tools, batch-load all their schemas in a single ",{"type":40,"tag":55,"props":129,"children":131},{"className":130},[],[132],{"type":46,"value":133},"ToolSearch",{"type":46,"value":135}," call",{"type":46,"value":137}," using the ",{"type":40,"tag":55,"props":139,"children":141},{"className":140},[],[142],{"type":46,"value":143},"select:",{"type":46,"value":145}," syntax — e.g. ",{"type":40,"tag":55,"props":147,"children":149},{"className":148},[],[150],{"type":46,"value":151},"ToolSearch query=\"select:use_figma,get_screenshot,get_metadata,create_new_file\"",{"type":46,"value":153},". One round trip beats six.",{"type":40,"tag":49,"props":155,"children":156},{},[157,162,164,171,173,179],{"type":40,"tag":75,"props":158,"children":159},{},[160],{"type":46,"value":161},"If the task involves building or updating a full page, screen, or multi-section layout in Figma from code",{"type":46,"value":163},", also load ",{"type":40,"tag":165,"props":166,"children":168},"a",{"href":167},"..\u002Ffigma-generate-design\u002FSKILL.md",[169],{"type":46,"value":170},"figma-generate-design",{"type":46,"value":172},". It provides the workflow for discovering design system components via ",{"type":40,"tag":55,"props":174,"children":176},{"className":175},[],[177],{"type":46,"value":178},"search_design_system",{"type":46,"value":180},", importing them, and assembling screens incrementally. Both skills work together: this one for the API rules, that one for the screen-building workflow.",{"type":40,"tag":49,"props":182,"children":183},{},[184,189,191,197,199,204],{"type":40,"tag":75,"props":185,"children":186},{},[187],{"type":46,"value":188},"If the task involves creating or building a component in Figma",{"type":46,"value":190}," (even a single component), also load ",{"type":40,"tag":165,"props":192,"children":194},{"href":193},"..\u002Ffigma-generate-library\u002FSKILL.md",[195],{"type":46,"value":196},"figma-generate-library",{"type":46,"value":198},". It provides the component creation workflow — variable foundations, variant sets, design token bindings — that ",{"type":40,"tag":55,"props":200,"children":202},{"className":201},[],[203],{"type":46,"value":4},{"type":46,"value":205}," alone doesn't cover.",{"type":40,"tag":49,"props":207,"children":208},{},[209,211,217,219,225],{"type":46,"value":210},"Before anything, load ",{"type":40,"tag":165,"props":212,"children":214},{"href":213},"references\u002Fplugin-api-standalone.index.md",[215],{"type":46,"value":216},"plugin-api-standalone.index.md",{"type":46,"value":218}," to understand what is possible. When you are asked to write plugin API code, use this context to grep ",{"type":40,"tag":165,"props":220,"children":222},{"href":221},"references\u002Fplugin-api-standalone.d.ts",[223],{"type":46,"value":224},"plugin-api-standalone.d.ts",{"type":46,"value":226}," for relevant types, methods, and properties. This is the definitive source of truth for the API surface. It is a large typings file, so do not load it all at once, grep for relevant sections as needed.",{"type":40,"tag":49,"props":228,"children":229},{},[230,232,238],{"type":46,"value":231},"IMPORTANT: Whenever you work with design systems, start with ",{"type":40,"tag":165,"props":233,"children":235},{"href":234},"references\u002Fworking-with-design-systems\u002Fwwds.md",[236],{"type":46,"value":237},"working-with-design-systems\u002Fwwds.md",{"type":46,"value":239}," to understand the key concepts, processes, and guidelines for working with design systems in Figma. Then load the more specific references for components, variables, text styles, and effect styles as needed.",{"type":40,"tag":241,"props":242,"children":244},"h2",{"id":243},"_1-critical-rules",[245],{"type":46,"value":246},"1. Critical Rules",{"type":40,"tag":248,"props":249,"children":250},"ol",{},[251,278,309,372,390,407,427,439,547,580,598,616,912,936,967,992,1050],{"type":40,"tag":252,"props":253,"children":254},"li",{},[255,268,270,276],{"type":40,"tag":75,"props":256,"children":257},{},[258,260,266],{"type":46,"value":259},"Use ",{"type":40,"tag":55,"props":261,"children":263},{"className":262},[],[264],{"type":46,"value":265},"return",{"type":46,"value":267}," to send data back.",{"type":46,"value":269}," The return value is JSON-serialized automatically (objects, arrays, strings, numbers). Do NOT call ",{"type":40,"tag":55,"props":271,"children":273},{"className":272},[],[274],{"type":46,"value":275},"figma.closePlugin()",{"type":46,"value":277}," or wrap code in an async IIFE — this is handled for you.",{"type":40,"tag":252,"props":279,"children":280},{},[281,300,302,308],{"type":40,"tag":75,"props":282,"children":283},{},[284,286,292,294,299],{"type":46,"value":285},"Write plain JavaScript with top-level ",{"type":40,"tag":55,"props":287,"children":289},{"className":288},[],[290],{"type":46,"value":291},"await",{"type":46,"value":293}," and ",{"type":40,"tag":55,"props":295,"children":297},{"className":296},[],[298],{"type":46,"value":265},{"type":46,"value":70},{"type":46,"value":301}," Code is automatically wrapped in an async context. Do NOT wrap in ",{"type":40,"tag":55,"props":303,"children":305},{"className":304},[],[306],{"type":46,"value":307},"(async () => { ... })()",{"type":46,"value":70},{"type":40,"tag":252,"props":310,"children":311},{},[312,318,320,325,327,333,335,341,343,348,350,355,357,363,364,370],{"type":40,"tag":55,"props":313,"children":315},{"className":314},[],[316],{"type":46,"value":317},"figma.notify()",{"type":46,"value":319}," ",{"type":40,"tag":75,"props":321,"children":322},{},[323],{"type":46,"value":324},"throws \"not implemented\"",{"type":46,"value":326}," — never use it\n3a. ",{"type":40,"tag":55,"props":328,"children":330},{"className":329},[],[331],{"type":46,"value":332},"getPluginData()",{"type":46,"value":334}," \u002F ",{"type":40,"tag":55,"props":336,"children":338},{"className":337},[],[339],{"type":46,"value":340},"setPluginData()",{"type":46,"value":342}," are ",{"type":40,"tag":75,"props":344,"children":345},{},[346],{"type":46,"value":347},"not supported",{"type":46,"value":349}," in ",{"type":40,"tag":55,"props":351,"children":353},{"className":352},[],[354],{"type":46,"value":60},{"type":46,"value":356}," — do not use them. Use ",{"type":40,"tag":55,"props":358,"children":360},{"className":359},[],[361],{"type":46,"value":362},"getSharedPluginData()",{"type":46,"value":334},{"type":40,"tag":55,"props":365,"children":367},{"className":366},[],[368],{"type":46,"value":369},"setSharedPluginData()",{"type":46,"value":371}," instead (these ARE supported), or track node IDs by returning them and passing them to subsequent calls.",{"type":40,"tag":252,"props":373,"children":374},{},[375,381,383,388],{"type":40,"tag":55,"props":376,"children":378},{"className":377},[],[379],{"type":46,"value":380},"console.log()",{"type":46,"value":382}," is NOT returned — use ",{"type":40,"tag":55,"props":384,"children":386},{"className":385},[],[387],{"type":46,"value":265},{"type":46,"value":389}," for output",{"type":40,"tag":252,"props":391,"children":392},{},[393,398,400,405],{"type":40,"tag":75,"props":394,"children":395},{},[396],{"type":46,"value":397},"Work incrementally in small steps.",{"type":46,"value":399}," Break large operations into multiple ",{"type":40,"tag":55,"props":401,"children":403},{"className":402},[],[404],{"type":46,"value":60},{"type":46,"value":406}," calls. Validate after each step. This is the single most important practice for avoiding bugs.",{"type":40,"tag":252,"props":408,"children":409},{},[410,412,417,419,425],{"type":46,"value":411},"Colors are ",{"type":40,"tag":75,"props":413,"children":414},{},[415],{"type":46,"value":416},"0–1 range",{"type":46,"value":418}," (not 0–255): ",{"type":40,"tag":55,"props":420,"children":422},{"className":421},[],[423],{"type":46,"value":424},"{r: 1, g: 0, b: 0}",{"type":46,"value":426}," = red",{"type":40,"tag":252,"props":428,"children":429},{},[430,432,437],{"type":46,"value":431},"Fills\u002Fstrokes are ",{"type":40,"tag":75,"props":433,"children":434},{},[435],{"type":46,"value":436},"read-only arrays",{"type":46,"value":438}," — clone, modify, reassign",{"type":40,"tag":252,"props":440,"children":441},{},[442,454,456,462,464,470,472,478,480,486,487,493,494,500,501,507,508,514,516,522,524,530,532,538,540,546],{"type":40,"tag":75,"props":443,"children":444},{},[445,447,452],{"type":46,"value":446},"Every text edit follows the canonical recipe: load font → ",{"type":40,"tag":55,"props":448,"children":450},{"className":449},[],[451],{"type":46,"value":291},{"type":46,"value":453}," → mutate → return affected node IDs.",{"type":46,"value":455}," Skipping the load throws ",{"type":40,"tag":55,"props":457,"children":459},{"className":458},[],[460],{"type":46,"value":461},"Cannot write to node with unloaded font \"\u003Cfamily> \u003Cstyle>\"",{"type":46,"value":463},". The rule covers more than ",{"type":40,"tag":55,"props":465,"children":467},{"className":466},[],[468],{"type":46,"value":469},"characters",{"type":46,"value":471}," — it applies to any operation on nodes with unloaded fonts (",{"type":40,"tag":55,"props":473,"children":475},{"className":474},[],[476],{"type":46,"value":477},"appendChild",{"type":46,"value":479},", ",{"type":40,"tag":55,"props":481,"children":483},{"className":482},[],[484],{"type":46,"value":485},"insertChild",{"type":46,"value":479},{"type":40,"tag":55,"props":488,"children":490},{"className":489},[],[491],{"type":46,"value":492},"setBoundVariable",{"type":46,"value":479},{"type":40,"tag":55,"props":495,"children":497},{"className":496},[],[498],{"type":46,"value":499},"setExplicitVariableModeForCollection",{"type":46,"value":479},{"type":40,"tag":55,"props":502,"children":504},{"className":503},[],[505],{"type":46,"value":506},"setValueForMode",{"type":46,"value":479},{"type":40,"tag":55,"props":509,"children":511},{"className":510},[],[512],{"type":46,"value":513},"findAll",{"type":46,"value":515}," callbacks touching text). When mutating existing text, load the node's ",{"type":40,"tag":517,"props":518,"children":519},"em",{},[520],{"type":46,"value":521},"current",{"type":46,"value":523}," fonts via ",{"type":40,"tag":55,"props":525,"children":527},{"className":526},[],[528],{"type":46,"value":529},"getStyledTextSegments(['fontName'])",{"type":46,"value":531},", not a hardcoded default. Inter is preloaded in most environments so other families surface this bug more often — the recipe is the same for every font. Use ",{"type":40,"tag":55,"props":533,"children":535},{"className":534},[],[536],{"type":46,"value":537},"await figma.listAvailableFontsAsync()",{"type":46,"value":539}," first if the style string is unverified. See ",{"type":40,"tag":165,"props":541,"children":543},{"href":542},"references\u002Fgotchas.md#canonical-text-edit-recipe-font-load--await--mutate--return-ids",[544],{"type":46,"value":545},"Canonical text-edit recipe",{"type":46,"value":70},{"type":40,"tag":252,"props":548,"children":549},{},[550,555,557,563,565,571,573,578],{"type":40,"tag":75,"props":551,"children":552},{},[553],{"type":46,"value":554},"Pages load incrementally",{"type":46,"value":556}," — use ",{"type":40,"tag":55,"props":558,"children":560},{"className":559},[],[561],{"type":46,"value":562},"await figma.setCurrentPageAsync(page)",{"type":46,"value":564}," to switch pages and load their content. The sync setter ",{"type":40,"tag":55,"props":566,"children":568},{"className":567},[],[569],{"type":46,"value":570},"figma.currentPage = page",{"type":46,"value":572}," does ",{"type":40,"tag":75,"props":574,"children":575},{},[576],{"type":46,"value":577},"NOT",{"type":46,"value":579}," work and will throw (see Page Rules below)",{"type":40,"tag":252,"props":581,"children":582},{},[583,589,591,596],{"type":40,"tag":55,"props":584,"children":586},{"className":585},[],[587],{"type":46,"value":588},"setBoundVariableForPaint",{"type":46,"value":590}," returns a ",{"type":40,"tag":75,"props":592,"children":593},{},[594],{"type":46,"value":595},"NEW",{"type":46,"value":597}," paint — must capture and reassign",{"type":40,"tag":252,"props":599,"children":600},{},[601,607,609,614],{"type":40,"tag":55,"props":602,"children":604},{"className":603},[],[605],{"type":46,"value":606},"createVariable",{"type":46,"value":608}," accepts collection ",{"type":40,"tag":75,"props":610,"children":611},{},[612],{"type":46,"value":613},"object or ID string",{"type":46,"value":615}," (object preferred)",{"type":40,"tag":252,"props":617,"children":618},{},[619,653,654,660,662,667,669,675,677,682,684,689,691,697,699,705,707,712,714,720,722,728,730,736,737,743,745,763,764,770,771,777,779,784,786,792,794,800,801,807,809,814,816,822,824,830,832,837,839,845,847,853,855,861,862,868,870,876,877,883,885,904,906,911],{"type":40,"tag":75,"props":620,"children":621},{},[622,628,630,636,638,644,645,651],{"type":40,"tag":55,"props":623,"children":625},{"className":624},[],[626],{"type":46,"value":627},"layoutSizingHorizontal\u002FVertical",{"type":46,"value":629}," is value-restricted by structural context — ",{"type":40,"tag":55,"props":631,"children":633},{"className":632},[],[634],{"type":46,"value":635},"FIXED",{"type":46,"value":637}," always works, ",{"type":40,"tag":55,"props":639,"children":641},{"className":640},[],[642],{"type":46,"value":643},"HUG",{"type":46,"value":293},{"type":40,"tag":55,"props":646,"children":648},{"className":647},[],[649],{"type":46,"value":650},"FILL",{"type":46,"value":652}," do not.",{"type":46,"value":319},{"type":40,"tag":55,"props":655,"children":657},{"className":656},[],[658],{"type":46,"value":659},"'HUG'",{"type":46,"value":661}," is valid only on an auto-layout frame itself OR on a ",{"type":40,"tag":75,"props":663,"children":664},{},[665],{"type":46,"value":666},"TEXT",{"type":46,"value":668}," child of one. ",{"type":40,"tag":55,"props":670,"children":672},{"className":671},[],[673],{"type":46,"value":674},"'FILL'",{"type":46,"value":676}," is valid only on a child of an auto-layout frame that is also not absolute-positioned, not inside an immutable frame, and not a canvas-grid child. Practical consequence: append to an auto-layout parent FIRST, then set ",{"type":40,"tag":55,"props":678,"children":680},{"className":679},[],[681],{"type":46,"value":643},{"type":46,"value":683},"\u002F",{"type":40,"tag":55,"props":685,"children":687},{"className":686},[],[688],{"type":46,"value":650},{"type":46,"value":690}," — a newly-created or unparented node can't satisfy the rule yet. The property itself exists on every ",{"type":40,"tag":55,"props":692,"children":694},{"className":693},[],[695],{"type":46,"value":696},"SceneNode",{"type":46,"value":698},"; the error is value-rejection, not \"no such property\". See ",{"type":40,"tag":165,"props":700,"children":702},{"href":701},"references\u002Fgotchas.md#layoutsizinghorizontallayoutsizingvertical-value-rules-fixed-hug-fill",[703],{"type":46,"value":704},"Gotchas",{"type":46,"value":706},".\n12a. ",{"type":40,"tag":75,"props":708,"children":709},{},[710],{"type":46,"value":711},"Use auto-layout for containers that hold related children.",{"type":46,"value":713}," When children have a structural relationship — stacked, side-by-side, aligned, gapped, hugged — wrap them in ",{"type":40,"tag":55,"props":715,"children":717},{"className":716},[],[718],{"type":46,"value":719},"figma.createAutoLayout()",{"type":46,"value":721},", not ",{"type":40,"tag":55,"props":723,"children":725},{"className":724},[],[726],{"type":46,"value":727},"figma.createFrame()",{"type":46,"value":729}," with absolute ",{"type":40,"tag":55,"props":731,"children":733},{"className":732},[],[734],{"type":46,"value":735},"x",{"type":46,"value":683},{"type":40,"tag":55,"props":738,"children":740},{"className":739},[],[741],{"type":46,"value":742},"y",{"type":46,"value":744},". Absolute coordinates govern where a container sits on the canvas; auto-layout governs how its children relate inside it. Skipping the container leaves no protection against text reflow, content changes, or overlap.\n12b. ",{"type":40,"tag":75,"props":746,"children":747},{},[748,754,755,761],{"type":40,"tag":55,"props":749,"children":751},{"className":750},[],[752],{"type":46,"value":753},"layoutSizing*",{"type":46,"value":293},{"type":40,"tag":55,"props":756,"children":758},{"className":757},[],[759],{"type":46,"value":760},"*AxisSizingMode",{"type":46,"value":762}," are different enums — don't cross them.",{"type":46,"value":319},{"type":40,"tag":55,"props":765,"children":767},{"className":766},[],[768],{"type":46,"value":769},"layoutSizingHorizontal",{"type":46,"value":683},{"type":40,"tag":55,"props":772,"children":774},{"className":773},[],[775],{"type":46,"value":776},"layoutSizingVertical",{"type":46,"value":778}," (set on a ",{"type":40,"tag":75,"props":780,"children":781},{},[782],{"type":46,"value":783},"child",{"type":46,"value":785},") take ",{"type":40,"tag":55,"props":787,"children":789},{"className":788},[],[790],{"type":46,"value":791},"'FIXED'|'HUG'|'FILL'",{"type":46,"value":793},"; ",{"type":40,"tag":55,"props":795,"children":797},{"className":796},[],[798],{"type":46,"value":799},"primaryAxisSizingMode",{"type":46,"value":683},{"type":40,"tag":55,"props":802,"children":804},{"className":803},[],[805],{"type":46,"value":806},"counterAxisSizingMode",{"type":46,"value":808}," (set on the ",{"type":40,"tag":75,"props":810,"children":811},{},[812],{"type":46,"value":813},"frame",{"type":46,"value":815}," itself) take ",{"type":40,"tag":55,"props":817,"children":819},{"className":818},[],[820],{"type":46,"value":821},"'FIXED'|'AUTO'",{"type":46,"value":823},". So ",{"type":40,"tag":55,"props":825,"children":827},{"className":826},[],[828],{"type":46,"value":829},"layoutSizingVertical = 'AUTO'",{"type":46,"value":831}," is invalid (use ",{"type":40,"tag":55,"props":833,"children":835},{"className":834},[],[836],{"type":46,"value":659},{"type":46,"value":838},"), and ",{"type":40,"tag":55,"props":840,"children":842},{"className":841},[],[843],{"type":46,"value":844},"counterAxisSizingMode = 'FILL'",{"type":46,"value":846}," throws ",{"type":40,"tag":55,"props":848,"children":850},{"className":849},[],[851],{"type":46,"value":852},"Expected 'FIXED' | 'AUTO', received 'FILL'",{"type":46,"value":854}," (use ",{"type":40,"tag":55,"props":856,"children":858},{"className":857},[],[859],{"type":46,"value":860},"'FIXED'",{"type":46,"value":683},{"type":40,"tag":55,"props":863,"children":865},{"className":864},[],[866],{"type":46,"value":867},"'AUTO'",{"type":46,"value":869},"). Two more errors from the same setter — ",{"type":40,"tag":55,"props":871,"children":873},{"className":872},[],[874],{"type":46,"value":875},"Error: in set_layoutSizingHorizontal: node must be an auto-layout frame or a child of an auto-layout frame",{"type":46,"value":293},{"type":40,"tag":55,"props":878,"children":880},{"className":879},[],[881],{"type":46,"value":882},"Error: in set_layoutSizingHorizontal: FILL can only be set on children of auto-layout frames",{"type":46,"value":884}," — mean the node isn't in an auto-layout context yet; ",{"type":40,"tag":75,"props":886,"children":887},{},[888,890,895,897,902],{"type":46,"value":889},"recommendation: make the parent auto-layout (",{"type":40,"tag":55,"props":891,"children":893},{"className":892},[],[894],{"type":46,"value":719},{"type":46,"value":896},") and ",{"type":40,"tag":55,"props":898,"children":900},{"className":899},[],[901],{"type":46,"value":477},{"type":46,"value":903}," the node before setting",{"type":46,"value":905}," (see Rule 12). See ",{"type":40,"tag":165,"props":907,"children":909},{"href":908},"references\u002Fgotchas.md#layoutsizing-vs-axissizingmode-two-different-sizing-enums",[910],{"type":46,"value":704},{"type":46,"value":70},{"type":40,"tag":252,"props":913,"children":914},{},[915,920,922,928,930,935],{"type":40,"tag":75,"props":916,"children":917},{},[918],{"type":46,"value":919},"Position new top-level nodes away from (0,0).",{"type":46,"value":921}," Nodes appended directly to the page default to (0,0). Scan ",{"type":40,"tag":55,"props":923,"children":925},{"className":924},[],[926],{"type":46,"value":927},"figma.currentPage.children",{"type":46,"value":929}," to find a clear position (e.g., to the right of the rightmost node). This only applies to page-level nodes — nodes nested inside other frames or auto-layout containers are positioned by their parent. See ",{"type":40,"tag":165,"props":931,"children":933},{"href":932},"references\u002Fgotchas.md",[934],{"type":46,"value":704},{"type":46,"value":70},{"type":40,"tag":252,"props":937,"children":938},{},[939,951,953,958,960,966],{"type":40,"tag":75,"props":940,"children":941},{},[942,944,949],{"type":46,"value":943},"On ",{"type":40,"tag":55,"props":945,"children":947},{"className":946},[],[948],{"type":46,"value":60},{"type":46,"value":950}," error, STOP. Do NOT immediately retry.",{"type":46,"value":952}," Failed scripts are ",{"type":40,"tag":75,"props":954,"children":955},{},[956],{"type":46,"value":957},"atomic",{"type":46,"value":959}," — if a script errors, it is not executed at all and no changes are made to the file. Read the error message carefully, fix the script, then retry. See ",{"type":40,"tag":165,"props":961,"children":963},{"href":962},"#6-error-recovery--self-correction",[964],{"type":46,"value":965},"Error Recovery",{"type":46,"value":70},{"type":40,"tag":252,"props":968,"children":969},{},[970,982,984,990],{"type":40,"tag":75,"props":971,"children":972},{},[973,975,980],{"type":46,"value":974},"MUST ",{"type":40,"tag":55,"props":976,"children":978},{"className":977},[],[979],{"type":46,"value":265},{"type":46,"value":981}," ALL created\u002Fmutated node IDs.",{"type":46,"value":983}," Whenever a script creates new nodes or mutates existing ones on the canvas, collect every affected node ID and return them in a structured object (e.g. ",{"type":40,"tag":55,"props":985,"children":987},{"className":986},[],[988],{"type":46,"value":989},"return { createdNodeIds: [...], mutatedNodeIds: [...] }",{"type":46,"value":991},"). This is essential for subsequent calls to reference, validate, or clean up those nodes.",{"type":40,"tag":252,"props":993,"children":994},{},[995,1008,1010,1016,1018,1024,1026,1032,1034,1040,1042,1048],{"type":40,"tag":75,"props":996,"children":997},{},[998,1000,1006],{"type":46,"value":999},"Always set ",{"type":40,"tag":55,"props":1001,"children":1003},{"className":1002},[],[1004],{"type":46,"value":1005},"variable.scopes",{"type":46,"value":1007}," explicitly when creating variables.",{"type":46,"value":1009}," The default ",{"type":40,"tag":55,"props":1011,"children":1013},{"className":1012},[],[1014],{"type":46,"value":1015},"ALL_SCOPES",{"type":46,"value":1017}," pollutes every property picker — almost never what you want. Use specific scopes like ",{"type":40,"tag":55,"props":1019,"children":1021},{"className":1020},[],[1022],{"type":46,"value":1023},"[\"FRAME_FILL\", \"SHAPE_FILL\"]",{"type":46,"value":1025}," for backgrounds, ",{"type":40,"tag":55,"props":1027,"children":1029},{"className":1028},[],[1030],{"type":46,"value":1031},"[\"TEXT_FILL\"]",{"type":46,"value":1033}," for text colors, ",{"type":40,"tag":55,"props":1035,"children":1037},{"className":1036},[],[1038],{"type":46,"value":1039},"[\"GAP\"]",{"type":46,"value":1041}," for spacing, etc. See ",{"type":40,"tag":165,"props":1043,"children":1045},{"href":1044},"references\u002Fvariable-patterns.md",[1046],{"type":46,"value":1047},"variable-patterns.md",{"type":46,"value":1049}," for the full list.",{"type":40,"tag":252,"props":1051,"children":1052},{},[1053,1063,1065,1071,1073,1078,1080,1086,1087,1092],{"type":40,"tag":75,"props":1054,"children":1055},{},[1056,1061],{"type":40,"tag":55,"props":1057,"children":1059},{"className":1058},[],[1060],{"type":46,"value":291},{"type":46,"value":1062}," every Promise.",{"type":46,"value":1064}," Never leave a Promise unawaited — unawaited async calls (e.g. ",{"type":40,"tag":55,"props":1066,"children":1068},{"className":1067},[],[1069],{"type":46,"value":1070},"figma.loadFontAsync(...)",{"type":46,"value":1072}," without ",{"type":40,"tag":55,"props":1074,"children":1076},{"className":1075},[],[1077],{"type":46,"value":291},{"type":46,"value":1079},", or ",{"type":40,"tag":55,"props":1081,"children":1083},{"className":1082},[],[1084],{"type":46,"value":1085},"figma.setCurrentPageAsync(page)",{"type":46,"value":1072},{"type":40,"tag":55,"props":1088,"children":1090},{"className":1089},[],[1091],{"type":46,"value":291},{"type":46,"value":1093},") will fire-and-forget, causing silent failures or race conditions. The script may return before the async operation completes, leading to missing data or half-applied changes.",{"type":40,"tag":1095,"props":1096,"children":1097},"blockquote",{},[1098],{"type":40,"tag":49,"props":1099,"children":1100},{},[1101,1103,1108],{"type":46,"value":1102},"For detailed WRONG\u002FCORRECT examples of each rule, see ",{"type":40,"tag":165,"props":1104,"children":1105},{"href":932},[1106],{"type":46,"value":1107},"Gotchas & Common Mistakes",{"type":46,"value":70},{"type":40,"tag":241,"props":1110,"children":1112},{"id":1111},"_2-page-rules-critical",[1113],{"type":46,"value":1114},"2. Page Rules (Critical)",{"type":40,"tag":49,"props":1116,"children":1117},{},[1118,1130,1132,1138],{"type":40,"tag":75,"props":1119,"children":1120},{},[1121,1123,1128],{"type":46,"value":1122},"Page context resets between ",{"type":40,"tag":55,"props":1124,"children":1126},{"className":1125},[],[1127],{"type":46,"value":60},{"type":46,"value":1129}," calls",{"type":46,"value":1131}," — ",{"type":40,"tag":55,"props":1133,"children":1135},{"className":1134},[],[1136],{"type":46,"value":1137},"figma.currentPage",{"type":46,"value":1139}," starts on the first page each time.",{"type":40,"tag":1141,"props":1142,"children":1144},"h3",{"id":1143},"switching-pages",[1145],{"type":46,"value":1146},"Switching pages",{"type":40,"tag":49,"props":1148,"children":1149},{},[1150,1151,1156,1157,1162,1163,1168,1170,1176,1177,1182],{"type":46,"value":259},{"type":40,"tag":55,"props":1152,"children":1154},{"className":1153},[],[1155],{"type":46,"value":562},{"type":46,"value":564},{"type":40,"tag":55,"props":1158,"children":1160},{"className":1159},[],[1161],{"type":46,"value":570},{"type":46,"value":572},{"type":40,"tag":75,"props":1164,"children":1165},{},[1166],{"type":46,"value":1167},"NOT work",{"type":46,"value":1169}," — it throws ",{"type":40,"tag":55,"props":1171,"children":1173},{"className":1172},[],[1174],{"type":46,"value":1175},"\"Setting figma.currentPage is not supported\"",{"type":46,"value":349},{"type":40,"tag":55,"props":1178,"children":1180},{"className":1179},[],[1181],{"type":46,"value":60},{"type":46,"value":1183},". Always use the async method.",{"type":40,"tag":1185,"props":1186,"children":1191},"pre",{"className":1187,"code":1188,"language":1189,"meta":1190,"style":1190},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Switch to a specific page (loads its content)\nconst targetPage = figma.root.children.find((p) => p.name === \"My Page\");\nawait figma.setCurrentPageAsync(targetPage);\n\u002F\u002F targetPage.children is now populated\n","js","",[1192],{"type":40,"tag":55,"props":1193,"children":1194},{"__ignoreMap":1190},[1195,1207,1329,1360],{"type":40,"tag":1196,"props":1197,"children":1200},"span",{"class":1198,"line":1199},"line",1,[1201],{"type":40,"tag":1196,"props":1202,"children":1204},{"style":1203},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1205],{"type":46,"value":1206},"\u002F\u002F Switch to a specific page (loads its content)\n",{"type":40,"tag":1196,"props":1208,"children":1210},{"class":1198,"line":1209},2,[1211,1217,1223,1229,1234,1238,1242,1246,1251,1255,1261,1266,1270,1275,1280,1285,1290,1294,1299,1304,1309,1315,1320,1324],{"type":40,"tag":1196,"props":1212,"children":1214},{"style":1213},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1215],{"type":46,"value":1216},"const",{"type":40,"tag":1196,"props":1218,"children":1220},{"style":1219},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[1221],{"type":46,"value":1222}," targetPage ",{"type":40,"tag":1196,"props":1224,"children":1226},{"style":1225},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[1227],{"type":46,"value":1228},"=",{"type":40,"tag":1196,"props":1230,"children":1231},{"style":1219},[1232],{"type":46,"value":1233}," figma",{"type":40,"tag":1196,"props":1235,"children":1236},{"style":1225},[1237],{"type":46,"value":70},{"type":40,"tag":1196,"props":1239,"children":1240},{"style":1219},[1241],{"type":46,"value":37},{"type":40,"tag":1196,"props":1243,"children":1244},{"style":1225},[1245],{"type":46,"value":70},{"type":40,"tag":1196,"props":1247,"children":1248},{"style":1219},[1249],{"type":46,"value":1250},"children",{"type":40,"tag":1196,"props":1252,"children":1253},{"style":1225},[1254],{"type":46,"value":70},{"type":40,"tag":1196,"props":1256,"children":1258},{"style":1257},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[1259],{"type":46,"value":1260},"find",{"type":40,"tag":1196,"props":1262,"children":1263},{"style":1219},[1264],{"type":46,"value":1265},"(",{"type":40,"tag":1196,"props":1267,"children":1268},{"style":1225},[1269],{"type":46,"value":1265},{"type":40,"tag":1196,"props":1271,"children":1273},{"style":1272},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[1274],{"type":46,"value":49},{"type":40,"tag":1196,"props":1276,"children":1277},{"style":1225},[1278],{"type":46,"value":1279},")",{"type":40,"tag":1196,"props":1281,"children":1282},{"style":1213},[1283],{"type":46,"value":1284}," =>",{"type":40,"tag":1196,"props":1286,"children":1287},{"style":1219},[1288],{"type":46,"value":1289}," p",{"type":40,"tag":1196,"props":1291,"children":1292},{"style":1225},[1293],{"type":46,"value":70},{"type":40,"tag":1196,"props":1295,"children":1296},{"style":1219},[1297],{"type":46,"value":1298},"name ",{"type":40,"tag":1196,"props":1300,"children":1301},{"style":1225},[1302],{"type":46,"value":1303},"===",{"type":40,"tag":1196,"props":1305,"children":1306},{"style":1225},[1307],{"type":46,"value":1308}," \"",{"type":40,"tag":1196,"props":1310,"children":1312},{"style":1311},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[1313],{"type":46,"value":1314},"My Page",{"type":40,"tag":1196,"props":1316,"children":1317},{"style":1225},[1318],{"type":46,"value":1319},"\"",{"type":40,"tag":1196,"props":1321,"children":1322},{"style":1219},[1323],{"type":46,"value":1279},{"type":40,"tag":1196,"props":1325,"children":1326},{"style":1225},[1327],{"type":46,"value":1328},";\n",{"type":40,"tag":1196,"props":1330,"children":1332},{"class":1198,"line":1331},3,[1333,1338,1342,1346,1351,1356],{"type":40,"tag":1196,"props":1334,"children":1336},{"style":1335},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[1337],{"type":46,"value":291},{"type":40,"tag":1196,"props":1339,"children":1340},{"style":1219},[1341],{"type":46,"value":1233},{"type":40,"tag":1196,"props":1343,"children":1344},{"style":1225},[1345],{"type":46,"value":70},{"type":40,"tag":1196,"props":1347,"children":1348},{"style":1257},[1349],{"type":46,"value":1350},"setCurrentPageAsync",{"type":40,"tag":1196,"props":1352,"children":1353},{"style":1219},[1354],{"type":46,"value":1355},"(targetPage)",{"type":40,"tag":1196,"props":1357,"children":1358},{"style":1225},[1359],{"type":46,"value":1328},{"type":40,"tag":1196,"props":1361,"children":1363},{"class":1198,"line":1362},4,[1364],{"type":40,"tag":1196,"props":1365,"children":1366},{"style":1203},[1367],{"type":46,"value":1368},"\u002F\u002F targetPage.children is now populated\n",{"type":40,"tag":1141,"props":1370,"children":1372},{"id":1371},"call-setcurrentpageasync-at-most-once-per-use_figma-invocation-fan-multi-page-work-out-in-parallel",[1373,1375,1380,1382,1387],{"type":46,"value":1374},"Call ",{"type":40,"tag":55,"props":1376,"children":1378},{"className":1377},[],[1379],{"type":46,"value":1350},{"type":46,"value":1381}," at most once per ",{"type":40,"tag":55,"props":1383,"children":1385},{"className":1384},[],[1386],{"type":46,"value":60},{"type":46,"value":1388}," invocation — fan multi-page work out in parallel",{"type":40,"tag":49,"props":1390,"children":1391},{},[1392,1397,1399,1405],{"type":40,"tag":75,"props":1393,"children":1394},{},[1395],{"type":46,"value":1396},"One script must switch pages at most once.",{"type":46,"value":1398}," Never loop over ",{"type":40,"tag":55,"props":1400,"children":1402},{"className":1401},[],[1403],{"type":46,"value":1404},"figma.root.children",{"type":46,"value":1406}," and switch pages inside the loop.",{"type":40,"tag":49,"props":1408,"children":1409},{},[1410,1412,1424,1426,1431,1433,1439],{"type":46,"value":1411},"If the work spans multiple pages, ",{"type":40,"tag":75,"props":1413,"children":1414},{},[1415,1417,1422],{"type":46,"value":1416},"split it into N ",{"type":40,"tag":55,"props":1418,"children":1420},{"className":1419},[],[1421],{"type":46,"value":60},{"type":46,"value":1423}," calls (one per target page) and emit them in parallel",{"type":46,"value":1425}," — a single assistant message containing N ",{"type":40,"tag":55,"props":1427,"children":1429},{"className":1428},[],[1430],{"type":46,"value":60},{"type":46,"value":1432}," tool-use blocks. The harness runs them concurrently; each script sets ",{"type":40,"tag":55,"props":1434,"children":1436},{"className":1435},[],[1437],{"type":46,"value":1438},"currentPage",{"type":46,"value":1440}," exactly once.",{"type":40,"tag":1095,"props":1442,"children":1443},{},[1444],{"type":40,"tag":49,"props":1445,"children":1446},{},[1447,1452,1454,1459],{"type":40,"tag":75,"props":1448,"children":1449},{},[1450],{"type":46,"value":1451},"Explicit instruction:",{"type":46,"value":1453}," when fanning out, you MUST issue the N tool calls in ",{"type":40,"tag":75,"props":1455,"children":1456},{},[1457],{"type":46,"value":1458},"one message",{"type":46,"value":1460},". Do not send them across multiple turns. Do not await one before issuing the next. Sequential per-page calls are slower than the in-loop pattern this rule replaces and waste the entire benefit of splitting.",{"type":40,"tag":1185,"props":1462,"children":1464},{"className":1187,"code":1463,"language":1189,"meta":1190,"style":1190},"\u002F\u002F AVOID — switches pages N times in one script, reloads the file each time\nfor (const page of figma.root.children) {\n  await figma.setCurrentPageAsync(page);\n  \u002F\u002F ... touch this page ...\n}\n\n\u002F\u002F PREFER — read-only discovery call to get page IDs, then in the NEXT message\n\u002F\u002F emit N parallel use_figma tool calls (one per page), each setting currentPage once.\n",[1465],{"type":40,"tag":55,"props":1466,"children":1467},{"__ignoreMap":1190},[1468,1476,1529,1567,1575,1584,1594,1603],{"type":40,"tag":1196,"props":1469,"children":1470},{"class":1198,"line":1199},[1471],{"type":40,"tag":1196,"props":1472,"children":1473},{"style":1203},[1474],{"type":46,"value":1475},"\u002F\u002F AVOID — switches pages N times in one script, reloads the file each time\n",{"type":40,"tag":1196,"props":1477,"children":1478},{"class":1198,"line":1209},[1479,1484,1489,1493,1498,1503,1507,1511,1515,1519,1524],{"type":40,"tag":1196,"props":1480,"children":1481},{"style":1335},[1482],{"type":46,"value":1483},"for",{"type":40,"tag":1196,"props":1485,"children":1486},{"style":1219},[1487],{"type":46,"value":1488}," (",{"type":40,"tag":1196,"props":1490,"children":1491},{"style":1213},[1492],{"type":46,"value":1216},{"type":40,"tag":1196,"props":1494,"children":1495},{"style":1219},[1496],{"type":46,"value":1497}," page ",{"type":40,"tag":1196,"props":1499,"children":1500},{"style":1225},[1501],{"type":46,"value":1502},"of",{"type":40,"tag":1196,"props":1504,"children":1505},{"style":1219},[1506],{"type":46,"value":1233},{"type":40,"tag":1196,"props":1508,"children":1509},{"style":1225},[1510],{"type":46,"value":70},{"type":40,"tag":1196,"props":1512,"children":1513},{"style":1219},[1514],{"type":46,"value":37},{"type":40,"tag":1196,"props":1516,"children":1517},{"style":1225},[1518],{"type":46,"value":70},{"type":40,"tag":1196,"props":1520,"children":1521},{"style":1219},[1522],{"type":46,"value":1523},"children) ",{"type":40,"tag":1196,"props":1525,"children":1526},{"style":1225},[1527],{"type":46,"value":1528},"{\n",{"type":40,"tag":1196,"props":1530,"children":1531},{"class":1198,"line":1331},[1532,1537,1541,1545,1549,1554,1559,1563],{"type":40,"tag":1196,"props":1533,"children":1534},{"style":1335},[1535],{"type":46,"value":1536},"  await",{"type":40,"tag":1196,"props":1538,"children":1539},{"style":1219},[1540],{"type":46,"value":1233},{"type":40,"tag":1196,"props":1542,"children":1543},{"style":1225},[1544],{"type":46,"value":70},{"type":40,"tag":1196,"props":1546,"children":1547},{"style":1257},[1548],{"type":46,"value":1350},{"type":40,"tag":1196,"props":1550,"children":1552},{"style":1551},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1553],{"type":46,"value":1265},{"type":40,"tag":1196,"props":1555,"children":1556},{"style":1219},[1557],{"type":46,"value":1558},"page",{"type":40,"tag":1196,"props":1560,"children":1561},{"style":1551},[1562],{"type":46,"value":1279},{"type":40,"tag":1196,"props":1564,"children":1565},{"style":1225},[1566],{"type":46,"value":1328},{"type":40,"tag":1196,"props":1568,"children":1569},{"class":1198,"line":1362},[1570],{"type":40,"tag":1196,"props":1571,"children":1572},{"style":1203},[1573],{"type":46,"value":1574},"  \u002F\u002F ... touch this page ...\n",{"type":40,"tag":1196,"props":1576,"children":1578},{"class":1198,"line":1577},5,[1579],{"type":40,"tag":1196,"props":1580,"children":1581},{"style":1225},[1582],{"type":46,"value":1583},"}\n",{"type":40,"tag":1196,"props":1585,"children":1587},{"class":1198,"line":1586},6,[1588],{"type":40,"tag":1196,"props":1589,"children":1591},{"emptyLinePlaceholder":1590},true,[1592],{"type":46,"value":1593},"\n",{"type":40,"tag":1196,"props":1595,"children":1597},{"class":1198,"line":1596},7,[1598],{"type":40,"tag":1196,"props":1599,"children":1600},{"style":1203},[1601],{"type":46,"value":1602},"\u002F\u002F PREFER — read-only discovery call to get page IDs, then in the NEXT message\n",{"type":40,"tag":1196,"props":1604,"children":1606},{"class":1198,"line":1605},8,[1607],{"type":40,"tag":1196,"props":1608,"children":1609},{"style":1203},[1610],{"type":46,"value":1611},"\u002F\u002F emit N parallel use_figma tool calls (one per page), each setting currentPage once.\n",{"type":40,"tag":49,"props":1613,"children":1614},{},[1615,1617,1629],{"type":46,"value":1616},"Default to parallel fan-out for any multi-page work — reads and writes alike. See ",{"type":40,"tag":165,"props":1618,"children":1620},{"href":1619},"references\u002Fgotchas.md#set-current-page-once-per-use_figma-call--split-multi-page-work-into-parallel-calls",[1621,1623,1628],{"type":46,"value":1622},"gotchas.md → Set current page once per ",{"type":40,"tag":55,"props":1624,"children":1626},{"className":1625},[],[1627],{"type":46,"value":60},{"type":46,"value":135},{"type":46,"value":1630}," for the full rationale.",{"type":40,"tag":1141,"props":1632,"children":1634},{"id":1633},"across-script-runs",[1635],{"type":46,"value":1636},"Across script runs",{"type":40,"tag":49,"props":1638,"children":1639},{},[1640,1645,1647,1652,1654,1659,1661,1666],{"type":40,"tag":55,"props":1641,"children":1643},{"className":1642},[],[1644],{"type":46,"value":1137},{"type":46,"value":1646}," resets to the ",{"type":40,"tag":75,"props":1648,"children":1649},{},[1650],{"type":46,"value":1651},"first page",{"type":46,"value":1653}," at the start of each ",{"type":40,"tag":55,"props":1655,"children":1657},{"className":1656},[],[1658],{"type":46,"value":60},{"type":46,"value":1660}," call. If your workflow spans multiple calls and targets a non-default page, call ",{"type":40,"tag":55,"props":1662,"children":1664},{"className":1663},[],[1665],{"type":46,"value":562},{"type":46,"value":1667}," at the start of each invocation.",{"type":40,"tag":49,"props":1669,"children":1670},{},[1671,1673,1678,1680,1685],{"type":46,"value":1672},"You can call ",{"type":40,"tag":55,"props":1674,"children":1676},{"className":1675},[],[1677],{"type":46,"value":60},{"type":46,"value":1679}," multiple times to incrementally build on the file state, or to retrieve information before writing another script. For example, write a script to get metadata about existing nodes, ",{"type":40,"tag":55,"props":1681,"children":1683},{"className":1682},[],[1684],{"type":46,"value":265},{"type":46,"value":1686}," that data, then use it in a subsequent script to modify those nodes.",{"type":40,"tag":241,"props":1688,"children":1690},{"id":1689},"_3-return-is-your-output-channel",[1691,1693,1698],{"type":46,"value":1692},"3. ",{"type":40,"tag":55,"props":1694,"children":1696},{"className":1695},[],[1697],{"type":46,"value":265},{"type":46,"value":1699}," Is Your Output Channel",{"type":40,"tag":49,"props":1701,"children":1702},{},[1703,1705,1710,1712,1717],{"type":46,"value":1704},"The agent sees ",{"type":40,"tag":75,"props":1706,"children":1707},{},[1708],{"type":46,"value":1709},"ONLY",{"type":46,"value":1711}," the value you ",{"type":40,"tag":55,"props":1713,"children":1715},{"className":1714},[],[1716],{"type":46,"value":265},{"type":46,"value":1718},". Everything else is invisible.",{"type":40,"tag":1720,"props":1721,"children":1722},"ul",{},[1723,1747,1763,1781,1798],{"type":40,"tag":252,"props":1724,"children":1725},{},[1726,1731,1733,1738,1740,1745],{"type":40,"tag":75,"props":1727,"children":1728},{},[1729],{"type":46,"value":1730},"Returning IDs (CRITICAL)",{"type":46,"value":1732},": Every script that creates or mutates canvas nodes ",{"type":40,"tag":75,"props":1734,"children":1735},{},[1736],{"type":46,"value":1737},"MUST",{"type":46,"value":1739}," return all affected node IDs — e.g. ",{"type":40,"tag":55,"props":1741,"children":1743},{"className":1742},[],[1744],{"type":46,"value":989},{"type":46,"value":1746},". This is a hard requirement, not optional.",{"type":40,"tag":252,"props":1748,"children":1749},{},[1750,1755,1757],{"type":40,"tag":75,"props":1751,"children":1752},{},[1753],{"type":46,"value":1754},"Progress reporting",{"type":46,"value":1756},": ",{"type":40,"tag":55,"props":1758,"children":1760},{"className":1759},[],[1761],{"type":46,"value":1762},"return { createdNodeIds: [...], count: 5, errors: [] }",{"type":40,"tag":252,"props":1764,"children":1765},{},[1766,1771,1773,1779],{"type":40,"tag":75,"props":1767,"children":1768},{},[1769],{"type":46,"value":1770},"Error info",{"type":46,"value":1772},": Thrown errors are automatically captured and returned — just let them propagate or ",{"type":40,"tag":55,"props":1774,"children":1776},{"className":1775},[],[1777],{"type":46,"value":1778},"throw",{"type":46,"value":1780}," explicitly.",{"type":40,"tag":252,"props":1782,"children":1783},{},[1784,1789,1791,1796],{"type":40,"tag":55,"props":1785,"children":1787},{"className":1786},[],[1788],{"type":46,"value":380},{"type":46,"value":1790}," output is ",{"type":40,"tag":75,"props":1792,"children":1793},{},[1794],{"type":46,"value":1795},"never",{"type":46,"value":1797}," returned to the agent",{"type":40,"tag":252,"props":1799,"children":1800},{},[1801],{"type":46,"value":1802},"Always return actionable data (IDs, counts, status) so subsequent calls can reference created objects",{"type":40,"tag":241,"props":1804,"children":1806},{"id":1805},"_4-editor-mode",[1807],{"type":46,"value":1808},"4. Editor Mode",{"type":40,"tag":49,"props":1810,"children":1811},{},[1812,1817,1819,1824,1826,1832,1834,1840,1842,1848],{"type":40,"tag":55,"props":1813,"children":1815},{"className":1814},[],[1816],{"type":46,"value":60},{"type":46,"value":1818}," works in ",{"type":40,"tag":75,"props":1820,"children":1821},{},[1822],{"type":46,"value":1823},"design mode",{"type":46,"value":1825}," (editorType ",{"type":40,"tag":55,"props":1827,"children":1829},{"className":1828},[],[1830],{"type":46,"value":1831},"\"figma\"",{"type":46,"value":1833},", the default). FigJam (",{"type":40,"tag":55,"props":1835,"children":1837},{"className":1836},[],[1838],{"type":46,"value":1839},"\"figjam\"",{"type":46,"value":1841},") and Slides (",{"type":40,"tag":55,"props":1843,"children":1845},{"className":1844},[],[1846],{"type":46,"value":1847},"\"slides\"",{"type":46,"value":1849},") have different sets of available node types — most design nodes are blocked in FigJam, and FigJam-only nodes are blocked in Slides.",{"type":40,"tag":49,"props":1851,"children":1852},{},[1853,1858,1860,1866,1868,1874,1876,1882],{"type":40,"tag":75,"props":1854,"children":1855},{},[1856],{"type":46,"value":1857},"Tell the editor from the URL:",{"type":46,"value":1859}," Design = ",{"type":40,"tag":55,"props":1861,"children":1863},{"className":1862},[],[1864],{"type":46,"value":1865},"figma.com\u002Fdesign\u002F...",{"type":46,"value":1867},", FigJam = ",{"type":40,"tag":55,"props":1869,"children":1871},{"className":1870},[],[1872],{"type":46,"value":1873},"figma.com\u002Fboard\u002F...",{"type":46,"value":1875},", Slides = ",{"type":40,"tag":55,"props":1877,"children":1879},{"className":1878},[],[1880],{"type":46,"value":1881},"figma.com\u002Fslides\u002F...",{"type":46,"value":1883},". Confirm before assuming an API is available.",{"type":40,"tag":49,"props":1885,"children":1886},{},[1887],{"type":46,"value":1888},"Available in design mode: Rectangle, Frame, Component, Text, Ellipse, Star, Line, Vector, Polygon, BooleanOperation, Slice, Page, Section, TextPath.",{"type":40,"tag":49,"props":1890,"children":1891},{},[1892,1897],{"type":40,"tag":75,"props":1893,"children":1894},{},[1895],{"type":46,"value":1896},"Blocked",{"type":46,"value":1898}," in design mode: Sticky, Connector, ShapeWithText, CodeBlock, Slide, SlideRow, SlideGrid, InteractiveSlideElement, Webpage.",{"type":40,"tag":49,"props":1900,"children":1901},{},[1902],{"type":46,"value":1903},"Available in Slides mode: Rectangle, Frame, Component, Text, Ellipse, Star, Line, Vector, Polygon, BooleanOperation, Slice, Section, TextPath, Slide, SlideRow, SlideGrid, InteractiveSlideElement.",{"type":40,"tag":49,"props":1905,"children":1906},{},[1907,1911],{"type":40,"tag":75,"props":1908,"children":1909},{},[1910],{"type":46,"value":1896},{"type":46,"value":1912}," in Slides mode: Sticky, Connector, ShapeWithText, CodeBlock, Webpage, Page.",{"type":40,"tag":49,"props":1914,"children":1915},{},[1916,1921,1922,1928,1930,1935,1937,1942,1943,1948,1950,1956,1958,1963],{"type":40,"tag":75,"props":1917,"children":1918},{},[1919],{"type":46,"value":1920},"Design-only APIs (not just node types):",{"type":46,"value":319},{"type":40,"tag":55,"props":1923,"children":1925},{"className":1924},[],[1926],{"type":46,"value":1927},"figma.createPage()",{"type":46,"value":1929}," is available only in Design files (",{"type":40,"tag":55,"props":1931,"children":1933},{"className":1932},[],[1934],{"type":46,"value":1865},{"type":46,"value":1936},"). In both FigJam (",{"type":40,"tag":55,"props":1938,"children":1940},{"className":1939},[],[1941],{"type":46,"value":1873},{"type":46,"value":1841},{"type":40,"tag":55,"props":1944,"children":1946},{"className":1945},[],[1947],{"type":46,"value":1881},{"type":46,"value":1949},") it throws ",{"type":40,"tag":55,"props":1951,"children":1953},{"className":1952},[],[1954],{"type":46,"value":1955},"TypeError: figma.createPage no such property 'createPage' on the figma global object",{"type":46,"value":1957},". Do not emit ",{"type":40,"tag":55,"props":1959,"children":1961},{"className":1960},[],[1962],{"type":46,"value":1927},{"type":46,"value":1964}," in FigJam or Slides workflows.",{"type":40,"tag":1095,"props":1966,"children":1967},{},[1968],{"type":40,"tag":49,"props":1969,"children":1970},{},[1971,1976,1978,1983,1985,1991,1992,1998,2000,2006],{"type":40,"tag":75,"props":1972,"children":1973},{},[1974],{"type":46,"value":1975},"Slides note:",{"type":46,"value":1977}," There is no dedicated read tool for Slides files yet. Use ",{"type":40,"tag":55,"props":1979,"children":1981},{"className":1980},[],[1982],{"type":46,"value":60},{"type":46,"value":1984}," with read-only scripts for inspection (see Section 6 \"Inspect first\" pattern), and ",{"type":40,"tag":55,"props":1986,"children":1988},{"className":1987},[],[1989],{"type":46,"value":1990},"get_screenshot",{"type":46,"value":334},{"type":40,"tag":55,"props":1993,"children":1995},{"className":1994},[],[1996],{"type":46,"value":1997},"await node.screenshot()",{"type":46,"value":1999}," for visual context. For Slides-specific API guidance, load the ",{"type":40,"tag":165,"props":2001,"children":2003},{"href":2002},"..\u002Ffigma-use-slides\u002FSKILL.md",[2004],{"type":46,"value":2005},"figma-use-slides",{"type":46,"value":2007}," skill.",{"type":40,"tag":241,"props":2009,"children":2011},{"id":2010},"_5-efficient-apis-prefer-these-over-verbose-alternatives",[2012],{"type":46,"value":2013},"5. Efficient APIs — Prefer These Over Verbose Alternatives",{"type":40,"tag":49,"props":2015,"children":2016},{},[2017,2019],{"type":46,"value":2018},"These APIs reduce boilerplate, eliminate ordering errors, and compress token output. ",{"type":40,"tag":75,"props":2020,"children":2021},{},[2022],{"type":46,"value":2023},"Always prefer them over the verbose alternatives.",{"type":40,"tag":1141,"props":2025,"children":2027},{"id":2026},"nodequeryselector-css-like-node-search",[2028,2034],{"type":40,"tag":55,"props":2029,"children":2031},{"className":2030},[],[2032],{"type":46,"value":2033},"node.query(selector)",{"type":46,"value":2035}," — CSS-like node search",{"type":40,"tag":49,"props":2037,"children":2038},{},[2039,2041,2046],{"type":46,"value":2040},"Find nodes within a subtree using CSS-like selectors. Replaces verbose ",{"type":40,"tag":55,"props":2042,"children":2044},{"className":2043},[],[2045],{"type":46,"value":513},{"type":46,"value":2047}," + filter loops.",{"type":40,"tag":1185,"props":2049,"children":2051},{"className":1187,"code":2050,"language":1189,"meta":1190,"style":1190},"\u002F\u002F BEFORE — verbose traversal\nconst texts = frame.findAll(n => n.type === 'TEXT' && n.name === 'Title')\n\n\u002F\u002F AFTER — one-liner with query\nconst texts = frame.query('TEXT[name=Title]')\n",[2052],{"type":40,"tag":55,"props":2053,"children":2054},{"__ignoreMap":1190},[2055,2063,2176,2183,2191],{"type":40,"tag":1196,"props":2056,"children":2057},{"class":1198,"line":1199},[2058],{"type":40,"tag":1196,"props":2059,"children":2060},{"style":1203},[2061],{"type":46,"value":2062},"\u002F\u002F BEFORE — verbose traversal\n",{"type":40,"tag":1196,"props":2064,"children":2065},{"class":1198,"line":1209},[2066,2070,2075,2079,2084,2088,2092,2096,2101,2105,2110,2114,2119,2123,2128,2132,2137,2142,2146,2150,2154,2158,2162,2167,2171],{"type":40,"tag":1196,"props":2067,"children":2068},{"style":1213},[2069],{"type":46,"value":1216},{"type":40,"tag":1196,"props":2071,"children":2072},{"style":1219},[2073],{"type":46,"value":2074}," texts ",{"type":40,"tag":1196,"props":2076,"children":2077},{"style":1225},[2078],{"type":46,"value":1228},{"type":40,"tag":1196,"props":2080,"children":2081},{"style":1219},[2082],{"type":46,"value":2083}," frame",{"type":40,"tag":1196,"props":2085,"children":2086},{"style":1225},[2087],{"type":46,"value":70},{"type":40,"tag":1196,"props":2089,"children":2090},{"style":1257},[2091],{"type":46,"value":513},{"type":40,"tag":1196,"props":2093,"children":2094},{"style":1219},[2095],{"type":46,"value":1265},{"type":40,"tag":1196,"props":2097,"children":2098},{"style":1272},[2099],{"type":46,"value":2100},"n",{"type":40,"tag":1196,"props":2102,"children":2103},{"style":1213},[2104],{"type":46,"value":1284},{"type":40,"tag":1196,"props":2106,"children":2107},{"style":1219},[2108],{"type":46,"value":2109}," n",{"type":40,"tag":1196,"props":2111,"children":2112},{"style":1225},[2113],{"type":46,"value":70},{"type":40,"tag":1196,"props":2115,"children":2116},{"style":1219},[2117],{"type":46,"value":2118},"type ",{"type":40,"tag":1196,"props":2120,"children":2121},{"style":1225},[2122],{"type":46,"value":1303},{"type":40,"tag":1196,"props":2124,"children":2125},{"style":1225},[2126],{"type":46,"value":2127}," '",{"type":40,"tag":1196,"props":2129,"children":2130},{"style":1311},[2131],{"type":46,"value":666},{"type":40,"tag":1196,"props":2133,"children":2134},{"style":1225},[2135],{"type":46,"value":2136},"'",{"type":40,"tag":1196,"props":2138,"children":2139},{"style":1225},[2140],{"type":46,"value":2141}," &&",{"type":40,"tag":1196,"props":2143,"children":2144},{"style":1219},[2145],{"type":46,"value":2109},{"type":40,"tag":1196,"props":2147,"children":2148},{"style":1225},[2149],{"type":46,"value":70},{"type":40,"tag":1196,"props":2151,"children":2152},{"style":1219},[2153],{"type":46,"value":1298},{"type":40,"tag":1196,"props":2155,"children":2156},{"style":1225},[2157],{"type":46,"value":1303},{"type":40,"tag":1196,"props":2159,"children":2160},{"style":1225},[2161],{"type":46,"value":2127},{"type":40,"tag":1196,"props":2163,"children":2164},{"style":1311},[2165],{"type":46,"value":2166},"Title",{"type":40,"tag":1196,"props":2168,"children":2169},{"style":1225},[2170],{"type":46,"value":2136},{"type":40,"tag":1196,"props":2172,"children":2173},{"style":1219},[2174],{"type":46,"value":2175},")\n",{"type":40,"tag":1196,"props":2177,"children":2178},{"class":1198,"line":1331},[2179],{"type":40,"tag":1196,"props":2180,"children":2181},{"emptyLinePlaceholder":1590},[2182],{"type":46,"value":1593},{"type":40,"tag":1196,"props":2184,"children":2185},{"class":1198,"line":1362},[2186],{"type":40,"tag":1196,"props":2187,"children":2188},{"style":1203},[2189],{"type":46,"value":2190},"\u002F\u002F AFTER — one-liner with query\n",{"type":40,"tag":1196,"props":2192,"children":2193},{"class":1198,"line":1577},[2194,2198,2202,2206,2210,2214,2219,2223,2227,2232,2236],{"type":40,"tag":1196,"props":2195,"children":2196},{"style":1213},[2197],{"type":46,"value":1216},{"type":40,"tag":1196,"props":2199,"children":2200},{"style":1219},[2201],{"type":46,"value":2074},{"type":40,"tag":1196,"props":2203,"children":2204},{"style":1225},[2205],{"type":46,"value":1228},{"type":40,"tag":1196,"props":2207,"children":2208},{"style":1219},[2209],{"type":46,"value":2083},{"type":40,"tag":1196,"props":2211,"children":2212},{"style":1225},[2213],{"type":46,"value":70},{"type":40,"tag":1196,"props":2215,"children":2216},{"style":1257},[2217],{"type":46,"value":2218},"query",{"type":40,"tag":1196,"props":2220,"children":2221},{"style":1219},[2222],{"type":46,"value":1265},{"type":40,"tag":1196,"props":2224,"children":2225},{"style":1225},[2226],{"type":46,"value":2136},{"type":40,"tag":1196,"props":2228,"children":2229},{"style":1311},[2230],{"type":46,"value":2231},"TEXT[name=Title]",{"type":40,"tag":1196,"props":2233,"children":2234},{"style":1225},[2235],{"type":46,"value":2136},{"type":40,"tag":1196,"props":2237,"children":2238},{"style":1219},[2239],{"type":46,"value":2175},{"type":40,"tag":49,"props":2241,"children":2242},{},[2243],{"type":40,"tag":75,"props":2244,"children":2245},{},[2246],{"type":46,"value":2247},"Selector syntax:",{"type":40,"tag":1720,"props":2249,"children":2250},{},[2251,2305,2330,2359,2379,2397,2434,2480,2493,2506],{"type":40,"tag":252,"props":2252,"children":2253},{},[2254,2256,2262,2263,2268,2269,2275,2276,2282,2283,2289,2290,2296,2297,2303],{"type":46,"value":2255},"Type: ",{"type":40,"tag":55,"props":2257,"children":2259},{"className":2258},[],[2260],{"type":46,"value":2261},"FRAME",{"type":46,"value":479},{"type":40,"tag":55,"props":2264,"children":2266},{"className":2265},[],[2267],{"type":46,"value":666},{"type":46,"value":479},{"type":40,"tag":55,"props":2270,"children":2272},{"className":2271},[],[2273],{"type":46,"value":2274},"RECTANGLE",{"type":46,"value":479},{"type":40,"tag":55,"props":2277,"children":2279},{"className":2278},[],[2280],{"type":46,"value":2281},"ELLIPSE",{"type":46,"value":479},{"type":40,"tag":55,"props":2284,"children":2286},{"className":2285},[],[2287],{"type":46,"value":2288},"COMPONENT",{"type":46,"value":479},{"type":40,"tag":55,"props":2291,"children":2293},{"className":2292},[],[2294],{"type":46,"value":2295},"INSTANCE",{"type":46,"value":479},{"type":40,"tag":55,"props":2298,"children":2300},{"className":2299},[],[2301],{"type":46,"value":2302},"SECTION",{"type":46,"value":2304}," (case-insensitive)",{"type":40,"tag":252,"props":2306,"children":2307},{},[2308,2310,2316,2317,2323,2324],{"type":46,"value":2309},"Attribute exact: ",{"type":40,"tag":55,"props":2311,"children":2313},{"className":2312},[],[2314],{"type":46,"value":2315},"[name=Card]",{"type":46,"value":479},{"type":40,"tag":55,"props":2318,"children":2320},{"className":2319},[],[2321],{"type":46,"value":2322},"[visible=true]",{"type":46,"value":479},{"type":40,"tag":55,"props":2325,"children":2327},{"className":2326},[],[2328],{"type":46,"value":2329},"[opacity=0.5]",{"type":40,"tag":252,"props":2331,"children":2332},{},[2333,2335,2341,2343,2349,2351,2357],{"type":46,"value":2334},"Attribute substring: ",{"type":40,"tag":55,"props":2336,"children":2338},{"className":2337},[],[2339],{"type":46,"value":2340},"[name*=art]",{"type":46,"value":2342}," (contains), ",{"type":40,"tag":55,"props":2344,"children":2346},{"className":2345},[],[2347],{"type":46,"value":2348},"[name^=Header]",{"type":46,"value":2350}," (starts-with), ",{"type":40,"tag":55,"props":2352,"children":2354},{"className":2353},[],[2355],{"type":46,"value":2356},"[name$=Nav]",{"type":46,"value":2358}," (ends-with)",{"type":40,"tag":252,"props":2360,"children":2361},{},[2362,2364,2370,2371,2377],{"type":46,"value":2363},"Dot-path traversal: ",{"type":40,"tag":55,"props":2365,"children":2367},{"className":2366},[],[2368],{"type":46,"value":2369},"[fills.0.type=SOLID]",{"type":46,"value":479},{"type":40,"tag":55,"props":2372,"children":2374},{"className":2373},[],[2375],{"type":46,"value":2376},"[fills.*.type=SOLID]",{"type":46,"value":2378}," (wildcard index)",{"type":40,"tag":252,"props":2380,"children":2381},{},[2382,2384,2390,2391],{"type":46,"value":2383},"Instance matching: ",{"type":40,"tag":55,"props":2385,"children":2387},{"className":2386},[],[2388],{"type":46,"value":2389},"[mainComponent=nodeId]",{"type":46,"value":479},{"type":40,"tag":55,"props":2392,"children":2394},{"className":2393},[],[2395],{"type":46,"value":2396},"[mainComponent.name=Button]",{"type":40,"tag":252,"props":2398,"children":2399},{},[2400,2402,2408,2410,2416,2418,2424,2426,2432],{"type":46,"value":2401},"Combinators: ",{"type":40,"tag":55,"props":2403,"children":2405},{"className":2404},[],[2406],{"type":46,"value":2407},"FRAME > TEXT",{"type":46,"value":2409}," (direct child), ",{"type":40,"tag":55,"props":2411,"children":2413},{"className":2412},[],[2414],{"type":46,"value":2415},"FRAME TEXT",{"type":46,"value":2417}," (any descendant), ",{"type":40,"tag":55,"props":2419,"children":2421},{"className":2420},[],[2422],{"type":46,"value":2423},"A + B",{"type":46,"value":2425}," (adjacent sibling), ",{"type":40,"tag":55,"props":2427,"children":2429},{"className":2428},[],[2430],{"type":46,"value":2431},"A ~ B",{"type":46,"value":2433}," (general sibling)",{"type":40,"tag":252,"props":2435,"children":2436},{},[2437,2439,2445,2446,2452,2453,2459,2460,2466,2467,2473,2474],{"type":46,"value":2438},"Pseudo-classes: ",{"type":40,"tag":55,"props":2440,"children":2442},{"className":2441},[],[2443],{"type":46,"value":2444},":first-child",{"type":46,"value":479},{"type":40,"tag":55,"props":2447,"children":2449},{"className":2448},[],[2450],{"type":46,"value":2451},":last-child",{"type":46,"value":479},{"type":40,"tag":55,"props":2454,"children":2456},{"className":2455},[],[2457],{"type":46,"value":2458},":nth-child(2)",{"type":46,"value":479},{"type":40,"tag":55,"props":2461,"children":2463},{"className":2462},[],[2464],{"type":46,"value":2465},":not(TYPE)",{"type":46,"value":479},{"type":40,"tag":55,"props":2468,"children":2470},{"className":2469},[],[2471],{"type":46,"value":2472},":is(FRAME, RECTANGLE)",{"type":46,"value":479},{"type":40,"tag":55,"props":2475,"children":2477},{"className":2476},[],[2478],{"type":46,"value":2479},":where(TEXT, ELLIPSE)",{"type":40,"tag":252,"props":2481,"children":2482},{},[2483,2485,2491],{"type":46,"value":2484},"Node ID: ",{"type":40,"tag":55,"props":2486,"children":2488},{"className":2487},[],[2489],{"type":46,"value":2490},"#nodeId",{"type":46,"value":2492}," or bare GUID",{"type":40,"tag":252,"props":2494,"children":2495},{},[2496,2498,2504],{"type":46,"value":2497},"Comma: ",{"type":40,"tag":55,"props":2499,"children":2501},{"className":2500},[],[2502],{"type":46,"value":2503},"TEXT, RECTANGLE",{"type":46,"value":2505}," (union)",{"type":40,"tag":252,"props":2507,"children":2508},{},[2509,2511,2517],{"type":46,"value":2510},"Wildcard: ",{"type":40,"tag":55,"props":2512,"children":2514},{"className":2513},[],[2515],{"type":46,"value":2516},"*",{"type":46,"value":2518}," (any type)",{"type":40,"tag":49,"props":2520,"children":2521},{},[2522],{"type":40,"tag":75,"props":2523,"children":2524},{},[2525],{"type":46,"value":2526},"QueryResult methods:",{"type":40,"tag":2528,"props":2529,"children":2530},"table",{},[2531,2550],{"type":40,"tag":2532,"props":2533,"children":2534},"thead",{},[2535],{"type":40,"tag":2536,"props":2537,"children":2538},"tr",{},[2539,2545],{"type":40,"tag":2540,"props":2541,"children":2542},"th",{},[2543],{"type":46,"value":2544},"Method",{"type":40,"tag":2540,"props":2546,"children":2547},{},[2548],{"type":46,"value":2549},"Description",{"type":40,"tag":2551,"props":2552,"children":2553},"tbody",{},[2554,2572,2596,2619,2636,2661,2678,2695,2726,2751,2768],{"type":40,"tag":2536,"props":2555,"children":2556},{},[2557,2567],{"type":40,"tag":2558,"props":2559,"children":2560},"td",{},[2561],{"type":40,"tag":55,"props":2562,"children":2564},{"className":2563},[],[2565],{"type":46,"value":2566},".length",{"type":40,"tag":2558,"props":2568,"children":2569},{},[2570],{"type":46,"value":2571},"Number of matched nodes",{"type":40,"tag":2536,"props":2573,"children":2574},{},[2575,2584],{"type":40,"tag":2558,"props":2576,"children":2577},{},[2578],{"type":40,"tag":55,"props":2579,"children":2581},{"className":2580},[],[2582],{"type":46,"value":2583},".first()",{"type":40,"tag":2558,"props":2585,"children":2586},{},[2587,2589,2595],{"type":46,"value":2588},"First matched node (or ",{"type":40,"tag":55,"props":2590,"children":2592},{"className":2591},[],[2593],{"type":46,"value":2594},"null",{"type":46,"value":1279},{"type":40,"tag":2536,"props":2597,"children":2598},{},[2599,2608],{"type":40,"tag":2558,"props":2600,"children":2601},{},[2602],{"type":40,"tag":55,"props":2603,"children":2605},{"className":2604},[],[2606],{"type":46,"value":2607},".last()",{"type":40,"tag":2558,"props":2609,"children":2610},{},[2611,2613,2618],{"type":46,"value":2612},"Last matched node (or ",{"type":40,"tag":55,"props":2614,"children":2616},{"className":2615},[],[2617],{"type":46,"value":2594},{"type":46,"value":1279},{"type":40,"tag":2536,"props":2620,"children":2621},{},[2622,2631],{"type":40,"tag":2558,"props":2623,"children":2624},{},[2625],{"type":40,"tag":55,"props":2626,"children":2628},{"className":2627},[],[2629],{"type":46,"value":2630},".toArray()",{"type":40,"tag":2558,"props":2632,"children":2633},{},[2634],{"type":46,"value":2635},"Convert to regular array",{"type":40,"tag":2536,"props":2637,"children":2638},{},[2639,2648],{"type":40,"tag":2558,"props":2640,"children":2641},{},[2642],{"type":40,"tag":55,"props":2643,"children":2645},{"className":2644},[],[2646],{"type":46,"value":2647},".each(fn)",{"type":40,"tag":2558,"props":2649,"children":2650},{},[2651,2653,2659],{"type":46,"value":2652},"Iterate with callback, returns ",{"type":40,"tag":55,"props":2654,"children":2656},{"className":2655},[],[2657],{"type":46,"value":2658},"this",{"type":46,"value":2660}," for chaining",{"type":40,"tag":2536,"props":2662,"children":2663},{},[2664,2673],{"type":40,"tag":2558,"props":2665,"children":2666},{},[2667],{"type":40,"tag":55,"props":2668,"children":2670},{"className":2669},[],[2671],{"type":46,"value":2672},".map(fn)",{"type":40,"tag":2558,"props":2674,"children":2675},{},[2676],{"type":46,"value":2677},"Map to new array",{"type":40,"tag":2536,"props":2679,"children":2680},{},[2681,2690],{"type":40,"tag":2558,"props":2682,"children":2683},{},[2684],{"type":40,"tag":55,"props":2685,"children":2687},{"className":2686},[],[2688],{"type":46,"value":2689},".filter(fn)",{"type":40,"tag":2558,"props":2691,"children":2692},{},[2693],{"type":46,"value":2694},"Filter to new QueryResult",{"type":40,"tag":2536,"props":2696,"children":2697},{},[2698,2707],{"type":40,"tag":2558,"props":2699,"children":2700},{},[2701],{"type":40,"tag":55,"props":2702,"children":2704},{"className":2703},[],[2705],{"type":46,"value":2706},".values(keys)",{"type":40,"tag":2558,"props":2708,"children":2709},{},[2710,2712,2718,2720],{"type":46,"value":2711},"Extract property values: ",{"type":40,"tag":55,"props":2713,"children":2715},{"className":2714},[],[2716],{"type":46,"value":2717},".values(['name', 'x', 'y'])",{"type":46,"value":2719}," → ",{"type":40,"tag":55,"props":2721,"children":2723},{"className":2722},[],[2724],{"type":46,"value":2725},"[{name, x, y}, ...]",{"type":40,"tag":2536,"props":2727,"children":2728},{},[2729,2738],{"type":40,"tag":2558,"props":2730,"children":2731},{},[2732],{"type":40,"tag":55,"props":2733,"children":2735},{"className":2734},[],[2736],{"type":46,"value":2737},".set(props)",{"type":40,"tag":2558,"props":2739,"children":2740},{},[2741,2743,2749],{"type":46,"value":2742},"Set properties on all matched nodes (see ",{"type":40,"tag":55,"props":2744,"children":2746},{"className":2745},[],[2747],{"type":46,"value":2748},"node.set()",{"type":46,"value":2750}," below)",{"type":40,"tag":2536,"props":2752,"children":2753},{},[2754,2763],{"type":40,"tag":2558,"props":2755,"children":2756},{},[2757],{"type":40,"tag":55,"props":2758,"children":2760},{"className":2759},[],[2761],{"type":46,"value":2762},".query(selector)",{"type":40,"tag":2558,"props":2764,"children":2765},{},[2766],{"type":46,"value":2767},"Sub-query within matched nodes",{"type":40,"tag":2536,"props":2769,"children":2770},{},[2771,2780],{"type":40,"tag":2558,"props":2772,"children":2773},{},[2774],{"type":40,"tag":55,"props":2775,"children":2777},{"className":2776},[],[2778],{"type":46,"value":2779},"for...of",{"type":40,"tag":2558,"props":2781,"children":2782},{},[2783,2785,2790],{"type":46,"value":2784},"Iterable — works in ",{"type":40,"tag":55,"props":2786,"children":2788},{"className":2787},[],[2789],{"type":46,"value":1483},{"type":46,"value":2791}," loops",{"type":40,"tag":49,"props":2793,"children":2794},{},[2795,2800,2801,2807,2809,2815,2817,2823],{"type":40,"tag":75,"props":2796,"children":2797},{},[2798],{"type":46,"value":2799},"Scope:",{"type":46,"value":319},{"type":40,"tag":55,"props":2802,"children":2804},{"className":2803},[],[2805],{"type":46,"value":2806},"node.query()",{"type":46,"value":2808}," searches within that node's subtree. To search the whole page: ",{"type":40,"tag":55,"props":2810,"children":2812},{"className":2811},[],[2813],{"type":46,"value":2814},"figma.currentPage.query('...')",{"type":46,"value":2816},". There is no global ",{"type":40,"tag":55,"props":2818,"children":2820},{"className":2819},[],[2821],{"type":46,"value":2822},"figma.query()",{"type":46,"value":70},{"type":40,"tag":49,"props":2825,"children":2826},{},[2827],{"type":40,"tag":75,"props":2828,"children":2829},{},[2830],{"type":46,"value":2831},"Examples:",{"type":40,"tag":1185,"props":2833,"children":2835},{"className":1187,"code":2834,"language":1189,"meta":1190,"style":1190},"\u002F\u002F Recolor all text inside cards\nfigma.currentPage.query('FRAME[name^=Card] TEXT').set({\n  fills: [{type: 'SOLID', color: {r: 0.2, g: 0.2, b: 0.8}}]\n})\n\n\u002F\u002F Get names and positions of all frames\nreturn figma.currentPage.query('FRAME').values(['name', 'x', 'y'])\n\n\u002F\u002F Find the first component named \"Button\"\nconst btn = figma.currentPage.query('COMPONENT[name=Button]').first()\n\n\u002F\u002F Find all instances of a specific component\nfigma.currentPage.query(`INSTANCE[mainComponent=${compId}]`)\n\n\u002F\u002F Find nodes with solid fills using dot-path traversal\nfigma.currentPage.query('[fills.0.type=SOLID]')\n",[2836],{"type":40,"tag":55,"props":2837,"children":2838},{"__ignoreMap":1190},[2839,2847,2908,3032,3044,3051,3059,3170,3177,3186,3258,3266,3275,3340,3348,3357],{"type":40,"tag":1196,"props":2840,"children":2841},{"class":1198,"line":1199},[2842],{"type":40,"tag":1196,"props":2843,"children":2844},{"style":1203},[2845],{"type":46,"value":2846},"\u002F\u002F Recolor all text inside cards\n",{"type":40,"tag":1196,"props":2848,"children":2849},{"class":1198,"line":1209},[2850,2854,2858,2862,2866,2870,2874,2878,2883,2887,2891,2895,2900,2904],{"type":40,"tag":1196,"props":2851,"children":2852},{"style":1219},[2853],{"type":46,"value":21},{"type":40,"tag":1196,"props":2855,"children":2856},{"style":1225},[2857],{"type":46,"value":70},{"type":40,"tag":1196,"props":2859,"children":2860},{"style":1219},[2861],{"type":46,"value":1438},{"type":40,"tag":1196,"props":2863,"children":2864},{"style":1225},[2865],{"type":46,"value":70},{"type":40,"tag":1196,"props":2867,"children":2868},{"style":1257},[2869],{"type":46,"value":2218},{"type":40,"tag":1196,"props":2871,"children":2872},{"style":1219},[2873],{"type":46,"value":1265},{"type":40,"tag":1196,"props":2875,"children":2876},{"style":1225},[2877],{"type":46,"value":2136},{"type":40,"tag":1196,"props":2879,"children":2880},{"style":1311},[2881],{"type":46,"value":2882},"FRAME[name^=Card] TEXT",{"type":40,"tag":1196,"props":2884,"children":2885},{"style":1225},[2886],{"type":46,"value":2136},{"type":40,"tag":1196,"props":2888,"children":2889},{"style":1219},[2890],{"type":46,"value":1279},{"type":40,"tag":1196,"props":2892,"children":2893},{"style":1225},[2894],{"type":46,"value":70},{"type":40,"tag":1196,"props":2896,"children":2897},{"style":1257},[2898],{"type":46,"value":2899},"set",{"type":40,"tag":1196,"props":2901,"children":2902},{"style":1219},[2903],{"type":46,"value":1265},{"type":40,"tag":1196,"props":2905,"children":2906},{"style":1225},[2907],{"type":46,"value":1528},{"type":40,"tag":1196,"props":2909,"children":2910},{"class":1198,"line":1331},[2911,2916,2921,2926,2931,2936,2940,2944,2949,2953,2958,2963,2967,2972,2977,2981,2987,2991,2996,3000,3004,3008,3013,3017,3022,3027],{"type":40,"tag":1196,"props":2912,"children":2913},{"style":1551},[2914],{"type":46,"value":2915},"  fills",{"type":40,"tag":1196,"props":2917,"children":2918},{"style":1225},[2919],{"type":46,"value":2920},":",{"type":40,"tag":1196,"props":2922,"children":2923},{"style":1219},[2924],{"type":46,"value":2925}," [",{"type":40,"tag":1196,"props":2927,"children":2928},{"style":1225},[2929],{"type":46,"value":2930},"{",{"type":40,"tag":1196,"props":2932,"children":2933},{"style":1551},[2934],{"type":46,"value":2935},"type",{"type":40,"tag":1196,"props":2937,"children":2938},{"style":1225},[2939],{"type":46,"value":2920},{"type":40,"tag":1196,"props":2941,"children":2942},{"style":1225},[2943],{"type":46,"value":2127},{"type":40,"tag":1196,"props":2945,"children":2946},{"style":1311},[2947],{"type":46,"value":2948},"SOLID",{"type":40,"tag":1196,"props":2950,"children":2951},{"style":1225},[2952],{"type":46,"value":2136},{"type":40,"tag":1196,"props":2954,"children":2955},{"style":1225},[2956],{"type":46,"value":2957},",",{"type":40,"tag":1196,"props":2959,"children":2960},{"style":1551},[2961],{"type":46,"value":2962}," color",{"type":40,"tag":1196,"props":2964,"children":2965},{"style":1225},[2966],{"type":46,"value":2920},{"type":40,"tag":1196,"props":2968,"children":2969},{"style":1225},[2970],{"type":46,"value":2971}," {",{"type":40,"tag":1196,"props":2973,"children":2974},{"style":1551},[2975],{"type":46,"value":2976},"r",{"type":40,"tag":1196,"props":2978,"children":2979},{"style":1225},[2980],{"type":46,"value":2920},{"type":40,"tag":1196,"props":2982,"children":2984},{"style":2983},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[2985],{"type":46,"value":2986}," 0.2",{"type":40,"tag":1196,"props":2988,"children":2989},{"style":1225},[2990],{"type":46,"value":2957},{"type":40,"tag":1196,"props":2992,"children":2993},{"style":1551},[2994],{"type":46,"value":2995}," g",{"type":40,"tag":1196,"props":2997,"children":2998},{"style":1225},[2999],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3001,"children":3002},{"style":2983},[3003],{"type":46,"value":2986},{"type":40,"tag":1196,"props":3005,"children":3006},{"style":1225},[3007],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3009,"children":3010},{"style":1551},[3011],{"type":46,"value":3012}," b",{"type":40,"tag":1196,"props":3014,"children":3015},{"style":1225},[3016],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3018,"children":3019},{"style":2983},[3020],{"type":46,"value":3021}," 0.8",{"type":40,"tag":1196,"props":3023,"children":3024},{"style":1225},[3025],{"type":46,"value":3026},"}}",{"type":40,"tag":1196,"props":3028,"children":3029},{"style":1219},[3030],{"type":46,"value":3031},"]\n",{"type":40,"tag":1196,"props":3033,"children":3034},{"class":1198,"line":1362},[3035,3040],{"type":40,"tag":1196,"props":3036,"children":3037},{"style":1225},[3038],{"type":46,"value":3039},"}",{"type":40,"tag":1196,"props":3041,"children":3042},{"style":1219},[3043],{"type":46,"value":2175},{"type":40,"tag":1196,"props":3045,"children":3046},{"class":1198,"line":1577},[3047],{"type":40,"tag":1196,"props":3048,"children":3049},{"emptyLinePlaceholder":1590},[3050],{"type":46,"value":1593},{"type":40,"tag":1196,"props":3052,"children":3053},{"class":1198,"line":1586},[3054],{"type":40,"tag":1196,"props":3055,"children":3056},{"style":1203},[3057],{"type":46,"value":3058},"\u002F\u002F Get names and positions of all frames\n",{"type":40,"tag":1196,"props":3060,"children":3061},{"class":1198,"line":1596},[3062,3066,3070,3074,3078,3082,3086,3090,3094,3098,3102,3106,3110,3115,3120,3124,3129,3133,3137,3141,3145,3149,3153,3157,3161,3165],{"type":40,"tag":1196,"props":3063,"children":3064},{"style":1335},[3065],{"type":46,"value":265},{"type":40,"tag":1196,"props":3067,"children":3068},{"style":1219},[3069],{"type":46,"value":1233},{"type":40,"tag":1196,"props":3071,"children":3072},{"style":1225},[3073],{"type":46,"value":70},{"type":40,"tag":1196,"props":3075,"children":3076},{"style":1219},[3077],{"type":46,"value":1438},{"type":40,"tag":1196,"props":3079,"children":3080},{"style":1225},[3081],{"type":46,"value":70},{"type":40,"tag":1196,"props":3083,"children":3084},{"style":1257},[3085],{"type":46,"value":2218},{"type":40,"tag":1196,"props":3087,"children":3088},{"style":1219},[3089],{"type":46,"value":1265},{"type":40,"tag":1196,"props":3091,"children":3092},{"style":1225},[3093],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3095,"children":3096},{"style":1311},[3097],{"type":46,"value":2261},{"type":40,"tag":1196,"props":3099,"children":3100},{"style":1225},[3101],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3103,"children":3104},{"style":1219},[3105],{"type":46,"value":1279},{"type":40,"tag":1196,"props":3107,"children":3108},{"style":1225},[3109],{"type":46,"value":70},{"type":40,"tag":1196,"props":3111,"children":3112},{"style":1257},[3113],{"type":46,"value":3114},"values",{"type":40,"tag":1196,"props":3116,"children":3117},{"style":1219},[3118],{"type":46,"value":3119},"([",{"type":40,"tag":1196,"props":3121,"children":3122},{"style":1225},[3123],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3125,"children":3126},{"style":1311},[3127],{"type":46,"value":3128},"name",{"type":40,"tag":1196,"props":3130,"children":3131},{"style":1225},[3132],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3134,"children":3135},{"style":1225},[3136],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3138,"children":3139},{"style":1225},[3140],{"type":46,"value":2127},{"type":40,"tag":1196,"props":3142,"children":3143},{"style":1311},[3144],{"type":46,"value":735},{"type":40,"tag":1196,"props":3146,"children":3147},{"style":1225},[3148],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3150,"children":3151},{"style":1225},[3152],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3154,"children":3155},{"style":1225},[3156],{"type":46,"value":2127},{"type":40,"tag":1196,"props":3158,"children":3159},{"style":1311},[3160],{"type":46,"value":742},{"type":40,"tag":1196,"props":3162,"children":3163},{"style":1225},[3164],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3166,"children":3167},{"style":1219},[3168],{"type":46,"value":3169},"])\n",{"type":40,"tag":1196,"props":3171,"children":3172},{"class":1198,"line":1605},[3173],{"type":40,"tag":1196,"props":3174,"children":3175},{"emptyLinePlaceholder":1590},[3176],{"type":46,"value":1593},{"type":40,"tag":1196,"props":3178,"children":3180},{"class":1198,"line":3179},9,[3181],{"type":40,"tag":1196,"props":3182,"children":3183},{"style":1203},[3184],{"type":46,"value":3185},"\u002F\u002F Find the first component named \"Button\"\n",{"type":40,"tag":1196,"props":3187,"children":3189},{"class":1198,"line":3188},10,[3190,3194,3199,3203,3207,3211,3215,3219,3223,3227,3231,3236,3240,3244,3248,3253],{"type":40,"tag":1196,"props":3191,"children":3192},{"style":1213},[3193],{"type":46,"value":1216},{"type":40,"tag":1196,"props":3195,"children":3196},{"style":1219},[3197],{"type":46,"value":3198}," btn ",{"type":40,"tag":1196,"props":3200,"children":3201},{"style":1225},[3202],{"type":46,"value":1228},{"type":40,"tag":1196,"props":3204,"children":3205},{"style":1219},[3206],{"type":46,"value":1233},{"type":40,"tag":1196,"props":3208,"children":3209},{"style":1225},[3210],{"type":46,"value":70},{"type":40,"tag":1196,"props":3212,"children":3213},{"style":1219},[3214],{"type":46,"value":1438},{"type":40,"tag":1196,"props":3216,"children":3217},{"style":1225},[3218],{"type":46,"value":70},{"type":40,"tag":1196,"props":3220,"children":3221},{"style":1257},[3222],{"type":46,"value":2218},{"type":40,"tag":1196,"props":3224,"children":3225},{"style":1219},[3226],{"type":46,"value":1265},{"type":40,"tag":1196,"props":3228,"children":3229},{"style":1225},[3230],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3232,"children":3233},{"style":1311},[3234],{"type":46,"value":3235},"COMPONENT[name=Button]",{"type":40,"tag":1196,"props":3237,"children":3238},{"style":1225},[3239],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3241,"children":3242},{"style":1219},[3243],{"type":46,"value":1279},{"type":40,"tag":1196,"props":3245,"children":3246},{"style":1225},[3247],{"type":46,"value":70},{"type":40,"tag":1196,"props":3249,"children":3250},{"style":1257},[3251],{"type":46,"value":3252},"first",{"type":40,"tag":1196,"props":3254,"children":3255},{"style":1219},[3256],{"type":46,"value":3257},"()\n",{"type":40,"tag":1196,"props":3259,"children":3261},{"class":1198,"line":3260},11,[3262],{"type":40,"tag":1196,"props":3263,"children":3264},{"emptyLinePlaceholder":1590},[3265],{"type":46,"value":1593},{"type":40,"tag":1196,"props":3267,"children":3269},{"class":1198,"line":3268},12,[3270],{"type":40,"tag":1196,"props":3271,"children":3272},{"style":1203},[3273],{"type":46,"value":3274},"\u002F\u002F Find all instances of a specific component\n",{"type":40,"tag":1196,"props":3276,"children":3278},{"class":1198,"line":3277},13,[3279,3283,3287,3291,3295,3299,3303,3308,3313,3318,3323,3327,3332,3336],{"type":40,"tag":1196,"props":3280,"children":3281},{"style":1219},[3282],{"type":46,"value":21},{"type":40,"tag":1196,"props":3284,"children":3285},{"style":1225},[3286],{"type":46,"value":70},{"type":40,"tag":1196,"props":3288,"children":3289},{"style":1219},[3290],{"type":46,"value":1438},{"type":40,"tag":1196,"props":3292,"children":3293},{"style":1225},[3294],{"type":46,"value":70},{"type":40,"tag":1196,"props":3296,"children":3297},{"style":1257},[3298],{"type":46,"value":2218},{"type":40,"tag":1196,"props":3300,"children":3301},{"style":1219},[3302],{"type":46,"value":1265},{"type":40,"tag":1196,"props":3304,"children":3305},{"style":1225},[3306],{"type":46,"value":3307},"`",{"type":40,"tag":1196,"props":3309,"children":3310},{"style":1311},[3311],{"type":46,"value":3312},"INSTANCE[mainComponent=",{"type":40,"tag":1196,"props":3314,"children":3315},{"style":1225},[3316],{"type":46,"value":3317},"${",{"type":40,"tag":1196,"props":3319,"children":3320},{"style":1219},[3321],{"type":46,"value":3322},"compId",{"type":40,"tag":1196,"props":3324,"children":3325},{"style":1225},[3326],{"type":46,"value":3039},{"type":40,"tag":1196,"props":3328,"children":3329},{"style":1311},[3330],{"type":46,"value":3331},"]",{"type":40,"tag":1196,"props":3333,"children":3334},{"style":1225},[3335],{"type":46,"value":3307},{"type":40,"tag":1196,"props":3337,"children":3338},{"style":1219},[3339],{"type":46,"value":2175},{"type":40,"tag":1196,"props":3341,"children":3343},{"class":1198,"line":3342},14,[3344],{"type":40,"tag":1196,"props":3345,"children":3346},{"emptyLinePlaceholder":1590},[3347],{"type":46,"value":1593},{"type":40,"tag":1196,"props":3349,"children":3351},{"class":1198,"line":3350},15,[3352],{"type":40,"tag":1196,"props":3353,"children":3354},{"style":1203},[3355],{"type":46,"value":3356},"\u002F\u002F Find nodes with solid fills using dot-path traversal\n",{"type":40,"tag":1196,"props":3358,"children":3360},{"class":1198,"line":3359},16,[3361,3365,3369,3373,3377,3381,3385,3389,3393,3397],{"type":40,"tag":1196,"props":3362,"children":3363},{"style":1219},[3364],{"type":46,"value":21},{"type":40,"tag":1196,"props":3366,"children":3367},{"style":1225},[3368],{"type":46,"value":70},{"type":40,"tag":1196,"props":3370,"children":3371},{"style":1219},[3372],{"type":46,"value":1438},{"type":40,"tag":1196,"props":3374,"children":3375},{"style":1225},[3376],{"type":46,"value":70},{"type":40,"tag":1196,"props":3378,"children":3379},{"style":1257},[3380],{"type":46,"value":2218},{"type":40,"tag":1196,"props":3382,"children":3383},{"style":1219},[3384],{"type":46,"value":1265},{"type":40,"tag":1196,"props":3386,"children":3387},{"style":1225},[3388],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3390,"children":3391},{"style":1311},[3392],{"type":46,"value":2369},{"type":40,"tag":1196,"props":3394,"children":3395},{"style":1225},[3396],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3398,"children":3399},{"style":1219},[3400],{"type":46,"value":2175},{"type":40,"tag":1141,"props":3402,"children":3404},{"id":3403},"nodesetprops-batch-property-updates",[3405,3411],{"type":40,"tag":55,"props":3406,"children":3408},{"className":3407},[],[3409],{"type":46,"value":3410},"node.set(props)",{"type":46,"value":3412}," — batch property updates",{"type":40,"tag":49,"props":3414,"children":3415},{},[3416,3418,3423],{"type":46,"value":3417},"Set multiple properties in one call. Returns ",{"type":40,"tag":55,"props":3419,"children":3421},{"className":3420},[],[3422],{"type":46,"value":2658},{"type":46,"value":3424}," for chaining.",{"type":40,"tag":1185,"props":3426,"children":3428},{"className":1187,"code":3427,"language":1189,"meta":1190,"style":1190},"\u002F\u002F BEFORE — one line per property\nframe.opacity = 0.5\nframe.cornerRadius = 8\nframe.name = \"Card\"\n\n\u002F\u002F AFTER — single call\nframe.set({ opacity: 0.5, cornerRadius: 8, name: \"Card\" })\n",[3429],{"type":40,"tag":55,"props":3430,"children":3431},{"__ignoreMap":1190},[3432,3440,3465,3490,3523,3530,3538],{"type":40,"tag":1196,"props":3433,"children":3434},{"class":1198,"line":1199},[3435],{"type":40,"tag":1196,"props":3436,"children":3437},{"style":1203},[3438],{"type":46,"value":3439},"\u002F\u002F BEFORE — one line per property\n",{"type":40,"tag":1196,"props":3441,"children":3442},{"class":1198,"line":1209},[3443,3447,3451,3456,3460],{"type":40,"tag":1196,"props":3444,"children":3445},{"style":1219},[3446],{"type":46,"value":813},{"type":40,"tag":1196,"props":3448,"children":3449},{"style":1225},[3450],{"type":46,"value":70},{"type":40,"tag":1196,"props":3452,"children":3453},{"style":1219},[3454],{"type":46,"value":3455},"opacity ",{"type":40,"tag":1196,"props":3457,"children":3458},{"style":1225},[3459],{"type":46,"value":1228},{"type":40,"tag":1196,"props":3461,"children":3462},{"style":2983},[3463],{"type":46,"value":3464}," 0.5\n",{"type":40,"tag":1196,"props":3466,"children":3467},{"class":1198,"line":1331},[3468,3472,3476,3481,3485],{"type":40,"tag":1196,"props":3469,"children":3470},{"style":1219},[3471],{"type":46,"value":813},{"type":40,"tag":1196,"props":3473,"children":3474},{"style":1225},[3475],{"type":46,"value":70},{"type":40,"tag":1196,"props":3477,"children":3478},{"style":1219},[3479],{"type":46,"value":3480},"cornerRadius ",{"type":40,"tag":1196,"props":3482,"children":3483},{"style":1225},[3484],{"type":46,"value":1228},{"type":40,"tag":1196,"props":3486,"children":3487},{"style":2983},[3488],{"type":46,"value":3489}," 8\n",{"type":40,"tag":1196,"props":3491,"children":3492},{"class":1198,"line":1362},[3493,3497,3501,3505,3509,3513,3518],{"type":40,"tag":1196,"props":3494,"children":3495},{"style":1219},[3496],{"type":46,"value":813},{"type":40,"tag":1196,"props":3498,"children":3499},{"style":1225},[3500],{"type":46,"value":70},{"type":40,"tag":1196,"props":3502,"children":3503},{"style":1219},[3504],{"type":46,"value":1298},{"type":40,"tag":1196,"props":3506,"children":3507},{"style":1225},[3508],{"type":46,"value":1228},{"type":40,"tag":1196,"props":3510,"children":3511},{"style":1225},[3512],{"type":46,"value":1308},{"type":40,"tag":1196,"props":3514,"children":3515},{"style":1311},[3516],{"type":46,"value":3517},"Card",{"type":40,"tag":1196,"props":3519,"children":3520},{"style":1225},[3521],{"type":46,"value":3522},"\"\n",{"type":40,"tag":1196,"props":3524,"children":3525},{"class":1198,"line":1577},[3526],{"type":40,"tag":1196,"props":3527,"children":3528},{"emptyLinePlaceholder":1590},[3529],{"type":46,"value":1593},{"type":40,"tag":1196,"props":3531,"children":3532},{"class":1198,"line":1586},[3533],{"type":40,"tag":1196,"props":3534,"children":3535},{"style":1203},[3536],{"type":46,"value":3537},"\u002F\u002F AFTER — single call\n",{"type":40,"tag":1196,"props":3539,"children":3540},{"class":1198,"line":1596},[3541,3545,3549,3553,3557,3561,3566,3570,3575,3579,3584,3588,3593,3597,3602,3606,3610,3614,3618,3623],{"type":40,"tag":1196,"props":3542,"children":3543},{"style":1219},[3544],{"type":46,"value":813},{"type":40,"tag":1196,"props":3546,"children":3547},{"style":1225},[3548],{"type":46,"value":70},{"type":40,"tag":1196,"props":3550,"children":3551},{"style":1257},[3552],{"type":46,"value":2899},{"type":40,"tag":1196,"props":3554,"children":3555},{"style":1219},[3556],{"type":46,"value":1265},{"type":40,"tag":1196,"props":3558,"children":3559},{"style":1225},[3560],{"type":46,"value":2930},{"type":40,"tag":1196,"props":3562,"children":3563},{"style":1551},[3564],{"type":46,"value":3565}," opacity",{"type":40,"tag":1196,"props":3567,"children":3568},{"style":1225},[3569],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3571,"children":3572},{"style":2983},[3573],{"type":46,"value":3574}," 0.5",{"type":40,"tag":1196,"props":3576,"children":3577},{"style":1225},[3578],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3580,"children":3581},{"style":1551},[3582],{"type":46,"value":3583}," cornerRadius",{"type":40,"tag":1196,"props":3585,"children":3586},{"style":1225},[3587],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3589,"children":3590},{"style":2983},[3591],{"type":46,"value":3592}," 8",{"type":40,"tag":1196,"props":3594,"children":3595},{"style":1225},[3596],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3598,"children":3599},{"style":1551},[3600],{"type":46,"value":3601}," name",{"type":40,"tag":1196,"props":3603,"children":3604},{"style":1225},[3605],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3607,"children":3608},{"style":1225},[3609],{"type":46,"value":1308},{"type":40,"tag":1196,"props":3611,"children":3612},{"style":1311},[3613],{"type":46,"value":3517},{"type":40,"tag":1196,"props":3615,"children":3616},{"style":1225},[3617],{"type":46,"value":1319},{"type":40,"tag":1196,"props":3619,"children":3620},{"style":1225},[3621],{"type":46,"value":3622}," }",{"type":40,"tag":1196,"props":3624,"children":3625},{"style":1219},[3626],{"type":46,"value":2175},{"type":40,"tag":49,"props":3628,"children":3629},{},[3630,3635,3636,3642,3644,3650,3651,3657,3659,3665,3667,3672],{"type":40,"tag":75,"props":3631,"children":3632},{},[3633],{"type":46,"value":3634},"Priority key ordering:",{"type":46,"value":319},{"type":40,"tag":55,"props":3637,"children":3639},{"className":3638},[],[3640],{"type":46,"value":3641},"layoutMode",{"type":46,"value":3643}," is always applied before other properties (like ",{"type":40,"tag":55,"props":3645,"children":3647},{"className":3646},[],[3648],{"type":46,"value":3649},"width",{"type":46,"value":683},{"type":40,"tag":55,"props":3652,"children":3654},{"className":3653},[],[3655],{"type":46,"value":3656},"height",{"type":46,"value":3658},") regardless of object key order. This prevents the common bug where ",{"type":40,"tag":55,"props":3660,"children":3662},{"className":3661},[],[3663],{"type":46,"value":3664},"resize()",{"type":46,"value":3666}," behaves differently depending on whether ",{"type":40,"tag":55,"props":3668,"children":3670},{"className":3669},[],[3671],{"type":46,"value":3641},{"type":46,"value":3673}," is set.",{"type":40,"tag":49,"props":3675,"children":3676},{},[3677,3682,3683,3688,3689,3694,3696,3702,3704,3710,3712,3718],{"type":40,"tag":75,"props":3678,"children":3679},{},[3680],{"type":46,"value":3681},"Width\u002Fheight handling:",{"type":46,"value":319},{"type":40,"tag":55,"props":3684,"children":3686},{"className":3685},[],[3687],{"type":46,"value":3649},{"type":46,"value":293},{"type":40,"tag":55,"props":3690,"children":3692},{"className":3691},[],[3693],{"type":46,"value":3656},{"type":46,"value":3695}," are routed through ",{"type":40,"tag":55,"props":3697,"children":3699},{"className":3698},[],[3700],{"type":46,"value":3701},"node.resize()",{"type":46,"value":3703}," automatically — setting ",{"type":40,"tag":55,"props":3705,"children":3707},{"className":3706},[],[3708],{"type":46,"value":3709},"{ width: 200 }",{"type":46,"value":3711}," calls ",{"type":40,"tag":55,"props":3713,"children":3715},{"className":3714},[],[3716],{"type":46,"value":3717},"resize(200, currentHeight)",{"type":46,"value":70},{"type":40,"tag":49,"props":3720,"children":3721},{},[3722],{"type":40,"tag":75,"props":3723,"children":3724},{},[3725],{"type":46,"value":3726},"Chaining with query:",{"type":40,"tag":1185,"props":3728,"children":3730},{"className":1187,"code":3729,"language":1189,"meta":1190,"style":1190},"\u002F\u002F Find all rectangles named \"Divider\" and update them\nfigma.currentPage.query('RECTANGLE[name=Divider]').set({\n  fills: [{type: 'SOLID', color: {r: 0.9, g: 0.9, b: 0.9}}],\n  cornerRadius: 2\n})\n",[3731],{"type":40,"tag":55,"props":3732,"children":3733},{"__ignoreMap":1190},[3734,3742,3802,3915,3932],{"type":40,"tag":1196,"props":3735,"children":3736},{"class":1198,"line":1199},[3737],{"type":40,"tag":1196,"props":3738,"children":3739},{"style":1203},[3740],{"type":46,"value":3741},"\u002F\u002F Find all rectangles named \"Divider\" and update them\n",{"type":40,"tag":1196,"props":3743,"children":3744},{"class":1198,"line":1209},[3745,3749,3753,3757,3761,3765,3769,3773,3778,3782,3786,3790,3794,3798],{"type":40,"tag":1196,"props":3746,"children":3747},{"style":1219},[3748],{"type":46,"value":21},{"type":40,"tag":1196,"props":3750,"children":3751},{"style":1225},[3752],{"type":46,"value":70},{"type":40,"tag":1196,"props":3754,"children":3755},{"style":1219},[3756],{"type":46,"value":1438},{"type":40,"tag":1196,"props":3758,"children":3759},{"style":1225},[3760],{"type":46,"value":70},{"type":40,"tag":1196,"props":3762,"children":3763},{"style":1257},[3764],{"type":46,"value":2218},{"type":40,"tag":1196,"props":3766,"children":3767},{"style":1219},[3768],{"type":46,"value":1265},{"type":40,"tag":1196,"props":3770,"children":3771},{"style":1225},[3772],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3774,"children":3775},{"style":1311},[3776],{"type":46,"value":3777},"RECTANGLE[name=Divider]",{"type":40,"tag":1196,"props":3779,"children":3780},{"style":1225},[3781],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3783,"children":3784},{"style":1219},[3785],{"type":46,"value":1279},{"type":40,"tag":1196,"props":3787,"children":3788},{"style":1225},[3789],{"type":46,"value":70},{"type":40,"tag":1196,"props":3791,"children":3792},{"style":1257},[3793],{"type":46,"value":2899},{"type":40,"tag":1196,"props":3795,"children":3796},{"style":1219},[3797],{"type":46,"value":1265},{"type":40,"tag":1196,"props":3799,"children":3800},{"style":1225},[3801],{"type":46,"value":1528},{"type":40,"tag":1196,"props":3803,"children":3804},{"class":1198,"line":1331},[3805,3809,3813,3817,3821,3825,3829,3833,3837,3841,3845,3849,3853,3857,3861,3865,3870,3874,3878,3882,3886,3890,3894,3898,3902,3906,3910],{"type":40,"tag":1196,"props":3806,"children":3807},{"style":1551},[3808],{"type":46,"value":2915},{"type":40,"tag":1196,"props":3810,"children":3811},{"style":1225},[3812],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3814,"children":3815},{"style":1219},[3816],{"type":46,"value":2925},{"type":40,"tag":1196,"props":3818,"children":3819},{"style":1225},[3820],{"type":46,"value":2930},{"type":40,"tag":1196,"props":3822,"children":3823},{"style":1551},[3824],{"type":46,"value":2935},{"type":40,"tag":1196,"props":3826,"children":3827},{"style":1225},[3828],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3830,"children":3831},{"style":1225},[3832],{"type":46,"value":2127},{"type":40,"tag":1196,"props":3834,"children":3835},{"style":1311},[3836],{"type":46,"value":2948},{"type":40,"tag":1196,"props":3838,"children":3839},{"style":1225},[3840],{"type":46,"value":2136},{"type":40,"tag":1196,"props":3842,"children":3843},{"style":1225},[3844],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3846,"children":3847},{"style":1551},[3848],{"type":46,"value":2962},{"type":40,"tag":1196,"props":3850,"children":3851},{"style":1225},[3852],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3854,"children":3855},{"style":1225},[3856],{"type":46,"value":2971},{"type":40,"tag":1196,"props":3858,"children":3859},{"style":1551},[3860],{"type":46,"value":2976},{"type":40,"tag":1196,"props":3862,"children":3863},{"style":1225},[3864],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3866,"children":3867},{"style":2983},[3868],{"type":46,"value":3869}," 0.9",{"type":40,"tag":1196,"props":3871,"children":3872},{"style":1225},[3873],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3875,"children":3876},{"style":1551},[3877],{"type":46,"value":2995},{"type":40,"tag":1196,"props":3879,"children":3880},{"style":1225},[3881],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3883,"children":3884},{"style":2983},[3885],{"type":46,"value":3869},{"type":40,"tag":1196,"props":3887,"children":3888},{"style":1225},[3889],{"type":46,"value":2957},{"type":40,"tag":1196,"props":3891,"children":3892},{"style":1551},[3893],{"type":46,"value":3012},{"type":40,"tag":1196,"props":3895,"children":3896},{"style":1225},[3897],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3899,"children":3900},{"style":2983},[3901],{"type":46,"value":3869},{"type":40,"tag":1196,"props":3903,"children":3904},{"style":1225},[3905],{"type":46,"value":3026},{"type":40,"tag":1196,"props":3907,"children":3908},{"style":1219},[3909],{"type":46,"value":3331},{"type":40,"tag":1196,"props":3911,"children":3912},{"style":1225},[3913],{"type":46,"value":3914},",\n",{"type":40,"tag":1196,"props":3916,"children":3917},{"class":1198,"line":1362},[3918,3923,3927],{"type":40,"tag":1196,"props":3919,"children":3920},{"style":1551},[3921],{"type":46,"value":3922},"  cornerRadius",{"type":40,"tag":1196,"props":3924,"children":3925},{"style":1225},[3926],{"type":46,"value":2920},{"type":40,"tag":1196,"props":3928,"children":3929},{"style":2983},[3930],{"type":46,"value":3931}," 2\n",{"type":40,"tag":1196,"props":3933,"children":3934},{"class":1198,"line":1577},[3935,3939],{"type":40,"tag":1196,"props":3936,"children":3937},{"style":1225},[3938],{"type":46,"value":3039},{"type":40,"tag":1196,"props":3940,"children":3941},{"style":1219},[3942],{"type":46,"value":2175},{"type":40,"tag":1141,"props":3944,"children":3946},{"id":3945},"figmacreateautolayoutdirection-props-auto-layout-frames",[3947,3953],{"type":40,"tag":55,"props":3948,"children":3950},{"className":3949},[],[3951],{"type":46,"value":3952},"figma.createAutoLayout(direction?, props?)",{"type":46,"value":3954}," — auto-layout frames",{"type":40,"tag":49,"props":3956,"children":3957},{},[3958,3960],{"type":46,"value":3959},"Creates a frame with auto-layout already enabled and both axes hugging content. ",{"type":40,"tag":75,"props":3961,"children":3962},{},[3963],{"type":46,"value":3964},"This is the default container whenever children have a structural relationship to each other (see Rule 12a).",{"type":40,"tag":1185,"props":3966,"children":3968},{"className":1187,"code":3967,"language":1189,"meta":1190,"style":1190},"\u002F\u002F BEFORE — manual setup, easy to get ordering wrong\nconst frame = figma.createFrame()\nframe.layoutMode = 'VERTICAL'\nframe.primaryAxisSizingMode = 'AUTO'\nframe.counterAxisSizingMode = 'AUTO'\nframe.layoutSizingHorizontal = 'HUG'\nframe.layoutSizingVertical = 'HUG'\n\n\u002F\u002F AFTER — one call, layout ready\nconst frame = figma.createAutoLayout('VERTICAL')\n",[3969],{"type":40,"tag":55,"props":3970,"children":3971},{"__ignoreMap":1190},[3972,3980,4013,4047,4080,4112,4144,4176,4183,4191],{"type":40,"tag":1196,"props":3973,"children":3974},{"class":1198,"line":1199},[3975],{"type":40,"tag":1196,"props":3976,"children":3977},{"style":1203},[3978],{"type":46,"value":3979},"\u002F\u002F BEFORE — manual setup, easy to get ordering wrong\n",{"type":40,"tag":1196,"props":3981,"children":3982},{"class":1198,"line":1209},[3983,3987,3992,3996,4000,4004,4009],{"type":40,"tag":1196,"props":3984,"children":3985},{"style":1213},[3986],{"type":46,"value":1216},{"type":40,"tag":1196,"props":3988,"children":3989},{"style":1219},[3990],{"type":46,"value":3991}," frame ",{"type":40,"tag":1196,"props":3993,"children":3994},{"style":1225},[3995],{"type":46,"value":1228},{"type":40,"tag":1196,"props":3997,"children":3998},{"style":1219},[3999],{"type":46,"value":1233},{"type":40,"tag":1196,"props":4001,"children":4002},{"style":1225},[4003],{"type":46,"value":70},{"type":40,"tag":1196,"props":4005,"children":4006},{"style":1257},[4007],{"type":46,"value":4008},"createFrame",{"type":40,"tag":1196,"props":4010,"children":4011},{"style":1219},[4012],{"type":46,"value":3257},{"type":40,"tag":1196,"props":4014,"children":4015},{"class":1198,"line":1331},[4016,4020,4024,4029,4033,4037,4042],{"type":40,"tag":1196,"props":4017,"children":4018},{"style":1219},[4019],{"type":46,"value":813},{"type":40,"tag":1196,"props":4021,"children":4022},{"style":1225},[4023],{"type":46,"value":70},{"type":40,"tag":1196,"props":4025,"children":4026},{"style":1219},[4027],{"type":46,"value":4028},"layoutMode ",{"type":40,"tag":1196,"props":4030,"children":4031},{"style":1225},[4032],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4034,"children":4035},{"style":1225},[4036],{"type":46,"value":2127},{"type":40,"tag":1196,"props":4038,"children":4039},{"style":1311},[4040],{"type":46,"value":4041},"VERTICAL",{"type":40,"tag":1196,"props":4043,"children":4044},{"style":1225},[4045],{"type":46,"value":4046},"'\n",{"type":40,"tag":1196,"props":4048,"children":4049},{"class":1198,"line":1362},[4050,4054,4058,4063,4067,4071,4076],{"type":40,"tag":1196,"props":4051,"children":4052},{"style":1219},[4053],{"type":46,"value":813},{"type":40,"tag":1196,"props":4055,"children":4056},{"style":1225},[4057],{"type":46,"value":70},{"type":40,"tag":1196,"props":4059,"children":4060},{"style":1219},[4061],{"type":46,"value":4062},"primaryAxisSizingMode ",{"type":40,"tag":1196,"props":4064,"children":4065},{"style":1225},[4066],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4068,"children":4069},{"style":1225},[4070],{"type":46,"value":2127},{"type":40,"tag":1196,"props":4072,"children":4073},{"style":1311},[4074],{"type":46,"value":4075},"AUTO",{"type":40,"tag":1196,"props":4077,"children":4078},{"style":1225},[4079],{"type":46,"value":4046},{"type":40,"tag":1196,"props":4081,"children":4082},{"class":1198,"line":1577},[4083,4087,4091,4096,4100,4104,4108],{"type":40,"tag":1196,"props":4084,"children":4085},{"style":1219},[4086],{"type":46,"value":813},{"type":40,"tag":1196,"props":4088,"children":4089},{"style":1225},[4090],{"type":46,"value":70},{"type":40,"tag":1196,"props":4092,"children":4093},{"style":1219},[4094],{"type":46,"value":4095},"counterAxisSizingMode ",{"type":40,"tag":1196,"props":4097,"children":4098},{"style":1225},[4099],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4101,"children":4102},{"style":1225},[4103],{"type":46,"value":2127},{"type":40,"tag":1196,"props":4105,"children":4106},{"style":1311},[4107],{"type":46,"value":4075},{"type":40,"tag":1196,"props":4109,"children":4110},{"style":1225},[4111],{"type":46,"value":4046},{"type":40,"tag":1196,"props":4113,"children":4114},{"class":1198,"line":1586},[4115,4119,4123,4128,4132,4136,4140],{"type":40,"tag":1196,"props":4116,"children":4117},{"style":1219},[4118],{"type":46,"value":813},{"type":40,"tag":1196,"props":4120,"children":4121},{"style":1225},[4122],{"type":46,"value":70},{"type":40,"tag":1196,"props":4124,"children":4125},{"style":1219},[4126],{"type":46,"value":4127},"layoutSizingHorizontal ",{"type":40,"tag":1196,"props":4129,"children":4130},{"style":1225},[4131],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4133,"children":4134},{"style":1225},[4135],{"type":46,"value":2127},{"type":40,"tag":1196,"props":4137,"children":4138},{"style":1311},[4139],{"type":46,"value":643},{"type":40,"tag":1196,"props":4141,"children":4142},{"style":1225},[4143],{"type":46,"value":4046},{"type":40,"tag":1196,"props":4145,"children":4146},{"class":1198,"line":1596},[4147,4151,4155,4160,4164,4168,4172],{"type":40,"tag":1196,"props":4148,"children":4149},{"style":1219},[4150],{"type":46,"value":813},{"type":40,"tag":1196,"props":4152,"children":4153},{"style":1225},[4154],{"type":46,"value":70},{"type":40,"tag":1196,"props":4156,"children":4157},{"style":1219},[4158],{"type":46,"value":4159},"layoutSizingVertical ",{"type":40,"tag":1196,"props":4161,"children":4162},{"style":1225},[4163],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4165,"children":4166},{"style":1225},[4167],{"type":46,"value":2127},{"type":40,"tag":1196,"props":4169,"children":4170},{"style":1311},[4171],{"type":46,"value":643},{"type":40,"tag":1196,"props":4173,"children":4174},{"style":1225},[4175],{"type":46,"value":4046},{"type":40,"tag":1196,"props":4177,"children":4178},{"class":1198,"line":1605},[4179],{"type":40,"tag":1196,"props":4180,"children":4181},{"emptyLinePlaceholder":1590},[4182],{"type":46,"value":1593},{"type":40,"tag":1196,"props":4184,"children":4185},{"class":1198,"line":3179},[4186],{"type":40,"tag":1196,"props":4187,"children":4188},{"style":1203},[4189],{"type":46,"value":4190},"\u002F\u002F AFTER — one call, layout ready\n",{"type":40,"tag":1196,"props":4192,"children":4193},{"class":1198,"line":3188},[4194,4198,4202,4206,4210,4214,4219,4223,4227,4231,4235],{"type":40,"tag":1196,"props":4195,"children":4196},{"style":1213},[4197],{"type":46,"value":1216},{"type":40,"tag":1196,"props":4199,"children":4200},{"style":1219},[4201],{"type":46,"value":3991},{"type":40,"tag":1196,"props":4203,"children":4204},{"style":1225},[4205],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4207,"children":4208},{"style":1219},[4209],{"type":46,"value":1233},{"type":40,"tag":1196,"props":4211,"children":4212},{"style":1225},[4213],{"type":46,"value":70},{"type":40,"tag":1196,"props":4215,"children":4216},{"style":1257},[4217],{"type":46,"value":4218},"createAutoLayout",{"type":40,"tag":1196,"props":4220,"children":4221},{"style":1219},[4222],{"type":46,"value":1265},{"type":40,"tag":1196,"props":4224,"children":4225},{"style":1225},[4226],{"type":46,"value":2136},{"type":40,"tag":1196,"props":4228,"children":4229},{"style":1311},[4230],{"type":46,"value":4041},{"type":40,"tag":1196,"props":4232,"children":4233},{"style":1225},[4234],{"type":46,"value":2136},{"type":40,"tag":1196,"props":4236,"children":4237},{"style":1219},[4238],{"type":46,"value":2175},{"type":40,"tag":49,"props":4240,"children":4241},{},[4242,4244,4250],{"type":46,"value":4243},"Children can immediately use ",{"type":40,"tag":55,"props":4245,"children":4247},{"className":4246},[],[4248],{"type":46,"value":4249},"layoutSizingHorizontal\u002FVertical = 'FILL'",{"type":46,"value":4251}," after being appended — no need to set sizing modes manually.",{"type":40,"tag":49,"props":4253,"children":4254},{},[4255],{"type":46,"value":4256},"Accepts an optional props object as the first or second argument:",{"type":40,"tag":1185,"props":4258,"children":4260},{"className":1187,"code":4259,"language":1189,"meta":1190,"style":1190},"figma.createAutoLayout({ name: 'Card', itemSpacing: 12 })               \u002F\u002F HORIZONTAL + props\nfigma.createAutoLayout('VERTICAL', { name: 'Column', itemSpacing: 8 })  \u002F\u002F VERTICAL + props\n",[4261],{"type":40,"tag":55,"props":4262,"children":4263},{"__ignoreMap":1190},[4264,4339],{"type":40,"tag":1196,"props":4265,"children":4266},{"class":1198,"line":1199},[4267,4271,4275,4279,4283,4287,4291,4295,4299,4303,4307,4311,4316,4320,4325,4329,4334],{"type":40,"tag":1196,"props":4268,"children":4269},{"style":1219},[4270],{"type":46,"value":21},{"type":40,"tag":1196,"props":4272,"children":4273},{"style":1225},[4274],{"type":46,"value":70},{"type":40,"tag":1196,"props":4276,"children":4277},{"style":1257},[4278],{"type":46,"value":4218},{"type":40,"tag":1196,"props":4280,"children":4281},{"style":1219},[4282],{"type":46,"value":1265},{"type":40,"tag":1196,"props":4284,"children":4285},{"style":1225},[4286],{"type":46,"value":2930},{"type":40,"tag":1196,"props":4288,"children":4289},{"style":1551},[4290],{"type":46,"value":3601},{"type":40,"tag":1196,"props":4292,"children":4293},{"style":1225},[4294],{"type":46,"value":2920},{"type":40,"tag":1196,"props":4296,"children":4297},{"style":1225},[4298],{"type":46,"value":2127},{"type":40,"tag":1196,"props":4300,"children":4301},{"style":1311},[4302],{"type":46,"value":3517},{"type":40,"tag":1196,"props":4304,"children":4305},{"style":1225},[4306],{"type":46,"value":2136},{"type":40,"tag":1196,"props":4308,"children":4309},{"style":1225},[4310],{"type":46,"value":2957},{"type":40,"tag":1196,"props":4312,"children":4313},{"style":1551},[4314],{"type":46,"value":4315}," itemSpacing",{"type":40,"tag":1196,"props":4317,"children":4318},{"style":1225},[4319],{"type":46,"value":2920},{"type":40,"tag":1196,"props":4321,"children":4322},{"style":2983},[4323],{"type":46,"value":4324}," 12",{"type":40,"tag":1196,"props":4326,"children":4327},{"style":1225},[4328],{"type":46,"value":3622},{"type":40,"tag":1196,"props":4330,"children":4331},{"style":1219},[4332],{"type":46,"value":4333},")               ",{"type":40,"tag":1196,"props":4335,"children":4336},{"style":1203},[4337],{"type":46,"value":4338},"\u002F\u002F HORIZONTAL + props\n",{"type":40,"tag":1196,"props":4340,"children":4341},{"class":1198,"line":1209},[4342,4346,4350,4354,4358,4362,4366,4370,4374,4378,4382,4386,4390,4395,4399,4403,4407,4411,4415,4419,4424],{"type":40,"tag":1196,"props":4343,"children":4344},{"style":1219},[4345],{"type":46,"value":21},{"type":40,"tag":1196,"props":4347,"children":4348},{"style":1225},[4349],{"type":46,"value":70},{"type":40,"tag":1196,"props":4351,"children":4352},{"style":1257},[4353],{"type":46,"value":4218},{"type":40,"tag":1196,"props":4355,"children":4356},{"style":1219},[4357],{"type":46,"value":1265},{"type":40,"tag":1196,"props":4359,"children":4360},{"style":1225},[4361],{"type":46,"value":2136},{"type":40,"tag":1196,"props":4363,"children":4364},{"style":1311},[4365],{"type":46,"value":4041},{"type":40,"tag":1196,"props":4367,"children":4368},{"style":1225},[4369],{"type":46,"value":2136},{"type":40,"tag":1196,"props":4371,"children":4372},{"style":1225},[4373],{"type":46,"value":2957},{"type":40,"tag":1196,"props":4375,"children":4376},{"style":1225},[4377],{"type":46,"value":2971},{"type":40,"tag":1196,"props":4379,"children":4380},{"style":1551},[4381],{"type":46,"value":3601},{"type":40,"tag":1196,"props":4383,"children":4384},{"style":1225},[4385],{"type":46,"value":2920},{"type":40,"tag":1196,"props":4387,"children":4388},{"style":1225},[4389],{"type":46,"value":2127},{"type":40,"tag":1196,"props":4391,"children":4392},{"style":1311},[4393],{"type":46,"value":4394},"Column",{"type":40,"tag":1196,"props":4396,"children":4397},{"style":1225},[4398],{"type":46,"value":2136},{"type":40,"tag":1196,"props":4400,"children":4401},{"style":1225},[4402],{"type":46,"value":2957},{"type":40,"tag":1196,"props":4404,"children":4405},{"style":1551},[4406],{"type":46,"value":4315},{"type":40,"tag":1196,"props":4408,"children":4409},{"style":1225},[4410],{"type":46,"value":2920},{"type":40,"tag":1196,"props":4412,"children":4413},{"style":2983},[4414],{"type":46,"value":3592},{"type":40,"tag":1196,"props":4416,"children":4417},{"style":1225},[4418],{"type":46,"value":3622},{"type":40,"tag":1196,"props":4420,"children":4421},{"style":1219},[4422],{"type":46,"value":4423},")  ",{"type":40,"tag":1196,"props":4425,"children":4426},{"style":1203},[4427],{"type":46,"value":4428},"\u002F\u002F VERTICAL + props\n",{"type":40,"tag":1141,"props":4430,"children":4432},{"id":4431},"nodeplaceholder-shimmer-overlay-for-ai-in-progress-feedback",[4433,4439],{"type":40,"tag":55,"props":4434,"children":4436},{"className":4435},[],[4437],{"type":46,"value":4438},"node.placeholder",{"type":46,"value":4440}," — shimmer overlay for AI-in-progress feedback",{"type":40,"tag":49,"props":4442,"children":4443},{},[4444,4446,4451],{"type":46,"value":4445},"Sets a visual shimmer overlay on a node indicating work is in progress. ",{"type":40,"tag":75,"props":4447,"children":4448},{},[4449],{"type":46,"value":4450},"Always remove the shimmer when done",{"type":46,"value":4452}," — leftover shimmers confuse users and indicate incomplete work.",{"type":40,"tag":1185,"props":4454,"children":4456},{"className":1187,"code":4455,"language":1189,"meta":1190,"style":1190},"\u002F\u002F Mark as in-progress\nframe.placeholder = true\n\n\u002F\u002F ... build out the content ...\n\n\u002F\u002F MUST remove when done — never leave shimmers on finished nodes\nframe.placeholder = false\n",[4457],{"type":40,"tag":55,"props":4458,"children":4459},{"__ignoreMap":1190},[4460,4468,4494,4501,4509,4516,4524],{"type":40,"tag":1196,"props":4461,"children":4462},{"class":1198,"line":1199},[4463],{"type":40,"tag":1196,"props":4464,"children":4465},{"style":1203},[4466],{"type":46,"value":4467},"\u002F\u002F Mark as in-progress\n",{"type":40,"tag":1196,"props":4469,"children":4470},{"class":1198,"line":1209},[4471,4475,4479,4484,4488],{"type":40,"tag":1196,"props":4472,"children":4473},{"style":1219},[4474],{"type":46,"value":813},{"type":40,"tag":1196,"props":4476,"children":4477},{"style":1225},[4478],{"type":46,"value":70},{"type":40,"tag":1196,"props":4480,"children":4481},{"style":1219},[4482],{"type":46,"value":4483},"placeholder ",{"type":40,"tag":1196,"props":4485,"children":4486},{"style":1225},[4487],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4489,"children":4491},{"style":4490},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[4492],{"type":46,"value":4493}," true\n",{"type":40,"tag":1196,"props":4495,"children":4496},{"class":1198,"line":1331},[4497],{"type":40,"tag":1196,"props":4498,"children":4499},{"emptyLinePlaceholder":1590},[4500],{"type":46,"value":1593},{"type":40,"tag":1196,"props":4502,"children":4503},{"class":1198,"line":1362},[4504],{"type":40,"tag":1196,"props":4505,"children":4506},{"style":1203},[4507],{"type":46,"value":4508},"\u002F\u002F ... build out the content ...\n",{"type":40,"tag":1196,"props":4510,"children":4511},{"class":1198,"line":1577},[4512],{"type":40,"tag":1196,"props":4513,"children":4514},{"emptyLinePlaceholder":1590},[4515],{"type":46,"value":1593},{"type":40,"tag":1196,"props":4517,"children":4518},{"class":1198,"line":1586},[4519],{"type":40,"tag":1196,"props":4520,"children":4521},{"style":1203},[4522],{"type":46,"value":4523},"\u002F\u002F MUST remove when done — never leave shimmers on finished nodes\n",{"type":40,"tag":1196,"props":4525,"children":4526},{"class":1198,"line":1596},[4527,4531,4535,4539,4543],{"type":40,"tag":1196,"props":4528,"children":4529},{"style":1219},[4530],{"type":46,"value":813},{"type":40,"tag":1196,"props":4532,"children":4533},{"style":1225},[4534],{"type":46,"value":70},{"type":40,"tag":1196,"props":4536,"children":4537},{"style":1219},[4538],{"type":46,"value":4483},{"type":40,"tag":1196,"props":4540,"children":4541},{"style":1225},[4542],{"type":46,"value":1228},{"type":40,"tag":1196,"props":4544,"children":4545},{"style":4490},[4546],{"type":46,"value":4547}," false\n",{"type":40,"tag":49,"props":4549,"children":4550},{},[4551,4553,4559,4561,4567],{"type":46,"value":4552},"When building complex layouts, set ",{"type":40,"tag":55,"props":4554,"children":4556},{"className":4555},[],[4557],{"type":46,"value":4558},"placeholder = true",{"type":46,"value":4560}," on sections before populating them, then set ",{"type":40,"tag":55,"props":4562,"children":4564},{"className":4563},[],[4565],{"type":46,"value":4566},"placeholder = false",{"type":46,"value":4568}," on each section as it's completed.",{"type":40,"tag":1141,"props":4570,"children":4572},{"id":4571},"await-nodescreenshotopts-inline-screenshots",[4573,4579],{"type":40,"tag":55,"props":4574,"children":4576},{"className":4575},[],[4577],{"type":46,"value":4578},"await node.screenshot(opts?)",{"type":46,"value":4580}," — inline screenshots",{"type":40,"tag":49,"props":4582,"children":4583},{},[4584,4586,4591],{"type":46,"value":4585},"Capture a node as a PNG and return it inline in the response. Eliminates the need for a separate ",{"type":40,"tag":55,"props":4587,"children":4589},{"className":4588},[],[4590],{"type":46,"value":1990},{"type":46,"value":4592}," call.",{"type":40,"tag":1185,"props":4594,"children":4596},{"className":1187,"code":4595,"language":1189,"meta":1190,"style":1190},"\u002F\u002F Take a screenshot of a frame (returned inline in the tool response)\nawait frame.screenshot()\n\n\u002F\u002F Custom scale (default auto-scales: 0.5x or capped so max dimension ≤ 1024px)\nawait frame.screenshot({ scale: 2 })\n\n\u002F\u002F Include overlapping content from sibling nodes\nawait frame.screenshot({ contentsOnly: false })\n",[4597],{"type":40,"tag":55,"props":4598,"children":4599},{"__ignoreMap":1190},[4600,4608,4632,4639,4647,4696,4703,4711],{"type":40,"tag":1196,"props":4601,"children":4602},{"class":1198,"line":1199},[4603],{"type":40,"tag":1196,"props":4604,"children":4605},{"style":1203},[4606],{"type":46,"value":4607},"\u002F\u002F Take a screenshot of a frame (returned inline in the tool response)\n",{"type":40,"tag":1196,"props":4609,"children":4610},{"class":1198,"line":1209},[4611,4615,4619,4623,4628],{"type":40,"tag":1196,"props":4612,"children":4613},{"style":1335},[4614],{"type":46,"value":291},{"type":40,"tag":1196,"props":4616,"children":4617},{"style":1219},[4618],{"type":46,"value":2083},{"type":40,"tag":1196,"props":4620,"children":4621},{"style":1225},[4622],{"type":46,"value":70},{"type":40,"tag":1196,"props":4624,"children":4625},{"style":1257},[4626],{"type":46,"value":4627},"screenshot",{"type":40,"tag":1196,"props":4629,"children":4630},{"style":1219},[4631],{"type":46,"value":3257},{"type":40,"tag":1196,"props":4633,"children":4634},{"class":1198,"line":1331},[4635],{"type":40,"tag":1196,"props":4636,"children":4637},{"emptyLinePlaceholder":1590},[4638],{"type":46,"value":1593},{"type":40,"tag":1196,"props":4640,"children":4641},{"class":1198,"line":1362},[4642],{"type":40,"tag":1196,"props":4643,"children":4644},{"style":1203},[4645],{"type":46,"value":4646},"\u002F\u002F Custom scale (default auto-scales: 0.5x or capped so max dimension ≤ 1024px)\n",{"type":40,"tag":1196,"props":4648,"children":4649},{"class":1198,"line":1577},[4650,4654,4658,4662,4666,4670,4674,4679,4683,4688,4692],{"type":40,"tag":1196,"props":4651,"children":4652},{"style":1335},[4653],{"type":46,"value":291},{"type":40,"tag":1196,"props":4655,"children":4656},{"style":1219},[4657],{"type":46,"value":2083},{"type":40,"tag":1196,"props":4659,"children":4660},{"style":1225},[4661],{"type":46,"value":70},{"type":40,"tag":1196,"props":4663,"children":4664},{"style":1257},[4665],{"type":46,"value":4627},{"type":40,"tag":1196,"props":4667,"children":4668},{"style":1219},[4669],{"type":46,"value":1265},{"type":40,"tag":1196,"props":4671,"children":4672},{"style":1225},[4673],{"type":46,"value":2930},{"type":40,"tag":1196,"props":4675,"children":4676},{"style":1551},[4677],{"type":46,"value":4678}," scale",{"type":40,"tag":1196,"props":4680,"children":4681},{"style":1225},[4682],{"type":46,"value":2920},{"type":40,"tag":1196,"props":4684,"children":4685},{"style":2983},[4686],{"type":46,"value":4687}," 2",{"type":40,"tag":1196,"props":4689,"children":4690},{"style":1225},[4691],{"type":46,"value":3622},{"type":40,"tag":1196,"props":4693,"children":4694},{"style":1219},[4695],{"type":46,"value":2175},{"type":40,"tag":1196,"props":4697,"children":4698},{"class":1198,"line":1586},[4699],{"type":40,"tag":1196,"props":4700,"children":4701},{"emptyLinePlaceholder":1590},[4702],{"type":46,"value":1593},{"type":40,"tag":1196,"props":4704,"children":4705},{"class":1198,"line":1596},[4706],{"type":40,"tag":1196,"props":4707,"children":4708},{"style":1203},[4709],{"type":46,"value":4710},"\u002F\u002F Include overlapping content from sibling nodes\n",{"type":40,"tag":1196,"props":4712,"children":4713},{"class":1198,"line":1605},[4714,4718,4722,4726,4730,4734,4738,4743,4747,4752,4756],{"type":40,"tag":1196,"props":4715,"children":4716},{"style":1335},[4717],{"type":46,"value":291},{"type":40,"tag":1196,"props":4719,"children":4720},{"style":1219},[4721],{"type":46,"value":2083},{"type":40,"tag":1196,"props":4723,"children":4724},{"style":1225},[4725],{"type":46,"value":70},{"type":40,"tag":1196,"props":4727,"children":4728},{"style":1257},[4729],{"type":46,"value":4627},{"type":40,"tag":1196,"props":4731,"children":4732},{"style":1219},[4733],{"type":46,"value":1265},{"type":40,"tag":1196,"props":4735,"children":4736},{"style":1225},[4737],{"type":46,"value":2930},{"type":40,"tag":1196,"props":4739,"children":4740},{"style":1551},[4741],{"type":46,"value":4742}," contentsOnly",{"type":40,"tag":1196,"props":4744,"children":4745},{"style":1225},[4746],{"type":46,"value":2920},{"type":40,"tag":1196,"props":4748,"children":4749},{"style":4490},[4750],{"type":46,"value":4751}," false",{"type":40,"tag":1196,"props":4753,"children":4754},{"style":1225},[4755],{"type":46,"value":3622},{"type":40,"tag":1196,"props":4757,"children":4758},{"style":1219},[4759],{"type":46,"value":2175},{"type":40,"tag":49,"props":4761,"children":4762},{},[4763,4768,4770,4776,4778,4783],{"type":40,"tag":75,"props":4764,"children":4765},{},[4766],{"type":46,"value":4767},"When to use:",{"type":46,"value":4769}," After creating or modifying nodes, call ",{"type":40,"tag":55,"props":4771,"children":4773},{"className":4772},[],[4774],{"type":46,"value":4775},"screenshot()",{"type":46,"value":4777}," to visually verify the result within the same script. No need for a separate ",{"type":40,"tag":55,"props":4779,"children":4781},{"className":4780},[],[4782],{"type":46,"value":1990},{"type":46,"value":4592},{"type":40,"tag":49,"props":4785,"children":4786},{},[4787,4792,4794,4800],{"type":40,"tag":75,"props":4788,"children":4789},{},[4790],{"type":46,"value":4791},"Auto-naming:",{"type":46,"value":4793}," The image caption includes node metadata — ",{"type":40,"tag":55,"props":4795,"children":4797},{"className":4796},[],[4798],{"type":46,"value":4799},"\"Card (300x150 at 0,60).png\"",{"type":46,"value":4801}," — giving spatial context without parsing the image.",{"type":40,"tag":49,"props":4803,"children":4804},{},[4805,4810,4812,4818],{"type":40,"tag":75,"props":4806,"children":4807},{},[4808],{"type":46,"value":4809},"Default scaling:",{"type":46,"value":4811}," Uses 0.5x scale, but automatically caps so the largest output dimension never exceeds 1024px. Explicit ",{"type":40,"tag":55,"props":4813,"children":4815},{"className":4814},[],[4816],{"type":46,"value":4817},"{ scale: N }",{"type":46,"value":4819}," bypasses the cap.",{"type":40,"tag":241,"props":4821,"children":4823},{"id":4822},"_6-incremental-workflow-how-to-avoid-bugs",[4824],{"type":46,"value":4825},"6. Incremental Workflow (How to Avoid Bugs)",{"type":40,"tag":49,"props":4827,"children":4828},{},[4829,4831,4836,4838],{"type":46,"value":4830},"The most common cause of bugs is trying to do too much in a single ",{"type":40,"tag":55,"props":4832,"children":4834},{"className":4833},[],[4835],{"type":46,"value":60},{"type":46,"value":4837}," call. ",{"type":40,"tag":75,"props":4839,"children":4840},{},[4841],{"type":46,"value":4842},"Work in small steps and validate after each one.",{"type":40,"tag":1141,"props":4844,"children":4846},{"id":4845},"key-rules",[4847],{"type":46,"value":4848},"Key rules",{"type":40,"tag":1720,"props":4850,"children":4851},{},[4852,4881],{"type":40,"tag":252,"props":4853,"children":4854},{},[4855,4866,4868,4873,4875,4879],{"type":40,"tag":75,"props":4856,"children":4857},{},[4858,4860,4865],{"type":46,"value":4859},"At most 10 logical operations per ",{"type":40,"tag":55,"props":4861,"children":4863},{"className":4862},[],[4864],{"type":46,"value":60},{"type":46,"value":4592},{"type":46,"value":4867}," A \"logical operation\" is creating a node, setting its properties, and parenting it. If you need to create 20 nodes, split across 2-3 calls. ",{"type":40,"tag":75,"props":4869,"children":4870},{},[4871],{"type":46,"value":4872},"Slides override:",{"type":46,"value":4874}," in Slides files, slides are isolated subtrees — the relevant limit is complexity per slide, not total nodes across slides. Building 3–5 new slides in one call is safe, and so is applying the same edit (e.g. adding a footer, recoloring a heading) across every slide in the deck in a single call. See ",{"type":40,"tag":165,"props":4876,"children":4877},{"href":2002},[4878],{"type":46,"value":2005},{"type":46,"value":4880}," for the deck-building workflow.",{"type":40,"tag":252,"props":4882,"children":4883},{},[4884,4889,4891,4896],{"type":40,"tag":75,"props":4885,"children":4886},{},[4887],{"type":46,"value":4888},"Build top-down, starting with placeholders.",{"type":46,"value":4890}," Create the outer structure first with ",{"type":40,"tag":55,"props":4892,"children":4894},{"className":4893},[],[4895],{"type":46,"value":4558},{"type":46,"value":4897}," on each section, then incrementally replace placeholders with real content in subsequent calls.",{"type":40,"tag":1141,"props":4899,"children":4901},{"id":4900},"the-pattern",[4902],{"type":46,"value":4903},"The pattern",{"type":40,"tag":248,"props":4905,"children":4906},{},[4907,4924,4941,4965,4990,5022],{"type":40,"tag":252,"props":4908,"children":4909},{},[4910,4915,4917,4922],{"type":40,"tag":75,"props":4911,"children":4912},{},[4913],{"type":46,"value":4914},"Inspect first.",{"type":46,"value":4916}," Before creating anything, run a read-only ",{"type":40,"tag":55,"props":4918,"children":4920},{"className":4919},[],[4921],{"type":46,"value":60},{"type":46,"value":4923}," to discover what already exists in the file — pages, components, variables, naming conventions. Match what's there.",{"type":40,"tag":252,"props":4925,"children":4926},{},[4927,4932,4934,4939],{"type":40,"tag":75,"props":4928,"children":4929},{},[4930],{"type":46,"value":4931},"Build the skeleton.",{"type":46,"value":4933}," Create the top-level structure with placeholder sections. Set ",{"type":40,"tag":55,"props":4935,"children":4937},{"className":4936},[],[4938],{"type":46,"value":4558},{"type":46,"value":4940}," on each section so the user sees progress.",{"type":40,"tag":252,"props":4942,"children":4943},{},[4944,4949,4951,4956,4958,4963],{"type":40,"tag":75,"props":4945,"children":4946},{},[4947],{"type":46,"value":4948},"Fill in sections incrementally.",{"type":46,"value":4950}," In each subsequent call, populate one section and set its ",{"type":40,"tag":55,"props":4952,"children":4954},{"className":4953},[],[4955],{"type":46,"value":4566},{"type":46,"value":4957}," when done. Take a ",{"type":40,"tag":55,"props":4959,"children":4961},{"className":4960},[],[4962],{"type":46,"value":4775},{"type":46,"value":4964}," to verify.",{"type":40,"tag":252,"props":4966,"children":4967},{},[4968,4973,4975,4980,4982,4988],{"type":40,"tag":75,"props":4969,"children":4970},{},[4971],{"type":46,"value":4972},"Return IDs from every call.",{"type":46,"value":4974}," Always ",{"type":40,"tag":55,"props":4976,"children":4978},{"className":4977},[],[4979],{"type":46,"value":265},{"type":46,"value":4981}," created node IDs, variable IDs, collection IDs as objects (e.g. ",{"type":40,"tag":55,"props":4983,"children":4985},{"className":4984},[],[4986],{"type":46,"value":4987},"return { createdNodeIds: [...] }",{"type":46,"value":4989},"). You'll need these as inputs to subsequent calls.",{"type":40,"tag":252,"props":4991,"children":4992},{},[4993,4998,5000,5006,5008,5013,5015,5020],{"type":40,"tag":75,"props":4994,"children":4995},{},[4996],{"type":46,"value":4997},"Validate after each step.",{"type":46,"value":4999}," Use ",{"type":40,"tag":55,"props":5001,"children":5003},{"className":5002},[],[5004],{"type":46,"value":5005},"get_metadata",{"type":46,"value":5007}," to verify structure (counts, names, hierarchy, positions). Use ",{"type":40,"tag":55,"props":5009,"children":5011},{"className":5010},[],[5012],{"type":46,"value":1997},{"type":46,"value":5014}," inline or ",{"type":40,"tag":55,"props":5016,"children":5018},{"className":5017},[],[5019],{"type":46,"value":1990},{"type":46,"value":5021}," after major milestones to catch visual issues.",{"type":40,"tag":252,"props":5023,"children":5024},{},[5025,5030],{"type":40,"tag":75,"props":5026,"children":5027},{},[5028],{"type":46,"value":5029},"Fix before moving on.",{"type":46,"value":5031}," If validation reveals a problem, fix it before proceeding to the next step. Don't build on a broken foundation.",{"type":40,"tag":1141,"props":5033,"children":5035},{"id":5034},"suggested-step-order-for-complex-tasks",[5036],{"type":46,"value":5037},"Suggested step order for complex tasks",{"type":40,"tag":1185,"props":5039,"children":5043},{"className":5040,"code":5042,"language":46},[5041],"language-text","Step 1: Inspect file — discover existing pages, components, variables, conventions\nStep 2: Create tokens\u002Fvariables (if needed)\n       → validate with get_metadata\nStep 3: Create individual components\n       → validate with get_metadata + get_screenshot\nStep 4: Compose layouts from component instances\n       → validate with get_screenshot\nStep 5: Final verification\n",[5044],{"type":40,"tag":55,"props":5045,"children":5046},{"__ignoreMap":1190},[5047],{"type":46,"value":5042},{"type":40,"tag":1141,"props":5049,"children":5051},{"id":5050},"what-to-validate-at-each-step",[5052],{"type":46,"value":5053},"What to validate at each step",{"type":40,"tag":2528,"props":5055,"children":5056},{},[5057,5087],{"type":40,"tag":2532,"props":5058,"children":5059},{},[5060],{"type":40,"tag":2536,"props":5061,"children":5062},{},[5063,5068,5078],{"type":40,"tag":2540,"props":5064,"children":5065},{},[5066],{"type":46,"value":5067},"After...",{"type":40,"tag":2540,"props":5069,"children":5070},{},[5071,5073],{"type":46,"value":5072},"Check with ",{"type":40,"tag":55,"props":5074,"children":5076},{"className":5075},[],[5077],{"type":46,"value":5005},{"type":40,"tag":2540,"props":5079,"children":5080},{},[5081,5082],{"type":46,"value":5072},{"type":40,"tag":55,"props":5083,"children":5085},{"className":5084},[],[5086],{"type":46,"value":1990},{"type":40,"tag":2551,"props":5088,"children":5089},{},[5090,5108,5126,5144],{"type":40,"tag":2536,"props":5091,"children":5092},{},[5093,5098,5103],{"type":40,"tag":2558,"props":5094,"children":5095},{},[5096],{"type":46,"value":5097},"Creating variables",{"type":40,"tag":2558,"props":5099,"children":5100},{},[5101],{"type":46,"value":5102},"Collection count, variable count, mode names",{"type":40,"tag":2558,"props":5104,"children":5105},{},[5106],{"type":46,"value":5107},"—",{"type":40,"tag":2536,"props":5109,"children":5110},{},[5111,5116,5121],{"type":40,"tag":2558,"props":5112,"children":5113},{},[5114],{"type":46,"value":5115},"Creating components",{"type":40,"tag":2558,"props":5117,"children":5118},{},[5119],{"type":46,"value":5120},"Child count, variant names, property definitions",{"type":40,"tag":2558,"props":5122,"children":5123},{},[5124],{"type":46,"value":5125},"Variants visible, not collapsed, grid readable",{"type":40,"tag":2536,"props":5127,"children":5128},{},[5129,5134,5139],{"type":40,"tag":2558,"props":5130,"children":5131},{},[5132],{"type":46,"value":5133},"Binding variables",{"type":40,"tag":2558,"props":5135,"children":5136},{},[5137],{"type":46,"value":5138},"Node properties reflect bindings",{"type":40,"tag":2558,"props":5140,"children":5141},{},[5142],{"type":46,"value":5143},"Colors\u002Ftokens resolved correctly",{"type":40,"tag":2536,"props":5145,"children":5146},{},[5147,5152,5157],{"type":40,"tag":2558,"props":5148,"children":5149},{},[5150],{"type":46,"value":5151},"Composing layouts",{"type":40,"tag":2558,"props":5153,"children":5154},{},[5155],{"type":46,"value":5156},"Instance nodes have mainComponent, hierarchy correct",{"type":40,"tag":2558,"props":5158,"children":5159},{},[5160],{"type":46,"value":5161},"No cropped\u002Fclipped text, no overlapping elements, correct spacing",{"type":40,"tag":241,"props":5163,"children":5165},{"id":5164},"_7-error-recovery-self-correction",[5166],{"type":46,"value":5167},"7. Error Recovery & Self-Correction",{"type":40,"tag":49,"props":5169,"children":5170},{},[5171,5181],{"type":40,"tag":75,"props":5172,"children":5173},{},[5174,5179],{"type":40,"tag":55,"props":5175,"children":5177},{"className":5176},[],[5178],{"type":46,"value":60},{"type":46,"value":5180}," is atomic — failed scripts do not execute.",{"type":46,"value":5182}," If a script errors, no changes are made to the file. The file remains in the same state as before the call. This means there are no partial nodes, no orphaned elements from the failed script, and retrying after a fix is safe.",{"type":40,"tag":1141,"props":5184,"children":5186},{"id":5185},"when-use_figma-returns-an-error",[5187,5189,5194],{"type":46,"value":5188},"When ",{"type":40,"tag":55,"props":5190,"children":5192},{"className":5191},[],[5193],{"type":46,"value":60},{"type":46,"value":5195}," returns an error",{"type":40,"tag":248,"props":5197,"children":5198},{},[5199,5209,5219,5243,5253],{"type":40,"tag":252,"props":5200,"children":5201},{},[5202,5207],{"type":40,"tag":75,"props":5203,"children":5204},{},[5205],{"type":46,"value":5206},"STOP.",{"type":46,"value":5208}," Do not immediately fix the code and retry.",{"type":40,"tag":252,"props":5210,"children":5211},{},[5212,5217],{"type":40,"tag":75,"props":5213,"children":5214},{},[5215],{"type":46,"value":5216},"Read the error message carefully.",{"type":46,"value":5218}," Understand exactly what went wrong — wrong API usage, missing font, invalid property value, etc.",{"type":40,"tag":252,"props":5220,"children":5221},{},[5222,5227,5229,5234,5236,5241],{"type":40,"tag":75,"props":5223,"children":5224},{},[5225],{"type":46,"value":5226},"If the error is unclear",{"type":46,"value":5228},", call ",{"type":40,"tag":55,"props":5230,"children":5232},{"className":5231},[],[5233],{"type":46,"value":5005},{"type":46,"value":5235}," or ",{"type":40,"tag":55,"props":5237,"children":5239},{"className":5238},[],[5240],{"type":46,"value":1990},{"type":46,"value":5242}," to understand the current file state.",{"type":40,"tag":252,"props":5244,"children":5245},{},[5246,5251],{"type":40,"tag":75,"props":5247,"children":5248},{},[5249],{"type":46,"value":5250},"Fix the script",{"type":46,"value":5252}," based on the error message.",{"type":40,"tag":252,"props":5254,"children":5255},{},[5256,5261],{"type":40,"tag":75,"props":5257,"children":5258},{},[5259],{"type":46,"value":5260},"Retry",{"type":46,"value":5262}," the corrected script.",{"type":40,"tag":1141,"props":5264,"children":5266},{"id":5265},"common-self-correction-patterns",[5267],{"type":46,"value":5268},"Common self-correction patterns",{"type":40,"tag":2528,"props":5270,"children":5271},{},[5272,5293],{"type":40,"tag":2532,"props":5273,"children":5274},{},[5275],{"type":40,"tag":2536,"props":5276,"children":5277},{},[5278,5283,5288],{"type":40,"tag":2540,"props":5279,"children":5280},{},[5281],{"type":46,"value":5282},"Error message",{"type":40,"tag":2540,"props":5284,"children":5285},{},[5286],{"type":46,"value":5287},"Likely cause",{"type":40,"tag":2540,"props":5289,"children":5290},{},[5291],{"type":46,"value":5292},"How to fix",{"type":40,"tag":2551,"props":5294,"children":5295},{},[5296,5329,5449,5483,5501,5523,5556],{"type":40,"tag":2536,"props":5297,"children":5298},{},[5299,5308,5318],{"type":40,"tag":2558,"props":5300,"children":5301},{},[5302],{"type":40,"tag":55,"props":5303,"children":5305},{"className":5304},[],[5306],{"type":46,"value":5307},"\"not implemented\"",{"type":40,"tag":2558,"props":5309,"children":5310},{},[5311,5313],{"type":46,"value":5312},"Used ",{"type":40,"tag":55,"props":5314,"children":5316},{"className":5315},[],[5317],{"type":46,"value":317},{"type":40,"tag":2558,"props":5319,"children":5320},{},[5321,5323,5328],{"type":46,"value":5322},"Remove it — use ",{"type":40,"tag":55,"props":5324,"children":5326},{"className":5325},[],[5327],{"type":46,"value":265},{"type":46,"value":389},{"type":40,"tag":2536,"props":5330,"children":5331},{},[5332,5367,5405],{"type":40,"tag":2558,"props":5333,"children":5334},{},[5335,5340,5341,5346,5347,5353,5354,5360,5361],{"type":40,"tag":55,"props":5336,"children":5338},{"className":5337},[],[5339],{"type":46,"value":875},{"type":46,"value":334},{"type":40,"tag":55,"props":5342,"children":5344},{"className":5343},[],[5345],{"type":46,"value":882},{"type":46,"value":334},{"type":40,"tag":55,"props":5348,"children":5350},{"className":5349},[],[5351],{"type":46,"value":5352},"\"HUG can only be set on auto-layout frames or text children of auto-layout frames\"",{"type":46,"value":334},{"type":40,"tag":55,"props":5355,"children":5357},{"className":5356},[],[5358],{"type":46,"value":5359},"\"FILL cannot be set on absolute positioned auto-layout children\"",{"type":46,"value":334},{"type":40,"tag":55,"props":5362,"children":5364},{"className":5363},[],[5365],{"type":46,"value":5366},"\"FILL cannot be set on canvas grid children\"",{"type":40,"tag":2558,"props":5368,"children":5369},{},[5370,5372,5377,5378,5383,5385,5390,5392,5397,5399,5404],{"type":46,"value":5371},"Tried to assign ",{"type":40,"tag":55,"props":5373,"children":5375},{"className":5374},[],[5376],{"type":46,"value":643},{"type":46,"value":683},{"type":40,"tag":55,"props":5379,"children":5381},{"className":5380},[],[5382],{"type":46,"value":650},{"type":46,"value":5384}," to a node whose structural context doesn't allow it (e.g. parent isn't auto-layout, ran before ",{"type":40,"tag":55,"props":5386,"children":5388},{"className":5387},[],[5389],{"type":46,"value":477},{"type":46,"value":5391},", non-text child trying to ",{"type":40,"tag":55,"props":5393,"children":5395},{"className":5394},[],[5396],{"type":46,"value":643},{"type":46,"value":5398},", absolute-positioned child trying to ",{"type":40,"tag":55,"props":5400,"children":5402},{"className":5401},[],[5403],{"type":46,"value":650},{"type":46,"value":1279},{"type":40,"tag":2558,"props":5406,"children":5407},{},[5408,5410,5415,5416,5421,5423,5428,5430,5435,5437,5442,5444],{"type":46,"value":5409},"Make the parent auto-layout via ",{"type":40,"tag":55,"props":5411,"children":5413},{"className":5412},[],[5414],{"type":46,"value":719},{"type":46,"value":793},{"type":40,"tag":55,"props":5417,"children":5419},{"className":5418},[],[5420],{"type":46,"value":477},{"type":46,"value":5422}," first; reserve ",{"type":40,"tag":55,"props":5424,"children":5426},{"className":5425},[],[5427],{"type":46,"value":643},{"type":46,"value":5429}," for the auto-layout frame itself or for TEXT children; for absolute\u002Fimmutable\u002Fgrid children use ",{"type":40,"tag":55,"props":5431,"children":5433},{"className":5432},[],[5434],{"type":46,"value":635},{"type":46,"value":5436}," + ",{"type":40,"tag":55,"props":5438,"children":5440},{"className":5439},[],[5441],{"type":46,"value":3664},{"type":46,"value":5443},". See ",{"type":40,"tag":165,"props":5445,"children":5446},{"href":701},[5447],{"type":46,"value":5448},"gotchas.md",{"type":40,"tag":2536,"props":5450,"children":5451},{},[5452,5460,5472],{"type":40,"tag":2558,"props":5453,"children":5454},{},[5455],{"type":40,"tag":55,"props":5456,"children":5458},{"className":5457},[],[5459],{"type":46,"value":1175},{"type":40,"tag":2558,"props":5461,"children":5462},{},[5463,5465,5470],{"type":46,"value":5464},"Used sync page setter (",{"type":40,"tag":55,"props":5466,"children":5468},{"className":5467},[],[5469],{"type":46,"value":570},{"type":46,"value":5471},") which does NOT work",{"type":40,"tag":2558,"props":5473,"children":5474},{},[5475,5476,5481],{"type":46,"value":259},{"type":40,"tag":55,"props":5477,"children":5479},{"className":5478},[],[5480],{"type":46,"value":562},{"type":46,"value":5482}," — the only way to switch pages",{"type":40,"tag":2536,"props":5484,"children":5485},{},[5486,5491,5496],{"type":40,"tag":2558,"props":5487,"children":5488},{},[5489],{"type":46,"value":5490},"Property value out of range",{"type":40,"tag":2558,"props":5492,"children":5493},{},[5494],{"type":46,"value":5495},"Color channel > 1 (used 0–255 instead of 0–1)",{"type":40,"tag":2558,"props":5497,"children":5498},{},[5499],{"type":46,"value":5500},"Divide by 255",{"type":40,"tag":2536,"props":5502,"children":5503},{},[5504,5513,5518],{"type":40,"tag":2558,"props":5505,"children":5506},{},[5507],{"type":40,"tag":55,"props":5508,"children":5510},{"className":5509},[],[5511],{"type":46,"value":5512},"\"Cannot read properties of null\"",{"type":40,"tag":2558,"props":5514,"children":5515},{},[5516],{"type":46,"value":5517},"Node doesn't exist (wrong ID, wrong page)",{"type":40,"tag":2558,"props":5519,"children":5520},{},[5521],{"type":46,"value":5522},"Check page context, verify ID",{"type":40,"tag":2536,"props":5524,"children":5525},{},[5526,5531,5536],{"type":40,"tag":2558,"props":5527,"children":5528},{},[5529],{"type":46,"value":5530},"Script hangs \u002F no response",{"type":40,"tag":2558,"props":5532,"children":5533},{},[5534],{"type":46,"value":5535},"Infinite loop or unresolved promise",{"type":40,"tag":2558,"props":5537,"children":5538},{},[5539,5541,5547,5549,5554],{"type":46,"value":5540},"Check for ",{"type":40,"tag":55,"props":5542,"children":5544},{"className":5543},[],[5545],{"type":46,"value":5546},"while(true)",{"type":46,"value":5548}," or missing ",{"type":40,"tag":55,"props":5550,"children":5552},{"className":5551},[],[5553],{"type":46,"value":291},{"type":46,"value":5555},"; ensure code terminates",{"type":40,"tag":2536,"props":5557,"children":5558},{},[5559,5568,5581],{"type":40,"tag":2558,"props":5560,"children":5561},{},[5562],{"type":40,"tag":55,"props":5563,"children":5565},{"className":5564},[],[5566],{"type":46,"value":5567},"\"The node with id X does not exist\"",{"type":40,"tag":2558,"props":5569,"children":5570},{},[5571,5573,5579],{"type":46,"value":5572},"Parent instance was implicitly detached by a child ",{"type":40,"tag":55,"props":5574,"children":5576},{"className":5575},[],[5577],{"type":46,"value":5578},"detachInstance()",{"type":46,"value":5580},", changing IDs",{"type":40,"tag":2558,"props":5582,"children":5583},{},[5584],{"type":46,"value":5585},"Re-discover nodes by traversal from a stable (non-instance) parent frame",{"type":40,"tag":1141,"props":5587,"children":5589},{"id":5588},"when-the-script-succeeds-but-the-result-looks-wrong",[5590],{"type":46,"value":5591},"When the script succeeds but the result looks wrong",{"type":40,"tag":248,"props":5593,"children":5594},{},[5595,5606,5617,5622],{"type":40,"tag":252,"props":5596,"children":5597},{},[5598,5599,5604],{"type":46,"value":1374},{"type":40,"tag":55,"props":5600,"children":5602},{"className":5601},[],[5603],{"type":46,"value":5005},{"type":46,"value":5605}," to check structural correctness (hierarchy, counts, positions).",{"type":40,"tag":252,"props":5607,"children":5608},{},[5609,5610,5615],{"type":46,"value":1374},{"type":40,"tag":55,"props":5611,"children":5613},{"className":5612},[],[5614],{"type":46,"value":1990},{"type":46,"value":5616}," to check visual correctness. Look closely for cropped\u002Fclipped text (line heights cutting off content) and overlapping elements — these are common and easy to miss.",{"type":40,"tag":252,"props":5618,"children":5619},{},[5620],{"type":46,"value":5621},"Identify the discrepancy — is it structural (wrong hierarchy, missing nodes) or visual (wrong colors, broken layout, clipped content)?",{"type":40,"tag":252,"props":5623,"children":5624},{},[5625],{"type":46,"value":5626},"Write a targeted fix script that modifies only the broken parts — don't recreate everything.",{"type":40,"tag":1095,"props":5628,"children":5629},{},[5630],{"type":40,"tag":49,"props":5631,"children":5632},{},[5633,5635,5641],{"type":46,"value":5634},"For the full validation workflow, see ",{"type":40,"tag":165,"props":5636,"children":5638},{"href":5637},"references\u002Fvalidation-and-recovery.md",[5639],{"type":46,"value":5640},"Validation & Error Recovery",{"type":46,"value":70},{"type":40,"tag":241,"props":5643,"children":5645},{"id":5644},"_8-pre-flight-checklist",[5646],{"type":46,"value":5647},"8. Pre-Flight Checklist",{"type":40,"tag":49,"props":5649,"children":5650},{},[5651,5653,5658],{"type":46,"value":5652},"Before submitting ANY ",{"type":40,"tag":55,"props":5654,"children":5656},{"className":5655},[],[5657],{"type":46,"value":60},{"type":46,"value":5659}," call, verify:",{"type":40,"tag":1720,"props":5661,"children":5664},{"className":5662},[5663],"contains-task-list",[5665,5690,5699,5714,5730,5752,5761,5800,5809,5832,5854,5905,5941,5974,6009,6040,6055,6064,6073,6089,6105],{"type":40,"tag":252,"props":5666,"children":5669},{"className":5667},[5668],"task-list-item",[5670,5675,5677,5682,5684,5689],{"type":40,"tag":5671,"props":5672,"children":5674},"input",{"disabled":1590,"type":5673},"checkbox",[],{"type":46,"value":5676}," Code uses ",{"type":40,"tag":55,"props":5678,"children":5680},{"className":5679},[],[5681],{"type":46,"value":265},{"type":46,"value":5683}," to send data back (NOT ",{"type":40,"tag":55,"props":5685,"children":5687},{"className":5686},[],[5688],{"type":46,"value":275},{"type":46,"value":1279},{"type":40,"tag":252,"props":5691,"children":5693},{"className":5692},[5668],[5694,5697],{"type":40,"tag":5671,"props":5695,"children":5696},{"disabled":1590,"type":5673},[],{"type":46,"value":5698}," Code is NOT wrapped in an async IIFE (auto-wrapped for you)",{"type":40,"tag":252,"props":5700,"children":5702},{"className":5701},[5668],[5703,5706,5707,5712],{"type":40,"tag":5671,"props":5704,"children":5705},{"disabled":1590,"type":5673},[],{"type":46,"value":319},{"type":40,"tag":55,"props":5708,"children":5710},{"className":5709},[],[5711],{"type":46,"value":265},{"type":46,"value":5713}," value includes structured data with actionable info (IDs, counts)",{"type":40,"tag":252,"props":5715,"children":5717},{"className":5716},[5668],[5718,5721,5723,5728],{"type":40,"tag":5671,"props":5719,"children":5720},{"disabled":1590,"type":5673},[],{"type":46,"value":5722}," NO usage of ",{"type":40,"tag":55,"props":5724,"children":5726},{"className":5725},[],[5727],{"type":46,"value":317},{"type":46,"value":5729}," anywhere",{"type":40,"tag":252,"props":5731,"children":5733},{"className":5732},[5668],[5734,5737,5738,5743,5745,5750],{"type":40,"tag":5671,"props":5735,"children":5736},{"disabled":1590,"type":5673},[],{"type":46,"value":5722},{"type":40,"tag":55,"props":5739,"children":5741},{"className":5740},[],[5742],{"type":46,"value":380},{"type":46,"value":5744}," as output (use ",{"type":40,"tag":55,"props":5746,"children":5748},{"className":5747},[],[5749],{"type":46,"value":265},{"type":46,"value":5751}," instead)",{"type":40,"tag":252,"props":5753,"children":5755},{"className":5754},[5668],[5756,5759],{"type":40,"tag":5671,"props":5757,"children":5758},{"disabled":1590,"type":5673},[],{"type":46,"value":5760}," All colors use 0–1 range (not 0–255)",{"type":40,"tag":252,"props":5762,"children":5764},{"className":5763},[5668],[5765,5768,5770,5776,5778,5784,5786,5791,5793,5799],{"type":40,"tag":5671,"props":5766,"children":5767},{"disabled":1590,"type":5673},[],{"type":46,"value":5769}," Paint ",{"type":40,"tag":55,"props":5771,"children":5773},{"className":5772},[],[5774],{"type":46,"value":5775},"color",{"type":46,"value":5777}," objects use ",{"type":40,"tag":55,"props":5779,"children":5781},{"className":5780},[],[5782],{"type":46,"value":5783},"{r, g, b}",{"type":46,"value":5785}," only — no ",{"type":40,"tag":55,"props":5787,"children":5789},{"className":5788},[],[5790],{"type":46,"value":165},{"type":46,"value":5792}," field (opacity goes at the paint level: ",{"type":40,"tag":55,"props":5794,"children":5796},{"className":5795},[],[5797],{"type":46,"value":5798},"{ type: 'SOLID', color: {...}, opacity: 0.5 }",{"type":46,"value":1279},{"type":40,"tag":252,"props":5801,"children":5803},{"className":5802},[5668],[5804,5807],{"type":40,"tag":5671,"props":5805,"children":5806},{"disabled":1590,"type":5673},[],{"type":46,"value":5808}," Fills\u002Fstrokes are reassigned as new arrays (not mutated in place)",{"type":40,"tag":252,"props":5810,"children":5812},{"className":5811},[5668],[5813,5816,5818,5823,5825,5830],{"type":40,"tag":5671,"props":5814,"children":5815},{"disabled":1590,"type":5673},[],{"type":46,"value":5817}," Page switches use ",{"type":40,"tag":55,"props":5819,"children":5821},{"className":5820},[],[5822],{"type":46,"value":562},{"type":46,"value":5824}," (sync setter ",{"type":40,"tag":55,"props":5826,"children":5828},{"className":5827},[],[5829],{"type":46,"value":570},{"type":46,"value":5831}," does NOT work)",{"type":40,"tag":252,"props":5833,"children":5835},{"className":5834},[5668],[5836,5839,5840,5846,5848],{"type":40,"tag":5671,"props":5837,"children":5838},{"disabled":1590,"type":5673},[],{"type":46,"value":319},{"type":40,"tag":55,"props":5841,"children":5843},{"className":5842},[],[5844],{"type":46,"value":5845},"layoutSizingVertical\u002FHorizontal = 'FILL'",{"type":46,"value":5847}," is set AFTER ",{"type":40,"tag":55,"props":5849,"children":5851},{"className":5850},[],[5852],{"type":46,"value":5853},"parent.appendChild(child)",{"type":40,"tag":252,"props":5855,"children":5857},{"className":5856},[5668],[5858,5861,5863,5869,5871,5876,5877,5882,5884,5889,5891,5897,5899],{"type":40,"tag":5671,"props":5859,"children":5860},{"disabled":1590,"type":5673},[],{"type":46,"value":5862}," Wrapping TEXT blocks set ",{"type":40,"tag":55,"props":5864,"children":5866},{"className":5865},[],[5867],{"type":46,"value":5868},"textAutoResize = 'HEIGHT'",{"type":46,"value":5870}," and an explicit width (",{"type":40,"tag":55,"props":5872,"children":5874},{"className":5873},[],[5875],{"type":46,"value":860},{"type":46,"value":5436},{"type":40,"tag":55,"props":5878,"children":5880},{"className":5879},[],[5881],{"type":46,"value":3664},{"type":46,"value":5883},") — NOT ",{"type":40,"tag":55,"props":5885,"children":5887},{"className":5886},[],[5888],{"type":46,"value":650},{"type":46,"value":5890}," alone, which the default ",{"type":40,"tag":55,"props":5892,"children":5894},{"className":5893},[],[5895],{"type":46,"value":5896},"WIDTH_AND_HEIGHT",{"type":46,"value":5898}," mode ignores, collapsing the node to a near-zero-width thread. Verify ",{"type":40,"tag":55,"props":5900,"children":5902},{"className":5901},[],[5903],{"type":46,"value":5904},"node.width > 0",{"type":40,"tag":252,"props":5906,"children":5908},{"className":5907},[5668],[5909,5912,5914,5919,5920,5926,5927,5932,5934,5939],{"type":40,"tag":5671,"props":5910,"children":5911},{"disabled":1590,"type":5673},[],{"type":46,"value":5913}," Every text mutation follows the ",{"type":40,"tag":165,"props":5915,"children":5916},{"href":542},[5917],{"type":46,"value":5918},"canonical recipe",{"type":46,"value":1756},{"type":40,"tag":55,"props":5921,"children":5923},{"className":5922},[],[5924],{"type":46,"value":5925},"loadFontAsync",{"type":46,"value":2719},{"type":40,"tag":55,"props":5928,"children":5930},{"className":5929},[],[5931],{"type":46,"value":291},{"type":46,"value":5933}," → mutate ",{"type":40,"tag":55,"props":5935,"children":5937},{"className":5936},[],[5938],{"type":46,"value":469},{"type":46,"value":5940},"\u002Ffont\u002Fsize\u002Fetc. → return affected node IDs. Works for ANY font family\u002Fstyle, not just Inter (which only happens to be preloaded).",{"type":40,"tag":252,"props":5942,"children":5944},{"className":5943},[5668],[5945,5948,5950,5956,5958,5964,5966,5972],{"type":40,"tag":5671,"props":5946,"children":5947},{"disabled":1590,"type":5673},[],{"type":46,"value":5949}," Style names have already been verified via ",{"type":40,"tag":55,"props":5951,"children":5953},{"className":5952},[],[5954],{"type":46,"value":5955},"listAvailableFontsAsync()",{"type":46,"value":5957}," — NOT guessed from memory (",{"type":40,"tag":55,"props":5959,"children":5961},{"className":5960},[],[5962],{"type":46,"value":5963},"\"SemiBold\"",{"type":46,"value":5965}," vs ",{"type":40,"tag":55,"props":5967,"children":5969},{"className":5968},[],[5970],{"type":46,"value":5971},"\"Semi Bold\"",{"type":46,"value":5973}," is a common footgun)",{"type":40,"tag":252,"props":5975,"children":5977},{"className":5976},[5668],[5978,5981,5983,5989,5991,5997,5998,6003,6004],{"type":40,"tag":5671,"props":5979,"children":5980},{"disabled":1590,"type":5673},[],{"type":46,"value":5982}," For ",{"type":40,"tag":55,"props":5984,"children":5986},{"className":5985},[],[5987],{"type":46,"value":5988},"FONT_FAMILY",{"type":46,"value":5990},"-scoped variables: every value across every relevant mode is loaded before ",{"type":40,"tag":55,"props":5992,"children":5994},{"className":5993},[],[5995],{"type":46,"value":5996},"setBoundVariable(\"fontFamily\", …)",{"type":46,"value":479},{"type":40,"tag":55,"props":5999,"children":6001},{"className":6000},[],[6002],{"type":46,"value":506},{"type":46,"value":1079},{"type":40,"tag":55,"props":6005,"children":6007},{"className":6006},[],[6008],{"type":46,"value":499},{"type":40,"tag":252,"props":6010,"children":6012},{"className":6011},[5668],[6013,6016,6017,6023,6024,6030,6032,6038],{"type":40,"tag":5671,"props":6014,"children":6015},{"disabled":1590,"type":5673},[],{"type":46,"value":319},{"type":40,"tag":55,"props":6018,"children":6020},{"className":6019},[],[6021],{"type":46,"value":6022},"lineHeight",{"type":46,"value":683},{"type":40,"tag":55,"props":6025,"children":6027},{"className":6026},[],[6028],{"type":46,"value":6029},"letterSpacing",{"type":46,"value":6031}," use ",{"type":40,"tag":55,"props":6033,"children":6035},{"className":6034},[],[6036],{"type":46,"value":6037},"{unit, value}",{"type":46,"value":6039}," format (not bare numbers)",{"type":40,"tag":252,"props":6041,"children":6043},{"className":6042},[5668],[6044,6047,6048,6053],{"type":40,"tag":5671,"props":6045,"children":6046},{"disabled":1590,"type":5673},[],{"type":46,"value":319},{"type":40,"tag":55,"props":6049,"children":6051},{"className":6050},[],[6052],{"type":46,"value":3664},{"type":46,"value":6054}," is called BEFORE setting sizing modes (resize resets them to FIXED)",{"type":40,"tag":252,"props":6056,"children":6058},{"className":6057},[5668],[6059,6062],{"type":40,"tag":5671,"props":6060,"children":6061},{"disabled":1590,"type":5673},[],{"type":46,"value":6063}," For multi-step workflows: IDs from previous calls are passed as string literals (not variables)",{"type":40,"tag":252,"props":6065,"children":6067},{"className":6066},[5668],[6068,6071],{"type":40,"tag":5671,"props":6069,"children":6070},{"disabled":1590,"type":5673},[],{"type":46,"value":6072}," New top-level nodes are positioned away from (0,0) to avoid overlapping existing content",{"type":40,"tag":252,"props":6074,"children":6076},{"className":6075},[5668],[6077,6080,6082,6087],{"type":40,"tag":5671,"props":6078,"children":6079},{"disabled":1590,"type":5673},[],{"type":46,"value":6081}," Containers with structurally-related children use ",{"type":40,"tag":55,"props":6083,"children":6085},{"className":6084},[],[6086],{"type":46,"value":719},{"type":46,"value":6088},", not absolute x\u002Fy (see Rule 12a)",{"type":40,"tag":252,"props":6090,"children":6092},{"className":6091},[5668],[6093,6096,6098,6103],{"type":40,"tag":5671,"props":6094,"children":6095},{"disabled":1590,"type":5673},[],{"type":46,"value":6097}," ALL created\u002Fmutated node IDs are collected and included in the ",{"type":40,"tag":55,"props":6099,"children":6101},{"className":6100},[],[6102],{"type":46,"value":265},{"type":46,"value":6104}," value",{"type":40,"tag":252,"props":6106,"children":6108},{"className":6107},[5668],[6109,6112,6114,6119,6120,6125,6126,6132,6134,6139],{"type":40,"tag":5671,"props":6110,"children":6111},{"disabled":1590,"type":5673},[],{"type":46,"value":6113}," Every async call (",{"type":40,"tag":55,"props":6115,"children":6117},{"className":6116},[],[6118],{"type":46,"value":5925},{"type":46,"value":479},{"type":40,"tag":55,"props":6121,"children":6123},{"className":6122},[],[6124],{"type":46,"value":1350},{"type":46,"value":479},{"type":40,"tag":55,"props":6127,"children":6129},{"className":6128},[],[6130],{"type":46,"value":6131},"importComponentByKeyAsync",{"type":46,"value":6133},", etc.) is ",{"type":40,"tag":55,"props":6135,"children":6137},{"className":6136},[],[6138],{"type":46,"value":291},{"type":46,"value":6140},"ed — no fire-and-forget Promises",{"type":40,"tag":241,"props":6142,"children":6144},{"id":6143},"_9-discover-conventions-before-creating",[6145],{"type":46,"value":6146},"9. Discover Conventions Before Creating",{"type":40,"tag":49,"props":6148,"children":6149},{},[6150,6155],{"type":40,"tag":75,"props":6151,"children":6152},{},[6153],{"type":46,"value":6154},"Always inspect the Figma file before creating anything.",{"type":46,"value":6156}," Different files use different naming conventions, variable structures, and component patterns. Your code should match what's already there, not impose new conventions.",{"type":40,"tag":49,"props":6158,"children":6159},{},[6160],{"type":46,"value":6161},"When in doubt about any convention (naming, scoping, structure), check the Figma file first, then the user's codebase. Only fall back to common patterns when neither exists.",{"type":40,"tag":1141,"props":6163,"children":6165},{"id":6164},"quick-inspection-scripts",[6166],{"type":46,"value":6167},"Quick inspection scripts",{"type":40,"tag":49,"props":6169,"children":6170},{},[6171],{"type":40,"tag":75,"props":6172,"children":6173},{},[6174],{"type":46,"value":6175},"List all pages and top-level nodes:",{"type":40,"tag":1185,"props":6177,"children":6179},{"className":1187,"code":6178,"language":1189,"meta":1190,"style":1190},"const pages = figma.root.children.map(p => `${p.name} id=${p.id} children=${p.children.length}`);\nreturn pages.join('\\n');\n",[6180],{"type":40,"tag":55,"props":6181,"children":6182},{"__ignoreMap":1190},[6183,6330],{"type":40,"tag":1196,"props":6184,"children":6185},{"class":1198,"line":1199},[6186,6190,6195,6199,6203,6207,6211,6215,6219,6223,6228,6232,6236,6240,6245,6249,6253,6257,6261,6266,6270,6274,6278,6283,6287,6292,6296,6300,6304,6308,6312,6317,6322,6326],{"type":40,"tag":1196,"props":6187,"children":6188},{"style":1213},[6189],{"type":46,"value":1216},{"type":40,"tag":1196,"props":6191,"children":6192},{"style":1219},[6193],{"type":46,"value":6194}," pages ",{"type":40,"tag":1196,"props":6196,"children":6197},{"style":1225},[6198],{"type":46,"value":1228},{"type":40,"tag":1196,"props":6200,"children":6201},{"style":1219},[6202],{"type":46,"value":1233},{"type":40,"tag":1196,"props":6204,"children":6205},{"style":1225},[6206],{"type":46,"value":70},{"type":40,"tag":1196,"props":6208,"children":6209},{"style":1219},[6210],{"type":46,"value":37},{"type":40,"tag":1196,"props":6212,"children":6213},{"style":1225},[6214],{"type":46,"value":70},{"type":40,"tag":1196,"props":6216,"children":6217},{"style":1219},[6218],{"type":46,"value":1250},{"type":40,"tag":1196,"props":6220,"children":6221},{"style":1225},[6222],{"type":46,"value":70},{"type":40,"tag":1196,"props":6224,"children":6225},{"style":1257},[6226],{"type":46,"value":6227},"map",{"type":40,"tag":1196,"props":6229,"children":6230},{"style":1219},[6231],{"type":46,"value":1265},{"type":40,"tag":1196,"props":6233,"children":6234},{"style":1272},[6235],{"type":46,"value":49},{"type":40,"tag":1196,"props":6237,"children":6238},{"style":1213},[6239],{"type":46,"value":1284},{"type":40,"tag":1196,"props":6241,"children":6242},{"style":1225},[6243],{"type":46,"value":6244}," `${",{"type":40,"tag":1196,"props":6246,"children":6247},{"style":1219},[6248],{"type":46,"value":49},{"type":40,"tag":1196,"props":6250,"children":6251},{"style":1225},[6252],{"type":46,"value":70},{"type":40,"tag":1196,"props":6254,"children":6255},{"style":1219},[6256],{"type":46,"value":3128},{"type":40,"tag":1196,"props":6258,"children":6259},{"style":1225},[6260],{"type":46,"value":3039},{"type":40,"tag":1196,"props":6262,"children":6263},{"style":1311},[6264],{"type":46,"value":6265}," id=",{"type":40,"tag":1196,"props":6267,"children":6268},{"style":1225},[6269],{"type":46,"value":3317},{"type":40,"tag":1196,"props":6271,"children":6272},{"style":1219},[6273],{"type":46,"value":49},{"type":40,"tag":1196,"props":6275,"children":6276},{"style":1225},[6277],{"type":46,"value":70},{"type":40,"tag":1196,"props":6279,"children":6280},{"style":1219},[6281],{"type":46,"value":6282},"id",{"type":40,"tag":1196,"props":6284,"children":6285},{"style":1225},[6286],{"type":46,"value":3039},{"type":40,"tag":1196,"props":6288,"children":6289},{"style":1311},[6290],{"type":46,"value":6291}," children=",{"type":40,"tag":1196,"props":6293,"children":6294},{"style":1225},[6295],{"type":46,"value":3317},{"type":40,"tag":1196,"props":6297,"children":6298},{"style":1219},[6299],{"type":46,"value":49},{"type":40,"tag":1196,"props":6301,"children":6302},{"style":1225},[6303],{"type":46,"value":70},{"type":40,"tag":1196,"props":6305,"children":6306},{"style":1219},[6307],{"type":46,"value":1250},{"type":40,"tag":1196,"props":6309,"children":6310},{"style":1225},[6311],{"type":46,"value":70},{"type":40,"tag":1196,"props":6313,"children":6314},{"style":1219},[6315],{"type":46,"value":6316},"length",{"type":40,"tag":1196,"props":6318,"children":6319},{"style":1225},[6320],{"type":46,"value":6321},"}`",{"type":40,"tag":1196,"props":6323,"children":6324},{"style":1219},[6325],{"type":46,"value":1279},{"type":40,"tag":1196,"props":6327,"children":6328},{"style":1225},[6329],{"type":46,"value":1328},{"type":40,"tag":1196,"props":6331,"children":6332},{"class":1198,"line":1209},[6333,6337,6342,6346,6351,6355,6359,6364,6368,6372],{"type":40,"tag":1196,"props":6334,"children":6335},{"style":1335},[6336],{"type":46,"value":265},{"type":40,"tag":1196,"props":6338,"children":6339},{"style":1219},[6340],{"type":46,"value":6341}," pages",{"type":40,"tag":1196,"props":6343,"children":6344},{"style":1225},[6345],{"type":46,"value":70},{"type":40,"tag":1196,"props":6347,"children":6348},{"style":1257},[6349],{"type":46,"value":6350},"join",{"type":40,"tag":1196,"props":6352,"children":6353},{"style":1219},[6354],{"type":46,"value":1265},{"type":40,"tag":1196,"props":6356,"children":6357},{"style":1225},[6358],{"type":46,"value":2136},{"type":40,"tag":1196,"props":6360,"children":6361},{"style":1219},[6362],{"type":46,"value":6363},"\\n",{"type":40,"tag":1196,"props":6365,"children":6366},{"style":1225},[6367],{"type":46,"value":2136},{"type":40,"tag":1196,"props":6369,"children":6370},{"style":1219},[6371],{"type":46,"value":1279},{"type":40,"tag":1196,"props":6373,"children":6374},{"style":1225},[6375],{"type":46,"value":1328},{"type":40,"tag":49,"props":6377,"children":6378},{},[6379],{"type":40,"tag":75,"props":6380,"children":6381},{},[6382],{"type":46,"value":6383},"List existing components across all pages:",{"type":40,"tag":49,"props":6385,"children":6386},{},[6387,6392,6394],{"type":40,"tag":55,"props":6388,"children":6390},{"className":6389},[],[6391],{"type":46,"value":178},{"type":46,"value":6393}," is an option for published components. For on-canvas components, use the two-step fan-out — ",{"type":40,"tag":75,"props":6395,"children":6396},{},[6397],{"type":46,"value":6398},"don't loop pages inside one script.",{"type":40,"tag":49,"props":6400,"children":6401},{},[6402,6404,6409],{"type":46,"value":6403},"Step 1: one read-only ",{"type":40,"tag":55,"props":6405,"children":6407},{"className":6406},[],[6408],{"type":46,"value":60},{"type":46,"value":6410}," to get page IDs:",{"type":40,"tag":1185,"props":6412,"children":6414},{"className":1187,"code":6413,"language":1189,"meta":1190,"style":1190},"return figma.root.children.map(p => ({ id: p.id, name: p.name }));\n",[6415],{"type":40,"tag":55,"props":6416,"children":6417},{"__ignoreMap":1190},[6418],{"type":40,"tag":1196,"props":6419,"children":6420},{"class":1198,"line":1199},[6421,6425,6429,6433,6437,6441,6445,6449,6453,6457,6461,6465,6469,6473,6478,6482,6486,6490,6494,6498,6502,6506,6510,6514,6518,6522,6527],{"type":40,"tag":1196,"props":6422,"children":6423},{"style":1335},[6424],{"type":46,"value":265},{"type":40,"tag":1196,"props":6426,"children":6427},{"style":1219},[6428],{"type":46,"value":1233},{"type":40,"tag":1196,"props":6430,"children":6431},{"style":1225},[6432],{"type":46,"value":70},{"type":40,"tag":1196,"props":6434,"children":6435},{"style":1219},[6436],{"type":46,"value":37},{"type":40,"tag":1196,"props":6438,"children":6439},{"style":1225},[6440],{"type":46,"value":70},{"type":40,"tag":1196,"props":6442,"children":6443},{"style":1219},[6444],{"type":46,"value":1250},{"type":40,"tag":1196,"props":6446,"children":6447},{"style":1225},[6448],{"type":46,"value":70},{"type":40,"tag":1196,"props":6450,"children":6451},{"style":1257},[6452],{"type":46,"value":6227},{"type":40,"tag":1196,"props":6454,"children":6455},{"style":1219},[6456],{"type":46,"value":1265},{"type":40,"tag":1196,"props":6458,"children":6459},{"style":1272},[6460],{"type":46,"value":49},{"type":40,"tag":1196,"props":6462,"children":6463},{"style":1213},[6464],{"type":46,"value":1284},{"type":40,"tag":1196,"props":6466,"children":6467},{"style":1219},[6468],{"type":46,"value":1488},{"type":40,"tag":1196,"props":6470,"children":6471},{"style":1225},[6472],{"type":46,"value":2930},{"type":40,"tag":1196,"props":6474,"children":6475},{"style":1551},[6476],{"type":46,"value":6477}," id",{"type":40,"tag":1196,"props":6479,"children":6480},{"style":1225},[6481],{"type":46,"value":2920},{"type":40,"tag":1196,"props":6483,"children":6484},{"style":1219},[6485],{"type":46,"value":1289},{"type":40,"tag":1196,"props":6487,"children":6488},{"style":1225},[6489],{"type":46,"value":70},{"type":40,"tag":1196,"props":6491,"children":6492},{"style":1219},[6493],{"type":46,"value":6282},{"type":40,"tag":1196,"props":6495,"children":6496},{"style":1225},[6497],{"type":46,"value":2957},{"type":40,"tag":1196,"props":6499,"children":6500},{"style":1551},[6501],{"type":46,"value":3601},{"type":40,"tag":1196,"props":6503,"children":6504},{"style":1225},[6505],{"type":46,"value":2920},{"type":40,"tag":1196,"props":6507,"children":6508},{"style":1219},[6509],{"type":46,"value":1289},{"type":40,"tag":1196,"props":6511,"children":6512},{"style":1225},[6513],{"type":46,"value":70},{"type":40,"tag":1196,"props":6515,"children":6516},{"style":1219},[6517],{"type":46,"value":1298},{"type":40,"tag":1196,"props":6519,"children":6520},{"style":1225},[6521],{"type":46,"value":3039},{"type":40,"tag":1196,"props":6523,"children":6524},{"style":1219},[6525],{"type":46,"value":6526},"))",{"type":40,"tag":1196,"props":6528,"children":6529},{"style":1225},[6530],{"type":46,"value":1328},{"type":40,"tag":49,"props":6532,"children":6533},{},[6534,6536,6548],{"type":46,"value":6535},"Step 2: in the ",{"type":40,"tag":75,"props":6537,"children":6538},{},[6539,6541,6546],{"type":46,"value":6540},"next assistant turn, emit one ",{"type":40,"tag":55,"props":6542,"children":6544},{"className":6543},[],[6545],{"type":46,"value":60},{"type":46,"value":6547}," per page in parallel",{"type":46,"value":6549}," (a single message containing N tool-use blocks). Each runs:",{"type":40,"tag":1185,"props":6551,"children":6553},{"className":1187,"code":6552,"language":1189,"meta":1190,"style":1190},"const page = await figma.getNodeByIdAsync(PAGE_ID);\nawait figma.setCurrentPageAsync(page);\n\u002F\u002F findAllWithCriteria uses an indexed type lookup — hundreds of times faster\n\u002F\u002F than the findAll(n => n.type === '…') side-effect-in-predicate antipattern.\nconst matches = page.findAllWithCriteria({ types: ['COMPONENT', 'COMPONENT_SET'] });\nreturn matches.map(n => ({ page: page.name, name: n.name, type: n.type, id: n.id }));\n",[6554],{"type":40,"tag":55,"props":6555,"children":6556},{"__ignoreMap":1190},[6557,6599,6627,6635,6643,6740],{"type":40,"tag":1196,"props":6558,"children":6559},{"class":1198,"line":1199},[6560,6564,6568,6572,6577,6581,6585,6590,6595],{"type":40,"tag":1196,"props":6561,"children":6562},{"style":1213},[6563],{"type":46,"value":1216},{"type":40,"tag":1196,"props":6565,"children":6566},{"style":1219},[6567],{"type":46,"value":1497},{"type":40,"tag":1196,"props":6569,"children":6570},{"style":1225},[6571],{"type":46,"value":1228},{"type":40,"tag":1196,"props":6573,"children":6574},{"style":1335},[6575],{"type":46,"value":6576}," await",{"type":40,"tag":1196,"props":6578,"children":6579},{"style":1219},[6580],{"type":46,"value":1233},{"type":40,"tag":1196,"props":6582,"children":6583},{"style":1225},[6584],{"type":46,"value":70},{"type":40,"tag":1196,"props":6586,"children":6587},{"style":1257},[6588],{"type":46,"value":6589},"getNodeByIdAsync",{"type":40,"tag":1196,"props":6591,"children":6592},{"style":1219},[6593],{"type":46,"value":6594},"(PAGE_ID)",{"type":40,"tag":1196,"props":6596,"children":6597},{"style":1225},[6598],{"type":46,"value":1328},{"type":40,"tag":1196,"props":6600,"children":6601},{"class":1198,"line":1209},[6602,6606,6610,6614,6618,6623],{"type":40,"tag":1196,"props":6603,"children":6604},{"style":1335},[6605],{"type":46,"value":291},{"type":40,"tag":1196,"props":6607,"children":6608},{"style":1219},[6609],{"type":46,"value":1233},{"type":40,"tag":1196,"props":6611,"children":6612},{"style":1225},[6613],{"type":46,"value":70},{"type":40,"tag":1196,"props":6615,"children":6616},{"style":1257},[6617],{"type":46,"value":1350},{"type":40,"tag":1196,"props":6619,"children":6620},{"style":1219},[6621],{"type":46,"value":6622},"(page)",{"type":40,"tag":1196,"props":6624,"children":6625},{"style":1225},[6626],{"type":46,"value":1328},{"type":40,"tag":1196,"props":6628,"children":6629},{"class":1198,"line":1331},[6630],{"type":40,"tag":1196,"props":6631,"children":6632},{"style":1203},[6633],{"type":46,"value":6634},"\u002F\u002F findAllWithCriteria uses an indexed type lookup — hundreds of times faster\n",{"type":40,"tag":1196,"props":6636,"children":6637},{"class":1198,"line":1362},[6638],{"type":40,"tag":1196,"props":6639,"children":6640},{"style":1203},[6641],{"type":46,"value":6642},"\u002F\u002F than the findAll(n => n.type === '…') side-effect-in-predicate antipattern.\n",{"type":40,"tag":1196,"props":6644,"children":6645},{"class":1198,"line":1577},[6646,6650,6655,6659,6664,6668,6673,6677,6681,6686,6690,6694,6698,6702,6706,6710,6714,6719,6723,6728,6732,6736],{"type":40,"tag":1196,"props":6647,"children":6648},{"style":1213},[6649],{"type":46,"value":1216},{"type":40,"tag":1196,"props":6651,"children":6652},{"style":1219},[6653],{"type":46,"value":6654}," matches ",{"type":40,"tag":1196,"props":6656,"children":6657},{"style":1225},[6658],{"type":46,"value":1228},{"type":40,"tag":1196,"props":6660,"children":6661},{"style":1219},[6662],{"type":46,"value":6663}," page",{"type":40,"tag":1196,"props":6665,"children":6666},{"style":1225},[6667],{"type":46,"value":70},{"type":40,"tag":1196,"props":6669,"children":6670},{"style":1257},[6671],{"type":46,"value":6672},"findAllWithCriteria",{"type":40,"tag":1196,"props":6674,"children":6675},{"style":1219},[6676],{"type":46,"value":1265},{"type":40,"tag":1196,"props":6678,"children":6679},{"style":1225},[6680],{"type":46,"value":2930},{"type":40,"tag":1196,"props":6682,"children":6683},{"style":1551},[6684],{"type":46,"value":6685}," types",{"type":40,"tag":1196,"props":6687,"children":6688},{"style":1225},[6689],{"type":46,"value":2920},{"type":40,"tag":1196,"props":6691,"children":6692},{"style":1219},[6693],{"type":46,"value":2925},{"type":40,"tag":1196,"props":6695,"children":6696},{"style":1225},[6697],{"type":46,"value":2136},{"type":40,"tag":1196,"props":6699,"children":6700},{"style":1311},[6701],{"type":46,"value":2288},{"type":40,"tag":1196,"props":6703,"children":6704},{"style":1225},[6705],{"type":46,"value":2136},{"type":40,"tag":1196,"props":6707,"children":6708},{"style":1225},[6709],{"type":46,"value":2957},{"type":40,"tag":1196,"props":6711,"children":6712},{"style":1225},[6713],{"type":46,"value":2127},{"type":40,"tag":1196,"props":6715,"children":6716},{"style":1311},[6717],{"type":46,"value":6718},"COMPONENT_SET",{"type":40,"tag":1196,"props":6720,"children":6721},{"style":1225},[6722],{"type":46,"value":2136},{"type":40,"tag":1196,"props":6724,"children":6725},{"style":1219},[6726],{"type":46,"value":6727},"] ",{"type":40,"tag":1196,"props":6729,"children":6730},{"style":1225},[6731],{"type":46,"value":3039},{"type":40,"tag":1196,"props":6733,"children":6734},{"style":1219},[6735],{"type":46,"value":1279},{"type":40,"tag":1196,"props":6737,"children":6738},{"style":1225},[6739],{"type":46,"value":1328},{"type":40,"tag":1196,"props":6741,"children":6742},{"class":1198,"line":1586},[6743,6747,6752,6756,6760,6764,6768,6772,6776,6780,6784,6788,6792,6796,6800,6804,6808,6812,6816,6820,6824,6828,6833,6837,6841,6845,6849,6853,6857,6861,6865,6869,6874,6878,6882],{"type":40,"tag":1196,"props":6744,"children":6745},{"style":1335},[6746],{"type":46,"value":265},{"type":40,"tag":1196,"props":6748,"children":6749},{"style":1219},[6750],{"type":46,"value":6751}," matches",{"type":40,"tag":1196,"props":6753,"children":6754},{"style":1225},[6755],{"type":46,"value":70},{"type":40,"tag":1196,"props":6757,"children":6758},{"style":1257},[6759],{"type":46,"value":6227},{"type":40,"tag":1196,"props":6761,"children":6762},{"style":1219},[6763],{"type":46,"value":1265},{"type":40,"tag":1196,"props":6765,"children":6766},{"style":1272},[6767],{"type":46,"value":2100},{"type":40,"tag":1196,"props":6769,"children":6770},{"style":1213},[6771],{"type":46,"value":1284},{"type":40,"tag":1196,"props":6773,"children":6774},{"style":1219},[6775],{"type":46,"value":1488},{"type":40,"tag":1196,"props":6777,"children":6778},{"style":1225},[6779],{"type":46,"value":2930},{"type":40,"tag":1196,"props":6781,"children":6782},{"style":1551},[6783],{"type":46,"value":6663},{"type":40,"tag":1196,"props":6785,"children":6786},{"style":1225},[6787],{"type":46,"value":2920},{"type":40,"tag":1196,"props":6789,"children":6790},{"style":1219},[6791],{"type":46,"value":6663},{"type":40,"tag":1196,"props":6793,"children":6794},{"style":1225},[6795],{"type":46,"value":70},{"type":40,"tag":1196,"props":6797,"children":6798},{"style":1219},[6799],{"type":46,"value":3128},{"type":40,"tag":1196,"props":6801,"children":6802},{"style":1225},[6803],{"type":46,"value":2957},{"type":40,"tag":1196,"props":6805,"children":6806},{"style":1551},[6807],{"type":46,"value":3601},{"type":40,"tag":1196,"props":6809,"children":6810},{"style":1225},[6811],{"type":46,"value":2920},{"type":40,"tag":1196,"props":6813,"children":6814},{"style":1219},[6815],{"type":46,"value":2109},{"type":40,"tag":1196,"props":6817,"children":6818},{"style":1225},[6819],{"type":46,"value":70},{"type":40,"tag":1196,"props":6821,"children":6822},{"style":1219},[6823],{"type":46,"value":3128},{"type":40,"tag":1196,"props":6825,"children":6826},{"style":1225},[6827],{"type":46,"value":2957},{"type":40,"tag":1196,"props":6829,"children":6830},{"style":1551},[6831],{"type":46,"value":6832}," type",{"type":40,"tag":1196,"props":6834,"children":6835},{"style":1225},[6836],{"type":46,"value":2920},{"type":40,"tag":1196,"props":6838,"children":6839},{"style":1219},[6840],{"type":46,"value":2109},{"type":40,"tag":1196,"props":6842,"children":6843},{"style":1225},[6844],{"type":46,"value":70},{"type":40,"tag":1196,"props":6846,"children":6847},{"style":1219},[6848],{"type":46,"value":2935},{"type":40,"tag":1196,"props":6850,"children":6851},{"style":1225},[6852],{"type":46,"value":2957},{"type":40,"tag":1196,"props":6854,"children":6855},{"style":1551},[6856],{"type":46,"value":6477},{"type":40,"tag":1196,"props":6858,"children":6859},{"style":1225},[6860],{"type":46,"value":2920},{"type":40,"tag":1196,"props":6862,"children":6863},{"style":1219},[6864],{"type":46,"value":2109},{"type":40,"tag":1196,"props":6866,"children":6867},{"style":1225},[6868],{"type":46,"value":70},{"type":40,"tag":1196,"props":6870,"children":6871},{"style":1219},[6872],{"type":46,"value":6873},"id ",{"type":40,"tag":1196,"props":6875,"children":6876},{"style":1225},[6877],{"type":46,"value":3039},{"type":40,"tag":1196,"props":6879,"children":6880},{"style":1219},[6881],{"type":46,"value":6526},{"type":40,"tag":1196,"props":6883,"children":6884},{"style":1225},[6885],{"type":46,"value":1328},{"type":40,"tag":49,"props":6887,"children":6888},{},[6889],{"type":40,"tag":75,"props":6890,"children":6891},{},[6892],{"type":46,"value":6893},"List existing variable collections and their conventions:",{"type":40,"tag":1185,"props":6895,"children":6897},{"className":1187,"code":6896,"language":1189,"meta":1190,"style":1190},"const collections = await figma.variables.getLocalVariableCollectionsAsync();\nconst results = collections.map(c => ({\n  name: c.name, id: c.id,\n  varCount: c.variableIds.length,\n  modes: c.modes.map(m => m.name)\n}));\nreturn results;\n",[6898],{"type":40,"tag":55,"props":6899,"children":6900},{"__ignoreMap":1190},[6901,6952,7002,7055,7092,7152,7167],{"type":40,"tag":1196,"props":6902,"children":6903},{"class":1198,"line":1199},[6904,6908,6913,6917,6921,6925,6929,6934,6938,6943,6948],{"type":40,"tag":1196,"props":6905,"children":6906},{"style":1213},[6907],{"type":46,"value":1216},{"type":40,"tag":1196,"props":6909,"children":6910},{"style":1219},[6911],{"type":46,"value":6912}," collections ",{"type":40,"tag":1196,"props":6914,"children":6915},{"style":1225},[6916],{"type":46,"value":1228},{"type":40,"tag":1196,"props":6918,"children":6919},{"style":1335},[6920],{"type":46,"value":6576},{"type":40,"tag":1196,"props":6922,"children":6923},{"style":1219},[6924],{"type":46,"value":1233},{"type":40,"tag":1196,"props":6926,"children":6927},{"style":1225},[6928],{"type":46,"value":70},{"type":40,"tag":1196,"props":6930,"children":6931},{"style":1219},[6932],{"type":46,"value":6933},"variables",{"type":40,"tag":1196,"props":6935,"children":6936},{"style":1225},[6937],{"type":46,"value":70},{"type":40,"tag":1196,"props":6939,"children":6940},{"style":1257},[6941],{"type":46,"value":6942},"getLocalVariableCollectionsAsync",{"type":40,"tag":1196,"props":6944,"children":6945},{"style":1219},[6946],{"type":46,"value":6947},"()",{"type":40,"tag":1196,"props":6949,"children":6950},{"style":1225},[6951],{"type":46,"value":1328},{"type":40,"tag":1196,"props":6953,"children":6954},{"class":1198,"line":1209},[6955,6959,6964,6968,6973,6977,6981,6985,6990,6994,6998],{"type":40,"tag":1196,"props":6956,"children":6957},{"style":1213},[6958],{"type":46,"value":1216},{"type":40,"tag":1196,"props":6960,"children":6961},{"style":1219},[6962],{"type":46,"value":6963}," results ",{"type":40,"tag":1196,"props":6965,"children":6966},{"style":1225},[6967],{"type":46,"value":1228},{"type":40,"tag":1196,"props":6969,"children":6970},{"style":1219},[6971],{"type":46,"value":6972}," collections",{"type":40,"tag":1196,"props":6974,"children":6975},{"style":1225},[6976],{"type":46,"value":70},{"type":40,"tag":1196,"props":6978,"children":6979},{"style":1257},[6980],{"type":46,"value":6227},{"type":40,"tag":1196,"props":6982,"children":6983},{"style":1219},[6984],{"type":46,"value":1265},{"type":40,"tag":1196,"props":6986,"children":6987},{"style":1272},[6988],{"type":46,"value":6989},"c",{"type":40,"tag":1196,"props":6991,"children":6992},{"style":1213},[6993],{"type":46,"value":1284},{"type":40,"tag":1196,"props":6995,"children":6996},{"style":1219},[6997],{"type":46,"value":1488},{"type":40,"tag":1196,"props":6999,"children":7000},{"style":1225},[7001],{"type":46,"value":1528},{"type":40,"tag":1196,"props":7003,"children":7004},{"class":1198,"line":1331},[7005,7010,7014,7019,7023,7027,7031,7035,7039,7043,7047,7051],{"type":40,"tag":1196,"props":7006,"children":7007},{"style":1551},[7008],{"type":46,"value":7009},"  name",{"type":40,"tag":1196,"props":7011,"children":7012},{"style":1225},[7013],{"type":46,"value":2920},{"type":40,"tag":1196,"props":7015,"children":7016},{"style":1219},[7017],{"type":46,"value":7018}," c",{"type":40,"tag":1196,"props":7020,"children":7021},{"style":1225},[7022],{"type":46,"value":70},{"type":40,"tag":1196,"props":7024,"children":7025},{"style":1219},[7026],{"type":46,"value":3128},{"type":40,"tag":1196,"props":7028,"children":7029},{"style":1225},[7030],{"type":46,"value":2957},{"type":40,"tag":1196,"props":7032,"children":7033},{"style":1551},[7034],{"type":46,"value":6477},{"type":40,"tag":1196,"props":7036,"children":7037},{"style":1225},[7038],{"type":46,"value":2920},{"type":40,"tag":1196,"props":7040,"children":7041},{"style":1219},[7042],{"type":46,"value":7018},{"type":40,"tag":1196,"props":7044,"children":7045},{"style":1225},[7046],{"type":46,"value":70},{"type":40,"tag":1196,"props":7048,"children":7049},{"style":1219},[7050],{"type":46,"value":6282},{"type":40,"tag":1196,"props":7052,"children":7053},{"style":1225},[7054],{"type":46,"value":3914},{"type":40,"tag":1196,"props":7056,"children":7057},{"class":1198,"line":1362},[7058,7063,7067,7071,7075,7080,7084,7088],{"type":40,"tag":1196,"props":7059,"children":7060},{"style":1551},[7061],{"type":46,"value":7062},"  varCount",{"type":40,"tag":1196,"props":7064,"children":7065},{"style":1225},[7066],{"type":46,"value":2920},{"type":40,"tag":1196,"props":7068,"children":7069},{"style":1219},[7070],{"type":46,"value":7018},{"type":40,"tag":1196,"props":7072,"children":7073},{"style":1225},[7074],{"type":46,"value":70},{"type":40,"tag":1196,"props":7076,"children":7077},{"style":1219},[7078],{"type":46,"value":7079},"variableIds",{"type":40,"tag":1196,"props":7081,"children":7082},{"style":1225},[7083],{"type":46,"value":70},{"type":40,"tag":1196,"props":7085,"children":7086},{"style":1219},[7087],{"type":46,"value":6316},{"type":40,"tag":1196,"props":7089,"children":7090},{"style":1225},[7091],{"type":46,"value":3914},{"type":40,"tag":1196,"props":7093,"children":7094},{"class":1198,"line":1577},[7095,7100,7104,7108,7112,7117,7121,7125,7129,7134,7138,7143,7147],{"type":40,"tag":1196,"props":7096,"children":7097},{"style":1551},[7098],{"type":46,"value":7099},"  modes",{"type":40,"tag":1196,"props":7101,"children":7102},{"style":1225},[7103],{"type":46,"value":2920},{"type":40,"tag":1196,"props":7105,"children":7106},{"style":1219},[7107],{"type":46,"value":7018},{"type":40,"tag":1196,"props":7109,"children":7110},{"style":1225},[7111],{"type":46,"value":70},{"type":40,"tag":1196,"props":7113,"children":7114},{"style":1219},[7115],{"type":46,"value":7116},"modes",{"type":40,"tag":1196,"props":7118,"children":7119},{"style":1225},[7120],{"type":46,"value":70},{"type":40,"tag":1196,"props":7122,"children":7123},{"style":1257},[7124],{"type":46,"value":6227},{"type":40,"tag":1196,"props":7126,"children":7127},{"style":1219},[7128],{"type":46,"value":1265},{"type":40,"tag":1196,"props":7130,"children":7131},{"style":1272},[7132],{"type":46,"value":7133},"m",{"type":40,"tag":1196,"props":7135,"children":7136},{"style":1213},[7137],{"type":46,"value":1284},{"type":40,"tag":1196,"props":7139,"children":7140},{"style":1219},[7141],{"type":46,"value":7142}," m",{"type":40,"tag":1196,"props":7144,"children":7145},{"style":1225},[7146],{"type":46,"value":70},{"type":40,"tag":1196,"props":7148,"children":7149},{"style":1219},[7150],{"type":46,"value":7151},"name)\n",{"type":40,"tag":1196,"props":7153,"children":7154},{"class":1198,"line":1586},[7155,7159,7163],{"type":40,"tag":1196,"props":7156,"children":7157},{"style":1225},[7158],{"type":46,"value":3039},{"type":40,"tag":1196,"props":7160,"children":7161},{"style":1219},[7162],{"type":46,"value":6526},{"type":40,"tag":1196,"props":7164,"children":7165},{"style":1225},[7166],{"type":46,"value":1328},{"type":40,"tag":1196,"props":7168,"children":7169},{"class":1198,"line":1596},[7170,7174,7179],{"type":40,"tag":1196,"props":7171,"children":7172},{"style":1335},[7173],{"type":46,"value":265},{"type":40,"tag":1196,"props":7175,"children":7176},{"style":1219},[7177],{"type":46,"value":7178}," results",{"type":40,"tag":1196,"props":7180,"children":7181},{"style":1225},[7182],{"type":46,"value":1328},{"type":40,"tag":241,"props":7184,"children":7186},{"id":7185},"_10-reference-docs",[7187],{"type":46,"value":7188},"10. Reference Docs",{"type":40,"tag":49,"props":7190,"children":7191},{},[7192],{"type":46,"value":7193},"Load these as needed based on what your task involves:",{"type":40,"tag":2528,"props":7195,"children":7196},{},[7197,7218],{"type":40,"tag":2532,"props":7198,"children":7199},{},[7200],{"type":40,"tag":2536,"props":7201,"children":7202},{},[7203,7208,7213],{"type":40,"tag":2540,"props":7204,"children":7205},{},[7206],{"type":46,"value":7207},"Doc",{"type":40,"tag":2540,"props":7209,"children":7210},{},[7211],{"type":46,"value":7212},"When to load",{"type":40,"tag":2540,"props":7214,"children":7215},{},[7216],{"type":46,"value":7217},"What it covers",{"type":40,"tag":2551,"props":7219,"children":7220},{},[7221,7251,7273,7295,7317,7349,7371,7391,7421,7443,7463],{"type":40,"tag":2536,"props":7222,"children":7223},{},[7224,7231,7241],{"type":40,"tag":2558,"props":7225,"children":7226},{},[7227],{"type":40,"tag":165,"props":7228,"children":7229},{"href":932},[7230],{"type":46,"value":5448},{"type":40,"tag":2558,"props":7232,"children":7233},{},[7234,7236],{"type":46,"value":7235},"Before any ",{"type":40,"tag":55,"props":7237,"children":7239},{"className":7238},[],[7240],{"type":46,"value":60},{"type":40,"tag":2558,"props":7242,"children":7243},{},[7244,7246],{"type":46,"value":7245},"Every known pitfall with WRONG\u002FCORRECT code examples — start with the ",{"type":40,"tag":165,"props":7247,"children":7248},{"href":542},[7249],{"type":46,"value":7250},"canonical text-edit recipe",{"type":40,"tag":2536,"props":7252,"children":7253},{},[7254,7263,7268],{"type":40,"tag":2558,"props":7255,"children":7256},{},[7257],{"type":40,"tag":165,"props":7258,"children":7260},{"href":7259},"references\u002Fcommon-patterns.md",[7261],{"type":46,"value":7262},"common-patterns.md",{"type":40,"tag":2558,"props":7264,"children":7265},{},[7266],{"type":46,"value":7267},"Need working code examples",{"type":40,"tag":2558,"props":7269,"children":7270},{},[7271],{"type":46,"value":7272},"Script scaffolds: shapes, text, auto-layout, variables, components, multi-step workflows",{"type":40,"tag":2536,"props":7274,"children":7275},{},[7276,7285,7290],{"type":40,"tag":2558,"props":7277,"children":7278},{},[7279],{"type":40,"tag":165,"props":7280,"children":7282},{"href":7281},"references\u002Fplugin-api-patterns.md",[7283],{"type":46,"value":7284},"plugin-api-patterns.md",{"type":40,"tag":2558,"props":7286,"children":7287},{},[7288],{"type":46,"value":7289},"Creating\u002Fediting nodes",{"type":40,"tag":2558,"props":7291,"children":7292},{},[7293],{"type":46,"value":7294},"Fills, strokes, Auto Layout, effects, grouping, cloning, styles",{"type":40,"tag":2536,"props":7296,"children":7297},{},[7298,7307,7312],{"type":40,"tag":2558,"props":7299,"children":7300},{},[7301],{"type":40,"tag":165,"props":7302,"children":7304},{"href":7303},"references\u002Fapi-reference.md",[7305],{"type":46,"value":7306},"api-reference.md",{"type":40,"tag":2558,"props":7308,"children":7309},{},[7310],{"type":46,"value":7311},"Need exact API surface",{"type":40,"tag":2558,"props":7313,"children":7314},{},[7315],{"type":46,"value":7316},"Node creation, variables API, core properties, what works and what doesn't",{"type":40,"tag":2536,"props":7318,"children":7319},{},[7320,7328,7333],{"type":40,"tag":2558,"props":7321,"children":7322},{},[7323],{"type":40,"tag":165,"props":7324,"children":7325},{"href":5637},[7326],{"type":46,"value":7327},"validation-and-recovery.md",{"type":40,"tag":2558,"props":7329,"children":7330},{},[7331],{"type":46,"value":7332},"Multi-step writes or error recovery",{"type":40,"tag":2558,"props":7334,"children":7335},{},[7336,7341,7342,7347],{"type":40,"tag":55,"props":7337,"children":7339},{"className":7338},[],[7340],{"type":46,"value":5005},{"type":46,"value":5965},{"type":40,"tag":55,"props":7343,"children":7345},{"className":7344},[],[7346],{"type":46,"value":1990},{"type":46,"value":7348}," workflow, mandatory error recovery steps",{"type":40,"tag":2536,"props":7350,"children":7351},{},[7352,7361,7366],{"type":40,"tag":2558,"props":7353,"children":7354},{},[7355],{"type":40,"tag":165,"props":7356,"children":7358},{"href":7357},"references\u002Fcomponent-patterns.md",[7359],{"type":46,"value":7360},"component-patterns.md",{"type":40,"tag":2558,"props":7362,"children":7363},{},[7364],{"type":46,"value":7365},"Creating components\u002Fvariants",{"type":40,"tag":2558,"props":7367,"children":7368},{},[7369],{"type":46,"value":7370},"combineAsVariants, component properties, INSTANCE_SWAP, variant layout, discovering existing components, metadata traversal",{"type":40,"tag":2536,"props":7372,"children":7373},{},[7374,7381,7386],{"type":40,"tag":2558,"props":7375,"children":7376},{},[7377],{"type":40,"tag":165,"props":7378,"children":7379},{"href":1044},[7380],{"type":46,"value":1047},{"type":40,"tag":2558,"props":7382,"children":7383},{},[7384],{"type":46,"value":7385},"Creating\u002Fbinding variables",{"type":40,"tag":2558,"props":7387,"children":7388},{},[7389],{"type":46,"value":7390},"Collections, modes, scopes, aliasing, binding patterns, discovering existing variables",{"type":40,"tag":2536,"props":7392,"children":7393},{},[7394,7403,7408],{"type":40,"tag":2558,"props":7395,"children":7396},{},[7397],{"type":40,"tag":165,"props":7398,"children":7400},{"href":7399},"references\u002Ftext-style-patterns.md",[7401],{"type":46,"value":7402},"text-style-patterns.md",{"type":40,"tag":2558,"props":7404,"children":7405},{},[7406],{"type":46,"value":7407},"Creating\u002Fapplying text styles",{"type":40,"tag":2558,"props":7409,"children":7410},{},[7411,7413,7419],{"type":46,"value":7412},"Type ramps, font discovery via ",{"type":40,"tag":55,"props":7414,"children":7416},{"className":7415},[],[7417],{"type":46,"value":7418},"listAvailableFontsAsync",{"type":46,"value":7420},", listing styles, applying styles to nodes",{"type":40,"tag":2536,"props":7422,"children":7423},{},[7424,7433,7438],{"type":40,"tag":2558,"props":7425,"children":7426},{},[7427],{"type":40,"tag":165,"props":7428,"children":7430},{"href":7429},"references\u002Feffect-style-patterns.md",[7431],{"type":46,"value":7432},"effect-style-patterns.md",{"type":40,"tag":2558,"props":7434,"children":7435},{},[7436],{"type":46,"value":7437},"Creating\u002Fapplying effect styles",{"type":40,"tag":2558,"props":7439,"children":7440},{},[7441],{"type":46,"value":7442},"Drop shadows, listing styles, applying styles to nodes",{"type":40,"tag":2536,"props":7444,"children":7445},{},[7446,7453,7458],{"type":40,"tag":2558,"props":7447,"children":7448},{},[7449],{"type":40,"tag":165,"props":7450,"children":7451},{"href":213},[7452],{"type":46,"value":216},{"type":40,"tag":2558,"props":7454,"children":7455},{},[7456],{"type":46,"value":7457},"Need to understand the full API surface",{"type":40,"tag":2558,"props":7459,"children":7460},{},[7461],{"type":46,"value":7462},"Index of all types, methods, and properties in the Plugin API",{"type":40,"tag":2536,"props":7464,"children":7465},{},[7466,7473,7478],{"type":40,"tag":2558,"props":7467,"children":7468},{},[7469],{"type":40,"tag":165,"props":7470,"children":7471},{"href":221},[7472],{"type":46,"value":224},{"type":40,"tag":2558,"props":7474,"children":7475},{},[7476],{"type":46,"value":7477},"Need exact type signatures",{"type":40,"tag":2558,"props":7479,"children":7480},{},[7481],{"type":46,"value":7482},"Full typings file — grep for specific symbols, don't load all at once",{"type":40,"tag":241,"props":7484,"children":7486},{"id":7485},"_11-snippet-examples",[7487],{"type":46,"value":7488},"11. Snippet examples",{"type":40,"tag":49,"props":7490,"children":7491},{},[7492],{"type":46,"value":7493},"You will see snippets throughout documentation here. These snippets contain useful plugin API code that can be repurposed. Use them as is, or as starter code as you go. If there are key concepts that are best documented as generic snippets, call them out and write to disk so you can reuse in the future.",{"type":40,"tag":7495,"props":7496,"children":7497},"style",{},[7498],{"type":46,"value":7499},"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":7501,"total":7623},[7502,7521,7537,7549,7569,7591,7611],{"slug":7503,"name":7503,"fn":7504,"description":7505,"org":7506,"tags":7507,"stars":22,"repoUrl":23,"updatedAt":7520},"accessibility-and-inclusive-visualization","make data visualizations accessible","Make data visualizations accessible and inclusive. Use when the user needs chart or diagram accessibility guidance, text alternatives for complex visuals, color and contrast review, keyboard support, reduced-motion behavior for animation or parallax, or an accessibility QA workflow for exported figures, UML-like diagrams, and dashboards.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7508,7511,7514,7517],{"name":7509,"slug":7510,"type":15},"Accessibility","accessibility",{"name":7512,"slug":7513,"type":15},"Charts","charts",{"name":7515,"slug":7516,"type":15},"Data Visualization","data-visualization",{"name":7518,"slug":7519,"type":15},"Design","design","2026-06-30T19:00:57.102",{"slug":7522,"name":7522,"fn":7523,"description":7524,"org":7525,"tags":7526,"stars":22,"repoUrl":23,"updatedAt":7536},"agent-browser","automate browser interactions for agents","Browser automation CLI for AI agents. Use when the user needs to interact with websites, verify dev server output, test web apps, navigate pages, fill forms, click buttons, take screenshots, extract data, or automate any browser task. Also triggers when a dev server starts so you can verify it visually.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7527,7530,7533],{"name":7528,"slug":7529,"type":15},"Agents","agents",{"name":7531,"slug":7532,"type":15},"Browser Automation","browser-automation",{"name":7534,"slug":7535,"type":15},"Testing","testing","2026-04-06T18:41:03.44016",{"slug":7538,"name":7538,"fn":7539,"description":7540,"org":7541,"tags":7542,"stars":22,"repoUrl":23,"updatedAt":7548},"agent-browser-verify","verify dev server output with automated browser","Automated browser verification for dev servers. Triggers when a dev server starts to run a visual gut-check with agent-browser — verifies the page loads, checks for console errors, validates key UI elements, and reports pass\u002Ffail before continuing.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7543,7544,7547],{"name":7531,"slug":7532,"type":15},{"name":7545,"slug":7546,"type":15},"Local Development","local-development",{"name":7534,"slug":7535,"type":15},"2026-04-06T18:41:17.526867",{"slug":7550,"name":7550,"fn":7551,"description":7552,"org":7553,"tags":7554,"stars":22,"repoUrl":23,"updatedAt":7568},"agents-sdk","build AI agents on Cloudflare Workers","Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7555,7556,7559,7562,7565],{"name":7528,"slug":7529,"type":15},{"name":7557,"slug":7558,"type":15},"Cloudflare Workers","cloudflare-workers",{"name":7560,"slug":7561,"type":15},"SDK","sdk",{"name":7563,"slug":7564,"type":15},"Serverless","serverless",{"name":7566,"slug":7567,"type":15},"WebSockets","websockets","2026-04-06T18:39:51.717063",{"slug":7570,"name":7570,"fn":7571,"description":7572,"org":7573,"tags":7574,"stars":22,"repoUrl":23,"updatedAt":7590},"ai-elements","build chat UIs with AI Elements","AI Elements component library guidance — pre-built React components for AI interfaces built on shadcn\u002Fui. Use when building chat UIs, message displays, tool call rendering, streaming responses, reasoning panels, or any AI-native interface with the AI SDK.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7575,7578,7581,7584,7587],{"name":7576,"slug":7577,"type":15},"Frontend","frontend",{"name":7579,"slug":7580,"type":15},"React","react",{"name":7582,"slug":7583,"type":15},"shadcn\u002Fui","shadcn-ui",{"name":7585,"slug":7586,"type":15},"UI Components","ui-components",{"name":7588,"slug":7589,"type":15},"Vercel","vercel","2026-04-06T18:40:59.619419",{"slug":7592,"name":7592,"fn":7593,"description":7594,"org":7595,"tags":7596,"stars":22,"repoUrl":23,"updatedAt":7610},"ai-gateway","configure Vercel AI Gateway","Vercel AI Gateway expert guidance. Use when configuring model routing, provider failover, cost tracking, or managing multiple AI providers through a unified API.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7597,7600,7603,7606,7609],{"name":7598,"slug":7599,"type":15},"AI Infrastructure","ai-infrastructure",{"name":7601,"slug":7602,"type":15},"Cost Optimization","cost-optimization",{"name":7604,"slug":7605,"type":15},"LLM","llm",{"name":7607,"slug":7608,"type":15},"Performance","performance",{"name":7588,"slug":7589,"type":15},"2026-04-06T18:40:44.377464",{"slug":7612,"name":7612,"fn":7613,"description":7614,"org":7615,"tags":7616,"stars":22,"repoUrl":23,"updatedAt":7622},"ai-generation-persistence","implement persistence patterns for AI generations","AI generation persistence patterns — unique IDs, addressable URLs, database storage, and cost tracking for every LLM generation",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7617,7618,7621],{"name":7601,"slug":7602,"type":15},{"name":7619,"slug":7620,"type":15},"Database","database",{"name":7604,"slug":7605,"type":15},"2026-04-06T18:41:08.513425",600,{"items":7625,"total":7818},[7626,7647,7670,7685,7701,7718,7737,7747,7761,7775,7787,7802],{"slug":7627,"name":7627,"fn":7628,"description":7629,"org":7630,"tags":7631,"stars":7644,"repoUrl":7645,"updatedAt":7646},"prior-auth-packet-builder","build healthcare prior authorization packets","Build a concise prior authorization packet from local case files and payer policy docs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7632,7635,7638,7641],{"name":7633,"slug":7634,"type":15},"Documents","documents",{"name":7636,"slug":7637,"type":15},"Healthcare","healthcare",{"name":7639,"slug":7640,"type":15},"Insurance","insurance",{"name":7642,"slug":7643,"type":15},"Regulatory Compliance","regulatory-compliance",28169,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-agents-python","2026-04-16T05:11:39.180399",{"slug":7648,"name":7648,"fn":7649,"description":7650,"org":7651,"tags":7652,"stars":7667,"repoUrl":7668,"updatedAt":7669},"aspnet-core","build ASP.NET Core web applications","Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development. Use when working on Blazor Web Apps, Razor Pages, MVC, Minimal APIs, controller-based Web APIs, SignalR, gRPC, middleware, dependency injection, configuration, authentication, authorization, testing, performance, deployment, or ASP.NET Core upgrades.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7653,7656,7658,7661,7664],{"name":7654,"slug":7655,"type":15},".NET","dotnet",{"name":7657,"slug":7648,"type":15},"ASP.NET Core",{"name":7659,"slug":7660,"type":15},"Blazor","blazor",{"name":7662,"slug":7663,"type":15},"C#","csharp",{"name":7665,"slug":7666,"type":15},"Web Development","web-development",23787,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fskills","2026-04-12T05:07:02.819491",{"slug":7671,"name":7671,"fn":7672,"description":7673,"org":7674,"tags":7675,"stars":7667,"repoUrl":7668,"updatedAt":7684},"chatgpt-apps","build ChatGPT Apps SDK applications","Build, scaffold, refactor, and troubleshoot ChatGPT Apps SDK applications that combine an MCP server and widget UI. Use when Codex needs to design tools, register UI resources, wire the MCP Apps bridge or ChatGPT compatibility APIs, apply Apps SDK metadata or CSP or domain settings, or produce a docs-aligned project scaffold. Prefer a docs-first workflow by invoking the openai-docs skill or OpenAI developer docs MCP tools before generating code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7676,7679,7682,7683],{"name":7677,"slug":7678,"type":15},"Apps SDK","apps-sdk",{"name":7680,"slug":7681,"type":15},"ChatGPT","chatgpt",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-04-12T05:07:05.468097",{"slug":7686,"name":7686,"fn":7687,"description":7688,"org":7689,"tags":7690,"stars":7667,"repoUrl":7668,"updatedAt":7700},"cli-creator","build CLIs from API docs","Build a composable CLI for Codex from API docs, an OpenAPI spec, existing curl examples, an SDK, a web app, an admin tool, or a local script. Use when the user wants Codex to create a command-line tool that can run from any repo, expose composable read\u002Fwrite commands, return stable JSON, manage auth, and pair with a companion skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7691,7694,7697],{"name":7692,"slug":7693,"type":15},"API Development","api-development",{"name":7695,"slug":7696,"type":15},"CLI","cli",{"name":7698,"slug":7699,"type":15},"Codex","codex","2026-04-12T05:07:04.132762",{"slug":7702,"name":7702,"fn":7703,"description":7704,"org":7705,"tags":7706,"stars":7667,"repoUrl":7668,"updatedAt":7717},"cloudflare-deploy","deploy projects to Cloudflare","Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7707,7710,7713,7714],{"name":7708,"slug":7709,"type":15},"Cloudflare","cloudflare",{"name":7711,"slug":7712,"type":15},"Cloudflare Pages","cloudflare-pages",{"name":7557,"slug":7558,"type":15},{"name":7715,"slug":7716,"type":15},"Deployment","deployment","2026-04-12T05:07:14.275118",{"slug":7719,"name":7719,"fn":7720,"description":7721,"org":7722,"tags":7723,"stars":7667,"repoUrl":7668,"updatedAt":7736},"define-goal","define and set measurable project goals","Help the user define a concrete, measurable goal before starting work, especially when they ask to use the goal tool, create a goal, set an objective, clarify success criteria, or turn a fuzzy intention into a quantitative outcome. Use this skill for goal creation and goal refinement only; it does not manage durable snapshots, decision logs, or long-running execution artifacts.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7724,7727,7730,7733],{"name":7725,"slug":7726,"type":15},"Productivity","productivity",{"name":7728,"slug":7729,"type":15},"Project Management","project-management",{"name":7731,"slug":7732,"type":15},"Strategy","strategy",{"name":7734,"slug":7735,"type":15},"Task Management","task-management","2026-05-23T06:17:16.870838",{"slug":21,"name":21,"fn":7738,"description":7739,"org":7740,"tags":7741,"stars":7667,"repoUrl":7668,"updatedAt":7746},"translate Figma designs into code","Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7742,7743,7744,7745],{"name":7518,"slug":7519,"type":15},{"name":20,"slug":21,"type":15},{"name":7576,"slug":7577,"type":15},{"name":17,"slug":18,"type":15},"2026-04-12T05:06:47.939943",{"slug":7748,"name":7748,"fn":7749,"description":7750,"org":7751,"tags":7752,"stars":7667,"repoUrl":7668,"updatedAt":7760},"figma-code-connect-components","connect Figma designs to code components","Connects Figma design components to code components using Code Connect mapping tools. Use when user says \"code connect\", \"connect this component to code\", \"map this component\", \"link component to code\", \"create code connect mapping\", or wants to establish mappings between Figma designs and code implementations. For canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7753,7754,7757,7758,7759],{"name":7518,"slug":7519,"type":15},{"name":7755,"slug":7756,"type":15},"Design System","design-system",{"name":20,"slug":21,"type":15},{"name":7576,"slug":7577,"type":15},{"name":7585,"slug":7586,"type":15},"2026-05-10T05:59:52.971881",{"slug":7762,"name":7762,"fn":7763,"description":7764,"org":7765,"tags":7766,"stars":7667,"repoUrl":7668,"updatedAt":7774},"figma-create-design-system-rules","generate design system rules from Figma","Generates custom design system rules for the user's codebase. Use when user says \"create design system rules\", \"generate rules for my project\", \"set up design rules\", \"customize design system guidelines\", or wants to establish project-specific conventions for Figma-to-code workflows. Requires Figma MCP server connection.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7767,7768,7769,7772,7773],{"name":7518,"slug":7519,"type":15},{"name":7755,"slug":7756,"type":15},{"name":7770,"slug":7771,"type":15},"Documentation","documentation",{"name":20,"slug":21,"type":15},{"name":7576,"slug":7577,"type":15},"2026-05-16T06:07:47.821474",{"slug":7776,"name":7776,"fn":7777,"description":7778,"org":7779,"tags":7780,"stars":7667,"repoUrl":7668,"updatedAt":7786},"figma-implement-design","translate Figma designs into application code","Translates Figma designs into production-ready application code with 1:1 visual fidelity. Use when implementing UI code from Figma files, when user mentions \"implement design\", \"generate code\", \"implement component\", provides Figma URLs, or asks to build components matching Figma specs. For Figma canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7781,7782,7783,7784,7785],{"name":7518,"slug":7519,"type":15},{"name":20,"slug":21,"type":15},{"name":7576,"slug":7577,"type":15},{"name":7585,"slug":7586,"type":15},{"name":7665,"slug":7666,"type":15},"2026-05-16T06:07:40.583615",{"slug":7788,"name":7788,"fn":7789,"description":7790,"org":7791,"tags":7792,"stars":7667,"repoUrl":7668,"updatedAt":7801},"hatch-pet","create animated pets for Codex","Create, repair, validate, visually QA, and package Codex-compatible animated pets and pet spritesheets from character art, generated images, company or prospect brand cues, or visual references. Use when a user wants a lightweight-worker Codex pet workflow, a non-pixel custom pet style, a prospect or company mascot pet, or a full 8x9 animated pet atlas with transparent unused cells, QA contact sheets, and pet.json packaging. This skill composes the installed $imagegen system skill for visual generation and uses bundled scripts for deterministic spritesheet assembly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7793,7796,7797,7800],{"name":7794,"slug":7795,"type":15},"Animation","animation",{"name":7698,"slug":7699,"type":15},{"name":7798,"slug":7799,"type":15},"Creative","creative",{"name":7518,"slug":7519,"type":15},"2026-05-02T05:31:48.48485",{"slug":7803,"name":7803,"fn":7804,"description":7805,"org":7806,"tags":7807,"stars":7667,"repoUrl":7668,"updatedAt":7817},"imagegen","generate and edit raster images","Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG\u002Fvector\u002Fcode-native assets, extending an established icon or logo system, or building the visual directly in HTML\u002FCSS\u002Fcanvas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7808,7809,7810,7813,7816],{"name":7798,"slug":7799,"type":15},{"name":7518,"slug":7519,"type":15},{"name":7811,"slug":7812,"type":15},"Image Generation","image-generation",{"name":7814,"slug":7815,"type":15},"Images","images",{"name":9,"slug":8,"type":15},"2026-05-15T06:23:24.312127",675]