design-systems

Enforces design token tier rules and audits React components for hardcoded visual values.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/apuya/react-basics-ui --skill design-systems-apuya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-systems
Source: https://github.com/apuya/react-basics-ui/tree/main/.claude/skills/design-systems
Command: npx skills add https://github.com/apuya/react-basics-ui --skill design-systems-apuya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Design systems decay when developers hardcode hex colors, skip dark-theme overrides, or let components reference undefined CSS variables that silently break styling. This Skill guards the react-basics-ui token funnel (primitive → semantic) and the primitive component layer so visual decisions stay coherent across themes. ## Core Features & Use Cases - Token governance: Enforces the one-way tier funnel where components consume only --semantic-* tokens, never raw values or --primitive-* references, and treats the legacy --component-* tier as frozen. - New token checklist: Walks through the five required steps when adding a semantic token — primitive, semantic definition, [data-theme="dark"] override, TypeScript mirror in src/tokens/index.ts, and an actual consumer. - Four audit commands: Provides grep-based audits for hardcoded colors, primitive-tier leaks, missing dark overrides, and dangling var() references that silently invalidate declarations. - Use Case: While reviewing a new Badge component, you run the primitive-leak audit, find a var(--primitive-color-gold-500) reference, and route it through a new semantic token with a dark override instead. ## Quick Start Audit src/components for hardcoded colors, primitive token leaks, and dangling CSS variable references, then fix each violation by routing it through the semantic token tier.

Frequently Asked Questions about design-systems

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

FAQPage Schema
How do I add a new design token to a React component library?

Add the raw value as a primitive token, create a semantic token referencing it via var(), redefine the semantic token inside the [data-theme="dark"] block, mirror it in src/tokens/index.ts for TypeScript autocomplete, and use it in a component. Skipping the dark override is the most common silent failure.

How do I find hardcoded colors in React components?

Run grep for patterns like "color: #" and Tailwind arbitrary values such as bg-[#...] across src/components. Replace each hit with a semantic token, or document why the value is genuinely local and one-off.

Why does my CSS variable styling silently not apply?

An undefined var() reference invalidates the entire CSS declaration with no console warning or build error. Audit by comparing every token defined in global.css against every var() referenced in source files and resolve the difference.

Should components reference primitive or semantic design tokens?

Components must reference semantic tokens only. Referencing --primitive-* variables skips the intent tier, so the component will not respond to theme changes such as the dark theme override.

Does this design system use prefers-color-scheme for dark mode?

No. Dark mode is keyed off the [data-theme="dark"] attribute set by ThemeProvider, not a media query. Adding overrides inside @media (prefers-color-scheme: dark) would have no effect.