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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
componentReflinks sotoken-mapcan 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
评论
- …