Communitygithub.com

figma/figma-generate-library

从代码库在Figma中构建或更新专业级设计系统。当用户想要创建变量/令牌、构建组件库、创建具有正确变体集和变量绑定的单个组件、设置主题(亮/暗模式)、记录基础规范、或弥合代码与Figma之间的差距时使用。

figma-generate-library 是什么?

figma/figma-generate-library 是一个面向AI代理的技能,旨在指导开发者从现有代码库在Figma中生成或更新专业级设计系统。它专注于定义“构建什么”以及“以何种顺序构建”,确保每个步骤——从创建设计令牌和变量,到构建具有变体集和变量绑定的组件库——都遵循生产级标准。该技能特别适用于设置主题(如亮/暗模式)、记录设计基础,以及协调代码与Figma设计之间的不一致。它与 figma-use 技能互补,后者专注于“如何调用”Figma插件API;建议两者同时加载以实现端到端的设计系统工作流。支持任何AI代理平台,如Claude Code、Cursor或Codex。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/figma/mcp-server-guide/tree/main/skills/figma-generate-library

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

figma-generate-library 是做什么的?

从代码库在Figma中构建或更新专业级设计系统。当用户想要创建变量/令牌、构建组件库、创建具有正确变体集和变量绑定的单个组件、设置主题(亮/暗模式)、记录基础规范、或弥合代码与Figma之间的差距时使用。当用户要求在Figma中创建或生成任何组件(即使只有一个)时也应使用,因为组件需要正确的变量基础、变体状态和设计令牌绑定才能达到生产质量。此技能教授“构建什么”以及“以何种顺序构建”——它补充了 figma-use 技能,后者教授“如何调用”插件API。应同时加载两个技能。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

figma/code-connect-components

Connects Figma design components to code components using Code Connect. Use when user says "code connect", "connect this component to code", "connect Figma to code", "map this component", "link component to code", "create code connect mapping", "add code connect", "connect design to code", or wants to establish mappings between Figma designs and code implementations. Requires Figma MCP server connection.

figma/create-design-system-rules

Generates custom design system rules for the user's codebase. Use when user says "create design system rules", "generate rules for my project", "set up design rules", "customize design system guidelines", or wants to establish project-specific conventions for Figma-to-code workflows. Requires Figma MCP server connection.

figma/figma-code-connect

Creates and maintains Figma Code Connect template files that map Figma components to code snippets. Use when the user mentions Code Connect, Figma component mapping, design-to-code translation, or asks to create/update .figma.ts or .figma.js files.

figma/figma-create-design-system-rules

Generates custom design system rules for the user's codebase. Use when user says "create design system rules", "generate rules for my project", "set up design rules", "customize design system guidelines", or wants to establish project-specific conventions for Figma-to-code workflows. Requires Figma MCP server connection.

figma/figma-create-new-file

**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `create_new_file` tool call. NEVER call `create_new_file` directly without loading this skill first. Trigger whenever the user wants a new blank Figma file — a new design, FigJam, or Slides file — or when you need a fresh file before calling `use_figma`. Usage — /figma-create-new-file [editorType] [fileName] (e.g. /figma-create-new-file figjam My Whiteboard, /figma-create-new-file slides Q3 Review)

figma/figma-generate-design

Use this skill alongside figma-use when the task involves translating an application page, view, or multi-section layout into Figma. Triggers: 'write to Figma', 'create in Figma from code', 'push page to Figma', 'take this app/page and build it in Figma', 'create a screen', 'build a landing page in Figma', 'update the Figma screen to match code', 'convert this modal/dialog/drawer/panel to Figma'. This is the preferred workflow skill whenever the user wants to build or update a full page, modal, dialog, drawer, sidebar, panel, or any composed multi-section view in Figma from code or a description. Discovers design system components, variables, and styles from Code Connect files, existing screens, and library search, then imports them and assembles views incrementally section-by-section using design system tokens instead of hardcoded values.

figma/figma-implement-design

Translates Figma designs into production-ready application code with 1:1 visual fidelity. Use when implementing UI code from Figma files, when user mentions "implement design", "generate code", "implement component", provides Figma URLs, or asks to build components matching Figma specs. For Figma canvas writes via `use_figma`, use `figma-use`.

figma/figma-use

**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.

figma/implement-design

Translates Figma designs into production-ready code with 1:1 visual fidelity. Use when implementing UI from Figma files, when user mentions "implement design", "generate code", "implement component", "build Figma design", provides Figma URLs, or asks to build components matching Figma specs. Requires Figma MCP server connection.

相关技能