/builder-design:design-token-auditfrom builder-design
Use before any AI feature UI lands in production. Every colour, spacing value, typography, shadow, and border in AI components must reference design tokens — no hardcoded values. Blocks "I'll align with the design system later" completions.
Ships in builder-design. 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.
None: SKILL.md is the whole skill.
HARDCODED VALUES IN AI COMPONENTS ARE DESIGN SYSTEM DEBT.
"#3b82f6 is fine for now" is a value that diverges on the next rebrand and becomes the pattern every developer copies until there are 40 hardcoded blues in the codebase.
Every colour, spacing, typography, shadow, and border radius referencing a token IS a token-compliant component.
Trigger before:
Every AI component must reference tokens for all five categories:
/* ✗ Hardcoded — fails audit */
color: #3b82f6;
background: rgba(239, 68, 68, 0.1);
border: 1px solid #e5e7eb;
/* ✓ Token-compliant — passes audit */
color: var(--color-primary);
background: var(--color-error-subtle);
border: 1px solid var(--color-border);
AI-specific colour tokens that must exist:
--color-ai-response-bg /* Background for AI response containers */
--color-ai-streaming /* Streaming cursor colour */
--color-ai-uncertain /* Uncertainty indicator (amber family) */
--color-ai-citation /* Citation highlight colour */
--color-ai-error /* AI-specific error (may differ from system error) */
/* ✗ Fails */
padding: 12px 16px;
gap: 8px;
/* ✓ Passes */
padding: var(--space-3) var(--space-4);
gap: var(--space-2);
All spacing must follow a scale (4px base, or 8px base). Arbitrary values (13px, 22px, 37px) are automatic failures.
/* ✗ Fails */
font-size: 14px;
font-weight: 500;
line-height: 1.6;
/* ✓ Passes */
font-size: var(--text-sm);
font-weight: var(--font-medium);
line-height: var(--leading-relaxed);
/* ✗ Fails */
box-shadow: 0 4px 24px rgba(0,0,0,0.4);
/* ✓ Passes */
box-shadow: var(--shadow-md);
/* ✗ Fails */
border-radius: 8px;
/* ✓ Passes */
border-radius: var(--radius-sm);
For each AI component file, extract every hardcoded CSS value:
# Find hardcoded colours (hex, rgb, hsl, oklch)
grep -Ern "(#[0-9a-fA-F]{3,8}|rgba?\(|hsl[a]?\(|oklch\()" src/components/ai/
# Find hardcoded spacing (px, rem not using var())
grep -Ern "[0-9]+px|[0-9]+\.?[0-9]*rem" src/components/ai/ | grep -v "var(--"
# Find hardcoded font sizes
grep -Ern "font-size:\s*[0-9]" src/components/ai/
For each hardcoded value found:
#3b82f6 → var(--color-primary) — replacetransition values may not need tokens in all systems — document the exceptionIf the design system doesn't have --color-ai-response-bg, --color-ai-uncertain, etc., define them now — not as hardcoded values in the component, but as tokens in the system's token file.
All tokens must work in both light and dark mode (or the product's theme variants). AI-specific tokens are especially prone to dark mode failures — --color-ai-uncertain amber that works in light mode may be illegible in dark mode.
:root {
--color-ai-uncertain: oklch(75% 0.15 85); /* Amber, light mode */
}
[data-theme="dark"] {
--color-ai-uncertain: oklch(80% 0.18 85); /* Brighter for dark mode */
}
These thoughts mean tokens were not used — stop:
When design-token-audit is satisfied, state it like this:
Token audit complete.
Components audited: <N> — <list: ComponentName, ComponentName>
Token file: <path to token/variables file where AI tokens are defined>
Hardcoded values found: <N>
Mapped to existing tokens: <N>
New tokens defined: <N> — <list: --color-ai-response-bg, --color-ai-uncertain, etc.>
Documented exceptions: <N> (e.g. transition durations, 0 exceptions)
All 5 categories compliant:
Colour ✓ | Spacing ✓ | Typography ✓ | Shadow ✓ | Border radius ✓
AI-specific tokens:
--color-ai-response-bg: defined ✓ / not needed ✓
--color-ai-streaming: defined ✓ / not needed ✓
--color-ai-uncertain: defined ✓ / not needed ✓
--color-ai-citation: defined ✓ / not needed ✓
--color-ai-error: defined ✓ / not needed ✓
Dark mode: AI-specific tokens verified in light and dark ✓
Zero hardcoded values remaining ✓
AI feature components are often built under time pressure, outside the normal design system workflow. Hardcoded values in these components compound: each new AI component copies the pattern, the design system drifts from the product, and a theme change or rebrand requires editing every component individually instead of updating three token values.
What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/accessible-ai-outputUse before shipping any UI that renders AI-generated content. Dynamic model output requires ARIA live regions, reading order, and cognitive load review that static content does not. Blocks "we'll do accessibility later" completions./ai-component-patternsUse when designing or implementing any of the 6 core AI UI components. Each has specific patterns, pitfalls, and required sub-components that generic UI components don't address./ai-onboarding-designUse when designing first-run flows and empty states for AI features. AI onboarding has specific requirements — model capability communication, trust building, and graceful degradation when the model doesn't know — that generic onboarding patterns miss.Other plugins' skills for the same job
builder-design@rbraga01 is listed by rbraga01/a-team — review the source before installing
npx claudepluginhub rbraga01/a-team --plugin builder-design