token-validator

Detect hardcoded visual values in UI code and suggest design token replacements.

7|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/kaelig/react-craft --skill token-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-validator
Source: https://github.com/kaelig/react-craft/tree/main/react-craft/skills/token-validator
Command: npx skills add https://github.com/kaelig/react-craft --skill token-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill identifies and flags hardcoded visual values (like colors, spacing, and typography) in UI code, promoting the consistent use of design tokens.

Core Features & Use Cases

  • Hardcoded Value Detection: Scans code for direct use of colors, spacing, typography, and border-radius values.
  • Token Suggestion: Recommends appropriate design token replacements with confidence scores.
  • Use Case: A developer is writing new UI components and accidentally uses a hardcoded hex color like #333333 instead of the design system's color.text.primary token. The Token Validator flags this, suggests the correct token, and provides a confidence score.

Quick Start

Scan the project for hardcoded values and suggest design token replacements.

Frequently Asked Questions about token-validator

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

FAQPage Schema
How do I detect hardcoded colors and spacing values in React UI components?

To detect hardcoded visual values in React UI components, this solution scans your codebase for direct uses of colors, spacing, typography, and border-radius. It then flags these instances and recommends matching design token replacements.

How does design token suggestion work when replacing hardcoded CSS values?

Design token suggestion works by analyzing hardcoded CSS values against your token definitions. It recommends matching replacements and provides confidence scores to indicate the accuracy of the suggested token mapping for your UI code.

Does the design token validator support DTCG and CSS Custom Properties formats?

Yes, the design token validator supports DTCG, CSS Custom Properties, and Storybook MCP formats. This allows it to accurately recognize and map hardcoded values to your specific token naming conventions across different frontend setups.

How do I avoid false positives when scanning frontend code for design tokens?

To avoid false positives when scanning frontend code, the validator filters suggestions based on context and specific exclusions. This ensures only relevant hardcoded visual values are flagged for design token replacement, improving code quality.

What is the best way to enforce design tokens in my existing UI development workflow?

The best way to enforce design tokens in UI development is to scan your project for hardcoded visual values and replace them with suggested tokens. This promotes visual consistency and maintainability across your frontend codebase.