new-token

Adds design tokens across CSS theme files, registries, Storybook docs, and design documentation.

1|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/robritacca-dotcom/design-system --skill new-token-robritacca-dotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-token
Source: https://github.com/robritacca-dotcom/design-system/tree/main/.claude/skills/new-token
Command: npx skills add https://github.com/robritacca-dotcom/design-system --skill new-token-robritacca-dotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a design token to a multi-surface design system is error-prone: a token that exists only in CSS is incomplete, and missing a registry entry, a dark-theme counterpart, or a documentation home causes build failures or silent drift. This Skill walks a new token through every required home so nothing is missed. ## Core Features & Use Cases - Tier and file placement guidance: Decides primitive vs. semantic tier and routes the token to the correct file (tokens-light.css, tokens-dark.css, tokens-typography.css, tokens-motion.css), including light/dark parity rules for colour and shadow. - Registry and prefix handling: Explains when a new prefix must be added to CATEGORY_PREFIXES in generate-token-registry.mjs and why registry.json must never be hand-edited. - Documentation and packaging coverage: Maps each token category to its foundations page, Storybook doc, and design.md entry, plus the subpath/exports steps a TypeScript-side token needs. - Use Case: When asked to add a new motion duration token, the Skill places it in tokens-motion.css, confirms no new prefix registration is needed, adds it to the motion Storybook docs and design.md, then runs validate-registry and build to verify. ## Quick Start Ask the AI to add a new design token, for example: add a --motion-duration-slow token to the design system.

Frequently Asked Questions about new-token

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

FAQPage Schema
How do I add a new design token to a design system?

Decide whether it is a primitive or semantic token, place it in the CSS file for its category, register any new prefix in the registry generator, and add its documentation homes. Finish by running the registry validation and build to confirm every surface is in sync.

How do I add a colour token with dark mode support?

Add the colour token to both tokens-light.css and tokens-dark.css, since the registry validator enforces light/dark parity for colour. Semantic colour tokens must chain to a primitive or another --color-* token via var(), never a literal value.

Why does token registry generation fail with a new prefix?

Generation fails deliberately when a token introduces a prefix not listed in CATEGORY_PREFIXES in generate-token-registry.mjs. Add the prefix there so the new category gets a display home, then regenerate the registry.

Can I edit the generated token registry JSON directly?

No, registry.json must never be hand-edited because it regenerates from the CSS source files on every build. Change the token in its CSS file and let the generator update the registry.

What extra steps does a TypeScript token constant need?

A TypeScript-side token needs a subpath entry in the package manifest script mirrored into package.json exports and vite.lib.config.ts, or an INTERNAL_MODULES entry if internal-only. Any mirrored value in component code should be guarded by a validator to prevent drift.