Figma design system from a codebase
Builds a Figma design system library from a codebase in five supervised phases: discovery, variables and styles, page structure, components one by one, QA. Use when a product needs a Figma library that matches its code tokens and components.
figma-generate-library- Author
- OpenAI
- Source
- openai/skills/skills/.curated/figma-generate-library @ 49f948f
- License
- Figma Developer Terms
About this skill
What it does
The skill builds or updates a Figma design system library that matches a codebase: variables with light and dark modes, styles, foundation docs and components. It decides what to build and in which order; Figma use_figma prerequisite loads alongside for the API rules. Expect 20 to 100 or more use_figma calls, strictly one at a time.
Five phases each end at a user checkpoint. Discovery reads tokens and components from the code and the file, checks linked libraries and locks a v1 scope. Foundations: primitive and semantic variables, aliased per mode, each with scopes and code syntax such as var(--color-bg-primary). Then the page skeleton and foundation docs, then components one at a time, simple before composite, each approved from a screenshot. A final pass covers Code Connect, contrast, naming and leftover hardcoded values.
For lost context, created nodes are tagged and a state ledger goes to /tmp/dsb-state-<RUN_ID>.json.
references/ has a guide per phase plus naming and error recovery; scripts/ holds nine JavaScript helpers to embed in use_figma calls, from file inspection to cleanup. Six of them call setPluginData or getPluginData (four tag what they create, cleanupOrphans.js and rehydrateState.js read the tags), and SKILL.md says use_figma supports neither; test these scripts before relying on them.
When to use it, and when not
Use it to stand up a Figma library for an existing product or reconcile one with the code. On Figma's free Starter plan a collection has one mode, so light and dark themes need a paid plan.
For one screen, use Generate a Figma design from an app; for one component, figma-use alone: this skill runs discovery and foundations even for a button.
How to run it
We do not copy this skill: its files fall under Figma's Developer Terms, not an open licence. Install it from the author's repository with the button to the source; in Codex the route is $skill-installer figma-generate-library, for another agent copy the folder into its skills directory. OpenAI has marked openai/skills deprecated; newer versions live in openai/plugins. Install figma-use next to it.
- Claude Code:
/figma-generate-library, or ask for the skill by name. - Codex:
$figma-generate-library. - Cursor: type
/in the Agent chat and pickfigma-generate-library.
Example: /figma-generate-library Build a Figma library from src/styles/tokens.css and the components in src/ui.
How it differs from similar skills
Generate a Figma design from an app assembles screens from a library like this one. Figma Code Connect components links an existing library to code; here Code Connect is one build step. No skill outside the Figma set builds design libraries.
Install
This skill is not copied to the catalog: its licence does not allow it. Install it from the author's repository.
Connect through AnyModel API
This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.
AnyModel