npx skills add ...
npx skills add firebenders/sync-figma-token-skill --skill sync-figma-token
Sync design tokens between code and Figma variables with strict drift reporting, mandatory approval gate, safe delta apply, and persisted reports.
npx skills add firebenders/sync-figma-token-skill --skill sync-figma-token
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:
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.