← 返回列表
全部 Skill›内容与媒体 Content & Media›figma-extract

figma-extract

作者 @nexu-io · 语言 en
Pull a Figma file's node tree, design tokens, and embedded assets into the project cwd as a structured snapshot.
内容与媒体 Content & Media设计需海外环境待翻译
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
109,191
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
SKILL.md 原文预览

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.

评论
Nnexu-io
nexu-io
nexu-io/open-design
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@nexu-io
所属大类内容与媒体 Content & Media / 设计
国内可用性需海外环境
最近源活动—
风险提示无
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。