All skills
figma avatar

/figma-use

@1729207 official
by figmafigma/mcp-server-guide2k stars
194

**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/edit/delete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.

Use this Skill: https://skilld.dev/gh/figma/mcp-server-guide/figma-use

This session only. Nothing lands on disk.

referencesworking-with-design-systemswwds-effect-styles.md

≈962 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Working with design systems: Effect Styles

Effect styles in Figma are named, reusable definitions of one or more visual effects — drop shadows, inner shadows, and blurs. They are the closest equivalent to a shadow or elevation token in a design system.

Effect styles are distinct from variables. There is no single variable type that represents a shadow. However, individual numeric and color properties within an effect can be bound to variables, allowing shadow values to participate in a token system.

Model

An EffectStyle has one core writable property beyond the base style fields:

Property Type Notes
name string Slash-delimited for grouping (e.g. "Elevation/200")
effects ReadonlyArray<Effect> Read-only array — clone, modify, reassign
description string Inherited from BaseStyleMixin

Effect types

An Effect is a discriminated union. The most common types:

type Key properties
DROP_SHADOW color: RGBA, offset: Vector, radius: number, spread: number, visible: boolean, blendMode
INNER_SHADOW Same as DROP_SHADOW
LAYER_BLUR radius: number, visible: boolean
BACKGROUND_BLUR radius: number, visible: boolean

All colors are in 0–1 range (RGBA), not 0–255.

Variable bindings on effects

Effect properties that can be bound to variables (via setBoundVariableForEffect(effect, field, variable) on a node, or inline when constructing):

color, radius, spread, offsetX, offsetY

Note: setBoundVariableForEffect returns a new effect object — you must capture it and reassign the effects array.

Applying an effect style to a node

Assign the style's id to the node's effectStyleId. The node's effects property will then reflect the style's values.

Looking up a library effect style by key

When an effect style is found via a search_design_system queries entry with entity: "style", pass the returned key directly into $fig.getStyle(styleKey) — the plan queues the library import automatically, no separate await figma.importStyleByKeyAsync(...) step required. The handle can then be applied via the effects property on any $fig.rectangle(...) / $fig.frame(...) / $fig.query(...).set(...) call.

const shadow = $fig.getStyle(ELEVATION_200_KEY)
$fig.frame({ name: 'Card', effects: shadow })

Common gotchas

  • effects is read-only: You cannot mutate the array in place. Clone it, modify the clone, then reassign: style.effects = [...style.effects, newEffect].
  • Effects stack in order: The order of effects in the array matters visually. Drop shadows render bottom-to-top.
  • Colors are RGBA 0–1: { r: 0, g: 0, b: 0, a: 0.15 } — not hex, not 0–255.
  • getLocalEffectStyles() is deprecated: Always use getLocalEffectStylesAsync().
  • Styles are not automatically applied: Creating an EffectStyle has no effect on any node until you assign its ID to a node.

Code patterns

For runnable code examples (listing, creating, applying effect styles), see effect-style-patterns.md.

Source: SKILL.md on GitHub

No alerts9d4 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The skill provides comprehensive instructions and reference material for interacting with the Figma Plugin API. No security issues were detected.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 1729207. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago
disable-model-invocation
false
  • figma
  • plugin-api
  • design-systems
  • javascript
  • components
  • variables
  • auto-layout
  • tokens

README badge

README badge for figma/mcp-server-guide/figma-use

Loads prerequisites for the `use_figma` tool, which executes JavaScript in Figma files via the Plugin API. This skill teaches critical rules for font loading, text editing, auto-layout, pagination, async operations, and incremental work patterns that prevent hard-to-debug failures. Install this before any Figma programmatic task—creating or editing nodes, binding variables, building components, or inspecting file structure.

Generated from the current SKILL.md.

Do I need to load this skill before calling use_figma?
Yes. This skill is a mandatory prerequisite. You must load figma-use before every use_figma tool call and include it in the skillNames parameter, or the call will fail with hard-to-debug errors.
What kind of operations does this skill cover?
Write actions and unique read actions that require JavaScript execution in Figma files: creating/editing/deleting nodes, setting up variables and tokens, building components and variants, modifying auto-layout or fills, binding variables to properties, and inspecting file structure programmatically.
Can I use console.log() to debug my code?
No. console.log() output is not returned. Use return statements to send data back instead — return values are automatically JSON-serialized.
How do I switch to a different page in Figma?
Use await figma.setCurrentPageAsync(page) to switch pages and load their content. The synchronous setter figma.currentPage = page does not work and will throw an error.
What should I do if a use_figma call fails?
Stop and do not retry immediately. Failed scripts are atomic — no changes are made to the file. Read the error message carefully, fix the script, and retry.

Generated from the current SKILL.md. These answers refresh after source changes.