/loxihart-design:design-system-builderfrom loxihart-design
Build cohesive, scalable design systems with design tokens, component libraries, documentation, and governance. Use when creating company-wide design systems, style guides, or component libraries for product teams. Also triggers on requests mentioning design tokens, component API design, Storybook setup, CVA variants, Style Dictionary, atomic design, theme configuration, or contribution workflows for shared UI libraries. Even if someone just says "I need a component library" or "set up our design system" — use this skill.
Ships in loxihart-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.
Read when SKILL.md points to them; scripts run unread.
<essential_principles>
Every design system follows this build order. Tokens are the foundation — components consume tokens — docs make components discoverable — governance keeps it alive. Skipping steps creates tech debt.
WCAG 2.2 AA minimum. Keyboard navigation, screen reader support, focus management, and color contrast are non-negotiable in every component. Not bolted on later.
All components share the same prop conventions: variant, size, disabled, className escape hatch, ...rest spread. Consumers learn one pattern and apply it everywhere.
Use sideEffects: false, per-component exports, and zero-runtime CSS (Tailwind + CVA recommended). Target under 100KB gzipped for the entire system.
Tokens in code must match Figma tokens exactly. Style Dictionary transforms a single source of truth into platform-specific outputs (CSS, iOS, Android). No manual syncing.
</essential_principles>
Identify starting point from the user's request:
| User Says | Route To |
|---|---|
| "New design system" / "start from scratch" / "set up our system" | workflows/new-system.md |
| "Add a component" / "build a button/card/modal" / "component API" | workflows/add-component.md |
| "Document our system" / "Storybook" / "component docs" | workflows/document-system.md |
| "Design tokens" / "token architecture" / "Style Dictionary" | references/token-architecture.md |
| "CVA" / "component patterns" / "testing components" / "bundle size" | references/component-patterns.md |
| "Governance" / "contribution workflow" / "versioning" / "release" | references/governance.md |
| "What tech stack?" / "Tailwind vs Styled Components" | references/tech-stack-comparison.md |
If ambiguous, ask: "Are you starting a new design system, adding components to an existing one, or documenting what you already have?"
| Workflow | Purpose | When to Read |
|---|---|---|
workflows/new-system.md | Full setup: charter → tokens → structure → first components | Starting from zero |
workflows/add-component.md | Design API → implement → test → document a single component | Adding to existing system |
workflows/document-system.md | Storybook, component docs, getting-started guides | System exists, needs docs |
| Reference | Purpose | When to Read |
|---|---|---|
references/token-architecture.md | 3-tier token system, JSON format, Style Dictionary config | Setting up or modifying tokens |
references/component-patterns.md | CVA variants, file structure, testing strategy, bundle optimization | Building or reviewing components |
references/governance.md | Contribution flow, versioning, release automation, quality gates | Establishing team processes |
references/tech-stack-comparison.md | CSS/JS framework tradeoffs (Tailwind+CVA, Styled Components, CSS Modules, Vanilla Extract) | Choosing or evaluating tech stack |
| Script | Purpose | When to Run |
|---|---|---|
scripts/build-tokens.js | Transform token JSON into CSS/JS/iOS/Android outputs via Style Dictionary | After creating or modifying token files |
scripts/generate-component.js | Scaffold a new component with implementation, tests, stories, and barrel export | Adding a new component to the library |
| Asset | Purpose | When to Use |
|---|---|---|
assets/starter-tokens.json | Complete starter token file with colors, spacing, typography, shadows, radii | Bootstrapping a new token system |
assets/style-dictionary.config.json | Ready-to-use Style Dictionary config for CSS + JS output | Setting up token build pipeline |
assets/storybook-theme.js | Branded Storybook theme matching design system tokens | Configuring Storybook appearance |
After reading the relevant workflow/reference, follow it exactly.
<quick_reference>
Recommended stack: Tailwind + CVA (class-variance-authority) for new systems
Component file pattern:
ComponentName/
├── ComponentName.tsx (implementation)
├── ComponentName.test.tsx (tests)
├── ComponentName.stories.tsx (Storybook)
└── index.ts (barrel export)
Atomic design hierarchy:
primitives/ — atoms (Button, Input, Text, Icon)components/ — molecules (Card, FormField, SearchInput)patterns/ — organisms (Navigation, Modal, DataTable)layouts/ — templates (AppShell, Dashboard)Token tiers:
blue-500: #3b82f6 or blue-500: oklch(60% 0.19 261))color-primary: {blue-500})button-bg: {color-primary})Color space note: Define primitive tokens in OKLCH for new systems — perceptually uniform lightness produces consistent palette steps and smooth gradients. Keep hex fallbacks for browser compatibility. Existing locked brand profiles (FlashFusion v3, Loxihart) stay in hex — OKLCH is for new token authoring only.
Quality gates for v1.0:
npx vizzly tdd or Chromatic)</quick_reference>
sideEffects: false in package.json is required for tree-shaking to work in webpack/Rollup — without it, all components are included even if only one is importedassets/starter-tokens.json (opens in a new tab)assets/storybook-theme.js (opens in a new tab)assets/style-dictionary.config.json (opens in a new tab)references/component-patterns.md (opens in a new tab)references/governance.md (opens in a new tab)references/tech-stack-comparison.md (opens in a new tab)references/token-architecture.md (opens in a new tab)scripts/build-tokens.js (opens in a new tab)scripts/generate-component.js (opens in a new tab)workflows/add-component.md (opens in a new tab)workflows/document-system.md (opens in a new tab)workflows/new-system.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub krosebrook/loxihart-skills --plugin loxihart-design19 skills in this plugin
/advanced-ux-patternsComprehensive UX best practices including accessibility (WCAG 2.2), interaction patterns, user research methods, and usability principles. Use when designing user interfaces, conducting UX audits, or implementing accessible, user-centered designs. Also triggers on WCAG, ARIA, keyboard navigation, screen reader, focus trap, focus management, touch targets, usability testing, heuristic evaluation, card sorting, tree testing, NPS, SUS, form design, navigation patterns, mobile UX, design handoff, cognitive load, information architecture, dark patterns, skeleton screen, error states, reduced motion, dark mode accessibility, component states, error recovery, or any request to audit, improve, spec, or review a user interface — even casually. If UI is involved, use this skill./advanced-visual-designAdvanced visual design techniques including typography systems, color theory, grid-based layouts, visual hierarchy, and composition principles. Use when creating high-quality visual designs, establishing design foundations, or implementing sophisticated design systems. Also triggers on type scale, font pairing, color palette, HSL color, 8-point grid, 12-column layout, visual hierarchy, whitespace, composition, rule of thirds, golden ratio, dark mode design, optical adjustments, or easing curves. Even if someone says "make this look professional" or "set up my design foundations" — use this skill.Other plugins' skills for the same job