Establish or formalize your design system foundation...
Produce a working tokens file for this specific codebase — not a document about tokens. A token is a named design decision (--color-text-primary, --space-4); centralizing them is what makes every later design skill (layout, type, color, components) land consistently. Governing principle: extract before you invent — in an existing codebase, the token system should formalize the best of what's already there, so migration is renaming, not redesigning.
skills/frontend-design/color-system after the token skeleton exists.skills/frontend-design/typography-system.skills/frontend-design/component-architecture next.skills/frontend-design/frontend-orchestrator.Before asking anything, gather evidence:
tailwind.config.{js,ts,cjs,mjs}, **/globals.css, **/index.css, **/app.css, **/*theme*, **/tokens*. Read them.@import "tailwindcss" + @theme in CSS) vs v3 (config file theme object) vs CSS Modules / styled-components / vanilla CSS. Check package.json for the tailwindcss version.#[0-9a-fA-F]{3,8}\b, rgba?\(, hsla?\( → count distinct colors. Grep for \d+px and Tailwind arbitrary values \[(\d+px|#) → count rogue spacing/size values. These counts go in your rationale.dark:, prefers-color-scheme) — determines whether the semantic layer must ship two modes now.Ask in one batch, only what's missing: brand color (or "pick for me"), product feel (dense data tool vs. spacious marketing/consumer), and dark mode now or later. Infer everything else. Don't stall: if the codebase already answers these (an obvious brand blue, an existing dark: usage), state assumptions and proceed.
Two layers minimum, three when a component library exists:
bg-primary/secondary, text-primary/secondary/tertiary/inverse, border-primary, interactive-primary/hover/active/disabled. This is the layer that flips for dark mode — components only ever consume semantic tokens.--button-primary-bg: var(--color-interactive-primary)).Decision rules:
@theme in the main CSS file. Tailwind v3 → theme.extend in the config, with semantic layer as CSS variables referenced from the config. No Tailwind → plain CSS custom properties on :root (+ .dark or media-query block).--color-text-primary, --space-4, --radius-md). Match Tailwind's names where Tailwind is present, so utilities keep working.:root {
/* global */
--gray-50: #F8FAFC; --gray-500: #64748B; --gray-900: #0F172A; /* full 50–950 ramp, brand-tinted */
--brand-500: #3B82F6; --brand-600: #2563EB; /* full ramp */
--space-1: 0.25rem; --space-2: 0.5rem; --space-4: 1rem; --space-8: 2rem;
--radius-md: 0.375rem; --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10);
/* semantic — the only layer components touch */
--color-bg-primary: var(--gray-50);
--color-text-primary: var(--gray-900);
--color-text-secondary: var(--gray-600);
--color-border-primary: var(--gray-200);
--color-interactive-primary: var(--brand-600);
--color-interactive-hover: var(--brand-700);
}
.dark {
--color-bg-primary: var(--gray-950); /* dark gray, never #000 */
--color-text-primary: var(--gray-50);
--color-text-secondary: var(--gray-300);
--color-border-primary: var(--gray-700);
}
Full three-layer taxonomy, Tailwind v3/v4 wiring, and the variant/responsive-token patterns: read references/token-architecture.md when building the complete file.
Deliver code plus this summary:
## Tokens file
[path written, e.g. src/app/globals.css or tailwind.config.ts — full contents]
## Decisions
| Decision | Choice | Why |
| Stack wiring | Tailwind v4 @theme / v3 config / CSS vars | [detected how] |
| Neutral tint | [hue] | matches brand [color] |
| Spacing base | 4px | [most existing values already multiples / default] |
| Dark mode | now via .dark class / deferred | [user answer or inference] |
## Migration map (worst drift first)
| Found in code | Count | Replace with |
| #3c82f7, #3B82F6, #3a80f0 | 23 | var(--color-interactive-primary) |
| padding: 13px / p-[13px] | 9 | var(--space-3) (12px) |
| ... |
## Migrated now
[files actually edited as demonstration]
## Next step
[Which skill consumes this — typically skills/frontend-design/typography-system or color-system]
#808080 / pure #000skills/frontend-design/frontend-orchestrator (if it ran).skills/frontend-design/typography-system (extends the type tokens), skills/frontend-design/color-system (extends the color ramps + dark mode), skills/frontend-design/layout-system (spacing + breakpoints), skills/frontend-design/visual-hierarchy-refactoring (refactors screens onto tokens), skills/frontend-design/component-architecture (component layer).references/token-architecture.md — full three-layer token taxonomy with complete listings, Tailwind v3 and v4 wiring, and patterns for dark mode, component variants, and responsive tokens. Read when writing the complete tokens file or wiring an unfamiliar stack.