tokens

Audit and replace hardcoded UI design values with a three-layer token system.

3|Updated May 16, 2026
One-click install
npx skills add https://github.com/dawitlabs/ui-skills --skill tokens-dawitlabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tokens
Source: https://github.com/dawitlabs/ui-skills/tree/main/skills/tokens
Command: npx skills add https://github.com/dawitlabs/ui-skills --skill tokens-dawitlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

UI codebases often accumulate hardcoded design values (colors, spacing, typography, shadows, radii, z-index), making visual consistency hard to maintain and theme changes risky and slow.

Core Features & Use Cases

  • Token audit & mapping: Detects hardcoded design values across the codebase and maps them to a three-layer token model (primitives → semantic → optional component).
  • Token home integration: Locates the existing token “home” (CSS variables, Tailwind config, Style Dictionary, or creates globals.css :root) and snapshots current tokens to avoid conflicts.
  • Safe, screenshot-driven replacement: Replaces hardcoded values with var(...)/tokenized equivalents while validating regressions via before/after screenshots across key screens and viewports, and supports dark mode semantics.

Quick Start

Ask the assistant to run the tokens skill to audit your UI codebase for hardcoded design values and replace them with a maintainable, themeable token system.

Frequently Asked Questions about tokens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I replace hardcoded UI values with a design token system?

A design token system replaces raw values by mapping them into a three-layer model of primitives, semantics, and component tokens. This enforces UI consistency and enables maintainable theme changes across multiple components.

How do I audit my codebase for hardcoded colors and spacing before refactoring?

Auditing hardcoded colors and spacing involves scanning the UI codebase to detect raw design values and snapshotting existing tokens. This prevents conflicts before replacing values with tokenized equivalents.

Does this design token approach work with Tailwind config and CSS variables?

Yes, the design token approach works with Tailwind config, CSS variables, and Style Dictionary. It locates the existing token home or creates a globals.css :root to integrate theming seamlessly.

What is the best way to prepare a UI codebase for dark mode readiness?

The best way to prepare a UI codebase for dark mode readiness is by defining semantic tokens for light and dark themes. This replaces hardcoded values with themeable var() references.

How do you prevent visual regressions when refactoring UI code to use tokens?

Preventing visual regressions during token refactoring requires validating replacements with before and after screenshots. This visual regression checking spans key screens and viewports to ensure UI consistency.

Why do I need a three-layer token model for UI consistency?

A three-layer token model is needed for UI consistency because it separates primitive values, semantic meaning, and component-specific overrides. This structure makes theme changes safe and maintainable.