Skip to main content
skill CX Codex

design-tokens-sync — Claude Code skill: what it does, how to install

design-tokens-sync — a skill for Claude Code tracks drift between canonical design tokens and UI code. It catches hardcoded values, outdated duplicates, and unused variables across stylesheets.

MIT 107 installs ★ 440 updated 2026-10-20

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a claude-code
Open on GitHub

What design-tokens-sync does

This skill scans design tokens in tokens.json or Figma exports and maps them against downstream files like tailwind.config.*, CSS custom properties, and theme objects. If multiple files claim canonical status, the agent asks which source takes priority before changing any files.

It creates token-drift-report.md covering stale definitions, hardcoded raw values in components, orphan tokens, and raw values repeated three or more times. After confirmation, it regenerates downstream files from canonical definitions and can set up an npm run tokens:check script to fail CI on new drift.

Two-way synchronization in a single run is blocked. Near-matches in colors require individual manual approval rather than bulk replacement, preventing accidental overrides of intentional nuances.

What it helps with

  • Find hardcoded hex and spacing values in frontend components
  • Detect outdated token definitions inside Tailwind configurations
  • Generate a categorized token-drift-report.md audit
  • Add a CI check command to fail builds on token drift

Example prompts for the agent

  • Audit my tokens
  • Sync from tokens.json
  • Add the CI guard

How to install design-tokens-sync

1Skills CLI (Vercel)

npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a claude-code

2Manually: put the files in place

~/.claude/skills/design-tokens-sync/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/design-tokens-sync/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about design-tokens-sync

How to install design-tokens-sync in Claude Code?

Run npx skills add OneWave-AI/claude-skills --skill design-tokens-sync -a claude-code.

What does design-tokens-sync do?

It audits token definitions across canonical sources and UI configurations, reports drift, and updates code to reference canonical design tokens.

How does design-tokens-sync guard CI builds?

It configures an npm run tokens:check command that halts CI runs when it finds stale duplicate definitions or new hardcoded near-matches.

Source text

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

Similar skills

All skills for Frontend and UI →

From the same set185

The whole set →
review-response-writer The review-response-writer Claude Code skill drafts review replies in the owner’s voice and sorts reviews by situation. It flags mentions of injury, illness, discrimination, or legal threats for the owner. CX Codex +1 110installs dark-mode-converter The dark-mode-converter Claude Code skill turns a light-only project into a dark theme built around semantic color roles. It also wires up theme switching and saved preferences. CX Codex +1 108installs cowork-folder-organizer cowork-folder-organizer — a skill for Claude Code and Codex that tidies chaotic folders and shared drives. Scans the directory, proposes a folder hierarchy, and waits for user approval before moving any files. CX Codex +1 108installs cowork-hiring-screener cowork-hiring-screener — a Claude Code skill that scores resumes against a job description and ranks candidates with supporting evidence. It takes a resume folder and the role requirements. CX Codex +1 107installs cowork-inbox-triage cowork-inbox-triage — a Claude Code skill that triages unread email via Microsoft 365 or Gmail MCP connectors. Scans threads from the last 24 hours and prepares drafts for review. CX Codex +1 106installs cowork-expense-audit The cowork-expense-audit Claude Code skill checks receipts against statement entries and sorts transactions into expense categories. It produces a ledger plus a memo covering gaps and flagged items. CX Codex +1 106installs cowork-medical-bill-auditor The cowork-medical-bill-auditor Claude Code skill compares medical bills with insurance EOBs. It flags mismatches and drafts dispute letters and call scripts. CX Codex +1 105installs cowork-contract-renewal-radar cowork-contract-renewal-radar — a skill for Claude Code and Codex that audits contract folders, extracts notice terms, and calculates actual renewal decision deadlines. CX Codex +1 105installs

Project sponsors

Companies that keep this analytics open