design-tokens-validator

Detect hard-coded design values in CSS, SwiftUI, and Unity source code.

3|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/CANTAGESTUDIO/CosmicAtlasPacker --skill design-tokens-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-tokens-validator
Source: https://github.com/CANTAGESTUDIO/CosmicAtlasPacker/tree/main/.claude/skills/design-tokens-validator
Command: npx skills add https://github.com/CANTAGESTUDIO/CosmicAtlasPacker --skill design-tokens-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Validates that code uses official design tokens instead of hard-coded values to ensure design system consistency.

Core Features & Use Cases

  • Token Categories: Colors, Typography, Spacing, Radius, Shadows.
  • Detection: Highlights hard-coded values in CSS/SwiftUI and suggests token replacements.

Quick Start

python3 scripts/validate_tokens.py --tokens tokens.json --source src/

Frequently Asked Questions about design-tokens-validator

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

FAQPage Schema
How do I validate that my code uses design tokens instead of hard-coded values?

Design token validation flags hard-coded colors, typography, spacing, radius, and shadow values in your source code and suggests official token replacements. Run the validator against your tokens.json registry and source files to identify violations and get remediation guidance during code reviews or CI checks.

Does design token validation work with CSS, SwiftUI, and other frameworks?

Yes, the validator detects hard-coded values across CSS/SCSS/Tailwind/Styled Components, SwiftUI/UIKit, and Unity styles. It identifies violations in multiple frameworks and outputs tokenized replacements specific to each technology.

What do I need to set up before running a design tokens validator?

Prepare a tokens.json registry containing your design system definitions and point the validator to your source code directory. The validator then scans for hard-coded design values and maps them to available tokens.

Can I enforce design tokens in my CI/CD pipeline?

Yes, design token validation integrates into CI checks to catch hard-coded values automatically. It flags violations during code review stages and prevents non-compliant code from merging, ensuring design system consistency across releases.

What design token categories does the validator detect?

The validator identifies violations in Colors, Typography, Spacing, Radius, and Shadows. It matches hard-coded values in these categories against your tokens.json and recommends the corresponding token replacements.

Why should I replace hard-coded design values with tokens?

Using official design tokens ensures design consistency across your codebase and simplifies maintenance. When design specs change, update tokens once rather than hunting through hundreds of files for scattered hard-coded values.