Agent skill
design-tokens
Design tokens naming and creation rules for Wythm mobile app. **Use this skill when:** - Creating or renaming design tokens (colors, spacing, typography) - Replacing hardcoded colors/styles with tokens - Reviewing PRs where styles or colors are touched - Adding new UI components that need theming **Goal:** - Consistent naming across design and code - Tokens are discoverable, composable, and theme-aware
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/design-tokens-alexandrbasis-wythm-claude-workflo
SKILL.md
Design Tokens
This skill ensures consistent token naming and usage across Wythm's codebase.
Token Architecture
Wythm uses a two-layer system:
- Primitives (
colors.primitives.ts) - Raw hex values. The ONLY place for color literals. - Semantic Tokens (
colors.semantic.ts) - Theme-aware tokens organized by usage.
Quick Reference
Token Structure (dot notation)
color.{usage}.{variant}
In code: theme.colors.{usage}.{variant}
| Usage | Examples |
|---|---|
text |
color.text.base, color.text.secondary, color.text.on-brand |
background |
color.background.base, color.background.brand |
border |
color.border.base, color.border.secondary |
field |
color.field.background, color.field.border-danger |
icon |
color.icon.brand, color.icon.on-brand |
Variant Patterns
| Pattern | Meaning |
|---|---|
base |
Default variant |
secondary |
Less prominent |
tertiary |
Least prominent |
brand |
Brand color applied |
danger |
Error/destructive state |
on-brand |
Used ON brand-colored background |
{element}-disabled |
Disabled state (field only) |
Critical Rules
DO
- Use
theme.colors.{usage}.{variant}in all components - Add new tokens to BOTH
lightanddarkschemes - Follow dot notation naming:
color.{usage}.{variant} - Use kebab-case for multi-word variants:
on-brand,border-danger - Check for existing tokens before creating new ones
DON'T
- Use hex literals outside
colors.primitives.ts - Create deeply nested tokens (max 2 levels)
- Use
on-default(usebaseinstead) - Add tokens to only one color scheme
- Use camelCase in token names (use kebab-case:
on-brandnotonBrand)
File Locations
| File | Purpose |
|---|---|
src/shared/theme/tokens/colors.primitives.ts |
Raw hex colors |
src/shared/theme/tokens/colors.semantic.ts |
Semantic tokens |
src/shared/theme/types.ts |
TypeScript types |
When to Read Full Reference
Load references/token-grammar.md when:
- Creating a new usage category (beyond text/background/border/field/icon)
- Adding a new sentiment color (success, warning, info)
- Understanding the complete token creation workflow
- Reviewing naming convention edge cases
Checklist for New Tokens
- Does similar token already exist? (search
colors.semantic.ts) - Is raw value needed? (add to
colors.primitives.ts) - Added to correct usage category?
- Uses dot notation with kebab-case? (
color.text.on-brand) - Added to BOTH light and dark schemes?
- Updated TypeScript types if new keys added?
- Component uses
theme.colors.X.Ynot hex literal?
Dot Notation to Code Mapping
| Dot notation (design) | TypeScript (code) |
|---|---|
color.text.base |
theme.colors.text.base |
color.text.on-brand |
theme.colors.text.onBrand |
color.field.border-danger |
theme.colors.field.borderDanger |
Rule: Dot notation uses kebab-case, TypeScript uses camelCase for object keys.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?