Communitygithub.com

figma/figma-use

**必需的前提条件** — 在每次调用 `use_figma` 工具之前,必须先调用此技能。切勿直接调用 `use_figma` 而不先加载此技能,跳过它会导致常见且难以调试的错误。

figma-use 是什么?

这是一个关于 Figma 文件操作的工具技能,作为 `use_figma` 工具的前置条件,它确保 JavaScript 在 Figma 文件上下文中正确执行。该技能强制要求在每次进行写操作(如创建、编辑、删除节点,设置变量或设计令牌,构建组件和变体,修改自动布局或填充,将变量绑定到属性)或需要 JavaScript 执行的独特读操作(如程序化检查文件结构)之前,必须加载。支持的平台包括 Figma 设计工具及相关的 API 接口。通过该技能,开发者可以避免因直接调用 `use_figma` 而导致的常见故障,如运行时错误、数据不一致或操作失败。其核心在于通过标准化的前置加载流程,确保 Figma 文件的上下文环境被正确初始化,从而保障后续操作的稳定性和可预测性。

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

在你喜欢的 AI 中提问

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

文档

figma-use 是做什么的?

必需的前提条件 — 在每次调用 use_figma 工具之前,必须先调用此技能。切勿直接调用 use_figma 而不先加载此技能,跳过它会导致常见且难以调试的错误。当用户希望执行写操作或需要(在 Figma 文件上下文中)通过 JavaScript 执行的独特读操作时触发——例如创建、编辑或删除节点,设置变量或令牌,构建组件和变体,修改自动布局或填充,将变量绑定到属性,或者程序化地检查文件结构。

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-generate-library

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, create individual components with proper variant sets and variable bindings, set up theming (light/dark modes), document foundations, or reconcile gaps between code and Figma. Also use when the user asks to create or generate any component in Figma — even a single one — since components require proper variable foundations, variant states, and design token bindings to be production-quality. 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.

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

相关技能