design-tokens-sync — скилл для Claude Code: суть и установка
Скилл design-tokens-sync для Claude Code ищет расхождения между эталонными дизайн-токенами и стилями интерфейса. Находит захардкоженные цвета, устаревшие копии и забытые токены в кодовой базе.
MIT 107 установок ★ 440 обновлён 2026-10-20
npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a claude-codeЧто делает design-tokens-sync
Скилл сканирует файлы токенов вроде tokens.json или экспорта из Figma и сопоставляет их с кодом в tailwind.config.*, CSS custom properties и файлах тем. При наличии нескольких эталонов агент сначала спрашивает разработчика, какой источник считать каноническим, а не вносит правки вслепую.
Результат сводится в отчёт token-drift-report.md по четырём категориям: устаревшие копии, хардкод значений в компонентах, неиспользуемые токены и повторяющиеся стили без токена. После одобрения агент обновляет вторичные файлы по каноническому источнику, заменяет точные совпадения и предлагает команду npm run tokens:check для контроля в CI.
Скилл запрещает синхронизацию сразу в две стороны за один прогон и требует подтверждать замену близких цветов по отдельности. Значения #0B1121 и #0b1220 могут оказаться намеренной разницей, поэтому автозамена для них отключена.
Какие задачи решает
- Найти захардкоженные цвета и размеры в компонентах
- Выявить устаревшие копии токенов в конфигурации Tailwind и CSS
- Сформировать отчёт token-drift-report.md с категориями расхождений
- Добавить скрипт проверки токенов в пайплайн CI
Примеры запросов агенту
- Проверь мои токены и составь отчёт
- Синхронизируй токены из tokens.json
- Добавь проверку токенов в CI
Как установить design-tokens-sync
1Через Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a claude-code2Вручную: положить файлы
~/.claude/skills/design-tokens-sync/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/design-tokens-sync/
1Через Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a codex2Вручную: положить файлы
.agents/skills/design-tokens-sync/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a cursor2Вручную: положить файлы
.cursor/skills/design-tokens-sync/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install OneWave-AI/claude-skills design-tokens-sync2Вручную: положить файлы
.github/skills/design-tokens-sync/SKILL.md1Через Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a gemini-cli2Командой платформы
gemini skills install https://github.com/OneWave-AI/claude-skills --path design-tokens-syncВручную: положить файлы
.devin/skills/design-tokens-sync/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о design-tokens-sync
Как установить design-tokens-sync в Claude Code?
Установите скилл командой npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a claude-code.
Что делает design-tokens-sync?
Скилл сверяет канонический источник токенов с кодом проекта, строит карту расхождений и заменяет сырые значения на ссылки на токены.
Что нужно для автоматической проверки токенов в CI?
Скилл настраивает скрипт npm run tokens:check, который запускает аудит расхождений и завершает сборку ошибкой при обнаружении хардкода или рассинхрона.
Исходный текст
SKILL.md · MIT
--- name: design-tokens-sync description: Audit and sync design tokens between the source of truth (tokens.json, Figma variables export) and the code that should consume them (Tailwind config, CSS custom properties, theme files). Finds drift -- hardcoded values, orphan tokens, out-of-date copies -- and fixes it in the right direction. tools: Read, Glob, Grep, Write, Edit, Bash model: inherit --- # Design Tokens Sync Keep one source of truth actually true. Every design system decays the same way: a hex gets hardcoded in a hurry, a token gets renamed in Figma but not in Tailwind, a second half-copy of the palette appears in a one-off CSS file. This skill finds the drift, decides direction with the user, and reconciles. ## Workflow 1. **Locate the truths.** Find every place tokens are defined: `tokens.json`/`*.tokens.json` (W3C format), Figma variables export, `tailwind.config.*` theme, CSS custom properties, TS theme objects, SCSS variable files. If more than one claims to be canonical, ask which wins before touching anything -- direction of sync is a human decision. 2. **Build the graph.** For each token: canonical value, every downstream definition, and every consumption site. For each raw value in code (hex, px, rem, ms, cubic-bezier): whether a token exists for it. 3. **Drift report.** Output `token-drift-report.md` in four buckets: - `STALE COPIES` -- downstream definitions that no longer match canonical (with both values) - `HARDCODED` -- raw values in components where a matching token exists (exact match, then near-match within perceptual distance for colors) - `ORPHANS` -- tokens defined but consumed nowhere - `UNTOKENIZED` -- raw values appearing 3+ times with no token; these are tokens waiting to be named 4. **Reconcile on approval.** Stale copies: regenerate downstream from canonical. Hardcoded: replace with token references -- exact matches automatically, near-matches only with per-case confirmation (that slightly-off blue might be intentional). Untokenized: propose names following the existing convention and add to canonical. Orphans: list for deletion; never auto-delete. 5. **Guard.** Offer to add the cheap tripwire: a script (`npm run tokens:check`) that re-runs the drift detection and fails CI on new stale copies or hardcoded near-matches, so the system stays synced after you leave. ## Rules - Never sync both directions in one run. Canonical wins; anything flowing the other way (a designer wants the code's newer value) is an explicit canonical edit first. - Near-match replacement is per-case, never bulk. `#0B1121` vs `#0b1220` may be drift or may be a decision. - Preserve semantic layering: if the system has `color.blue.500 -> color.accent -> button.bg`, fix references at the right layer instead of flattening everything to primitives. - Renames propagate everywhere or nowhere -- a half-renamed token is worse than the old name. - Respect generated files: if `theme.css` is built from `tokens.json`, fix the source and rebuild; never hand-edit output. - The report quantifies health: token coverage percentage (tokenized vs. raw values in components) is the number to move release over release. ## Quick Commands - "Audit my tokens" -- steps 1-3, report only - "Sync from [source]" -- full reconciliation with the named canonical - "What's hardcoded?" -- the HARDCODED bucket only - "Add the CI guard" -- step 5 standalone
© OneWave-AI · MIT · OneWave-AI/claude-skills