skills/frontend-design/SKILL.md
Use this skill when specifying, designing, or documenting UI components, layouts, and design systems for frontend implementation. Trigger phrases: 'design this UI component', 'create a responsive layout', 'spec the CSS for', 'design system for'. Do NOT use for backend development, server-side logic, data engineering, or writing server code.
npx skillsauth add nickcrew/claude-cortex frontend-designInstall 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.
This skill bridges the gap between visual design and frontend implementation. It produces precise, developer-ready specifications for UI components, responsive layouts, and design systems—including CSS custom properties, layout logic, spacing scales, component states, and interaction behaviors. Whether you are designing a single button component or specifying an entire design system, the output is implementation-ready: exact values, not vague descriptions. This skill is for designing and specifying the frontend; for writing the actual code, pair it with a coding skill.
api-designer skill instead)| Task | Approach | |------|----------| | Spacing scale | 4px base unit: 4, 8, 12, 16, 24, 32, 48, 64, 96, 128 | | Typography scale | 12, 14, 16 (base), 18, 20, 24, 30, 36, 48, 60, 72px | | Breakpoints | Mobile: <640px, Tablet: 640–1024px, Desktop: >1024px (adjust for product) | | Grid | 4-column mobile, 8-column tablet, 12-column desktop; 16–24px gutters | | Component states | Always spec: default, hover, focus, active, disabled, loading, error | | Elevation | 3–5 levels: flat, raised (2px), overlay (4–8px), modal (16px), tooltip (24px) | | Focus ring | 2px offset, 2px width, brand primary color — never remove, only restyle | | Transition | 150ms ease-out for micro-interactions; 250–300ms for larger state changes |
Define the component or layout scope precisely. Name the component, its purpose, and where it appears in the product. A "Button" spec covers all button variants across the app; a "Hero Section" spec covers one layout pattern. Clarify scope before specifying—ambiguity at this stage creates implementation inconsistencies later.
Establish the design token foundation first. Before specifying any component, confirm the token system: color tokens (brand, semantic, neutral scales), spacing scale (4px base unit recommended), typography scale (size, weight, line-height, letter-spacing per level), and border radius values. Components reference tokens, not raw values — this makes theming and design system updates tractable.
Specify every component state. For interactive components, document all states: default, hover, focus-visible, active/pressed, disabled, loading, and any error or validation states. For each state, specify: background color, text color, border color, shadow, cursor, and transition from previous state. Missing states become inconsistent implementations.
Define layout with explicit grid and spacing logic. Specify column count, gutter width, and margin at each breakpoint. Name layout regions (header, sidebar, main, footer). Define how the layout collapses across breakpoints — not just "it becomes mobile" but specifically which columns stack, what reorders, and what hides.
Write CSS custom properties for every design token. Use the -- prefix convention. Group by category: --color-brand-primary, --spacing-4, --font-size-base, --radius-md, --shadow-md. Provide the actual values alongside the tokens. This makes the spec immediately usable by developers without translation.
Specify responsive behavior explicitly. For each breakpoint, document: font sizes, spacing adjustments, layout changes, and component variations (e.g., a desktop mega-menu becoming a mobile drawer). Use min-width breakpoints (mobile-first) as the default unless the project already uses a different convention.
Document interaction and animation specs. For every interactive state transition, specify: duration (ms), easing function, and which properties animate. For complex interactions (modals, drawers, tooltips), specify trigger, entrance animation, exit animation, and focus management behavior.
Produce a component anatomy diagram or structured spec. Label every sub-element of the component (container, icon, label, badge, etc.) with its token references. This eliminates ambiguity about which part of the spec applies to which element.
Input: "Spec a button component for our design system. We have primary, secondary, and ghost variants. Sizes: small, medium, large. Must be accessible. We use a 4px spacing scale and our primary brand color is #2563eb."
Output:
/* Color tokens */
--color-brand-primary-500: #2563eb;
--color-brand-primary-600: #1d4ed8;
--color-brand-primary-700: #1e40af;
--color-brand-primary-100: #dbeafe;
--color-neutral-700: #374151;
--color-neutral-800: #1f2937;
--color-white: #ffffff;
/* Spacing */
--spacing-2: 4px;
--spacing-3: 6px;
--spacing-4: 8px;
--spacing-6: 12px;
--spacing-8: 16px;
--spacing-10: 20px;
--spacing-12: 24px;
/* Typography */
--font-size-sm: 14px;
--font-size-base: 16px;
--font-weight-medium: 500;
--line-height-tight: 1.25;
/* Shape */
--radius-md: 6px;
/* Transition */
--transition-fast: 150ms ease-out;
| Size | Height | Padding (H × V) | Font size | Icon size | |------|--------|-----------------|-----------|-----------| | Small (sm) | 32px | 12px × 8px | 14px | 14px | | Medium (md) | 40px | 16px × 10px | 16px | 16px | | Large (lg) | 48px | 20px × 12px | 16px | 18px |
| State | Background | Text | Border | Shadow |
|-------|-----------|------|--------|--------|
| Default | --color-brand-primary-500 | white | none | none |
| Hover | --color-brand-primary-600 | white | none | none |
| Focus-visible | --color-brand-primary-500 | white | none | 0 0 0 2px white, 0 0 0 4px --color-brand-primary-500 |
| Active | --color-brand-primary-700 | white | none | none |
| Disabled | --color-brand-primary-200 | --color-brand-primary-400 | none | none |
| Loading | --color-brand-primary-500 | transparent | none | none + spinner overlay |
| State | Background | Text | Border |
|-------|-----------|------|--------|
| Default | white | --color-brand-primary-500 | 1.5px solid --color-brand-primary-500 |
| Hover | --color-brand-primary-100 | --color-brand-primary-600 | 1.5px solid --color-brand-primary-600 |
| Focus-visible | white | --color-brand-primary-500 | 1.5px solid + focus ring |
| Disabled | white | --color-neutral-400 | 1.5px solid --color-neutral-300 |
| State | Background | Text | Border |
|-------|-----------|------|--------|
| Default | transparent | --color-neutral-700 | none |
| Hover | --color-neutral-100 | --color-neutral-800 | none |
| Focus-visible | transparent | --color-neutral-700 | focus ring |
| Disabled | transparent | --color-neutral-400 | none |
background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast)outline: 2px solid var(--color-brand-primary-500); outline-offset: 2px — never outline: none without replacementbutton (native <button> preferred over role="button" on <div>)disabled attribute, not aria-disabled alone (removes from tab order correctly)aria-busy="true" and aria-label="Loading..." when in loading statearia-label with the button's actionInput: "Design a responsive layout for a SaaS analytics dashboard. It needs: a collapsible left sidebar with navigation, a top header bar, and a main content area with a 3-column card grid. Must work on mobile, tablet, and desktop."
Output:
Desktop (>1024px):
┌─────────┬──────────────────────────────────────┐
│ │ Header (64px, full width) │
│ Sidebar │──────────────────────────────────────│
│ (240px) │ │
│ │ Main Content Area │
│ │ (3-column card grid) │
│ │ │
└─────────┴──────────────────────────────────────┘
Tablet (640–1024px):
┌──────────────────────────────────────────────┐
│ Header (56px) + hamburger menu icon │
├──────────────────────────────────────────────┤
│ Main Content (2-column card grid) │
│ Sidebar: off-canvas drawer, opens on trigger │
└──────────────────────────────────────────────┘
Mobile (<640px):
┌──────────────────────────────────────────────┐
│ Header (52px) + hamburger menu icon │
├──────────────────────────────────────────────┤
│ Main Content (1-column card grid) │
│ Sidebar: full-width bottom sheet or drawer │
└──────────────────────────────────────────────┘
--sidebar-width: 240px;
--sidebar-collapsed-width: 64px;
--header-height-desktop: 64px;
--header-height-tablet: 56px;
--header-height-mobile: 52px;
--content-padding: 24px;
--content-padding-mobile: 16px;
--grid-gap: 16px;
--grid-gap-desktop: 24px;
| Breakpoint | Token | Value | Grid columns | Card grid |
|------------|-------|-------|--------------|-----------|
| Mobile | --bp-sm | 0–639px | 4 col | 1 col |
| Tablet | --bp-md | 640–1023px | 8 col | 2 col |
| Desktop | --bp-lg | 1024px+ | 12 col | 3 col |
| Wide | --bp-xl | 1280px+ | 12 col | 3 col (wider cards) |
| State | Desktop | Tablet | Mobile |
|-------|---------|--------|--------|
| Default | Expanded (240px) | Hidden | Hidden |
| Collapsed | Icon-only (64px) | — | — |
| Open trigger | Toggle button in sidebar | Hamburger in header | Hamburger in header |
| Close trigger | Toggle button | Backdrop click, ESC | Backdrop click, ESC, swipe down |
| Transition | width 200ms ease-in-out | Slide in from left (250ms) | Slide in from left (250ms) |
| Backdrop | None | rgba(0,0,0,0.4) overlay | rgba(0,0,0,0.4) overlay |
inert attribute on main).card-grid {
display: grid;
grid-template-columns: repeat(1, 1fr); /* mobile */
gap: var(--grid-gap);
padding: var(--content-padding-mobile);
}
@media (min-width: 640px) {
.card-grid {
grid-template-columns: repeat(2, 1fr); /* tablet */
padding: var(--content-padding);
gap: var(--grid-gap);
}
}
@media (min-width: 1024px) {
.card-grid {
grid-template-columns: repeat(3, 1fr); /* desktop */
gap: var(--grid-gap-desktop);
}
}
--radius-lg (8px)--color-white--color-neutral-2000 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)0 4px 6px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.06) — transition 150msoutline: none breaks keyboard navigation; always provide a styled alternativemargin-inline-start instead of margin-left) for easier RTL support later@container) are now well-supported and often better than media queries for component-level responsive behaviordevelopment
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.