Triggers
- ui design
- design system
- component library
- design tokens
- visual design
- interface design
- ui components
- button design
- form design
- card design
- color system
- typography system
- spacing system
- dark mode
- theming
- pixel perfect
- responsive design
- design handoff
- accessibility design
Instructions
Design System Foundation
When creating UI designs, establish the foundation first:
- Design Tokens: Define CSS custom properties for colors, typography, spacing, shadows, transitions
- Color System: Primary, secondary, semantic (success/warning/error/info), and neutral palettes with WCAG AA compliance
- Typography Scale: Consistent font sizes from xs (12px) to 4xl (36px) with appropriate line heights
- Spacing System: 4px base unit scale (4, 8, 12, 16, 24, 32, 48, 64px)
- Shadow & Elevation: Small, medium, large shadow tokens for depth perception
- Transition Tokens: Fast (150ms), normal (300ms), slow (500ms) ease curves
Component Architecture
Design base components with all states:
- Buttons: Primary, secondary, tertiary variants with sizes and states (default, hover, active, focus, disabled)
- Form Elements: Inputs, selects, checkboxes, radio buttons with validation states
- Navigation: Menu systems, breadcrumbs, pagination
- Feedback: Alerts, toasts, modals, tooltips
- Data Display: Cards, tables, lists, badges
- Loading States: Skeleton screens, spinners, progress bars
- Empty States: No data messaging and guidance
- Error States: Validation feedback and error messaging
Dark Mode & Theming
- Design dark theme tokens that invert appropriately (not just swapped values)
- Use
[data-theme="dark"] CSS selector pattern
- Ensure contrast ratios meet WCAG AA in both themes
- Respect
prefers-color-scheme system preference
Responsive Design
- Mobile-first approach starting at 320px
- Breakpoints: sm (640px), md (768px), lg (1024px), xl (1280px)
- Container max-widths and padding per breakpoint
- Grid patterns with responsive column counts
Accessibility (WCAG AA Minimum)
- Color contrast: 4.5:1 for normal text, 3:1 for large text
- Keyboard navigation: full functionality without mouse
- Focus indicators: clear 2px outline with offset
- Touch targets: 44px minimum for interactive elements
- Motion sensitivity: respect
prefers-reduced-motion
- Text scaling: design works up to 200% browser zoom
Performance-Conscious Design
- Optimize images, icons, and assets for web performance
- Design with CSS efficiency in mind
- Consider loading states and progressive enhancement
- Balance visual richness with technical constraints
EloPhanto Tool Integration
- Use
browser_navigate to review live implementations and audit design compliance
- Use
knowledge_write to persist design system documentation
- Use
web_search to research design patterns and accessibility standards
Deliverables
Component Library CSS
:root {
/* Color Tokens */
--color-primary-100: #f0f9ff;
--color-primary-500: #3b82f6;
--color-primary-900: #1e3a8a;
--color-success: #10b981;
--color-warning: #f59e0b;
--color-error: #ef4444;
--color-info: #3b82f6;
/* Typography Tokens */
--font-family-primary: 'Inter', system-ui, sans-serif;
--font-size-xs: 0.75rem;
--font-size-sm: 0.875rem;
--font-size-base: 1rem;
--font-size-lg: 1.125rem;
--font-size-xl: 1.25rem;
--font-size-2xl: 1.5rem;
--font-size-3xl: 1.875rem;
--font-size-4xl: 2.25rem;
/* Spacing Tokens */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-12: 3rem;
--space-16: 4rem;
/* Shadow Tokens */
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
/* Transition Tokens */
--transition-fast: 150ms ease;
--transition-normal: 300ms ease;
--transition-slow: 500ms ease;
}
[data-theme="dark"] {
--color-primary-100: #1e3a8a;
--color-primary-500: #60a5fa;
--color-primary-900: #dbeafe;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
font-family: var(--font-family-primary);
font-weight: 500;
border: none;
cursor: pointer;
transition: all var(--transition-fast);
&:focus-visible {
outline: 2px solid var(--color-primary-500);
outline-offset: 2px;
}
&:disabled {
opacity: 0.6;
cursor: not-allowed;
pointer-events: none;
}
}
Design System Deliverable Template
# [Project Name] UI Design System
## Design Foundations
- **Color System**: Primary, secondary, semantic, neutral palettes with accessibility
- **Typography System**: Font families, scale, weights, line heights
- **Spacing System**: 4px base unit scale
- **Shadow System**: Elevation levels for depth
## Component Library
- **Base Components**: Buttons, inputs, cards, navigation
- **Component States**: Default, hover, active, focus, disabled, loading, error, empty
- **Responsive Behavior**: How components adapt across breakpoints
## Responsive Design
- **Breakpoints**: 320px (mobile), 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
- **Grid System**: 12-column flexible grid
- **Container Widths**: Centered with max-widths per breakpoint
## Accessibility Standards
- **Color Contrast**: 4.5:1 normal text, 3:1 large text
- **Keyboard Navigation**: Full functionality, logical tab order
- **Focus Management**: Clear indicators
- **Touch Targets**: 44px minimum
Success Metrics
- Design system achieves 95%+ consistency across all interface elements
- Accessibility scores meet or exceed WCAG AA standards (4.5:1 contrast)
- Developer handoff requires minimal design revision requests (90%+ accuracy)
- User interface components are reused effectively reducing design debt
- Responsive designs work flawlessly across all target device breakpoints
Verify
- The change was rendered in a browser/simulator and a screenshot or DOM snapshot was captured, not just code-reviewed
- Layout was checked at the breakpoints the ui-design guide calls out (mobile + desktop minimum); evidence of each is attached
- Color, typography, and spacing values used come from the project's design tokens / theme, not hard-coded ad-hoc values
- Keyboard navigation and focus order were exercised on every interactive element introduced
- Reduced-motion / dark-mode (when supported) variants were verified, not assumed to inherit
- No console errors or hydration warnings were emitted during the verification render
1---2name: ui-design3description: Expert UI designer specializing in visual design systems, component libraries, and pixel-perfect accessible interface creation. Adapted from msitarzewski/agency-agents.4---56## Triggers78- ui design9- design system10- component library11- design tokens12- visual design13- interface design14- ui components15- button design16- form design17- card design18- color system19- typography system20- spacing system21- dark mode22- theming23- pixel perfect24- responsive design25- design handoff26- accessibility design2728## Instructions2930### Design System Foundation31When creating UI designs, establish the foundation first:32331. **Design Tokens**: Define CSS custom properties for colors, typography, spacing, shadows, transitions342. **Color System**: Primary, secondary, semantic (success/warning/error/info), and neutral palettes with WCAG AA compliance353. **Typography Scale**: Consistent font sizes from xs (12px) to 4xl (36px) with appropriate line heights364. **Spacing System**: 4px base unit scale (4, 8, 12, 16, 24, 32, 48, 64px)375. **Shadow & Elevation**: Small, medium, large shadow tokens for depth perception386. **Transition Tokens**: Fast (150ms), normal (300ms), slow (500ms) ease curves3940### Component Architecture41Design base components with all states:42- **Buttons**: Primary, secondary, tertiary variants with sizes and states (default, hover, active, focus, disabled)43- **Form Elements**: Inputs, selects, checkboxes, radio buttons with validation states44- **Navigation**: Menu systems, breadcrumbs, pagination45- **Feedback**: Alerts, toasts, modals, tooltips46- **Data Display**: Cards, tables, lists, badges47- **Loading States**: Skeleton screens, spinners, progress bars48- **Empty States**: No data messaging and guidance49- **Error States**: Validation feedback and error messaging5051### Dark Mode & Theming52- Design dark theme tokens that invert appropriately (not just swapped values)53- Use `[data-theme="dark"]` CSS selector pattern54- Ensure contrast ratios meet WCAG AA in both themes55- Respect `prefers-color-scheme` system preference5657### Responsive Design58- Mobile-first approach starting at 320px59- Breakpoints: sm (640px), md (768px), lg (1024px), xl (1280px)60- Container max-widths and padding per breakpoint61- Grid patterns with responsive column counts6263### Accessibility (WCAG AA Minimum)64- Color contrast: 4.5:1 for normal text, 3:1 for large text65- Keyboard navigation: full functionality without mouse66- Focus indicators: clear 2px outline with offset67- Touch targets: 44px minimum for interactive elements68- Motion sensitivity: respect `prefers-reduced-motion`69- Text scaling: design works up to 200% browser zoom7071### Performance-Conscious Design72- Optimize images, icons, and assets for web performance73- Design with CSS efficiency in mind74- Consider loading states and progressive enhancement75- Balance visual richness with technical constraints7677### EloPhanto Tool Integration78- Use `browser_navigate` to review live implementations and audit design compliance79- Use `knowledge_write` to persist design system documentation80- Use `web_search` to research design patterns and accessibility standards8182## Deliverables8384### Component Library CSS85```css86:root {87 /* Color Tokens */88 --color-primary-100: #f0f9ff;89 --color-primary-500: #3b82f6;90 --color-primary-900: #1e3a8a;9192 --color-success: #10b981;93 --color-warning: #f59e0b;94 --color-error: #ef4444;95 --color-info: #3b82f6;9697 /* Typography Tokens */98 --font-family-primary: 'Inter', system-ui, sans-serif;99 --font-size-xs: 0.75rem;100 --font-size-sm: 0.875rem;101 --font-size-base: 1rem;102 --font-size-lg: 1.125rem;103 --font-size-xl: 1.25rem;104 --font-size-2xl: 1.5rem;105 --font-size-3xl: 1.875rem;106 --font-size-4xl: 2.25rem;107108 /* Spacing Tokens */109 --space-1: 0.25rem;110 --space-2: 0.5rem;111 --space-3: 0.75rem;112 --space-4: 1rem;113 --space-6: 1.5rem;114 --space-8: 2rem;115 --space-12: 3rem;116 --space-16: 4rem;117118 /* Shadow Tokens */119 --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);120 --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);121 --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);122123 /* Transition Tokens */124 --transition-fast: 150ms ease;125 --transition-normal: 300ms ease;126 --transition-slow: 500ms ease;127}128129[data-theme="dark"] {130 --color-primary-100: #1e3a8a;131 --color-primary-500: #60a5fa;132 --color-primary-900: #dbeafe;133}134135.btn {136 display: inline-flex;137 align-items: center;138 justify-content: center;139 font-family: var(--font-family-primary);140 font-weight: 500;141 border: none;142 cursor: pointer;143 transition: all var(--transition-fast);144145 &:focus-visible {146 outline: 2px solid var(--color-primary-500);147 outline-offset: 2px;148 }149150 &:disabled {151 opacity: 0.6;152 cursor: not-allowed;153 pointer-events: none;154 }155}156```157158### Design System Deliverable Template159```markdown160# [Project Name] UI Design System161162## Design Foundations163- **Color System**: Primary, secondary, semantic, neutral palettes with accessibility164- **Typography System**: Font families, scale, weights, line heights165- **Spacing System**: 4px base unit scale166- **Shadow System**: Elevation levels for depth167168## Component Library169- **Base Components**: Buttons, inputs, cards, navigation170- **Component States**: Default, hover, active, focus, disabled, loading, error, empty171- **Responsive Behavior**: How components adapt across breakpoints172173## Responsive Design174- **Breakpoints**: 320px (mobile), 640px (sm), 768px (md), 1024px (lg), 1280px (xl)175- **Grid System**: 12-column flexible grid176- **Container Widths**: Centered with max-widths per breakpoint177178## Accessibility Standards179- **Color Contrast**: 4.5:1 normal text, 3:1 large text180- **Keyboard Navigation**: Full functionality, logical tab order181- **Focus Management**: Clear indicators182- **Touch Targets**: 44px minimum183```184185## Success Metrics186187- Design system achieves 95%+ consistency across all interface elements188- Accessibility scores meet or exceed WCAG AA standards (4.5:1 contrast)189- Developer handoff requires minimal design revision requests (90%+ accuracy)190- User interface components are reused effectively reducing design debt191- Responsive designs work flawlessly across all target device breakpoints192193## Verify194195- The change was rendered in a browser/simulator and a screenshot or DOM snapshot was captured, not just code-reviewed196- Layout was checked at the breakpoints the ui-design guide calls out (mobile + desktop minimum); evidence of each is attached197- Color, typography, and spacing values used come from the project's design tokens / theme, not hard-coded ad-hoc values198- Keyboard navigation and focus order were exercised on every interactive element introduced199- Reduced-motion / dark-mode (when supported) variants were verified, not assumed to inherit200- No console errors or hydration warnings were emitted during the verification render