Token map

From skeletorflet/opencode-supreme-setup · View interactive version

Token map is an AI agent skill from the GitHub repository skeletorflet/opencode-supreme-setup. Map an extracted Figma / source-code token bag onto the active OD design system, producing a deterministic mapping the generate stage can consume.

How to use this skill

Skill file

Token map

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.

Inputs

prompt; the atom reads from .od-skills/design-system/DESIGN.md).

Output

project-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.

Convergence

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).

Anti-patterns the prompt fragment forbids

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.

Status

Reserved id, prompt-only fragment in v1. The deterministic mapping

algorithm + DESIGN.md token-extraction helper land in spec §16

Phase 6 alongside figma-extract.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.