tokens
Skill1 starsChanged 3 months agoMITView on GitHub
Compile the finished design-system decisions (color, typography, spacing, radius, shadow, easing, animation) into Tailwind CSS v4 @theme tokens in app/globals.css — the single authoring source every component consumes across three token tiers. Writes the :root/.dark oklch variables, the @theme inline bridge, the fluid clamp() type scale, the --spacing multiplier, --animate-* keyframes, the @layer order that overrides shadcn without !important, @property-typed tokens so animatable colors interpolate, and the resolved-hex lib/tokens.ts export for email/OG. Invoke in the Foundation phase AFTER ultraweb:color, ultraweb:typography, ultraweb:motion-language and ultraweb:shape-language have written design/SYSTEM.md; also when globals.css must be created or regenerated, when the user says "set up the design tokens", "wire the theme", "add a token", "export tokens for email/OG", "make a token animatable", "update globals.css", or when components are found hardcoding values that belong in the system.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- dkadts/landing-kit-buildingtheir own version, first seen Aug 19, 2026
- educlopez/ui-crafttheir own version, first seen Aug 17, 2026
- 15yotsuka/claude-skillstheir own version, first seen May 22, 2026
- aibtcdev/skillstheir own version, first seen May 11, 2026
- PeterCang/claude-tokens-plugintheir own version, first seen Apr 15, 2026
Used with
Projects with it also use audit.
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.
OpenAISkillaudit
Audit or critique a product flow, journey, workflow, funnel, onboarding path, checkout path, settings path, screen, or multi-step product experience by capturing screenshots first, then reporting UX, design, and accessibility findings inline from that evidence. Use Figma only when the user explicitly asks for a board. Use when the user asks to audit, review, critique, inspect, assess, analyze, evaluate, or give feedback on a product experience.
Also in 3 projects that use this
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- educlopez/ui-craft★ 367same name
- aibtcdev/skills★ 10same name
- dkadts/landing-kit-building★ 2same name
- PeterCang/claude-tokens-plugin★ 1same name
- 15yotsuka/claude-skills★ 0same name
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 repository79 other files it gives its agents.
- ultrawebSkill
- analyticsSkill
- animejsSkill
- api-designSkill
- app-structureSkill
- assetsSkill
- authSkill
- award-canonSkill
- briefSkill
- buttonsSkill
- cardsSkill
- cartSkill
- checkpointSkill
- colorSkill
- command-paletteSkill
- component-apiSkill
- consentSkill
- content-cmsSkill
- copywritingSkill
- databaseSkill
- data-displaySkill
- data-fetchingSkill
- depthSkill
- directionSkill
- emailSkill
- faqSkill
- feature-sectionsSkill
- footerSkill
- formsSkill
- gate-accessibilitySkill
- gate-antislopSkill
- gate-codeSkill
- gate-contentSkill
- gate-performanceSkill
- gate-responsiveSkill
- gate-visualSkill
- handoffSkill
- heroSkill
- hidden-craftSkill
- i18nSkill
- iconsSkill
- identitySkill
- imagerySkill
- iterateSkill
- layout-gridSkill
- marginaliaSkill
- media-optimizationSkill
- micro-interactionsSkill
- mockupSkill
- motion-languageSkill
- navigationSkill
- overlaysSkill
- page-transitionsSkill
- paymentsSkill
- physicsSkill
- previewSkill
- pricingSkill
- print-craftSkill
- product-detailSkill
- retrofitSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Every SYSTEM.md decision becomes a token.
- Distinctive: line 25
Read SYSTEM.md §color/§type/§layout/§depth/§shape/§motion.
- Very specific: line 26
Write :root and .dark as plain CSS variables — the color skill's value table, verbatim.
- Very specific: line 34
Verify: npm run build clean, then Playwright browser_evaluate → getComputedStyle(document.body).backgroundColor resolves to the token value …
“Common” is measured: kept by at least 6 in 10 of the 3 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
tokens — the system becomes one file
Stage: Phase 3 — Foundation (final step, after color/typography/motion-language/shape-language decide) - Reads: design/SYSTEM.md, design/DIRECTION.md - Writes: app/globals.css
Standard
- app/globals.css is the single source of design truth. Components consume generated utilities; a hex code, a bare
oklch(, ortext-[17px]inside a component is a defect, not a shortcut. - Every SYSTEM.md decision becomes a token; every token traces to a SYSTEM.md line. No orphans in either direction.
- Full semantic color set in BOTH
:rootand.darkas complete oklch values — never bare HSL triplets, neverhsl(var(--x))(legacy shadcn v3 pattern, dead). - Tailwind 4.3 is CSS-first: no tailwind.config.js, no
@tailwinddirectives, notheme.extend. Ever. - Type scale is fluid; the hero token resolves to ≥3.5×
--text-baseat 1440px (taste floor). - Three tiers, never skipped: primitive (raw scale —
--color-neutral-*, never named by a component), semantic (intent —--background,--primary,--ring; what color/typography/depth already emit), component (one-off —--pricing-featured-ring, declared in the consuming component's own CSS, aliasing a semantic/primitive token). A component that invents a semantic token or hardcodes a value is skipping its tier — that is how the system rots. - The cascade layer order is the specificity contract. Tailwind v4 ships
@layer theme, base, components, utilities; treat it as law. Restyling shadcn's default look (taste demands it) is won by putting hand-written component CSS in@layer components— never by!important, never by an ever-deeper selector. - Animatable tokens are
@property-registered; static tokens are not. A plain custom property is untyped, so a color or gradient token inside atransition/keyframe snaps at the midpoint instead of interpolating. Register exactly the tokens that move — no more, and no exemption for a second engine: a token a DIRECTION-commissioned ultraweb:animejs timeline interpolates registers here like any other. lib/motion.tsis the same contract for time, and it is ONE mirror serving BOTH engines: motion-language's durations and curves live there once, read bymotion/reactin seconds and bezier arrays, and — only when DIRECTION.md commissions the SVG engine — by an appendedanimeEase/animeDurblock (ms andcubicBezier(), per motion-language) for anime.js. Two engines, one set of numbers; a duration typed into a component is the same defect either way.- globals.css is the single authoring source;
lib/tokens.tsis its generated projection, never a second source. Everything inside the CSS cascade reads globals.css; everything outside it (react-email,next/ogImageResponse) reads the resolved-hex mirror — one generated file, never a hand-retyped second palette.
Process
- Read SYSTEM.md §color/§type/§layout/§depth/§shape/§motion. A missing decision means the owning skill hasn't run — run it. Never invent values here.
- Write
:rootand.darkas plain CSS variables — the color skill's value table, verbatim. These are the primitive and semantic tiers; the component tier is declared later, inside each component's own CSS, aliasing back here — never a new value born in a component. - Bridge every var-referencing token through
@theme inline(colors, fonts, radius math, shadows); literals (text scale, spacing, easings, keyframes) go in plain@theme. Rule:inlinewhenever a token references another CSS variable. - Define the entrance
@keyframesinside@theme; durations and curves come from motion-language's--dur-*/--ease-*tokens, never hardcoded. Land its reduced-motion policy the way motion-language mandates: author every entrance utility inside@media (prefers-reduced-motion: no-preference)(worked example below) so motion is opt-in — reduce users receive the static end state and noboth-fill entrance leaves content hidden. No globalreducekill-switch. - Register the tokens that animate with
@property— a gradient<angle>, an interpolating<color>— each with asyntax,inherits, andinitial-value. An untyped custom property is a string to the engine, so it snaps at the transition midpoint instead of tweening; register exactly those that move and no static token. - Make the cascade order explicit: Tailwind v4 already declares
@layer theme, base, components, utilities, so any hand-written component override goes in@layer componentsand wins over shadcn's base styling by layer, not force.!importantin component CSS means the layer order is wrong. - Base layer: body colors, default border-color,
::selectionin palette — craft in the last 2% (taste). - Dark mode is class-strategy:
@custom-variant darkin CSS + next-themes —<html suppressHydrationWarning>and a client<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>wrapper. - Export
lib/tokens.ts— a plain object of resolved sRGB-hex values for every semantic token, generated from this file (a ~20-line converter, never hand-typed). react-email templates andnext/ogImageResponserender outside the cascade and read neither CSS variables noroklch(); this is their single color source, so the brand can't silently fork. - Verify:
npm run buildclean, then Playwrightbrowser_evaluate→getComputedStyle(document.body).backgroundColorresolves to the token value in BOTH themes.
Worked example — app/globals.css (Tailwind 4.3)
Moved to references/example.md — read only when this build's case is genuinely ambiguous; the sections above are the decision material.
Anti-patterns
tailwind.config,@tailwind base,theme.extend,darkMode:— v3 relics; the config file must not exist.hsl(var(--and bare HSL triplets in:root— the dead shadcn bridge; full oklch only.#-hex,rgb(,oklch(insideapp/orcomponents/— grep for all three; only globals.css defines color. The lone sanctioned exception is a named component-tier token in that component's own CSS (--pricing-featured-ring: var(--color-primary)), never a literal in aclassName.- A component inventing a semantic token, or reaching for a raw value, to cover a one-off — that is the component tier's job: a
--component-*custom property declared in the component, aliasing a semantic/primitive token. !importantin component CSS — the layer order is wrong, not the override too weak; move the rule into@layer componentsinstead of forcing it.- Animating a color/gradient token that was never
@property-registered (it snaps at the midpoint), or registering static tokens that never move (noise) — type exactly the ones that interpolate. - Hand-typed hex/
rgb()inemail/templates orapp/**/opengraph-image.tsx— both must importlib/tokens.ts; a second palette drifts and no visual gate renders email or OG to catch it. text-[,p-[,rounded-[,shadow-[arbitrary values — a value you need is a token you're missing.dark:bg-[— per-component dark hacks instead of the.darkblock re-decision.- Tokens defined but SYSTEM.md silent on them (invented here), or SYSTEM.md decisions with no token (system leaks into components).
- Entrance utilities authored outside
@media (prefers-reduced-motion: no-preference), or a globalreducekill-switch standing in for opt-in authoring — reduce users must never receive motion they didn't opt into; taste requires the preference honored by construction, not overridden after the fact.
Composes with
Moved to references/composes.md — the handoff map; load it when orchestrating this skill against its neighbors.
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.

