skills/design-system-architecture/SKILL.md
Build scalable design systems with design tokens, component APIs, and documentation. Use when creating or evolving component libraries.
npx skillsauth add nickcrew/claude-cortex design-system-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive guide to building scalable design systems with proper token architecture, component APIs, and documentation strategies.
┌─────────────────────────────────────┐
│ Component Tokens │ → button-primary-bg
│ (Specific to components) │
├─────────────────────────────────────┤
│ Semantic Tokens │ → color-action-primary
│ (Purpose-based naming) │
├─────────────────────────────────────┤
│ Primitive Tokens │ → blue-500
│ (Raw values) │
└─────────────────────────────────────┘
/* Primitive Tokens */
--color-blue-500: #3b82f6;
--spacing-4: 1rem;
--font-size-base: 16px;
--radius-md: 8px;
/* Semantic Tokens */
--color-action-primary: var(--color-blue-500);
--color-text-primary: var(--color-gray-900);
--spacing-component-gap: var(--spacing-4);
/* Component Tokens */
--button-bg: var(--color-action-primary);
--button-padding-x: var(--spacing-4);
--card-radius: var(--radius-md);
// tokens/themes.ts
export const lightTheme = {
'color-bg-primary': 'var(--color-white)',
'color-text-primary': 'var(--color-gray-900)',
'color-border': 'var(--color-gray-200)',
}
export const darkTheme = {
'color-bg-primary': 'var(--color-gray-900)',
'color-text-primary': 'var(--color-gray-100)',
'color-border': 'var(--color-gray-700)',
}
// ✅ Good: Clear, typed, with sensible defaults
interface ButtonProps {
variant?: 'primary' | 'secondary' | 'ghost';
size?: 'sm' | 'md' | 'lg';
isLoading?: boolean;
isDisabled?: boolean;
leftIcon?: React.ReactNode;
children: React.ReactNode;
onClick?: () => void;
}
// ✅ With defaults
const Button = ({
variant = 'primary',
size = 'md',
isLoading = false,
isDisabled = false,
...props
}: ButtonProps) => { ... }
// Compound components for complex UIs
const Tabs = ({ children, defaultValue }) => { ... }
Tabs.List = ({ children }) => { ... }
Tabs.Tab = ({ value, children }) => { ... }
Tabs.Panel = ({ value, children }) => { ... }
// Usage
<Tabs defaultValue="tab1">
<Tabs.List>
<Tabs.Tab value="tab1">First</Tabs.Tab>
<Tabs.Tab value="tab2">Second</Tabs.Tab>
</Tabs.List>
<Tabs.Panel value="tab1">Content 1</Tabs.Panel>
<Tabs.Panel value="tab2">Content 2</Tabs.Panel>
</Tabs>
// Component that can render as different elements
interface BoxProps<C extends React.ElementType> {
as?: C;
children?: React.ReactNode;
}
type PolymorphicProps<C extends React.ElementType> =
BoxProps<C> & Omit<React.ComponentPropsWithoutRef<C>, keyof BoxProps<C>>;
const Box = <C extends React.ElementType = 'div'>({
as,
...props
}: PolymorphicProps<C>) => {
const Component = as || 'div';
return <Component {...props} />;
};
// Usage
<Box as="section" className="...">Content</Box>
<Box as="button" onClick={...}>Click me</Box>
# Button
Buttons trigger actions or navigate users.
## Usage
\`\`\`jsx
import { Button } from '@/components/ui'
<Button variant="primary" size="md">
Click me
</Button>
\`\`\`
## Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| variant | 'primary' \| 'secondary' \| 'ghost' | 'primary' | Visual style |
| size | 'sm' \| 'md' \| 'lg' | 'md' | Size preset |
## Examples
### Variants
[Interactive examples]
### With Icons
[Interactive examples]
## Accessibility
- Uses `<button>` element by default
- Supports keyboard activation
- Loading state announced to screen readers
development
Product vision, roadmap development, and go-to-market execution with structured prioritization frameworks. Use when evaluating features, planning product direction, or assessing market fit.
development
Complete operational workflow for implementer agents (Codex, Gemini, etc.) making code changes and writing tests. Drives all work through atomic commits — each loop operates on the smallest complete, reviewable change. Defines the Code Change Loop, Test Writing Loop, Lint Gate, and Issue Filing process with circuit breakers, severity levels, and escalation rules. Requires `cortex git commit` for all commits. Includes bundled provider-aware review scripts that keep same-model shell-outs as the last resort, plus a fresh-context Codex fallback for code review and test audit. Use this skill when starting any implementation task.
development
Use this skill when writing product requirements documents, prioritizing features, creating user stories, defining acceptance criteria, or setting product metrics. Trigger phrases: 'write a PRD for', 'prioritize this feature backlog', 'write user stories for', 'help me define acceptance criteria', 'what metrics should we track for'. Not for writing code, designing UI mockups, or conducting user research interviews.
tools
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.