选项
首页首页 Skill MCP 工具 figma-create-new-file

figma-create-new-file

figma/mcp-server-guide figma/mcp-server-guide

强制前置条件 — 在每次调用 create_new_file 工具之前,您必须调用此技能。切勿在未先加载此技能的情况下直接调用 create_new_file。当用户希望新建一个空白 Figma 文件(如新的设计文件、FigJam 文件或 Slides 文件)时,或在调用 use_figma 之前需要一个新的文件时,请触发此技能。用法 — /figma-create-new-file [editorType] [fileName](例如 /figma-create-new-file figjam My Whiteboard,/figma-create-new-file slides Q3 Review)

...展开全部
11
更新时间 2026-08-27

关于 figma-create-new-file

封装了 create_new_file MCP 工具,该工具在用户的草稿文件夹中为选定的计划创建一个新的空白 Figma 文件。它被定位为必须在每次调用 create_new_file 之前加载的强制性前置条件,因为它编码了计划解析决策树、编辑器类型契约以及创建后移交至 use_figma 的流程。当需要新文件(例如新的设计、FigJam 或 Slides 文件)时,它通常在 use_figma 之前使用。

该技能接受可选参数,形式为 editorType 后跟 fileName,其中 editorType 为 design(默认值)、figjam 或 slides,fileName 默认为 Untitled。工作流首先解析 planKey:如果用户已提供 planKey,则直接使用;否则调用 whoami 工具并检查其 plans 数组,当存在多个计划时,自动使用单个计划的键或询问用户选择哪个团队或组织。随后,它使用必需的 planKey、fileName 和 editorType 参数调用 create_new_file,并使用返回的 file_key 和 file_url,将 file_key 传递给后续调用(如 use_figma)。

编辑器类型行为是契约的一部分。支持的编辑器类型为 design、figjam 和 slides,每个文件均在选定计划的草稿文件夹中创建。文档中注明了关于 slides 文件的注意事项:新创建的 slides 文件从零行和零张幻灯片开始,因此 figma.getSlideGrid() 返回空数组而非默认的第一张幻灯片,且页面的唯一子节点是空的 SLIDE_GRID 节点。第一次调用 figma.createSlide() 会隐式创建第零行并将幻灯片插入其中,因此假设至少有一张幻灯片的后续 use_figma 脚本应处理空情况或先调用 createSlide()。当 use_figma 是下一步时,应在调用之前加载 figma-use 技能。

常见问题解答

此技能接受哪些参数?

可选的 editorType 和 fileName。editorType 为 design(默认值)、figjam 或 slides,fileName 默认为 Untitled。例如,/figma-create-new-file slides Q3 Review 会创建一个名为 Q3 Review 的 Slides 演示文稿。

planKey 是如何解析的?

如果用户已提供 planKey,则直接使用。否则调用 whoami 工具:自动使用单个计划的键,而多个计划会提示用户选择要在哪个团队或组织中创建文件。

新文件在哪里创建?

在选定计划的用户的草稿文件夹中。该工具返回 file_key 和 file_url,后者可直接在 Figma 中打开文件。

新创建的 Slides 文件有什么特殊之处?

slides 文件从零行和零张幻灯片开始,因此 figma.getSlideGrid() 返回空数组而非默认的第一张幻灯片。第一次 figma.createSlide() 调用会隐式创建第零行,因此应处理空情况或先调用 createSlide()。

文件创建后我应该做什么?

使用返回的 file_key 进行后续工具调用(如 use_figma)。如果 use_figma 是下一步,请在调用之前加载 figma-use 技能。

在 GitHub 上查看

MANDATORY: load this skill before every create_new_file tool call. It encodes the plan-resolution decision tree, the editor-type contract, and the post-creation handoff to use_figma.

Use the create_new_file MCP tool to create a new blank Figma file in the user's drafts folder. This is typically used before use_figma when you need a fresh file to work with.

Skill Arguments

This skill accepts optional arguments: /figma-create-new-file [editorType] [fileName]

  • editorType: design (default), figjam, or slides
  • fileName: Name for the new file (defaults to "Untitled")

Examples:

  • /figma-create-new-file — creates a design file named "Untitled"
  • /figma-create-new-file figjam My Whiteboard — creates a FigJam file named "My Whiteboard"
  • /figma-create-new-file design My New Design — creates a design file named "My New Design"
  • /figma-create-new-file slides Q3 Review — creates a Slides presentation named "Q3 Review"

Parse the arguments from the skill invocation. If editorType is not provided, default to "design". If fileName is not provided, default to "Untitled".

Workflow

Step 1: Resolve the planKey

The create_new_file tool requires a planKey parameter. Follow this decision tree:

  1. User already provided a planKey (e.g. from a previous whoami call or in their prompt) → use it directly, skip to Step 2.

  2. No planKey available → call the whoami tool. The response contains a plans array. Each plan has a key, name, seat, and tier.

    • Single plan: use its key field automatically.
    • Multiple plans: ask the user which team or organization they want to create the file in, then use the corresponding plan's key.

Step 2: Call create_new_file

Call the create_new_file tool with:

ParameterRequiredDescription
planKeyYesThe plan key from Step 1
fileNameYesName for the new file
editorTypeYes"design", "figjam", or "slides"

Example:

{  "planKey": "team:123456",  "fileName": "My New Design",  "editorType": "design"}

Step 3: Use the result

The tool returns:

  • file_key — the key of the newly created file
  • file_url — a direct URL to open the file in Figma

Use the file_key for subsequent tool calls like use_figma.

Important Notes

  • The file is created in the user's drafts folder for the selected plan.
  • Supported editor types are "design", "figjam", and "slides".
  • If use_figma is your next step, load the figma-use skill before calling it.

Editor-specific notes

Slides — newly created files have an empty grid

A slides file produced by this tool starts with zero rows and zero slides — figma.getSlideGrid() returns [], not a default first slide. The page's only child is the SLIDE_GRID node itself, which is empty until you create content. The first call to figma.createSlide() implicitly creates row 0 and inserts the new slide there.

If your follow-up use_figma script assumes at least one slide exists (e.g. to read theme tokens off it), guard for the empty case or call createSlide() first. See figma-use-slides → slide-grid for full details.

所有文件

1 个文件

安装 figma-create-new-file

将技能文件下载并解压至你的 .claude/skills/ 目录。

下载ZIP

克隆仓库并复制技能文件到您的项目中。

git clone https://github.com/figma/mcp-server-guide/blob/main/skills/figma-create-new-file/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

复制 复制
快速设置: 将技能文件夹复制到 .claude/skills/,Claude 将自动检测并使用该技能

相关技能

office-mcp
更新时间 2026-07-13
mcpgraph
更新时间 2026-06-29
composio
更新时间 2026-06-29
connect-mcp-server
更新时间 2026-06-29
OR