Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Map an extracted Figma / source-code token bag onto the active OD design system, producing a deterministic mapping the generate stage can consume.
.claude/skills/nexu-io-token-map/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -17% | 0% |
Spec §10 / §21.3.1: every figma-migration / code-migration run crosses the same boundary — "the source has its own tokens; the target uses the active OD design system; we need a deterministic mapping". This atom produces that mapping.
figma/tokens.json from figma-extract (figma-migration), ORcode/tokens.json from design-extract (code-migration).prompt; the atom reads from the staged design-system context).
textproject-cwd/ └── token-map/ ├── colors.json # { source: '#hex' | 'tokenName', target: '--ds-token' }[] ├── typography.json # font + size + weight pairings ├── spacing.json # spacing scale crosswalk ├── unmatched.json # { source: ..., reason: 'no-target-equivalent' }[] └── meta.json # { sourceKind: 'figma' | 'code', generatedAt, atomDigest }
unmatched.json is the audit list a human reviews; the agent must not invent target tokens silently.
Figma often exports anonymous source names such as color-3, paint/17, or raw #5B8DEF. Do not ask the user to rename those before mapping. First infer the semantic role from usage evidence:
frame name, layer name, and nearby text such as Primary, Selected, Link, Error, Focus, Nav, Button, or CTA.
text/icon, border, divider, overlay, shadow tint, focus ring, status badge, chart series, or brand/accent treatment.
canvas is likely foreground; one paired with foreground inside CTA components is likely primary/accent background; a thin outline around interactive elements is likely border or focus-ring.
selected tabs, and active nav items is stronger evidence for --ds-color-primary than a value that appears once in an illustration.
Use that role evidence to choose among existing active design-system tokens and to decide whether an anonymous token should be renamed or left unmatched before the executable mapping pass. Keep the on-disk token-map contract unchanged: the atom still writes the existing bucket files, unmatched.json, and meta.json only.
For example, this is a useful reasoning note for deciding whether color-3 should map to the active primary token:
jsonc{ "source": "color-3", "value": "#5B8DEF", "role": "primary", "targetCandidates": ["--ds-color-primary", "--ds-color-link"], "evidence": [ "Button/Primary fill", "Selected tab indicator", "Link text in Settings frame" ] }
Then map to an active design-system token only when the evidence is role-based, not value-only. If the top candidates are too close to call, or if the evidence points to conflicting roles (primary vs link vs focus-ring), leave the source token unmatched using the existing no-target-equivalent reason and include the competing candidates in the hint. This keeps automation useful for common anonymous-token cases while preserving human review for ambiguous brand decisions.
Without semantic inference, an anonymous Figma token can only produce an uncertain value-level mapping:
jsonc{ "source": "color-3", "value": "#5B8DEF", "target": null, "reason": "no-target-equivalent" }
With semantic inference, the same token should carry role evidence before it is accepted:
jsonc{ "source": "color-3", "value": "#5B8DEF", "target": "--ds-color-primary", "via": "name" }
This deterministic v1 atom does not claim a measured accuracy lift by itself. Treat the expected improvement as coverage of previously manual anonymous-token cases when the Figma tree contains enough role evidence. Real accuracy numbers require a fixture suite with known source tokens, expected semantic roles, and a before/after agent run. See examples/semantic-inference-before-after.json for a deterministic same-token-batch simulation that compares the old value-level output with the semantic inference output.
The atom completes when every input token is either mapped or explicitly recorded under unmatched.json with a non-empty reason. The until evaluator reads tokens.unmatched.length === 0 on strict mode; default is "soft converge" (proceed with unmatched.json populated).
approval (use a confirmation GenUI surface for that).
thresholds belong in the visual-diff evaluator (Phase 7).
silently; record collisions in unmatched.json with reason target-collision.
Implemented by the daemon runner in apps/daemon/src/plugins/atoms/token-map.ts. It parses design-system tokens, performs deterministic mapping, and writes the mapped and unmatched outputs.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | pass→pass | 17,512 | 21,056 | +20% | 1 | 1 | 0% | 3,701 | 5,130 | +39% | 0 | 0 | — |
case-01 | fail→fail | 5,084 | 15,126 | +198% | 1 | 1 | 0% | 329 | 1,564 | +375% | 0 | 0 | — |
case-02 | fail→fail | 33,026 | 4,362 | -87% | 1 | 1 | 0% | 6,374 | 1,703 | -73% | 0 | 0 | — |
case-03 | fail→fail | 29,546 | 17,002 | -42% | 1 | 1 | 0% | 6,079 | 1,931 | -68% | 0 | 0 | — |
case-04 | fail→pass | 16,998 | 6,852 | -60% | 1 | 1 | 0% | 2,735 | 2,433 | -11% | 0 | 0 | — |
case-05 | fail→pass | 9,826 | 5,595 | -43% | 1 | 1 | 0% | 1,816 | 2,110 | +16% | 0 | 0 | — |
case-06 | fail→pass | 17,201 | 6,699 | -61% | 1 | 1 | 0% | 2,402 | 2,561 | +7% | 0 | 0 | — |
case-07 | pass→pass | 13,333 | 12,376 | -7% | 1 | 1 | 0% | 2,275 | 3,719 | +63% | 0 | 0 | — |
case-08 | fail→pass | 13,257 | 6,787 | -49% | 1 | 1 | 0% | 1,886 | 2,505 | +33% | 0 | 0 | — |
case-09 | fail→pass | 16,937 | 5,718 | -66% | 1 | 1 | 0% | 2,658 | 2,206 | -17% | 0 | 0 | — |
case-10 | fail→pass | 12,310 | 4,021 | -67% | 1 | 1 | 0% | 2,063 | 1,815 | -12% | 0 | 0 | — |
case-11 | pass→pass | 12,001 | 5,392 | -55% | 1 | 1 | 0% | 2,254 | 2,330 | +3% | 0 | 0 | — |
case-12 | fail→pass | 15,036 | 5,039 | -66% | 1 | 1 | 0% | 2,113 | 2,256 | +7% | 0 | 0 | — |
case-13 | fail→pass | 9,908 | 3,653 | -63% | 1 | 1 | 0% | 1,565 | 1,831 | +17% | 0 | 0 | — |
case-14 | pass→pass | 8,829 | 2,874 | -67% | 1 | 1 | 0% | 1,220 | 1,844 | +51% | 0 | 0 | — |
case-15 | pass→pass | 7,074 | 2,803 | -60% | 1 | 1 | 0% | 1,215 | 1,659 | +37% | 0 | 0 | — |
case-16 | pass→pass | 25,854 | 3,066 | -88% | 1 | 1 | 0% | 1,651 | 1,678 | +2% | 0 | 0 | — |
case-17 | fail→pass | 13,544 | 2,506 | -81% | 1 | 1 | 0% | 1,663 | 1,649 | -1% | 0 | 0 | — |
case-18 | fail→pass | 13,503 | 6,235 | -54% | 1 | 1 | 0% | 2,318 | 2,163 | -7% | 0 | 0 | — |
case-19 | pass→pass | 10,965 | 4,195 | -62% | 1 | 1 | 0% | 1,445 | 2,034 | +41% | 0 | 0 | — |
case-20 | pass→pass | 33,297 | 33,414 | +0% | 1 | 1 | 0% | 4,431 | 6,444 | +45% | 0 | 0 | — |
case-21 | pass→pass | 27,170 | 26,687 | -2% | 1 | 1 | 0% | 4,861 | 5,622 | +16% | 0 | 0 | — |
case-23 | pass→pass | 21,062 | 21,148 | +0% | 1 | 1 | 0% | 3,173 | 4,850 | +53% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 20 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +43 percentage points is the difference between those two pass rates over the 20 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.