Best fit
- Use when the user wants to create variables/tokens, build component libraries, set up theming (light/dark modes), document foundations, or reconcile gaps between code and Figma.
openai/skills
Build or update a professional-grade design system in Figma from a codebase. Use when the user wants to create variables/tokens, build component libraries, set up theming (light/dark modes), document foundations, or reconcile gaps between code and Figma. This skill teaches WHAT to build and in WHAT ORDER — it complements the `figma-use` skill which teaches HOW to call the Plugin API. Both skills should be loaded together.
npx skills add https://github.com/openai/skills --skill "skills/.curated/figma-generate-library"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Reorganized from the pinned upstream SKILL.md
Build professional-grade design systems in Figma that match code. This skill orchestrates multi-phase workflows across 20–100+ usefigma calls, enforcing quality patterns from real-world design systems (Material 3, Polaris, Figma UI3, Simple DS).
npx skills add https://github.com/openai/skills --skill "skills/.curated/figma-generate-library"The pinned source contains enough sections and task detail for a source-grounded deep guide; automated content is still not an independent test.
2,160 source words · 11 usable sections
Best fit
Design process
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
Every design system build follows this phase order. Skipping or reordering phases causes structural failures that are expensive to undo.
Phase 0 anti-patterns: - ❌ Starting to create anything before scope is locked with user - ❌ Ignoring existing file conventions and imposing new ones - ❌ Skipping searchdesignsystem before planning component creation
This is NEVER a one-shot task. Building a design system requires 20–100+ usefigma calls across multiple phases, with mandatory user checkpoints between them. Any attempt to create everything in one call WILL produce broken, incomplete, or unrecoverable results. Break every opera…
Plugin API basics (from usefigma skill — enforced here too): - Use return to send data back (auto-serialized). Do NOT wrap in IIFE or call closePlugin. - Return ALL created/mutated node IDs in every return value - Page context resets each call — always await figma.setCurrentPage…
getPluginData() / setPluginData() are NOT supported in usefigma. Use getSharedPluginData() / setSharedPluginData() instead (these ARE supported), or use name-based lookups and the state ledger (returned IDs).
SkillSignal prompt templates
These prompts were written by SkillSignal from the source structure; they are not upstream text.
Source-grounded prompt
Use for a design task while explicitly checking the source sections.
Use figma-generate-library for this design task: [task]. Inputs and constraints: [details]. Work through these pinned SKILL.md sections: “2. Mandatory Workflow”, “9. Per-Phase Anti-Patterns”, “1. The One Rule That Matters Most”, “3. Critical Rules”, “4. State Management (Required for Long Workflows)”. Cite the concrete requirements that shape each step, do not invent capabilities absent from the source, and verify the result against: [acceptance criteria].
Design checklist
The source section “2. Mandatory Workflow” has been checked.
The source section “9. Per-Phase Anti-Patterns” has been checked.
The source section “1. The One Rule That Matters Most” has been checked.
The source section “3. Critical Rules” has been checked.
Static permission evidence
These are source excerpts matched by deterministic rules, not findings of malicious behavior, safety, or actual execution.
SKILL.md · L24
0b. Inspect Figma file → pages, variables, components, styles, existing conventionsThe documentation asks the agent to read local files, directories, or repositories.
SKILL.md · L121
Re-read this file at the start of every turn. In long workflows, conversation context will be truncated — the file is the source of truth.The documentation asks the agent to read local files, directories, or repositories.
Choose a different workflow
Build or update a professional-grade design system library in Figma from a codebase. Useful for keeping the Figma source of truth in sync with shipped components.
A separate implementation from nexu-io/open-design; compare its source, maintenance signals, and permission requirements.
Open source detailUse when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
A separate implementation from event4u-app/agent-config; compare its source, maintenance signals, and permission requirements.
Open source detailGive a blunt A-F ship grade for a code change across correctness, security, data, UX, verification, and deploy readiness. Use for a grade, not a findings review.
A separate implementation from JasonColapietro/suede-creator-skills; compare its source, maintenance signals, and permission requirements.
Open source detailFAQ
Build professional-grade design systems in Figma that match code. This skill orchestrates multi-phase workflows across 20–100+ usefigma calls, enforcing quality patterns from real-world design systems (Material 3, Polaris, Figma UI3, Simple DS).
The source record exposes this install command: npx skills add https://github.com/openai/skills --skill "skills/.curated/figma-generate-library". Inspect the command and pinned source before running it.
Static rules flagged read-files in the source; the page lists the matching lines and excerpts.
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
Build or update a professional-grade design system library in Figma from a codebase. Useful for keeping the Figma source of truth in sync with shipped components.
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
Give a blunt A-F ship grade for a code change across correctness, security, data, UX, verification, and deploy readiness. Use for a grade, not a findings review.
Use when designing APIs, planning endpoints, REST conventions, versioning, or deprecation — even when the user just says 'expose this as an endpoint' without naming API design.
Use when writing Playwright E2E tests — browser automation, visual regression testing, Page Objects, fixtures, and reliable test patterns.
Build professional-grade design systems in Figma that match code. This skill orchestrates multi-phase workflows across 20–100+ use_figma calls, enforcing quality patterns from real-world design systems (Material 3, Polaris, Figma UI3, Simple DS).
Prerequisites: The figma-use skill MUST also be loaded for every use_figma call. It provides Plugin API syntax rules (return pattern, page reset, ID return, font loading, color range). This skill provides design system domain knowledge and workflow orchestration.
Always pass skillNames: "figma-generate-library" when calling use_figma as part of this skill. This is a logging parameter — it does not affect execution.
This is NEVER a one-shot task. Building a design system requires 20–100+ use_figma calls across multiple phases, with mandatory user checkpoints between them. Any attempt to create everything in one call WILL produce broken, incomplete, or unrecoverable results. Break every operation to the smallest useful unit, validate, get feedback, proceed.
Every design system build follows this phase order. Skipping or reordering phases causes structural failures that are expensive to undo.
Phase 0: DISCOVERY (always first — no use_figma writes yet)
0a. Analyze codebase → extract tokens, components, naming conventions
0b. Inspect Figma file → pages, variables, components, styles, existing conventions
0c. Search subscribed libraries → use search_design_system for reusable assets
0d. Lock v1 scope → agree on exact token set + component list before any creation
0e. Map code → Figma → resolve conflicts (code and Figma disagree = ask user)
✋ USER CHECKPOINT: present full plan, await explicit approval
Phase 1: FOUNDATIONS (tokens first — always before components)
1a. Create variable collections and modes
1b. Create primitive variables (raw values, 1 mode)
1c. Create semantic variables (aliased to primitives, mode-aware)
1d. Set scopes on ALL variables
1e. Set code syntax on ALL variables
1f. Create effect styles (shadows) and text styles (typography)
→ Exit criteria: every token from the agreed plan exists, all scopes set, all code syntax set
✋ USER CHECKPOINT: show variable summary, await approval
Phase 2: FILE STRUCTURE (before components)
2a. Create page skeleton: Cover → Getting Started → Foundations → --- → Components → --- → Utilities
2b. Create foundations documentation pages (color swatches, type specimens, spacing bars)
→ Exit criteria: all planned pages exist, foundations docs are navigable
✋ USER CHECKPOINT: show page list + screenshot, await approval
Phase 3: COMPONENTS (one at a time — never batch)
For EACH component (in dependency order: atoms before molecules):
3a. Create dedicated page
3b. Build base component with auto-layout + full variable bindings
3c. Create all variant combinations (combineAsVariants + grid layout)
3d. Add component properties (TEXT, BOOLEAN, INSTANCE_SWAP)
3e. Link properties to child nodes
3f. Add page documentation (title, description, usage notes)
3g. Validate: get_metadata (structure) + get_screenshot (visual)
3h. Optional: lightweight Code Connect mapping while context is fresh
→ Exit criteria: variant count correct, all bindings verified, screenshot looks right
✋ USER CHECKPOINT per component: show screenshot, await approval before next component
Phase 4: INTEGRATION + QA (final pass)
4a. Finalize all Code Connect mappings
4b. Accessibility audit (contrast, min touch targets, focus visibility)
4c. Naming audit (no duplicates, no unnamed nodes, consistent casing)
4d. Unresolved bindings audit (no hardcoded fills/strokes remaining)
4e. Final review screenshots of every page
✋ USER CHECKPOINT: complete sign-off
Plugin API basics (from use_figma skill — enforced here too):
return to send data back (auto-serialized). Do NOT wrap in IIFE or call closePlugin.await figma.setCurrentPageAsync(page) at startfigma.notify() throws — never use itawait figma.loadFontAsync({family, style})Design system rules:
use_figma to discover existing conventions. Match them.ALL_SCOPES. Background: FRAME_FILL, SHAPE_FILL. Text: TEXT_FILL. Border: STROKE_COLOR. Spacing: GAP. Radii: CORNER_RADIUS. Primitives: [] (hidden).var() wrapper: var(--color-bg-primary), not --color-bg-primary. Use the actual CSS variable name from the codebase. ANDROID/iOS do NOT use a wrapper.{ type: 'VARIABLE_ALIAS', id: primitiveVar.id }. Never duplicate raw values in semantic layer.get_metadata after every create, get_screenshot after each component.use_figma calls — Figma state mutations must be strictly sequential. Even if your tool supports parallel calls, never run two use_figma calls simultaneously.scripts/ into your use_figma calls. Don't write 200-line inline scripts from scratch.
getPluginData()/setPluginData()are NOT supported inuse_figma. UsegetSharedPluginData()/setSharedPluginData()instead (these ARE supported), or use name-based lookups and the state ledger (returned IDs).
| Entity type | Idempotency key | How to check existence |
|---|---|---|
| Scene nodes (pages, frames, components) | setSharedPluginData('dsb', 'key', value) or unique name | node.getSharedPluginData('dsb', 'key') or page.findOne(n => n.name === 'Button') |
| Variables | Name within collection | (await figma.variables.getLocalVariablesAsync()).find(v => v.name === name && v.variableCollectionId === collId) |
| Styles | Name | getLocalTextStyles().find(s => s.name === name) |
Tag every created scene node immediately after creation:
node.setSharedPluginData('dsb', 'run_id', RUN_ID); // identifies this build run
node.setSharedPluginData('dsb', 'phase', 'phase3'); // which phase created it
node.setSharedPluginData('dsb', 'key', 'component/button');// unique logical key
State persistence: Do NOT rely solely on conversation context for the state ledger. Write it to disk:
/tmp/dsb-state-{RUN_ID}.json
Re-read this file at the start of every turn. In long workflows, conversation context will be truncated — the file is the source of truth.
Maintain a state ledger tracking:
{
"runId": "ds-build-2024-001",
"phase": "phase3",
"step": "component-button",
"entities": {
"collections": { "primitives": "id:...", "color": "id:..." },
"variables": { "color/bg/primary": "id:...", "spacing/sm": "id:..." },
"pages": { "Cover": "id:...", "Button": "id:..." },
"components": { "Button": "id:..." }
},
"pendingValidations": ["Button:screenshot"],
"completedSteps": ["phase0", "phase1", "phase2", "component-avatar"]
}
Idempotency check before every create: query by name + state ledger ID. If exists, skip or update — never duplicate.
Resume protocol: at session start or after context truncation, run a read-only use_figma to scan all pages, components, variables, and styles by name to reconstruct the {key → id} map. Then re-read the state file from disk if available.
Continuation prompt (give this to the user when resuming in a new chat):
"I'm continuing a design system build. Run ID: {RUN_ID}. Load the figma-generate-library skill and resume from the last completed step."
Search FIRST in Phase 0, then again immediately before each component creation.
search_design_system({ query, fileKey, includeComponents: true, includeVariables: true, includeStyles: true })
Reuse if all of these are true:
Rebuild if any of these:
Wrap if visual match but API incompatible:
Three-way priority: local existing → subscribed library import → create new.
Mandatory. Design decisions require human judgment.
| After | Required artifacts | Ask |
|---|---|---|
| Discovery + scope lock | Token list, component list, gap analysis | "Here's my plan. Approve before I create anything?" |
| Foundations | Variable summary (N collections, M vars, K modes), style list | "All tokens created. Review before file structure?" |
| File structure | Page list + screenshot | "Pages set up. Review before components?" |
| Each component | get_screenshot of component page | "Here's [Component] with N variants. Correct?" |
| Each conflict (code ≠ Figma) | Show both versions | "Code says X, Figma has Y. Which wins?" |
| Final QA | Per-page screenshots + audit report | "Complete. Sign off?" |
If user rejects: fix before moving on. Never build on rejected work.
Match existing file conventions. If starting fresh:
Variables (slash-separated):
color/bg/primary color/text/secondary color/border/default
spacing/xs spacing/sm spacing/md spacing/lg spacing/xl spacing/2xl
radius/none radius/sm radius/md radius/lg radius/full
typography/body/font-size typography/heading/line-height
Primitives: blue/50 → blue/900, gray/50 → gray/900
Component names: Button, Input, Card, Avatar, Badge, Checkbox, Toggle
Variant names: Property=Value, Property=Value — e.g., Size=Medium, Style=Primary, State=Default
Page separators: --- (most common) or ——— COMPONENTS ———
Full naming reference: naming-conventions.md
| Complexity | Pattern |
|---|---|
| < 50 tokens | Single collection, 2 modes (Light/Dark) |
| 50–200 tokens | Standard: Primitives (1 mode) + Color semantic (Light/Dark) + Spacing (1 mode) + Typography (1 mode) |
| 200+ tokens | Advanced: Multiple semantic collections, 4–8 modes (Light/Dark × Contrast × Brand). See M3 pattern in token-creation.md |
Standard pattern (recommended starting point):
Collection: "Primitives" modes: ["Value"]
blue/500 = #3B82F6, gray/900 = #111827, ...
Collection: "Color" modes: ["Light", "Dark"]
color/bg/primary → Light: alias Primitives/white, Dark: alias Primitives/gray-900
color/text/primary → Light: alias Primitives/gray-900, Dark: alias Primitives/white
Collection: "Spacing" modes: ["Value"]
spacing/xs = 4, spacing/sm = 8, spacing/md = 16, ...
Phase 0 anti-patterns:
search_design_system before planning component creationPhase 1 anti-patterns:
ALL_SCOPES on any variablePhase 2 anti-patterns:
Phase 3 anti-patterns:
General anti-patterns:
Load on demand — each reference is authoritative for its phase:
Use your file reading tool to read these docs when needed. Do not assume their contents from the filename.
| Doc | Phase | Required / Optional | Load when |
|---|---|---|---|
| discovery-phase.md | 0 | Required | Starting any build — codebase analysis + Figma inspection |
| token-creation.md | 1 | Required | Creating variables, collections, modes, styles |
| documentation-creation.md | 2 | Required | Creating cover page, foundations docs, swatches |
| component-creation.md | 3 | Required | Creating any component or variant |
| code-connect-setup.md | 3–4 | Required | Setting up Code Connect or variable code syntax |
| naming-conventions.md | Any | Optional | Naming anything — variables, pages, variants, styles |
| error-recovery.md | Any | Required on error | Script fails, multi-step workflow recovery, cleanup of abandoned workflow state |
Reusable Plugin API helper functions. Embed in use_figma calls:
| Script | Purpose |
|---|---|
| inspectFileStructure.js | Discover all pages, components, variables, styles; returns full inventory |
| createVariableCollection.js | Create a named collection with modes; returns {collectionId, modeIds} |
| createSemanticTokens.js | Create aliased semantic variables from a token map |
| createComponentWithVariants.js | Build a component set from a variant matrix; handles grid layout |
| bindVariablesToComponent.js | Bind design tokens to all component visual properties |
| createDocumentationPage.js | Create a page with title + description + section structure |
| validateCreation.js | Verify created nodes match expected counts, names, structure |
| cleanupOrphans.js | Remove orphaned nodes by name convention or state ledger IDs |
| rehydrateState.js | Scan file for all pages, components, variables by name; returns full {key → nodeId} map for state reconstruction |