一键导入
sync-figma-token
Sync design tokens between code and Figma variables with strict drift reporting, mandatory approval gate, safe delta apply, and persisted reports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Sync design tokens between code and Figma variables with strict drift reporting, mandatory approval gate, safe delta apply, and persisted reports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | sync-figma-token |
| description | Sync design tokens between code and Figma variables with strict drift reporting, mandatory approval gate, safe delta apply, and persisted reports. |
| disable-model-invocation | true |
| metadata | {"mcp-server":"figma, figma-staging"} |
Use this skill for token parity workflows (code tokens vs Figma variables).
MANDATORY prerequisite: load figma-use before every use_figma call.
After producing dry-run output, you MUST STOP and ask for approval.
use_figma calls in the same turn as dry-run output.Prefer real token sources in this order:
tokens.json, tokens/*.json, DTCG-style)If source format is non-standard, explicitly state assumptions in dry-run output.
direction: code_to_figma (default), figma_to_code, bidirectionaldeletePolicy: default archive_only (NOT delete)conflictPolicy: prefer_code, prefer_figma, manual_reviewnamingPolicy: token key normalization strategymodePolicy: code mode <-> Figma mode mappingNever delete by default. Deletion requires explicit user instruction.
Normalize both sides to canonical rows:
key (canonical token name)type (COLOR, FLOAT, STRING, BOOLEAN)modeValues (light/dark/etc.)aliasTargetscopescodeSyntaxName normalization examples:
color.bg.primary <-> color/bg/primaryNeutral10 <-> Neutral/10 only if explicitly mapped by naming policyDry-run must validate values, not only presence/type.
epsilon = 0.0001Each drift item must include one of:
missing_in_figmamissing_in_codevalue_mismatchalias_mismatchtype_mismatchmode_mismatchscope_mismatchcode_syntax_mismatchbroken_aliasAlways return:
{
"create": 0,
"update": 0,
"aliasFix": 0,
"scopeFix": 0,
"syntaxFix": 0,
"archive": 0,
"delete": 0
}
Then ask:
Dry-run complete. Apply these changes? (yes/no)
Persist report JSON every run:
/tmp/sync-figma-token-dry-run-{runId}.json/tmp/sync-figma-token-final-{runId}.jsonIf file persistence fails, mention that explicitly in output.
When conflicting data is found (type/mode/alias ambiguity):
conflictPolicy=manual_review, list conflicts and STOP.conflictPolicy=prefer_code, update Figma to source values/types.conflictPolicy=prefer_figma, keep Figma and emit drift as informational.Apply deltas in this order:
deletePolicyNever parallelize write use_figma calls.
After apply, run a fresh diff. Success = unresolved drift is zero, or only explicitly approved exceptions remain.