Communitygithub.com

figma/figma-generate-library

根據程式碼庫在 Figma 中建立或更新專業級設計系統,適用於創建變數/符記、組件庫、主題設定等場景。

figma-generate-library 是什麼?

此技能(figma-generate-library)旨在指導 AI 代理或開發者從現有程式碼庫中,在 Figma 中建立或更新專業級的設計系統。它涵蓋了完整的流程:從創建設計變數(tokens)、組件庫、具有正確變體集與變數綁定的單個組件,到設置主題(如淺色/深色模式)、記錄基礎設計原則,以及協調程式碼與 Figma 之間的差異。此技能重點在於「要建立什麼」以及「建立的順序」,而與其互補的 `figma-use` 技能則專注於「如何」呼叫 Figma Plugin API 來實際執行動作。兩者應同時載入,以確保生成結果具有生產級品質。支援 Figma 平台,適合需要從程式碼無縫生成設計資產的開發者與設計系統團隊。

相容平台~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 技能相輔相成,後者教導「如何」呼叫 Plugin 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.

相關技能