token-map
Что он делает
Эта программа помогает упорядочить визуальные стили дизайна (например, цвета и шрифты), чтобы они хорошо работали с существующей дизайн-системой. Она сравнивает стили вашего дизайна со стилями, определенными в дизайн-системе, и создает карту соответствий, чтобы все совпадало.
Когда использовать
- ✓При переносе дизайна из Figma в код.
- ✓При обновлении существующего дизайна под новую дизайн-систему.
- ✓Когда нужно, чтобы все визуальные стили (цвета, шрифты, отступы) были согласованы между дизайном и дизайн-системой.
Ссылка на скилл
https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/token-map/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Пожалуйста, сопоставь токены цветов и типографики из моего дизайна с активной дизайн-системой.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Программа анализирует визуальные стили (токены) из вашего дизайна, извлеченные из Figma или кода. Она пытается определить назначение каждого стиля (например, является ли он основным цветом или стилем заголовка), исходя из того, как он используется в дизайне. Затем она создает файл, в котором показано, какому стилю дизайн-системы соответствует каждый стиль вашего дизайна.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
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
figma/tokens.jsonfromfigma-extract(figma-migration), ORcode/tokens.jsonfromdesign-extract(code-migration).- The active design system DESIGN.md (already injected into the prompt; the atom reads from the staged design-system context).
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.
Semantic token inference
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:
- Node path, component name, instance overrides, variant/state labels,
frame name, layer name, and nearby text such as
Primary,Selected,Link,Error,Focus,Nav,Button, orCTA. - CSS-like position in the rendered tree: background fill, foreground text/icon, border, divider, overlay, shadow tint, focus ring, status badge, chart series, or brand/accent treatment.
- Contrast relationships: a color paired repeatedly with the main 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.
- Reuse topology: a value that appears across primary buttons,
selected tabs, and active nav items is stronger evidence for
--ds-color-primarythan 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:
{
"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.
Before / after expectation
Without semantic inference, an anonymous Figma token can only produce an uncertain value-level mapping:
{
"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:
{
"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.
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
…
Частые вопросы
Что такое «токены»?
Токены это базовые элементы визуальных стилей дизайна, например конкретный цвет (синий #0000FF), размер шрифта (16px) или значение отступа (8px).
Что произойдет, если у стиля из моего дизайна нет аналога в дизайн-системе?
Программа перечислит такие стили в файле unmatched.json и объяснит, почему их не удалось сопоставить. Так вы сможете проверить их и решить, что с ними делать вручную, а не получить что-то придуманное программой.
Как программа понимает, какой стиль из моего дизайна соответствует какому стилю в дизайн-системе?
Она использует подсказки из дизайна, например названия компонентов, контекст использования стиля (например, текст кнопки) и связи между цветами, чтобы определить назначение стиля и найти лучшее соответствие в дизайн-системе.
Подробности
Оригинальное описание автора
Map an extracted Figma / source-code token bag onto the active OD design system, producing a deterministic mapping the generate stage can consume.
repo: nexu-io/open-design
Популярность
- Звёзды на GitHub
- 101k
- Место в рейтинге
- #990
- Лицензия
- Apache-2.0
- Обновлён
- 15.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
sample-plugin
101kАгент создаёт файл метаданных для тестов, чтобы код правильно работал в разных ситуациях.
aster-atelier
101kПомогает агенту создать художественный сайт в классическом стиле: изысканные образы, голубое небо и шрифты с засечками.
audio-jingle
101kАгент генерирует звук, например джинглы и звуковые эффекты, создаёт музыку и голоса и сохраняет результат в аудиофайл.
blog-post
101kПомогает агенту писать длинные статьи и посты для блога с местом для изображений, цитат и информации об авторе.
Похожие скиллы
canvas
394kПозволяет агенту показать размещенный визуальный виджет на подключенной панели Mac, а затем скрыть панель или перенести ее на другую страницу.
control-ui
394kПомогает агенту упорядочивать интерфейс управления OpenClaw и устранять неполадки в нем, включая сессии, панели и подключенные Gateway.
diagram-maker
394kПомогает агенту создавать понятные диаграммы в форматах SVG, HTML или редактируемом Excalidraw для процессов, архитектуры систем и эскизов на доске.