Skip to content

Figma Generate Library skill

Figma's skill for building a design system in Figma from your code: variables, light and dark modes, styles and components with variants.

Official · Figma
AuthorFigma
LicenceNo licence file; Figma Developer Terms apply
Sourcefigma/mcp-server-guide · SKILL.md on GitHub
Project websitedevelopers.figma.com/docs/figma-mcp-server
Works inClaude Code · Codex, Gemini CLI, Cursor, Copilot
Read from the source on

The figma-generate-library skill is Figma's official agent skill for building or updating a design system in Figma from your codebase. It reads your CSS variables, theme files and components, then creates the matching Figma variables (with light and dark modes), text and effect styles, and components with proper variant sets, each property bound to a variable instead of a hard-coded value.

It decides what to build and in what order; the companion figma-use skill decides how each canvas script is written, so the two are always loaded together. It runs through the remote Figma MCP server and needs a Figma account and a file you can edit. It scales to the request: a token set, one component, a full library, or a reconciliation of what drifted between code and Figma.

From the skill's SKILL.md: Build professional-grade design-system assets in Figma that match code.

This is an official skill from Figma. Like any skill it gives the agent instructions and may include scripts it runs, so install it from the source linked here, not from a copy elsewhere.

What it does

  1. Picks one scope before touching the file (tokens only, a single component or family, a full library, or a code-to-Figma reconciliation) and posts a short checklist of what it will deliver and how it will check it.
  2. Discovers first: analyses the relevant code, inspects the file's existing pages, variables and styles, lists the libraries the file can use and searches them, and asks you when code and Figma disagree on a value.
  3. Creates variable collections and modes (for example Primitives plus a Color collection with Light and Dark), semantic variables aliased to primitives, a scope on every variable, and the CSS var() code syntax that points back to your code.
  4. Builds components in dependency order with variant sets, component properties and variable bindings, uses instance swap for icons instead of one variant per icon, and splits any variant matrix larger than 30.
  5. For a full library, adds cover, getting-started, foundations and component pages, then Code Connect mappings and a final accessibility, naming and binding audit.
  6. Keeps a state ledger of every created ID in a JSON file so a long build can resume in a new chat, and never runs two canvas scripts at the same time.

What you get

  • Variables, modes, text styles, effect styles, components and component sets in your Figma file, plus documentation pages when the scope includes them.
  • A state file on your computer (/tmp/design-system-state-<run id>.json) listing what was created, used to resume the build.

When to use it

  • Your design tokens and components live in code and the Figma library is missing, incomplete or out of date.
  • You need one new component in Figma built properly, with variants and variable bindings rather than drawn by hand.
  • You are setting up light and dark themes as Figma variable modes that match your CSS.
  • Code and Figma have drifted and you want only the changed tokens and components updated in place.

When not to use it

  • You want a screen or page built from an existing library: that is figma-generate-design's job.
  • You want code from a Figma design: use figma-design-to-code instead.
  • You have no code or token source to work from and want a brand invented: the skill builds what the code defines and asks rather than guessing.
  • You only have a View or Collab seat on a shared file: writing outside your drafts needs a Full seat.

What it needs

  • A Figma account and a file you can edit. Figma's docs say writing outside your drafts needs a Full seat, and that writing to the canvas is free during the beta and will later be a usage-based paid feature.
  • The remote Figma MCP server (https://mcp.figma.com/mcp) connected to your agent and signed in.
  • Figma's figma-use skill, which the skill requires for every canvas script. The Figma plugin installs both.
  • Your codebase (or a token file) as the source of truth. Read tools count against Figma's rate limits: up to 20 calls a month on the Starter plan or a View or Collab seat; write tools are exempt.
  • Time for a full library: it runs in phases with checkpoints, and the skill gives you a continuation prompt to resume in a new chat.

Files in the skill

File or folderWhat it is for
SKILL.mdThe scope contract, the workflow per scope, 15 design-system rules, the state ledger, the library reuse matrix and when to ask you.
references/discovery-phase.mdHow to analyse code and the Figma file before changing anything.
references/token-creation.mdCollections, modes, aliases, scopes and code syntax, including a larger multi-brand pattern.
references/component-creation.mdBuilding components and variant sets with properties and bindings.
references/documentation-creation.mdCover, getting-started and foundations pages.
references/code-connect-setup.mdMapping Figma components to code components and setting variable code syntax.
references/naming-conventions.mdNames for variables, pages, variants and styles when the file has no convention yet.
references/error-recovery.mdWhat to do when a script fails and how to clean up abandoned work safely.
scripts/*.jsEight helper scripts embedded in canvas calls: inspect the file, create collections and semantic tokens, build variant sets, bind variables, create a docs page, validate, and remove only listed orphans.

Licence as found in the repository on 2026-11-15: No licence file; Figma Developer Terms apply.

Example prompts

Type one of these after installing; naming the skill makes sure it is used.

  • Use figma-generate-library to create Figma variables from src/styles/tokens.css in this file: <file URL>. Primitives plus a Color collection with Light and Dark modes.
  • Build our Button component in Figma from components/Button.tsx, with Size, Variant and State variants bound to our variables.
  • Compare our Tailwind theme with the variables in this Figma library and update only what changed.
  • Set up a full design system in a new Figma file from this repo: foundations, Button, Input, Card, Badge and a getting-started page.

How to install figma-generate-library

Connect the Figma MCP server and install figma-use too

The quickest route in Claude Code is Figma's plugin from Anthropic's official marketplace: it adds the MCP server and every Figma skill, including figma-use, which this skill needs. After installing, run /mcp in Claude Code and sign in to Figma in the browser.

Copying the folder by hand works too, as long as figma-use is copied next to it (the commands below do both) and the MCP server is added with the second command.

claude plugin install figma@claude-plugins-official
# or, by hand:
claude mcp add --transport http figma https://mcp.figma.com/mcp

Cursor, Gemini CLI and VS Code

Figma's guide installs the same plugin in Cursor with /add-plugin figma in agent chat, and as a Gemini CLI extension (then /mcp auth figma). In VS Code, add an HTTP MCP server with the same URL and use Copilot's agent mode.

/add-plugin figma
gemini extensions install https://github.com/figma/mcp-server-guide

Why there is no claude.ai or API route

Every step calls live Figma MCP tools such as use_figma, get_libraries and search_design_system. The Claude API skills sandbox has no network access and we have not verified a claude.ai setup, so only agent setups are given.

A skill is a folder with a SKILL.md file. You install it once; the agent reads its short description at the start of each session and loads the full instructions only when a request matches. Pick the place you use:

Claude Code: from the plugin marketplace

  1. Start Claude Code in a terminal with claude.
  2. This plugin is in Anthropic's official marketplace, which Claude Code adds for you the first time you start it.
  3. Install the plugin. Claude Code opens its details first: check what it will add (skills, hooks, MCP servers), then choose whether it is for you, for everyone on this repository, or for you in this repository only.
    /plugin install figma@claude-plugins-official
  4. Type / and look for /figma:figma-generate-library, or simply ask for the task.

From your shell instead of a session:

claude plugin install figma@claude-plugins-official

The plugin installs as a whole, so other skills come with it, including figma-3d-transforms, figma-code-connect, figma-code-workflows, figma-create-new-file, figma-design-to-code, figma-generate-design, figma-generate-diagram, figma-generative-plugins, figma-implement-motion, figma-shaders, figma-spec, figma-swiftui, figma-use, figma-use-figjam, figma-use-motion, figma-use-slides.

Claude Code: copy the folder into your skills folder

Put the skill's folder in ~/.claude/skills/ to use it in every project on this computer, or in .claude/skills/ inside a repository to share it with everyone who works there (commit it).

git clone --depth 1 https://github.com/figma/mcp-server-guide.git
mkdir -p ~/.claude/skills
cp -R mcp-server-guide/skills/figma-generate-library ~/.claude/skills/
cp -R mcp-server-guide/skills/figma-use ~/.claude/skills/

Claude Code notices new or changed skills in these folders during the session. If the skills folder did not exist when the session started, run /reload-skills once. Then type /figma-generate-library or just describe the task.

On Windows, run the commands in Git Bash or WSL, or copy the folder into the same place with File Explorer.

Codex, Gemini CLI, Cursor and GitHub Copilot

These agents read the same SKILL.md folders. The one folder all four accept inside a project is .agents/skills/, so this copies the skill there:

git clone --depth 1 https://github.com/figma/mcp-server-guide.git
mkdir -p .agents/skills
cp -R mcp-server-guide/skills/figma-generate-library .agents/skills/
cp -R mcp-server-guide/skills/figma-use .agents/skills/
AgentProject folderYour user folderNotes
OpenAI Codex
.agents/skills/
~/.agents/skills/
Type $ or run /skills to pick a skill; Codex also chooses one when your task matches.
Gemini CLI
.agents/skills/
.gemini/skills/
~/.agents/skills/
~/.gemini/skills/
Or install from Git with gemini skills install <git URL> --path <folder> --consent. Google replaced Gemini CLI with Antigravity CLI for free-tier and Google One users on 18 June 2026; Antigravity uses .agents/skills/ in a project and ~/.gemini/config/skills/ for you.
Cursor
.agents/skills/
.cursor/skills/
~/.agents/skills/
~/.cursor/skills/
Type / in Agent chat to pick a skill. Cursor also reads Claude Code's .claude/skills/ folders.
GitHub Copilot
.github/skills/
.agents/skills/
.claude/skills/
~/.copilot/skills/
~/.agents/skills/
Works in Copilot CLI, the cloud agent, and agent mode in VS Code, Visual Studio and JetBrains (IDE support depends on the version). Or run gh skill install OWNER/REPOSITORY SKILL (public preview, GitHub CLI 2.90.0 or later).
Only install skills you trust. Anthropic's advice is to use skills only from trusted sources, and to read every file of any other skill before using it: a skill can direct the agent to run commands, read files or send data in ways its description does not mention.

Sources for these steps

Checked against each vendor's documentation on 2026-11-14:

Scope first, then stop

The skill is written to avoid scope creep. A request for one component does not turn into a full library: it creates only the missing tokens that component needs, validates it, shows the requested states as instances in one compact frame, and stops. A token-only request does not get components.

Each scope has its own definition of done (variant coverage, variable scopes and aliases, code syntax, bindings and a visual check), and extra documentation or audits are reported as follow-ups instead of being started.

Rules that keep the library clean

Every variable gets an explicit scope (backgrounds, text, borders, gaps, radii) instead of appearing in every property picker, and web code syntax uses the var() form with your real CSS variable name. Semantic colours alias primitives rather than repeating raw values.

Clean-up only deletes nodes by the exact IDs in its ledger, never by guessing from names, so it does not remove your own layers.

Questions about figma-generate-library

What is the difference between figma-generate-library and figma-generate-design?

figma-generate-library builds the reusable parts of a design system: variables, styles, components and variant sets. figma-generate-design builds screens and pages out of those parts. If a task needs both, Figma's figma-use skill says to load both.

Can it create light and dark mode variables?

Yes. Its standard token pattern is a Primitives collection with one mode, a Color collection with Light and Dark modes aliased to the primitives, and separate Spacing and Typography collections. Larger systems can use more modes, for example brand or contrast variants.

Will it rebuild components my library already has?

No, it searches first. It reuses a library component when its properties, token model and naming fit; wraps it when it looks right but its properties do not; and rebuilds only when the API or token model is incompatible or you cannot edit the library. When the choice is not clear, it asks you.

Does it need figma-use?

Yes. The skill says figma-use must be loaded for every use_figma call: figma-generate-library knows what to build and in which order, figma-use knows the Plugin API rules. Installing Figma's plugin gives you both.

Is the figma-generate-library skill free?

The skill files are free to install but not open source: the repository has no licence file and Figma's Developer Terms apply. You need a Figma account; writing outside your drafts needs a Full seat, and Figma says writing to the canvas is free during the beta and will later be usage-based and paid.

What happens if a long build is interrupted?

The skill writes a state ledger of every created ID to a JSON file and gives a continuation prompt with a run ID. In a new chat it re-reads that file and scans the Figma file by name to pick up where it stopped, without duplicating what exists.

More AI skills

Related skills

Skill categories