No slash command · from dev
Enforces single-source-of-truth UI: design tokens for every style value, one component library, variants instead of call-site restyling. Use before writing or reviewing any component, screen, theme or style.
Ships in dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Every application UI has exactly two sources of truth:
Application screens only compose. They never define appearance.
Why this matters: when tokens and components live in one place, a rebrand is a one-file change, a component fix propagates everywhere, and there is never a third slightly-different implementation of the same button. Every hardcoded hex value or call-site restyle silently creates a second source of truth that someone else (human or agent) will later copy. These rules exist to make drift impossible, not to slow you down.
All styling values come from the theme as semantic tokens (named by role: primary, surface, destructive), never as raw values and never as primitive names (blue-500). Semantic names survive rebrands and make dark mode a token swap instead of a rewrite.
#3b82f6), rgb()/hsl()/oklch() literals, magic pixel values, or Tailwind arbitrary values (w-[347px], text-[#ff0000], bg-[rgb(0,0,0)]).// ❌ Three new sources of truth
<div className="bg-[#1a56db] p-[13px] rounded-[5px]">
// ✅ Tokens only
<div className="bg-primary p-3 rounded-md">
/* ❌ */ .card { background: #ffffff; border-radius: 8px; }
/* ✅ */ .card { background: var(--color-surface); border-radius: var(--radius-md); }
Every reusable component lives in the component library (e.g. src/components/ui/ or the design-system package) — never inside a screen, page, or feature folder. Every library component has stories covering every variant and interactive state (default, hover, focus, disabled, loading, error, empty).
A component without a story effectively doesn't exist: Storybook is the discovery surface, the spec, and the test fixture all at once. Story = part of definition of done.
Styled raw HTML in app code (<button className="px-4 py-2 bg-primary ...">) is a duplicate component in disguise — use or extend the library component instead.
All visual variations are part of the component's API — variant, size, tone, state props — encoded once inside the component (CVA/variants pattern, or your framework's equivalent).
// ❌ Unnamed variant created at the call site
<Button className="bg-emerald-600 hover:bg-emerald-700 text-white">Approve</Button>
// ✅ Named variant defined in the library (with a story), used everywhere
<Button variant="success">Approve</Button>
Components ship with no outer margins. Where a component sits and how much space surrounds it is the parent's decision; what it looks like is the component's decision.
Stack, Grid, Box, gap) rather than ad-hoc classes.bg-*, text color, border color, rounded-*, shadow-*, font-*) are a violation of Rule 3 — move them into a variant.style prop / inline styles: never (only exception: passing CSS custom properties, e.g. style={{ '--progress': x }}).// ✅ Layout from the parent
<Stack gap="4"><Button variant="primary">Save</Button></Stack>
<Card className="mt-6 max-w-md" /> // margin + width constraint: fine
// ❌ Appearance from the parent
<Card className="bg-zinc-900 rounded-2xl shadow-xl" /> // these are variants
App screens assemble library components and recipes. When a screen needs something the library doesn't have, classify it deliberately:
| It is a… | Definition | Where it lives |
|---|---|---|
| Variant | Existing component, new look/state | Inside the component, in the library (Rule 3) |
| Component | New reusable, context-agnostic building block | Component library + stories (Rule 2) |
| Recipe | Named composition of library components (ProductCard) | Recipes/Patterns section of the library + story |
| Snowflake | Genuine one-off for one screen | Feature folder, named *.snowflake.tsx (greppable), composed from tokens + library parts |
Snowflakes are allowed — systems without escape hatches get abandoned — but they must be named, quarantined, and reviewed. When any recipe/snowflake gets reused a third time, promote it into the library ("rule of three").
Need UI?
│
├─ 1. DISCOVER first (mandatory):
│ • search the component library (grep src/components, the DS package)
│ • check Storybook stories for existing variants/states
│ • if a Storybook MCP / shadcn registry / Figma Code Connect is available, query it
│
├─ 2. Component + variant exist → use as-is. Done.
├─ 3. Component exists, look missing → add variant/state IN THE LIBRARY + story → use it.
├─ 4. It's a combination of components → build a Recipe + story in the Recipes section.
├─ 5. Nothing fits → build a new component IN THE LIBRARY
│ (tokens only, variants API, stories for all states)
│ → then use it in the app.
└─ NEVER: copy-paste a component, restyle at a call site, or hardcode a value.
Duplication is almost always a discovery failure. Two minutes of searching beats twenty minutes of rebuilding — and beats the third divergent implementation forever.
Check the diff you produced, not the whole repo:
rgb()/hsl()/oklch() literals, no Tailwind arbitrary values, no inline style (run bun ${CLAUDE_PLUGIN_ROOT}/skills/frontend/design-system-guardrails/scripts/audit-ui.ts <path> if available — it checks exactly this)If any box fails, fix it before reporting the task complete.
Do this in order — tokens before components, components before screens:
@theme block and wipe defaults (--color-*: initial) so only your semantic tokens compile into utilities. Without Tailwind, a single CSS custom-properties file. → references/design-tokens.mdsrc/components/ui/ (or a package), Storybook with a Foundations / Components / Recipes / Snowflakes hierarchy, stories colocated with components. → references/storybook-structure.mdStack, Grid, Box). → references/component-patterns.mdassets/, add ${CLAUDE_PLUGIN_ROOT}/skills/frontend/design-system-guardrails/scripts/audit-ui.ts to CI, add story/visual tests. → references/enforcement.mdbun ${CLAUDE_PLUGIN_ROOT}/skills/frontend/design-system-guardrails/scripts/audit-ui.ts <repo-path> — it reports hardcoded colors, arbitrary values, inline styles, appearance overrides on components, and library components missing stories.Read these when the task goes deeper than the rules above (if a file is missing, the rules above are self-sufficient):
references/design-tokens.md — token tiers, Tailwind v4 strict theme setup, shadcn/ui semantic token conventions, dark mode, Figma → Style Dictionary pipelinesreferences/storybook-structure.md — Storybook hierarchy, story conventions per component, recipes section, interaction/visual/a11y testing, agent-oriented docsreferences/component-patterns.md — CVA reference implementation, state handling, the className policy, layout primitives, framework-agnostic equivalentsreferences/enforcement.md — complete ESLint/Stylelint configurations, CI gates, governance & promotion process, adoption metricsscripts/audit-ui.ts (run via bun ${CLAUDE_PLUGIN_ROOT}/skills/frontend/design-system-guardrails/scripts/audit-ui.ts) — dependency-free repo audit (CI-ready: exits non-zero on errors, --json for tooling). Covered by scripts/audit-ui.test.ts.assets/eslint.guardrails.example.mjs, assets/stylelint.guardrails.example.cjs — drop-in lint config templatesFramework note: the five rules are framework-agnostic. Examples here use React + Tailwind as the reference implementation; in Vue/Svelte/Angular apply the same rules with the equivalent mechanisms (props for variants, CSS custom properties for tokens, Storybook supports all of them).
assets/eslint.guardrails.example.mjs (opens in a new tab)assets/stylelint.guardrails.example.cjs (opens in a new tab)references/component-patterns.md (opens in a new tab)references/design-tokens.md (opens in a new tab)references/enforcement.md (opens in a new tab)references/storybook-structure.md (opens in a new tab)scripts/audit-ui.test.ts (opens in a new tab)scripts/audit-ui.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub madappgang/magus --plugin dev19 skills in this plugin
/aggregate-reviewsMerges independent reviews of one target into one report with a consensus tag per finding and a verdict from supplied thresholds; also synthesises research findings. Use when several reviews or votes must become one file a gate reads./architectureRouter for architecture knowledge — 7 architectural styles (layered, hexagonal, clean, modular monolith, microservices, event-driven, CQRS) and the 22 GoF design patterns. Names which file to read; loads none of them./brainstormingExplores solution approaches in parallel across models through claudish, then has an external panel review the chosen plan. Use when the direction is open, or the user asks to brainstorm or compare approaches./browser-debuggingDrives a real browser — claude-in-chrome or browser-use — to verify a UI change, read console and network activity, and reproduce browser-only bugs. Use when checking UI in a running app or chasing a console error./code-roastRoasts code with severity-graded sins, cites file and line, offers redemption. Use when the user asks to roast code, find sins, or shame my code./context-detectionDetects the project stack from its config files, then names the one or two dev skill files to read for this task — it loads none of them. Use at the start of any coding task, or on an unfamiliar or multi-stack repo.Other plugins' skills for the same job