跳到正文
Skillpedia
界面(UI/UX)101k · #985

figma-extract

它能做什么

这个工具会读取一个 Figma 文件,并把其中的核心信息保存到你的电脑上。它会以有条理的格式提取设计结构、样式(比如颜色和字体)以及图片。

适用场景

  • ✓当你想在本地保存一份 Figma 设计的副本时。
  • ✓当你准备在其他地方使用 Figma 中的样式和图片时。
  • ✓想为某个时间点的设计留下一份正式记录时。

技能链接

https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/figma-extract/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/figma-extract/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“把我的 Figma 设计保存成一个有条理的文件。”

每周 5 个新技能,1 分钟读完。

工作原理

你需要提供 Figma 文件的链接和特殊授权(OAuth 令牌)。工具随后会下载全部内容,并把它们整理到你电脑上的文件夹里。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Figma extract

Spec §10 / §21.3.1: the figma-migration scenario starts with a Figma file URL + an OAuth token. This atom turns that pair into the authoritative on-disk record subsequent stages (token-map, generate, critique) operate on.

Inputs

Source Required Notes
Figma file URL or node-id yes Provide via the figma-oauth GenUI surface or od plugin apply --input fileUrl=…
Figma OAuth token yes Routed through oauth-prompt with oauth.route='connector' and connectorId='figma'; the daemon never stores the token in SQLite

Output

The atom writes a deterministic, JSON-shaped extract under the project cwd:

project-cwd/
├── figma/
│   ├── tree.json        # canonical node tree (id / type / parent / children / box / fills / text)
│   ├── tokens.json      # color + typography + spacing tokens lifted off the file
│   ├── assets/          # rasterised exports of every leaf node that the file marks for export
│   │   └── <node-id>.<png|svg|webp>
│   └── meta.json        # { fileUrl, version, lastModified, exportedAt, atomDigest }

figma/tree.json is the canonical pivot for every downstream atom. figma/tokens.json is the input to token-map. assets/ is the input to generate's media stage.

Convergence

The atom completes when figma/tree.json exists and is non-empty. The until evaluator reads figma.tree.nodes >= 1; if the figma file is empty or the OAuth token expired, the atom emits a clear error event and the run aborts (the user fixes auth or picks a different file).

Anti-patterns the prompt fragment forbids

  • Synthesising a tree from screenshots when the OAuth path failed — always re-prompt the user; never make up node ids.
  • Dropping unsupported node types silently; record them in meta.json.unsupportedNodes[] so the human can audit gaps.
  • Treating component instances as duplicates; record componentRef links so token-map can de-duplicate at the right boundary.

Status

Implemented by the daemon runner in apps/daemon/src/plugins/atoms/figma-extract.ts. It fetches and walks the Figma REST tree, records unsupported nodes, lifts tokens, and rasterizes supported assets.

常见问题

什么是“设计令牌”(design tokens)?

设计令牌是设计中的基础样式,比如使用的精确颜色、字号以及元素之间的间距。

如果 Figma 文件是空的,或者授权过期了会怎样?

工具会给出清晰的错误提示,方便你修复授权,或者换一个文件。

如果无法访问 Figma,工具会自己猜测设计内容吗?

不会。它从不编造信息。如果出现问题,它会请你修复,或者选择其他文件。

详情

作者的原始描述

Pull a Figma file's node tree, design tokens, and embedded assets into the project cwd as a structured snapshot.

repo: nexu-io/open-design

热度

GitHub 星标
101k
排名
#985
许可证
Apache-2.0
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能