AgentSkillsCN

Ux Patterns Definition

导航、用户流程、交互设计及无障碍访问的UX模式制定指导

SKILL.md
--- frontmatter
description: UX pattern definition guidance for navigation, user flows, interactions, and accessibility
globs: []
alwaysApply: false

UX Patterns Definition Skill

Project: [PROJECT_NAME] Generated: [DATE] Purpose: Guide for defining UX patterns including navigation, user flows, interactions, and accessibility

When to Use

This skill guides you when defining UX patterns for:

  • UX pattern definition in /plan-product
  • Frontend architecture planning
  • Interaction design decisions

Quick Reference

UX Definition Process

  1. Analyze Product Type: Determine application category and user context
  2. Select Navigation Pattern: Match to product complexity and user mental model
  3. Define User Flows: Map key workflows from entry to completion
  4. Choose Interaction Patterns: Buttons, forms, drag-drop, gestures
  5. Define Feedback Patterns: Loading, success, error, empty states
  6. Set Accessibility Level: WCAG target and specific requirements
  7. Document in ux-patterns.md: Fill template with approved patterns

UX Patterns are COMPLETE when

  • Navigation pattern selected with rationale
  • Key user flows mapped (3-5 primary flows)
  • Interaction patterns defined for common actions
  • Feedback patterns specified for all states
  • Mobile considerations documented (if applicable)
  • Accessibility level and requirements set

Detailed Guidance

Navigation Patterns

Pattern Selection Guide

Product TypeRecommended PatternWhy
Dashboard/AdminSidebar navigationMany sections, quick switching, persistent context
Content/BlogTop navigation barLinear content, few top-level sections
E-commerceMega menu + breadcrumbsDeep category hierarchy, wayfinding
Mobile-first appBottom tab barThumb-reachable, limited primary destinations
DocumentationSidebar + table of contentsHierarchical content, in-page navigation
Social/FeedTop tabs + infinite scrollContent-first, few navigation levels
Multi-step toolWizard/stepperSequential process, progress tracking
Settings/ConfigVertical tabs or accordionGrouped options, scannable categories

Navigation Principles

  • Max 7 top-level items (Miller's Law)
  • 3-click rule: Any content reachable in 3 clicks
  • Consistent placement: Navigation stays in same position across pages
  • Current state visible: Active item always highlighted
  • Mobile-first: Design navigation for smallest screen first

User Flow Design

Flow Mapping Template

For each key flow, document:

code
Flow: [Name]
Entry Point: [Where user starts]
Steps:
  1. [Action] → [What user sees]
  2. [Action] → [What user sees]
  3. [Action] → [What user sees]
Success State: [What happens on completion]
Error States: [What can go wrong at each step]
Alternative Paths: [Shortcuts or alternate routes]

Common Flow Patterns

Flow TypePatternKey Considerations
OnboardingProgressive disclosureDon't overwhelm, show value early
AuthenticationSingle-page or modalMinimize friction, support social login
Data EntryStep-by-step wizardValidate inline, save progress
Search & FilterFaceted searchInstant results, clear filter state
CRUD OperationsList → Detail → EditConsistent patterns across entities
CheckoutLinear wizardProgress bar, minimal distractions

Interaction Patterns

Buttons & Actions

Action TypePatternExample
PrimarySolid, prominent"Save", "Submit", "Create"
SecondaryOutlined or subdued"Cancel", "Back", "Skip"
DestructiveRed/warning color, confirmation"Delete", "Remove"
InlineIcon button or text linkEdit, duplicate, share

Principles:

  • One primary action per view
  • Destructive actions require confirmation
  • Button labels describe the action ("Save Changes" not "OK")

Forms & Input

PatternWhen to Use
Inline validationReal-time feedback as user types
On-blur validationValidate when user leaves field
Submit validationSimple forms with few fields
Multi-step form> 6 fields, logical groupings
Auto-saveLong forms, collaborative editing

Principles:

  • Labels above inputs (not placeholder-only)
  • Error messages next to the field, not at top
  • Required fields marked, optional fields noted
  • Logical tab order

Data Display

PatternWhen to Use
TableStructured data, comparison, sorting needed
Card gridVisual items, variable content length
ListSequential items, scannable titles
TimelineChronological events
KanbanStatus-based workflow

Feedback Patterns

State Coverage

Every view should handle these states:

StatePatternExample
LoadingSkeleton screens or spinnerContent placeholders with animation
EmptyIllustration + CTA"No projects yet. Create your first project."
SuccessToast/snackbar notification"Changes saved successfully" (auto-dismiss)
ErrorInline message or toast"Failed to save. Please try again." (with retry)
PartialProgress indicator"Uploading 3 of 7 files..."
OfflineBanner notification"You're offline. Changes will sync when connected."

Notification Hierarchy

code
Critical (blocks user): Modal dialog — requires action
Important (needs attention): Banner/alert — persistent until dismissed
Informational (nice to know): Toast/snackbar — auto-dismiss after 5s
Background (status update): Badge/indicator — passive display

Mobile Considerations

Responsive Patterns

Desktop PatternMobile Equivalent
Sidebar navigationBottom tab bar or hamburger menu
Multi-column layoutSingle column, stacked
Hover statesLong-press or tap actions
Right-click context menuSwipe actions or action sheet
Data tablesCard list or horizontal scroll
Modal dialogsFull-screen sheets

Touch Targets

  • Minimum: 44x44px (Apple HIG) / 48x48dp (Material)
  • Comfortable: 48x48px with 8px spacing
  • Primary actions: Bottom of screen (thumb zone)

Accessibility Guidelines (WCAG)

Level Selection

LevelRequirementsWhen to Choose
A (Minimum)Basic accessibilityInternal tools, MVP
AA (Standard)Good accessibilityMost web applications, recommended default
AAA (Enhanced)Maximum accessibilityGovernment, healthcare, education

Key Requirements (AA)

CategoryRequirement
Color4.5:1 contrast ratio for text, 3:1 for large text
KeyboardAll functionality accessible via keyboard
Screen ReaderProper ARIA labels, semantic HTML, alt text
FocusVisible focus indicators, logical focus order
MotionRespect prefers-reduced-motion, no auto-play
FormsAssociated labels, error identification, suggestions
NavigationSkip links, consistent navigation, page titles

Interactive Decision Template

When presenting UX recommendations to the user:

code
Based on your [product type] targeting [audience], I recommend:

**Navigation:** [Pattern] — [rationale]
**Key Flows:** [Top 3 flows identified]
**Interactions:** [Primary patterns]
**Feedback:** [Approach]
**Accessibility:** WCAG [Level] — [rationale]

Would you like to:
1. Approve and proceed
2. Discuss alternatives for any pattern
3. Adjust the accessibility level

Template Reference

Use template: specwright/templates/product/ux-patterns-template.md

Hybrid lookup:

  • TRY: specwright/templates/product/ux-patterns-template.md (project)
  • FALLBACK: ~/.specwright/templates/product/ux-patterns-template.md (global)