figma-generate-library 是什么?
从代码库和现有Figma文件出发,分阶段建立token、浅深主题、基础文档和可复用组件库。它配合figma-use执行Plugin API,要求先锁定范围,再先变量后组件、逐个检查,并维护节点ID以支持继续和纠错。
中文说明由本站依据来源整理;英文原文保留在页面下方。
适合用在
- 要把已有代码库和 Figma 资产整理成团队可复用的变量、主题、基础说明和组件库,并能分阶段检查与确认。
这些情况不适合
- 要求一次调用就生成整个设计系统;来源明确要求小步执行、逐阶段检查和用户确认。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
figma-generate-library,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 figma-generate-library
请在 Codex 的当前工作环境中安装并检查 figma-generate-library 这个 Skill。
项目身份:openai/skills / figma-generate-library
来源:https://github.com/openai/skills/blob/49f948faa9258a0c61caceaf225e179651397431/skills/.curated/figma-generate-library/SKILL.md
已定位的源文件:skills/.curated/figma-generate-library/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 figma-generate-library
请在 Claude Code 的当前工作环境中安装并检查 figma-generate-library 这个 Skill。
项目身份:openai/skills / figma-generate-library
来源:https://github.com/openai/skills/blob/49f948faa9258a0c61caceaf225e179651397431/skills/.curated/figma-generate-library/SKILL.md
已定位的源文件:skills/.curated/figma-generate-library/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 figma-generate-library
请在 Cursor Agent 的当前工作环境中安装并检查 figma-generate-library 这个 Skill。
项目身份:openai/skills / figma-generate-library
来源:https://github.com/openai/skills/blob/49f948faa9258a0c61caceaf225e179651397431/skills/.curated/figma-generate-library/SKILL.md
已定位的源文件:skills/.curated/figma-generate-library/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 figma-generate-library
请在 当前 Agent 的当前工作环境中安装并检查 figma-generate-library 这个 Skill。
项目身份:openai/skills / figma-generate-library
来源:https://github.com/openai/skills/blob/49f948faa9258a0c61caceaf225e179651397431/skills/.curated/figma-generate-library/SKILL.md
已定位的源文件:skills/.curated/figma-generate-library/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 可写Figma文件、figma-use及对应MCP能力,代码token/组件资料和希望纳入的v1范围。
会得到什么
- Figma变量、样式、文档和组件库,以及阶段记录与未完成项。
实际使用顺序
- 只读盘点代码与Figma现有变量、样式和库资产,处理差异并确认token与组件清单。
- 按来源阶段建立变量和主题、基础说明页面,再按依赖顺序创建单个组件及变体;复用现有库,语义token优先alias而非复制值。
- 每阶段和每组件分别展示结构/截图供确认,保存返回的真实ID和进度,最后核对绑定、命名和界面;画布写调用保持顺序。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
教学示例:用figma-generate-library配合figma-use,只做当前代码与Figma文件的设计系统发现阶段。列出现有颜色、间距、主题与Button/Input可复用情况,提出一个小范围v1清单与冲突,不创建变量、组件或页面。预期得到可供确认的差异与建设计划;本站未写入Figma。
使用条件与边界
- 这是多阶段库建设,来源中的调用次数只是复杂度说明,不是成果或质量配额;不能一口气生成大量未经确认组件。
常见问题
为什么必须先做变量?
组件要绑定颜色、间距和圆角等token,先搭基础可减少后续硬编码和重复改动。
中断后如何继续?
来源要求保留阶段及节点ID,并重新扫描实际文件核对,不能只凭旧聊天记忆猜测节点。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
skills/.curated/figma-generate-library/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
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.
查看源文件章节 / Source sections
- 原文:Design System Builder — Figma MCP Skill
- 原文:1. The One Rule That Matters Most
- 原文:2. Mandatory Workflow
- 原文:3. Critical Rules
- 原文:4. State Management (Required for Long Workflows)
- 原文:5. search_design_system — Reuse Decision Matrix
- 原文:6. User Checkpoints
- 原文:7. Naming Conventions
- 原文:8. Token Architecture
- 原文:9. Per-Phase Anti-Patterns
- 原文:10. Reference Docs
- 原文:11. Scripts
原文:Design System Builder — Figma MCP Skill
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. ---
原文:1. The One Rule That Matters Most
**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. ---
原文:2. Mandatory Workflow
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
本段为节选,完整内容见源文件。
原文:3. Critical Rules
**Plugin API basics** (from use_figma 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.setCurrentPageAsync(page)` at start - `figma.notify()` throws — never use it - Colors are 0–1 range, not 0–255 - Font MUST be loaded before any text write: `await figma.loadFontAsync({family, style})` **Design system rules**: 1. **Variables BEFORE components** — components bind to variables. No token = no component. 2. **Inspect before creating** — run read-only `use_figma` to discover existing conventions. Match them. 3. **One page per component** *(default)* — exception: tightly related families (e.g., Input + helpers) may share a page with clear section separation. 4. **Bind visual properties to variables** *(default)* — fills, strokes, padding, radius, gap. Exceptions: intentionally fixed geometry (icon pixel-grid sizes, static dividers). 5. **Scopes on every variable** — NEVER leave as `ALL_SCOPES`. Background: `FRAME_FILL, SHAPE_FILL`. Text: `TEXT_FILL`. Border: `STROKE_COLOR`. Spacing: `GAP`. Radii: `CORNER_RADIUS`. Primitives: `[]` (hidden). 6. **Code syntax on every variable** — WEB syntax MUST use the `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. 7. **Alias semantics to primitives** — `{ type: 'VARIABLE_ALIAS', id: primitiveVar.id }`. Never duplicate raw values in semantic layer. 8. **Position variants after combineAsVariants** — they stack at (0,0). Manually grid-layout + resize. 9. **INSTANCE_SWAP for icons** — never create a variant per icon. Cap variant matrices: if Size × Style × State > 30 combinations, split into sub-component. 10. **Deterministic naming** — use consistent, unique node names for idempotent cleanup and resumability. Track created node IDs via return values and the state ledger. 11. **No destructive cleanup** — cleanup scripts identify nodes by name convention or returned IDs, not by guessing. 12. **Validate before proceeding** — never build on unvalidat
本段为节选,完整内容见源文件。
原文:4. State Management (Required for Long Workflows)
> **`getPluginData()` / `setPluginData()` are NOT supported in `use_figma`.** Use `getSharedPluginData()` / `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: ```javascript 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: ```json { "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.
本段为节选,完整内容见源文件。
原文:5. search_design_system — Reuse Decision Matrix
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: - Component property API matches your needs (same variant axes, compatible types) - Token binding model is compatible (uses same or aliasable variables) - Naming conventions match the target file - Component is editable (not locked in a remote library you don't own) **Rebuild if** any of these: - API incompatibility (different property names, wrong variant model) - Token model incompatible (hardcoded values, different variable schema) - Ownership issue (can't modify the library) **Wrap if** visual match but API incompatible: - Import the library component as a nested instance inside a new wrapper component - Expose a clean API on the wrapper **Three-way priority**: local existing → subscribed library import → create new. ---
文件 SHA256:7f42103c59fc181d7081404a56545f321c458d97f5ee7f7a0ab2af75ea69a85f
仓库许可证记录:未提供;not-established,查看来源。
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.
历史收录数据
| 来源仓库 | openai/skills |
|---|---|
| Skill源路径 | skills/.curated/figma-generate-library/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
