design-tokens
Skill15 starsChanged 10 months agoMITView on GitHub
Expert in design tokens using the DTCG specification. Use this skill when users ask about design tokens, DTCG format, token validation, formatting, transformation, color spaces (sRGB, Display P3, OKLCH), references and aliasing, resolvers, theming with modifiers/contexts, multi-platform design systems, accessibility, or working with tools like jq, jsonata, and terrazzo. Helps with token file creation, resolver configuration, structure, naming conventions, and best practices.
- Installs packages
21 other projects use a version of this.
Adopted by
Most recently taken up by
- TomSzenessy/AI_TEMPLATEtheir own version, first seen Oct 6, 2026
- dmlguq456/heartingtheir own version, first seen Sep 30, 2026
- mshadmanrahman/claude-for-designerstheir own version, first seen Sep 29, 2026
- yogvidwankhede/vishwakarmatheir own version, first seen Sep 26, 2026
- darkroomengineering/cc-settingstheir own version, first seen Sep 24, 2026
- DanielNoamTuby/claude-skillstheir own version, first seen Sep 20, 2026
Used with
Projects with it also use brief-to-tasks, information-architecture and 6 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 4 projects that use this
fefogarciaSkillinformation-architecture
Use when organizing content for digital products, designing navigation systems, restructuring information hierarchies, improving findability, creating taxonomies or metadata schemas, or when users mention information architecture, IA, sitemap, navigation design, content structure, card sorting, tree testing, taxonomy, findability, or need help making information discoverable and usable.
Also in 5 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 3 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 4 projects that use this
AICreator-WindSkilldesign-review
编码设计师工具。设计审计和修复。
Also in 9 projects that use this
AnthropicSkilldesign-system
Audit, document, or extend your design system. Use when checking for naming inconsistencies or hardcoded values across components, writing documentation for a component's variants, states, and accessibility notes, or designing a new pattern that fits the existing system.
Also in 3 projects that use this
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- plugin87/ux-ui-agent-skills★ 1.5ksame name
- julianoczkowski/designer-skills★ 574same name
- glebis/claude-skills★ 387same name
- dylanfeltus/skills★ 179same name
- marcusgoll/Spec-Flow★ 94same name
- darkroomengineering/cc-settings★ 47same name
- mshadmanrahman/claude-for-designers★ 32same name
- f0d010c/stark★ 29same name
- piyushverma0/android-agent-skills★ 15same name
- dmlguq456/hearting★ 8same name
11 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.
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 12 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 192
Step 2: Create semantic.tokens.json with references
- Very specific: line 217
Keep hex as fallback in the hex property
- Distinctive: line 218
Create semantic layer for purpose-driven naming
- Distinctive: line 229
Step 2: Create token files with mode extensions
- Distinctive: line 305
Use a DTCG export plugin or Figma's built-in export
- Distinctive: line 317
Step 3: Add mode extensions if needed
- Very specific: line 319
If Figma exported separate mode files, add $extensions.mode:
- Distinctive: line 325
Step 4: Add hex fallbacks (if missing)
- Very specific: line 335
Create terrazzo.config.mjs pointing to your imported files and build.
- Very specific: line 398
All tokens have resolvable $type
- Very specific: line 503
Every token needs a resolvable $type (explicit or inherited from parent group).
- Distinctive: line 518
No circular references (A → B → A)
- Very specific: line 563
Use lowercase with hyphens: color.brand.primary
- Distinctive: line 569
Use resolvers for themes (recommended over group extension):
- Very specific: line 577
Color contrast: Document contrast ratios in $extensions:
- Distinctive: line 587
Reduced motion: Use resolver modifier:
- Distinctive: line 624
When helping with design tokens:
- Distinctive: line 626
Verify before claiming: - Check reference files before stating what DTCG does/doesn't support.
- Very specific: line 628
Validate structure: - Check $value, $type, references
- Distinctive: line 636
Important: When asked about spec capabilities (what syntax is valid, what features exist), always read the relevant reference file first.
- Distinctive: line 638
Always provide clear examples and explain reasoning behind recommendations.
“Common” is measured: kept by at least 6 in 10 of the 19 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 Expert
Expert guidance for working with design tokens following the Design Tokens Community Group (DTCG) specification.
Quick Reference
| Topic | Reference |
| Token types, structure, validation | reference/format.md |
| Color spaces, components, alpha, common mistakes | reference/color.md |
| Sets, modifiers, resolution order | reference/resolver.md |
| jq, JSONata, Figma export, Terrazzo config | reference/tools.md |
| Common patterns and examples | examples/use-cases.md |
Getting Started: See Getting Started Guides for step-by-step workflows.
Specification Sources
Based on the latest DTCG Draft Community Group Reports:
Core Concepts
Token Structure
A token is a JSON object with $value. Special properties use $ prefix:
{
"brand-blue": {
"$type": "color",
"$value": {
"colorSpace": "srgb",
"components": [0.15, 0.39, 0.92],
"hex": "#2563eb"
},
"$description": "Primary brand color"
}
}Token Types
Atomic: color, dimension, fontFamily, fontWeight, duration, cubicBezier, number
Composite: strokeStyle, border, shadow, gradient, typography, transition
See reference/format.md for complete type definitions.
Color Format
Colors use structured objects (not hex strings):
{
"$type": "color",
"$value": {
"colorSpace": "srgb",
"components": [1, 0, 0.5],
"alpha": 0.8,
"hex": "#ff0080"
}
}Supported spaces: srgb, display-p3, oklch, oklab, hsl, hwb, lab, lch, and more. See reference/color.md.
References (Aliasing)
Two syntaxes supported:
- Curly braces - Token-level references:
"{path.to.token}" - JSON Pointer (
$ref) - Property-level access:{"$ref": "#/path/to/$value/property"}
Token reference example:
{
"color": {
"primary": {"$type": "color", "$value": {"colorSpace": "srgb", "components": [0, 0.4, 0.8]}}
},
"button": {
"background": {"$type": "color", "$value": "{color.primary}"}
}
}JSON Pointer example (accessing array elements):
{
"blue": {
"$type": "color",
"$value": {"colorSpace": "okhsl", "components": [0.733, 0.8, 0.5]}
},
"blue-hue": {
"$type": "number",
"$ref": "#/blue/$value/components/0"
}
}See reference/format.md for complete reference syntax details.
Groups and Type Inheritance
Groups organize tokens. $type on a group applies to all children:
{
"spacing": {
"$type": "dimension",
"sm": {"$value": {"value": 8, "unit": "px"}},
"md": {"$value": {"value": 16, "unit": "px"}},
"lg": {"$value": {"value": 24, "unit": "px"}}
}
}Resolvers for Theming
Resolvers manage tokens across contexts (themes, platforms, densities):
{
"name": "my-system",
"version": "2025.10",
"sets": {
"core": {"sources": [{"$ref": "tokens/base.json"}]}
},
"modifiers": {
"theme": {
"contexts": {
"light": [{"$ref": "themes/light.json"}],
"dark": [{"$ref": "themes/dark.json"}]
},
"default": "light"
}
},
"resolutionOrder": [
{"$ref": "#/sets/core"},
{"$ref": "#/modifiers/theme"}
]
}See reference/resolver.md for complete documentation.
Getting Started Guides
Quick Start: Convert CSS Variables to DTCG
Starting point: Existing CSS custom properties
:root {
--color-primary: #2563eb;
--color-background: #ffffff;
--spacing-sm: 8px;
--spacing-md: 16px;
}Step 1: Create primitives.tokens.json
{
"color": {
"primitive": {
"$type": "color",
"blue-500": {
"$value": { "colorSpace": "srgb", "components": [0.145, 0.388, 0.922], "hex": "#2563eb" }
},
"white": {
"$value": { "colorSpace": "srgb", "components": [1, 1, 1], "hex": "#ffffff" }
}
}
},
"spacing": {
"$type": "dimension",
"scale": {
"sm": { "$value": { "value": 8, "unit": "px" } },
"md": { "$value": { "value": 16, "unit": "px" } }
}
}
}Step 2: Create semantic.tokens.json with references
{
"color": {
"interactive": {
"$type": "color",
"primary": { "$value": "{color.primitive.blue-500}" }
},
"background": {
"$type": "color",
"page": { "$value": "{color.primitive.white}" }
}
},
"spacing": {
"$type": "dimension",
"component": {
"padding": { "$value": "{spacing.scale.sm}" },
"gap": { "$value": "{spacing.scale.md}" }
}
}
}Conversion tips:
- RGB hex to sRGB: divide each channel by 255 (e.g.,
37/255 = 0.145) - Keep hex as fallback in the
hexproperty - Create semantic layer for purpose-driven naming
Quick Start: Set Up Terrazzo with Dark Mode
Step 1: Install dependencies
npm install -D @terrazzo/cli @terrazzo/plugin-cssStep 2: Create token files with mode extensions
tokens/themes/light.tokens.json:
{
"$extensions": { "mode": "light" },
"color": {
"background": {
"$type": "color",
"page": { "$value": { "colorSpace": "srgb", "components": [1, 1, 1], "hex": "#ffffff" } }
},
"text": {
"$type": "color",
"primary": { "$value": { "colorSpace": "srgb", "components": [0.07, 0.07, 0.07], "hex": "#121212" } }
}
}
}tokens/themes/dark.tokens.json:
{
"$extensions": { "mode": "dark" },
"color": {
"background": {
"$type": "color",
"page": { "$value": { "colorSpace": "srgb", "components": [0.07, 0.07, 0.07], "hex": "#121212" } }
},
"text": {
"$type": "color",
"primary": { "$value": { "colorSpace": "srgb", "components": [0.95, 0.95, 0.95], "hex": "#f2f2f2" } }
}
}
}Step 3: Create terrazzo.config.mjs
import { defineConfig } from "@terrazzo/cli";
import pluginCSS from "@terrazzo/plugin-css";
export default defineConfig({
tokens: [
"./tokens/primitives.tokens.json",
"./tokens/themes/light.tokens.json",
"./tokens/themes/dark.tokens.json"
],
outDir: "./dist/",
plugins: [
pluginCSS({
filename: "tokens.css",
modeSelectors: [
{ mode: "light", selectors: [":root", "[data-theme='light']"] },
{ mode: "dark", selectors: ["[data-theme='dark']", "@media (prefers-color-scheme: dark)"] }
]
})
]
});Step 4: Build and use
npx terrazzo buildIn your HTML:
<html data-theme="light"><!-- or "dark" -->Quick Start: Import Figma Variables Export
Step 1: Export from Figma
- Open Variables panel in Figma
- Use a DTCG export plugin or Figma's built-in export
- Save as
figma-export.json
Step 2: Validate the export
# Check JSON is valid
jq '.' figma-export.json > /dev/null && echo "Valid JSON"
# List all token paths
jq -r 'paths(has("$value")) | join(".")' figma-export.jsonStep 3: Add mode extensions if needed
If Figma exported separate mode files, add $extensions.mode:
# Add mode to light theme file
jq '. + {"$extensions": {"mode": "light"}}' light.json > light.tokens.jsonStep 4: Add hex fallbacks (if missing)
Figma exports sRGB components but may omit hex:
# Quick check if hex values exist
jq '.. | objects | select(.colorSpace == "srgb") | select(.hex == null)' figma-export.jsonStep 5: Configure Terrazzo
Create terrazzo.config.mjs pointing to your imported files and build.
Common Figma export issues:
- Flat structure (no primitives/semantic separation) - reorganize manually
- Space in token names - use jq to convert to kebab-case
- Missing
$typeon groups - add type inheritance
Workflows
Creating a Token File
Token File Creation:
- [ ] Step 1: Define file structure (primitives → semantic → components)
- [ ] Step 2: Create primitive tokens with explicit types
- [ ] Step 3: Create semantic tokens referencing primitives
- [ ] Step 4: Validate structure and references
- [ ] Step 5: Test with target tools (Terrazzo, etc.)Step 1: Define structure
Organize into layers:
tokens/
├── primitives.tokens.json # Raw values (colors, spacing scales)
├── semantic.tokens.json # Purpose-driven aliases
└── components.tokens.json # Component-specific tokensStep 2: Create primitives
{
"color": {
"primitive": {
"$type": "color",
"blue": {
"500": {"$value": {"colorSpace": "srgb", "components": [0.15, 0.39, 0.92], "hex": "#2563eb"}}
}
}
}
}Step 3: Create semantic tokens
{
"color": {
"interactive": {
"$type": "color",
"default": {"$value": "{color.primitive.blue.500}"}
}
}
}Step 4: Validate
Check for:
- All tokens have resolvable
$type - No circular references
- Valid value formats for each type
- Names don't contain
{,},.or start with$
Step 5: Test with tools
terrazzo validate tokens.json
terrazzo build --input tokens.json --output test.css --format cssSetting Up a Theme Resolver
Resolver Setup:
- [ ] Step 1: Organize token files by concern
- [ ] Step 2: Create resolver.json with version and sets
- [ ] Step 3: Define theme modifier with contexts
- [ ] Step 4: Configure resolution order
- [ ] Step 5: Test with different inputsStep 1: Organize files
tokens/
├── resolver.json
├── base.tokens.json
└── themes/
├── light.tokens.json
└── dark.tokens.jsonStep 2: Create resolver
{
"name": "my-design-system",
"version": "2025.10",
"sets": {
"foundation": {
"sources": [{"$ref": "base.tokens.json"}]
}
}
}Step 3: Define theme modifier
{
"modifiers": {
"theme": {
"contexts": {
"light": [{"$ref": "themes/light.tokens.json"}],
"dark": [{"$ref": "themes/dark.tokens.json"}]
},
"default": "light"
}
}
}Step 4: Set resolution order
{
"resolutionOrder": [
{"$ref": "#/sets/foundation"},
{"$ref": "#/modifiers/theme"}
]
}Step 5: Test
terrazzo build --resolver resolver.json --output light.css
terrazzo build --resolver resolver.json --input theme=dark --output dark.cssValidating Token Files
Validation Checklist:
- [ ] Step 1: Check JSON syntax
- [ ] Step 2: Verify type declarations
- [ ] Step 3: Validate value formats
- [ ] Step 4: Check reference resolution
- [ ] Step 5: Verify naming constraintsStep 1: JSON syntax
jq '.' tokens.json > /dev/null && echo "Valid JSON"Step 2: Type declarations
Every token needs a resolvable $type (explicit or inherited from parent group).
Step 3: Value formats
| Type | Valid Format | |
| color | {colorSpace, components, [alpha], [hex]} | |
| dimension | `{value: number, unit: "px" | "rem"}` |
| duration | `{value: number, unit: "ms" | "s"}` |
| cubicBezier | [P1x, P1y, P2x, P2y] where P1x, P2x ∈ [0,1] | |
| fontWeight | 1-1000 or string ("normal", "bold", etc.) |
Step 4: References
- All
{path.to.token}references must resolve - No circular references (A → B → A)
- No self-references
Step 5: Naming
- Names cannot start with
$ - Names cannot contain
{,},.
Migrating from Other Formats
Migration Workflow:
- [ ] Step 1: Export existing tokens to JSON
- [ ] Step 2: Map types to DTCG equivalents
- [ ] Step 3: Convert color values to structured format
- [ ] Step 4: Update reference syntax
- [ ] Step 5: Validate and testCommon conversions:
| From | To DTCG |
"#ff0000" | {colorSpace: "srgb", components: [1,0,0], hex: "#ff0000"} |
"16px" | {value: 16, unit: "px"} |
"$colors.primary" or {colors.primary} | "{colors.primary}" |
Terrazzo conversion:
terrazzo convert --from style-dictionary --to dtcg input.json output.tokens.jsonBest Practices
Token Layers
- Primitives - Raw values without semantic meaning
- Semantic - Purpose-driven tokens referencing primitives
- Component - Specific component tokens referencing semantic
Naming Conventions
- Use lowercase with hyphens:
color.brand.primary - Structure:
[category].[subcategory].[variant].[state] - Semantic over appearance:
color.interactive.defaultnotcolor.blue-500
Theming Strategy
Use resolvers for themes (recommended over group extension):
- Cleaner separation of concerns
- Token paths stay consistent across themes
- Easy to compose themes (e.g., dark + high-contrast)
- Standardized input handling for build tools
Accessibility
Color contrast: Document contrast ratios in $extensions:
{
"$extensions": {
"com.example.a11y": {"contrastRatio": 7.5, "wcagLevel": "AA"}
}
}Reduced motion: Use resolver modifier:
{
"modifiers": {
"motion": {
"contexts": {
"full": [{"$ref": "motion/full.json"}],
"reduced": [{"$ref": "motion/reduced.json"}]
},
"default": "full"
}
}
}File Conventions
- Token files:
.tokensor.tokens.json - Resolver files:
.resolver.json - Encoding: UTF-8
Common Tasks
| Task | Approach |
| Format validation | Check against DTCG spec, use Terrazzo validate |
| Structure optimization | Organize into primitive → semantic → component layers |
| Alias resolution | Trace references, check for circular dependencies |
| Resolver configuration | Define sets, modifiers, resolution order |
| Theme implementation | Use resolver modifiers with context files |
| Multi-context builds | Generate outputs per theme/platform/density |
| Tool integration | Use jq for queries, Terrazzo for transforms |
| Migration | Convert colors to structured format, update references |
Your Role
When helping with design tokens:
- Verify before claiming - Check reference files before stating what DTCG does/doesn't support. Never assume spec limitations.
- Use latest DTCG spec - Structured color format, proper types
- Validate structure - Check
$value,$type, references - Suggest best practices - Naming, organization, layering
- Help with tools - jq queries, Terrazzo commands, JSONata transforms
- Consider platforms - Web, iOS, Android via
$extensions - Think about scale - Design for maintainability
- Prioritize accessibility - Contrast, motion, focus indicators
- Connect design and code - Bridge tools and implementation
Important: When asked about spec capabilities (what syntax is valid, what features exist), always read the relevant reference file first. Do not rely on assumptions or prior knowledge about the spec.
Always provide clear examples and explain reasoning behind recommendations.
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.

