design-tokens
Skill0 starsChanged 17 days agoMITView on GitHub
Design, audit, and refactor W3C design tokens. Use when creating palettes, fixing contrast, migrating to OKLCH, setting up dark mode, refactoring raw hexes, or piercing Shadow DOM Web Components.
33 other projects use a version of this.
Adopted by
Most recently taken up by
- ainurdev/mystical-assistanttheir own version, first seen Nov 8, 2026
- gitbutlerapp/gitbutlertheir own version, first seen Nov 8, 2026
- dmlguq456/heartingtheir own version, first seen Nov 8, 2026
- Aboudjem/ui-ux-suitetheir own version, first seen Nov 8, 2026
- drinkspiller/skillstheir own version, first seen Nov 6, 2026
- TomSzenessy/AI_TEMPLATEtheir own version, first seen Nov 6, 2026
Used with
Projects with it also use brief-to-tasks, design-flow and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
julianoczkowskiSkillbrief-to-tasks
Break a design brief into an ordered checklist of independently buildable tasks using vertical slices. Saves as a markdown checklist. Use when user wants to break down work, create tasks from a brief, plan implementation order, or mentions "tasks" or "breakdown".
Also in 7 projects that use this
julianoczkowskiSkilldesign-flow
Run the full design-to-build workflow as a guided sequence. Orchestrates all designer skills in order, from grilling through review. Use when user wants to go through the complete design process, start a project from scratch, run the full flow, or mentions "design flow" or "full workflow".
Also in 6 projects that use this
45ckSkillinformation-architecture
Define the information architecture for a prototype -- sitemap, navigation model, grouping logic, labeling, and action placement.
Also in 10 projects that use this
nandanosqlSkilldesign-brief
Create a design brief that clearly communicates the product context, user needs, constraints, and success criteria to the design team — bridging PM requirements and design execution.
Also in 8 projects that use this
solinkzSkillmicro-interactions
Expert micro-interaction architect for mobile apps, web applications, and responsive websites. Use this skill when the user asks to add, build, fix, audit, or consult on micro-interactions, animations, transitions, motion design, gesture feedback, haptics, loading states, skeleton screens, pull-to-refresh, swipe actions, scroll animations, button states, form validation feedback, toast notifications, modals, dropdowns, toggles, progress indicators, shared element transitions, spring physics, easing curves, motion tokens, or any interaction that provides visual/haptic/auditory feedback to user actions. Triggers on: "micro-interaction", "animation", "transition", "motion", "easing", "spring", "gesture", "haptic", "feedback", "loading state", "skeleton", "shimmer", "pull to refresh", "swipe", "drag", "hover effect", "press state", "focus ring", "scroll animation", "parallax", "stagger", "orchestration", "reduced motion", "View Transitions", "layout animation", "shared element", "hero animation", "morphing", "Framer Motion", "GSAP", "Lottie", "Rive", "React Spring", "anime.js", or any request to make an interface "feel better", "feel alive", "feel snappy", "feel responsive", or "feel polished".
Also in 3 projects that use this
jpoindexterSkilldesign-system-audit
Audit code for design system violations - grid spacing, tokens, existing components
Also in 3 projects that use this
Other versions33 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 33
- gitbutlerapp/gitbutler★ 22ksame name
- plugin87/ux-ui-agent-skills★ 3.1ksame name
- rommapp/argosy-launcher★ 710same name
- julianoczkowski/designer-skills★ 536same name
- glebis/claude-skills★ 410same name
- dylanfeltus/skills★ 179same name
- marcusgoll/Spec-Flow★ 94same name
- mshadmanrahman/claude-for-designers★ 32same name
- ilikescience/design-tokens-skill★ 15same name
- icons8/agent-skills★ 12same name
23 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- setup-pre-tokensSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 30 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Treat the design token system as a deep module:
- Very specific: line 29
Codebase Maturity: Check for existing stylesheets (.css, .scss, styled-components).
- Very specific: line 31
Engine Availability: Verify scripts/token-engine.mjs exists in the folder containing this loaded SKILL.md.
- Very specific: line 56
Run unified sync from the project root: node <skill-root>/scripts/token-engine.mjs sync --spec tokens.config.json --force --out …
- Very specific: line 59
If the project contains sd.config.mjs, run the target's build script: <pm> run tokens:build This is the compiler of record for …
- Very specific: line 62
If sync exits 4 at audit, report failing contrast pairs and remediate via references/contrast.md (remediation ladder).
- Distinctive: line 73
Narration: after migrating, state literals migrated per file and every remaining literal with its reason (unmapped, excluded, generated).
- Very specific: line 78
Run the visualizer compilation pass: node <skill-root>/scripts/token-engine.mjs build --tokens tokens --out build/engine --theme all …
- Very specific: line 82
If build exits 3 (missing or stale audit stamp), return to Step 3 sync — never pass --allow-unaudited.
- Distinctive: line 89
Verify these observable states before completing work:
“Common” is measured: kept by at least 6 in 10 of the 30 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Design Tokens
Transform fragmented, hardcoded styling into an accessible, multi-theme W3C design token architecture with automated contrast certification.
Architecture: Seams and Decoupling
Treat the design token system as a deep module:
- Interface: Semantic CSS custom properties (
var(--semantic-color-*), componentvar(--component-*)) compiled tobuild/tokens.css(+build/tokens.dark.css), with Sass$semantic-color-*aliases where a styles tree consumes them. - Implementation: Perceptually uniform OKLCH color science, APCA $|L_c| \ge 60$ contrast floors, and symmetrical multi-theme polarity inversion.
- Seam: The compiled CSS entry files, plus existing workspace package boundaries (
@tokens) only where the project already packages tokens. - Locality & Leverage: Alter brand decisions in one central token definition; all downstream components adapt automatically.
- The Deletion Test: Deleting the token definitions exposes raw values across dozens of components; keeping them encapsulates styling complexity behind a one-line seam.
- Human presence: The human is a present participant, never a per-action approver. Checkpoint — at a named seam, show evidence or an artifact, state your recommendation and reason, invite a reaction, and pause where the step says so. Gate — hard pause; proceeding without the human is unsafe. Narration — during deterministic stretches, state findings and results in one batched update per step; never seek confirmation for individual commands or file writes. Never ask the human for a fact you can read; always show the human a judgment you inferred from facts. An instruction to proceed autonomously ("just do it", "don't ask") is an autonomous opt-out: state it once, checkpoints become narrated stated-defaults, Gates still pause. A session that cannot receive replies counts as autonomous opt-out; list skipped checkpoints at yield.
Process
1. Context Triage
Inspect repository structure before creating or editing files:
- Codebase Maturity: Check for existing stylesheets (
.css,.scss, styled-components). In brownfield projects, followreferences/discovery-and-evidence.mdto inspect baseline contrast debt without modifying files. A missing group is itself a finding ('no styles found — greenfield'). - Tooling & Setup Detection: Inspect for
setup-pre-tokensartifacts (sd.config.mjs,sd.dark.config.mjs,tokens/**/*.tokens.json,"tokens:build"inpackage.jsonscripts). Check for an existingtokens.config.json. Detect package manager via lockfiles (pnpm-lock.yaml→pnpm,yarn.lock→yarn,bun.lockb/bun.lock→bun, elsenpm). If the conversation contains asetup-pre-tokensHandoff context block, treat its lines as stated defaults and verify each against disk; disk evidence wins, and any conflict is named in the evidence brief. - Engine Availability: Verify
scripts/token-engine.mjsexists in the folder containing this loadedSKILL.md. If missing, stop and report the skill installation is incomplete — do not hand-author tokens. - Runtime & Seam Scoping: Identify Shadow DOM Web Components (target
:host, :root), Tailwind v4 (target@theme), or standard DOM (target:root). Check whether an existing@tokenspackage or bundler alias already exists. - Review-Only Requests: For audit- or review-only tasks with no token mutations requested, run
diagnoseand render perreferences/diagnose-and-report.md. After rendering, present the top recommendation in chat and offer exactly two continuations — fix now (leaves review-only mode) or stop at the report; never mutate on a review-only request without that new instruction. - Checkpoint (evidence brief): State findings as evidence lines (
"<path>: <fact>", perreferences/discovery-and-evidence.md) plus the two calls they feed — greenfield vs brownfield, compiler of record — before Step 2. Pause for correction only when a call is ambiguous (mixed maturity signals, existing tokens with unclear replace-vs-keep posture, review-only vs mutation unclear); otherwise continue into Step 2 with findings as stated defaults. - Done when: The compiler of record is identified (target
tokens:buildifsd.config.mjspresent, else engine build artifacts, else hand-maintained CSS), engine presence is verified, and the evidence brief has been stated with any ambiguities resolved by the user.
2. Socratic Aesthetic Synthesis
Translate brand intent into harmonious OKLCH anchors:
- Greenfield: Guide palette selection with mood metaphors and aesthetic clusters. Conduct a structured interview using
references/palette.md(≤7 questions: asked as one batch, evidence defaults pre-stated, plain-language labels per the palette plain↔technical table; personality adjectives → cluster, primary anchor color, ramp steps [5, 9, 11], typography family + line-height [1.25, 1.5, 1.75], density [comfortablevscompact], corner radii presets). The pick is confirmed at the palette read-back checkpoint below before recording intotokens.config.jsonmatchingassets/tokens.config.example.json. - Brownfield: Consolidate mined colors into unified functional roles via semantic intent clustering (collapsing drifting hues into purposeful ramps).
- Engine extraction: Run extraction to mine candidate anchors from code, a URL, or an HTML file, consulting
references/discovery-and-evidence.mdto interpret scoring:node <skill-root>/scripts/token-engine.mjs extract --root . --out tokens.config.json --audit-baselinenode <skill-root>/scripts/token-engine.mjs extract --url <url> --out tokens.config.jsonnode <skill-root>/scripts/token-engine.mjs extract --html <file.html> --out tokens.config.json - Present the extract candidate table before proposing roles: relay the CLI
evidence:lines (top candidates with source/name), mark the winner and the runners-up it beat, state why the winner won in scoring terms (role-name hits, chroma, recurrence — perreferences/discovery-and-evidence.md), list every clustering collapse (source colors → functional role) and every stated default (font, radius, density, type ratio). Generation never precedes this table.
- Engine extraction: Run extraction to mine candidate anchors from code, a URL, or an HTML file, consulting
- Checkpoint (palette read-back): Read back the whole pick (cluster, role, name, OKLCH, reason; every vibe adjustment with its reason; brownfield: the candidate table verdicts) and pause. The user may approve, veto a winner in favor of a runner-up, or adjust defaults — a veto edits
tokens.config.jsonat read-back or re-runs extract with--force. Record only after the reaction. - Done when: The user has reacted to the palette read-back (approved or adjusted roles and anchors), or an autonomous opt-out is in effect with the read-back stated as recorded defaults.
Before running a command: state the resolved value of <skill-root> in your reply, then substitute it. If you cannot resolve it, stop and ask the user for the design-tokens skill folder. Never run a command containing literal < or >.
3. Architect Tokens
Construct or replace the 3-tier DTCG token hierarchy:
- Contract: Formulate brand decisions in
tokens.config.jsonperreferences/token-system.md. - Execution:
- Narration: state in one line that all tiers regenerate from the recorded spec (
--forceadopts the existing tree); after sync, state the audit outcome and every remediation applied (override path old → new, or anchor old → new). - Run unified sync from the project root:
node <skill-root>/scripts/token-engine.mjs sync --spec tokens.config.json --force --out build/engine --theme allFlags:--forceadopts the existing tree and regenerates all tiers from the spec;--out build/engineparks advisory artifacts (tokens.js,theme.css,DESIGN.md) safely away from target build files;--theme allcompiles all themes. - If the project contains
sd.config.mjs, run the target's build script:<pm> run tokens:buildThis is the compiler of record forbuild/tokens.css,build/tokens.dark.css, and<stylesRoot>/abstracts/_variables.scss. If nosd.config.mjsexists, the engine outputbuild/engine/tokens.cssis the compiled record and the import target. - If sync exits 4 at audit, report failing contrast pairs and remediate via
references/contrast.md(remediation ladder). Step-move overrides are autonomous and narrated; an anchor shift is a checkpoint — seecontrast.mdladder step 2. Never pass--allow-unaudited. - Targeted subcommands and flag reference are documented in
references/engine-and-build.md§6 (or vianode <skill-root>/scripts/token-engine.mjs <cmd> --help); exit codes follow the 0 ok / 2 usage / 3 refusal / 4 audit fail / 5 validation taxonomy.
- Narration: state in one line that all tiers regenerate from the recorded spec (
- Done when: The token tree contains complete feedback roles and component tokens,
build/tokens.css(viatokens:build) orbuild/engine/tokens.cssis regenerated, every remediation override/anchor shift has been stated, and marginal pairs (4.5–4.8) are carried to Step 5 — never silently passed.
4. Codebase Modernization
Wire tokens into host components:
- Checkpoint (migration preview): Before editing, state the scope — files containing color/spacing literals, literal counts per file, exclusions (generated files, token JSON). Proceed in the same turn when every literal maps unambiguously to a semantic role; pause only for unmapped literals (list them; the user assigns a role or excludes them) or for scope outside the styles/components tree found in Step 1.
- Pierce Shadow DOM boundaries by injecting compiled CSS inline into
:hostscopes. - In Sass projects, consume generated
$semantic-color-*and$component-*variables. Re-runnpm run tokens:buildafter token updates soabstracts/_variables.scssstays current. - Replace hardcoded color literals with semantic custom properties (
background: var(--semantic-color-bg-canvas)). Consultreferences/token-system.mdfor layout-role bindings when replacing spacing literals. - Establish
@tokenspackage aliasing only if a workspace tokens package already exists or the user explicitly requests one (sync --package @tokens). In standard projects, import directly frombuild/tokens.css(orbuild/engine/tokens.csswhensd.config.mjsis absent). - Narration: after migrating, state literals migrated per file and every remaining literal with its reason (unmapped, excluded, generated).
- Done when: Hardcoded styling literals in host components are migrated to semantic tokens, the migration preview was stated, and every unmapped literal has a recorded disposition (role assigned or excluded by the user, or stated under autonomous opt-out).
5. Visual Proof
Generate visual verification through the engine's built-in visualizer:
- Run the visualizer compilation pass:
node <skill-root>/scripts/token-engine.mjs build --tokens tokens --out build/engine --theme all --visualizer --force - Launch
build/engine/visualizer.htmlin the default browser using Bash (openon macOS,starton Windows,xdg-openon Linux). If launch fails, display the absolute path. - Checkpoint (visual review): Tell the user what to inspect — ramps (anchor at step 500), semantic role badges, typography specimen, component specimens, and any marginal pairs carried from Step 3 — and pause for a reaction. Accept → done. Adjust (color, density, radii, type) → return to the Step 2 read-back (edit
tokens.config.json), re-run Step 3 sync, regenerate the visualizer, and re-present. Under autonomous opt-out, report the path and note the review was skipped by opt-out. - If build exits 3 (missing or stale audit stamp), return to Step 3 sync — never pass
--allow-unaudited. - Done when:
build/engine/visualizer.htmlexists, was presented for human review, and the reaction is recorded (accepted, adjustments applied and re-presented, or autonomous opt-out stated).
Pre-Yield Checklist
Verify these observable states before completing work:
- Raw
#hexorrgba()literals in styled components are migrated tovar(--semantic-color-*)(or Sass$equivalents). - Every component token resolves through a semantic token alias.
build/tokens.css(viatokens:build) orbuild/engine/tokens.csswas regenerated this run and application stylesheet imports resolve cleanly.token-engine syncexited 0 with a verified audit stamp intokens/.token-engine-audit.json.- Human reaction to the visualizer is recorded (accepted / adjustments applied / autonomous opt-out stated), and the palette read-back reaction preceded generation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

