| name | ux-design |
| description | Use when designing user interfaces, improving UX, or creating design specifications. Enforces user-centered process, WCAG 2.1 AA accessibility, mobile-first approach. Triggers: 'design interface', 'improve UX', 'user experience', 'accessibility', 'responsive design', 'user flow'. |
UX Design
Required when creating or improving user interfaces. Enforces user-centered design with accessibility-first approach.
Core Principles
You must follow these non-negotiable principles:
- User needs drive decisions - Never add features without user validation
- Accessibility is baseline - WCAG 2.1 AA minimum, AAA where feasible
- Mobile-first always - Design for constraints, enhance for capabilities
- Document rationale - Every decision needs recorded reasoning
- Test with users - Assumptions kill usability
Mandatory Workflow
Never skip steps. Each phase validates the next.
Phase 1: Research (Required)
Before any design work:
- Identify user segments and needs
- Define success metrics
- Document constraints (technical, time, resources)
- Map current pain points if redesigning
State findings explicitly before proceeding.
Phase 2: Information Architecture
Create structure before visuals:
- User flows (happy path + edge cases)
- Content hierarchy
- Navigation patterns
- Error state handling
Use simple diagrams or structured text. Never jump to visual design without IA.
Phase 3: Design Implementation
Accessibility Requirements (Non-Negotiable)
Perceivable
- Color contrast: 4.5:1 text, 3:1 UI components
- Alt text for all informative images
- Captions/transcripts for media
- Text resizable to 200% without horizontal scroll
Operable
- Keyboard navigable (visible focus indicators)
- Touch targets minimum 44x44px (48x48px preferred)
- No keyboard traps
- Sufficient time limits
- Skip navigation links
Understandable
- Clear labels and instructions
- Consistent navigation
- Error identification and recovery guidance
- Plain language (8th grade level default)
Robust
- Semantic HTML structure
- ARIA only when native HTML insufficient
- Progressive enhancement
Mobile-First Implementation
Start with smallest viewport (320px). Use min-width queries to enhance.
/* Correct mobile-first */
.container { width: 100%; }
@media (min-width: 768px) { .container { width: 750px; } }
/* Never use max-width for responsive */
Design Tokens (Required)
Define systematic values:
/* Spacing (8px base) */
--space-1: 0.5rem;
--space-2: 1rem;
--space-3: 1.5rem;
/* Type scale (1.25 ratio) */
--text-xs: 0.64rem;
--text-sm: 0.8rem;
--text-base: 1rem;
--text-lg: 1.25rem;
/* Semantic colors */
--color-primary: /* brand color */;
--color-text: /* high contrast */;
--color-background: /* base */;
Phase 4: Validation
Required before implementation:
- Accessibility audit against WCAG 2.1 AA
- Responsive testing (320px to 2560px)
- User flow verification
- Performance budget check
- Cross-browser/device testing plan
Phase 5: Documentation
Create implementation specifications:
- Component inventory with states
- Interaction patterns
- Responsive breakpoints
- Accessibility annotations
- Edge case handling
- Success metrics
Avoiding Generic Design
Combat "AI slop" through specificity:
Typography: Choose distinctive fonts with high weight contrast. Never default to Inter/Roboto without justification.
Color: Commit to bold palettes. Avoid purple gradients and predictable combinations.
Layout: Break from centered containers. Use asymmetry and white space deliberately.
Motion: Prioritize meaningful transitions. Stagger page loads, avoid decoration.
Personality: Match brand voice. Generic "clean" and "modern" are not design directions.
Red Flags to Prevent
Never proceed if you catch yourself:
- Adding features without user need
- Treating accessibility as enhancement
- Starting with desktop layouts
- Using placeholder "Lorem ipsum" content
- Copying common patterns without adaptation
- Skipping documentation
- Assuming all users are identical
- Designing without constraints
Component Patterns
See @components.md for reusable patterns.
Testing Methodology
See @testing.md for validation protocols.
Decision Framework
When facing choices:
- What do users actually need? (not want)
- What's the simplest solution?
- How might this fail for disabled users?
- What's the mobile experience?
- How do we measure success?
Document answers before proceeding.
Progressive Disclosure
Complex features require staged revelation:
- Core functionality visible immediately
- Advanced options revealed on demand
- Help text contextual, not overwhelming
Error Prevention
Design to prevent errors before handling them:
- Clear affordances
- Confirmation for destructive actions
- Inline validation
- Progressive form disclosure
- Smart defaults
Performance Budget
- Initial load: <3 seconds on 3G
- Time to interactive: <5 seconds
- Core Web Vitals: Pass all thresholds
- Images: Optimized and lazy-loaded
- Fonts: Subset and preloaded
Deliverables Checklist
Before marking complete:
- User research documented
- User flows mapped
- Wireframes/mockups created
- Design tokens defined
- Accessibility audit passed
- Responsive behavior specified
- Component states documented
- Interaction patterns defined
- Implementation notes written
- Success metrics established
State: "UX design phase complete" only after all items checked.