AI Builder - UX Design
This skill creates/updates the UX design documentation including user flows, interaction specifications, edge cases, accessibility requirements, and most importantly, interactive HTML/CSS/JS mockups for UI-based applications.
When to Use This Skill
- User asks to "design UX" or "create mockups"
- User requests to start Stage 5 or the next stage after PRD
- User wants to visualize the product design
- User wants to create interactive prototypes
- User needs to present product design to non-technical stakeholders
Prerequisites
This skill requires 04-prd to be completed. The UX design will translate functional requirements into visual designs and user flows.
Your Roles in This Skill
- UX Designer: Lead UX design with user flows, interaction specs, and accessibility. Create user journey maps and ensure intuitive navigation. Design information architecture and interaction patterns. Ensure WCAG 2.1 accessibility compliance.
- UI Designer: Create visual mockups using static HTML/CSS/JS. Define theme, color palette, typography, and spacing. Design components and layouts. Create interactive prototypes that showcase the product to non-technical stakeholders.
- Content Moderator: Design user input moderation workflows in UI. Define content submission and review interfaces. Plan flagging, reporting, and appeals flows. Design moderation queue interfaces. Ensure community guidelines are presented clearly in UI. Plan user communication flows for moderation actions.
- Product Manager: Ensure UX aligns with requirements and user stories. Review flows against acceptance criteria. Validate that design solves user problems effectively.
Role Communication
As an expert in your assigned roles, you must announce your actions before performing them using the following format:
As a {Role} [and {Role}, ...], I will {action description}
This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
Instructions
Follow these steps in order:
Step 0: Verify Prerequisites and Gather Context
Check if 04-prd/ folder exists (mandatory):
- If NOT found: Inform user they need to create PRD first, then STOP
- If found: Read all files to understand:
- Functional requirements
- User journeys
- Product goals
- Non-functional requirements (especially usability and accessibility)
Check if 02-personas/ folder exists (mandatory):
- If NOT found: Inform user they need personas first, then STOP
- If found: Read to understand:
- User personas and their needs
- User pain points
- User preferences and behaviors
Check if 00-init-ideas/ folder exists (recommended):
- If found: Read to understand:
- Cost budget (to understand constraints for this stage)
Check if 03-mvp/ folder exists (recommended):
- If found: Read to understand:
- MVP scope
- Core features to prioritize in design
Check if this stage should be skipped:
- Check if
05-ux/SKIP.md exists
- If SKIP.md exists:
- Read SKIP.md to understand why this stage was skipped
- Inform the user: "Stage 5 (ux) is marked as SKIP because [reason from SKIP.md]"
- Ask the user: "Would you like to proceed to the next stage (architecture)?"
- If user says yes:
- Exit this skill and inform them to run the next stage skill
- If user says no:
- Ask if they want to proceed with UX anyway
- If yes, delete SKIP.md and continue with this skill
- If no, exit the skill
Check if 05-ux/ folder exists:
- If exists: Read all existing files to understand current UX design state
- If NOT exists: Will create new structure
If README.md exists: Check whether it requires diagrams. If it does,
follow dev-swarm/docs/mermaid-diagram-guide.md and use the
dev-swarm-mermaid skill to render outputs.
Proceed to Step 1 with gathered context
Step 1: Refine Design Requirements in README and Get Approval
CRITICAL: Create/update README.md first based on previous stage results, get user approval, then create other docs.
Analyze information from previous stages:
- Read
04-prd/ to understand functional requirements and user journeys
- Read
02-personas/ to understand user needs and pain points
- Read
03-mvp/ (if exists) to understand core features to prioritize
- Consider cost-budget constraints for this stage
Create or update 05-ux/README.md with refined requirements:
- List deliverables explicitly in README (typical: user-flows.md, interaction-specs.md, edge-cases.md, accessibility.md, mockups/)
- Stage overview and objectives (based on previous stage context)
- Owners: UX Designer (lead), UI Designer, Product Manager, Content Moderator
- Diagrams (if required by project init):
- Reference
dev-swarm/docs/mermaid-diagram-guide.md
- Include
diagram/ deliverables when needed
- What UX will include:
- User flows for critical journeys (list key flows from PRD)
- Interaction specifications for components
- Edge cases and error handling
- Accessibility compliance (WCAG 2.1 Level AA)
- Interactive mockups (for UI-based apps)
- Methodology:
- How user flows will be created (from PRD requirements)
- Mockup approach (HTML/CSS/JS for UI apps)
- Deliverables planned:
- List of files that will be created (user-flows.md, mockups/, etc.)
- Budget allocation for this stage (from cost-budget.md)
- Status: In Progress (update to "Completed" after implementation)
Present README to user:
- Show the UX approach and what will be designed
- Show what documentation files and mockups will be created
- Explain how it aligns with previous stages
- Ask: "Does this UX design plan look good? Should I proceed with creating user flows and mockups?"
Wait for user approval:
- If user says yes: Proceed to Step 2
- If user says no:
- Ask what needs to be changed
- Update README based on feedback
- Ask for approval again
Step 2: Create/Update UX Structure
Only after user approves the README:
Create files as specified in the approved README.md:
IMPORTANT: The file structure below is a SAMPLE only. The actual files you create must follow what was approved in the README.md in Step 1.
Typical structure (example):
05-ux/
├── README.md (already created and approved in Step 1)
├── user-flows.md (if specified in README)
├── interaction-specs.md (if specified in README)
├── edge-cases.md (if specified in README)
├── accessibility.md (if specified in README)
└── mockups/ (if specified in README - for UI-based applications)
├── index.html
├── styles.css
├── script.js
└── assets/
Create only the files listed in the README's "Deliverables planned" section.
Note: For UI-based web/mobile/desktop apps, the mockups/ folder with static HTML/CSS/JS files is CRITICAL as it showcases the product to non-technical stakeholders.
Step 3: Create/Update UX Documentation
IMPORTANT: Only create UX documentation after README is approved in Step 1.
NOTE: The content structure below provides GUIDELINES for typical UX documentation. Adapt based on the approved README and project needs.
user-flows.md (if specified in README):
Define user flows with diagrams and descriptions:
Critical User Flows:
For each critical flow from the PRD:
Format:
### Flow: [Flow Name]
**Related Requirements:** [FR-XXX, FR-YYY from PRD]
**User Persona:** [Primary/Secondary persona]
**Goal:** What the user wants to accomplish
**Flow Steps:**
1. **Entry Point:** Where does the user start?
- Screen/page: [Name]
- Trigger: [What initiates this flow]
2. **Step 1:** [Action/Screen]
- User action: [What user does]
- System response: [What happens]
- Next state: [Where user goes]
3. **Step 2:** [Action/Screen]
- User action: [What user does]
- System response: [What happens]
- Next state: [Where user goes]
... continue for all steps ...
N. **Success State:** [End goal achieved]
- Screen/page: [Name]
- Confirmation: [How user knows they succeeded]
**Alternative Paths:**
- If [condition]: User goes to [alternative step]
- If [error condition]: Show [error state]
**Flow Diagram:** (Use Mermaid or text-based diagram)
Use Mermaid diagrams when possible:
graph TD
A[Entry Point] --> B[Step 1]
B --> C{Decision?}
C -->|Yes| D[Step 2a]
C -->|No| E[Step 2b]
D --> F[Success]
E --> F
User Flow Categories:
- Onboarding Flow: First-time user experience
- Authentication Flows: Login, signup, password reset
- Core Feature Flows: Main user journeys for key features
- Settings & Profile Flows: User account management
- Error & Recovery Flows: What happens when things go wrong
interaction-specs.md:
Define interaction rules, states, and transitions:
Component States:
For each interactive component:
### Component: [Component Name]
**States:**
- **Default**: Normal state appearance and behavior
- **Hover**: When user hovers (desktop only)
- **Focus**: When component has keyboard focus
- **Active/Pressed**: When user clicks/taps
- **Disabled**: When component is not interactive
- **Loading**: When action is in progress
- **Error**: When validation fails or error occurs
- **Success**: When action completes successfully
**Transitions:**
- Default → Hover: [How it changes]
- Hover → Active: [How it changes]
- Active → Loading: [How it changes]
- Loading → Success/Error: [How it changes]
**Interaction Rules:**
- Click/tap behavior: [What happens]
- Keyboard interaction: [Enter, Space, Arrow keys, etc.]
- Screen reader behavior: [What is announced]
Interaction Patterns:
- Buttons: Primary, secondary, tertiary, icon buttons
- Forms: Input fields, dropdowns, checkboxes, radio buttons
- Navigation: Menus, tabs, breadcrumbs
- Feedback: Toast notifications, alerts, modals, confirmations
- Loading States: Spinners, skeleton screens, progress indicators
- Animations & Transitions: Durations, easing functions
Touch & Gesture Support (if mobile/tablet):
- Tap targets (minimum 44x44px)
- Swipe gestures
- Pull to refresh
- Long press actions
edge-cases.md:
Define edge cases and expected outcomes:
Data Edge Cases:
### Edge Case: [Scenario Name]
**Scenario:** What is the unusual condition?
**Examples:**
- Empty state: No data available
- Very long text: Name with 200 characters
- Special characters: Unicode, emojis, symbols
- Large numbers: Billions, scientific notation
- Zero values: Empty cart, $0.00 balance
**Expected Behavior:**
- What should the UI show?
- How should the system handle it?
- What message should the user see?
**Mockup Reference:** [Link to mockup showing this state]
Edge Case Categories:
- Empty States: No content, no results, no data
- Extreme Values: Very large, very small, zero, negative
- Boundary Conditions: Max length, min length, limits reached
- Unusual Input: Special characters, different languages, emojis
- Network Issues: Offline, slow connection, timeout
- Permission Issues: Access denied, unauthorized
- Concurrent Actions: Multiple users, race conditions
Error Scenarios:
- Validation Errors: Invalid input, missing required fields
- System Errors: Server errors, database errors, API failures
- Business Logic Errors: Insufficient balance, item out of stock
- User Errors: Wrong password, duplicate email, expired session
accessibility.md:
Define accessibility requirements and checklist:
Accessibility Standards:
- Target Compliance: WCAG 2.1 Level AA (or higher)
- Supported Assistive Technologies:
- Screen readers (NVDA, JAWS, VoiceOver)
- Keyboard navigation
- Voice control
- Screen magnification
WCAG 2.1 Checklist:
Perceivable:
Operable:
Understandable:
Robust:
Keyboard Navigation:
- Tab order and focus management
- Keyboard shortcuts (if any)
- Escape key behavior (close modals, cancel actions)
- Enter/Space key behavior (activate buttons, submit forms)
Screen Reader Support:
- ARIA labels and roles
- Live regions for dynamic content
- Meaningful link text (not "click here")
- Form field labels and error associations
mockups/ (CRITICAL for UI-based applications):
Create interactive HTML/CSS/JS mockups to showcase the product:
Purpose of Mockups:
- Visualize the product for non-technical stakeholders
- Define theme, style, and branding (colors, fonts, spacing)
- Showcase basic user flows interactively
- Serve as a project proposal to help customers understand what they'll get
- Provide a reference for developers during implementation
mockups/index.html:
Create a static HTML mockup with:
Structure:
- Proper HTML5 document structure
- Navigation section for site navigation
- Main content area with multiple screen sections
- Footer section
- Link to styles.css and script.js
What to Include:
- Multiple key screens: Home, main features, settings, profile
- Interactive navigation: Click to switch between screens
- Component examples: Buttons, forms, cards, modals
- State examples: Default, hover, active, disabled, loading, error
- Responsive design: Works on desktop, tablet, mobile
- Real content examples: Use realistic text and data (not Lorem Ipsum if possible)
mockups/styles.css:
Define the complete design system:
CSS Variables for Theme:
- Define color palette (primary, secondary, accent, background, surface, text, border, semantic colors)
- Define typography (font families, font sizes, font weights, line heights)
- Define spacing system (xs, sm, md, lg, xl, 2xl)
- Define border radius values (sm, md, lg, full)
- Define shadow values (sm, md, lg)
- Define transition timing (fast, base, slow)
Component Styles:
- Buttons (primary, secondary, outline, ghost)
- Forms (inputs, selects, checkboxes, radio buttons)
- Cards and containers
- Navigation (navbar, sidebar, tabs)
- Modals and dialogs
- Alerts and notifications
- Tables and lists
- Loading states and skeletons
Responsive Breakpoints:
- Define breakpoints for mobile, tablet, desktop, and wide screens
- Implement responsive behavior with media queries
mockups/script.js:
Add interactivity to the mockup:
Screen Navigation:
- Implement navigation function to switch between screens/pages
- Hide inactive screens and show active screen
- Handle navigation events (clicks on nav links)
Interactive Elements:
- Button click handlers
- Form interactions (show validation states)
- Modal open/close
- Dropdown menus
- Tab switching
- Accordion expand/collapse
- Toast notifications
State Demonstrations:
- Show loading states
- Show error states
- Show success states
- Show empty states
mockups/assets/:
Include any visual assets:
- Logo (SVG preferred)
- Icons (use icon libraries like Font Awesome or create custom SVGs)
- Sample images (if needed for mockup)
- Custom fonts (if not using web fonts)
Step 4: Ensure Alignment
Make sure UX design aligns with:
- Functional requirements from 04-prd/functional-requirements.md
- User journeys from 04-prd/prd.md
- User personas from 02-personas/
- MVP scope from 03-mvp/ (prioritize core features in mockups)
- Accessibility requirements from 04-prd/non-functional-requirements.md
Verify that:
- All critical user flows are documented
- All edge cases are considered
- Accessibility checklist is complete
- Mockups showcase the product effectively (for UI-based apps)
- Interactions are clearly specified
Step 5: Final User Review
Inform user that UX design is complete
Update README.md:
- Change Status from "In Progress" to "Completed"
- Add a Summary section with key insights (2-3 paragraphs)
- Add a Created Files section listing all created files
Present completed work to user:
- Show the interactive mockups (if UI-based app)
- Walk through critical user flows
- Demonstrate interaction patterns
- Explain accessibility considerations
Highlight key insights:
- Number of user flows documented
- Key interaction patterns defined
- Accessibility compliance level (WCAG 2.1 Level AA)
- Mockup screens created (if applicable)
- Theme and design system defined
For mockups specifically:
- Open
mockups/index.html in browser
- Demonstrate navigation between screens
- Show responsive behavior (resize browser)
- Point out theme consistency (colors, fonts, spacing)
- Explain how this represents the final product
Ask questions:
- Does the design align with their vision?
- Are there any flows missing?
- Any concerns about accessibility?
- Should any mockup screens be added/changed?
- Ready to proceed to next stage (architecture)?
Make adjustments based on user feedback if needed
Step 6: Commit to Git (if user confirms)
- If user confirms UX design is complete:
- Ask if they want to commit to git
- If user wants to commit:
- Stage all changes in
05-ux/
- Commit with message: "Design UX flows, interactions, and mockups (Stage 5)"
Expected Project Structure
project-root/
├── 00-init-ideas/
│ └── [existing files]
├── 01-market-research/ (optional)
│ └── [existing files if present]
├── 02-personas/
│ └── [existing files]
├── 03-mvp/
│ └── [existing files]
├── 04-prd/
│ └── [existing files]
└── 05-ux/
├── README.md (with owners and summary)
├── user-flows.md (flow diagrams with Mermaid)
├── interaction-specs.md (states, transitions, rules)
├── edge-cases.md (edge cases + expected outcomes)
├── accessibility.md (WCAG 2.1 checklist)
└── mockups/ (CRITICAL for UI apps)
├── index.html (interactive mockup)
├── styles.css (complete design system)
├── script.js (interactivity)
└── assets/ (images, icons, fonts)
Key UX Design Principles
- User-Centered: Design for user needs, not technical constraints
- Consistent: Use consistent patterns, components, and interactions
- Accessible: WCAG 2.1 Level AA compliance minimum
- Responsive: Works on all devices and screen sizes
- Clear: Intuitive navigation and clear feedback
- Forgiving: Handle errors gracefully with helpful messages
- Efficient: Minimize steps to complete tasks
- Delightful: Pleasant to use, not just functional
Mockup Best Practices (UI-Based Applications)
- Use realistic content: Avoid Lorem Ipsum, use actual product-like content
- Show multiple states: Default, hover, active, loading, error, success, empty
- Make it interactive: Allow clicking through key flows
- Keep it simple: Don't over-engineer, focus on showcasing design
- Use design system: Define colors, fonts, spacing in CSS variables
- Show responsiveness: Test on mobile, tablet, desktop sizes
- Include branding: Logo, color palette, typography that represent the brand
- Document theme: Comment the CSS to explain design decisions
Why Mockups Matter
For UI-based applications, mockups serve multiple purposes:
- Stakeholder Buy-in: Non-technical customers can see and interact with what they're getting
- Design Validation: Test the design before writing production code
- Developer Reference: Provides exact spacing, colors, fonts for implementation
- User Testing: Can be used to test flows with real users
- Proposal Tool: Helps sell the product vision to investors or clients
- Alignment: Ensures everyone has the same visual understanding
Deliverables
By the end of this stage, you should have:
- Complete user flow documentation with diagrams (5-15 critical flows)
- Detailed interaction specifications for all components
- Edge case documentation with expected behaviors
- Accessibility checklist and compliance plan (WCAG 2.1 Level AA)
- Interactive HTML/CSS/JS mockups showcasing theme, style, and user flows (for UI apps)
- Complete design system defined in CSS
- Foundation for architecture design (next stage)
- Visual reference for implementation
1---2name: dev-swarm-ux3description: Design user experience including flows, interactions, mockups, and accessibility. Use when user asks to design UX, create mockups, or start Stage 5 after PRD.4---5
6# AI Builder - UX Design
7
8This skill creates/updates the UX design documentation including user flows, interaction specifications, edge cases, accessibility requirements, and most importantly, **interactive HTML/CSS/JS mockups** for UI-based applications.
9
10## When to Use This Skill
11
12- User asks to "design UX" or "create mockups"
13- User requests to start Stage 5 or the next stage after PRD
14- User wants to visualize the product design
15- User wants to create interactive prototypes
16- User needs to present product design to non-technical stakeholders
17
18## Prerequisites
19
20This skill requires **04-prd** to be completed. The UX design will translate functional requirements into visual designs and user flows.
21
22## Your Roles in This Skill
23
24- **UX Designer**: Lead UX design with user flows, interaction specs, and accessibility. Create user journey maps and ensure intuitive navigation. Design information architecture and interaction patterns. Ensure WCAG 2.1 accessibility compliance.
25- **UI Designer**: Create visual mockups using static HTML/CSS/JS. Define theme, color palette, typography, and spacing. Design components and layouts. Create interactive prototypes that showcase the product to non-technical stakeholders.
26- **Content Moderator**: Design user input moderation workflows in UI. Define content submission and review interfaces. Plan flagging, reporting, and appeals flows. Design moderation queue interfaces. Ensure community guidelines are presented clearly in UI. Plan user communication flows for moderation actions.
27- **Product Manager**: Ensure UX aligns with requirements and user stories. Review flows against acceptance criteria. Validate that design solves user problems effectively.
28
29## Role Communication
30
31As an expert in your assigned roles, you must announce your actions before performing them using the following format:
32
33As a {Role} [and {Role}, ...], I will {action description}
34
35This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
36## Instructions
37
38Follow these steps in order:
39
40### Step 0: Verify Prerequisites and Gather Context
41
421. **Check if `04-prd/` folder exists (mandatory):**
43 - If NOT found: Inform user they need to create PRD first, then STOP
44 - If found: Read all files to understand:
45 - Functional requirements
46 - User journeys
47 - Product goals
48 - Non-functional requirements (especially usability and accessibility)
49
502. **Check if `02-personas/` folder exists (mandatory):**
51 - If NOT found: Inform user they need personas first, then STOP
52 - If found: Read to understand:
53 - User personas and their needs
54 - User pain points
55 - User preferences and behaviors
56
573. **Check if `00-init-ideas/` folder exists (recommended):**
58 - If found: Read to understand:
59 - Cost budget (to understand constraints for this stage)
60
614. **Check if `03-mvp/` folder exists (recommended):**
62 - If found: Read to understand:
63 - MVP scope
64 - Core features to prioritize in design
65
665. **Check if this stage should be skipped:**
67 - Check if `05-ux/SKIP.md` exists
68 - **If SKIP.md exists:**
69 - Read SKIP.md to understand why this stage was skipped
70 - Inform the user: "Stage 5 (ux) is marked as SKIP because [reason from SKIP.md]"
71 - Ask the user: "Would you like to proceed to the next stage (architecture)?"
72 - **If user says yes:**
73 - Exit this skill and inform them to run the next stage skill
74 - **If user says no:**
75 - Ask if they want to proceed with UX anyway
76 - If yes, delete SKIP.md and continue with this skill
77 - If no, exit the skill
78
796. **Check if `05-ux/` folder exists:**
80 - If exists: Read all existing files to understand current UX design state
81 - If NOT exists: Will create new structure
82
837. **If README.md exists:** Check whether it requires diagrams. If it does,
84 follow `dev-swarm/docs/mermaid-diagram-guide.md` and use the
85 `dev-swarm-mermaid` skill to render outputs.
86
878. Proceed to Step 1 with gathered context
88
89### Step 1: Refine Design Requirements in README and Get Approval
90
91**CRITICAL: Create/update README.md first based on previous stage results, get user approval, then create other docs.**
92
931. **Analyze information from previous stages:**
94 - Read `04-prd/` to understand functional requirements and user journeys
95 - Read `02-personas/` to understand user needs and pain points
96 - Read `03-mvp/` (if exists) to understand core features to prioritize
97 - Consider cost-budget constraints for this stage
98
992. **Create or update 05-ux/README.md with refined requirements:**
100 - List deliverables explicitly in README (typical: user-flows.md, interaction-specs.md, edge-cases.md, accessibility.md, mockups/)
101 - **Stage overview and objectives** (based on previous stage context)
102 - **Owners:** UX Designer (lead), UI Designer, Product Manager, Content Moderator
103 - **Diagrams (if required by project init):**
104 - Reference `dev-swarm/docs/mermaid-diagram-guide.md`
105 - Include `diagram/` deliverables when needed
106 - **What UX will include:**
107 - User flows for critical journeys (list key flows from PRD)
108 - Interaction specifications for components
109 - Edge cases and error handling
110 - Accessibility compliance (WCAG 2.1 Level AA)
111 - Interactive mockups (for UI-based apps)
112 - **Methodology:**
113 - How user flows will be created (from PRD requirements)
114 - Mockup approach (HTML/CSS/JS for UI apps)
115 - **Deliverables planned:**
116 - List of files that will be created (user-flows.md, mockups/, etc.)
117 - **Budget allocation for this stage** (from cost-budget.md)
118 - **Status:** In Progress (update to "Completed" after implementation)
119
1203. **Present README to user:**
121 - Show the UX approach and what will be designed
122 - Show what documentation files and mockups will be created
123 - Explain how it aligns with previous stages
124 - Ask: "Does this UX design plan look good? Should I proceed with creating user flows and mockups?"
125
1264. **Wait for user approval:**
127 - **If user says yes:** Proceed to Step 2
128 - **If user says no:**
129 - Ask what needs to be changed
130 - Update README based on feedback
131 - Ask for approval again
132
133### Step 2: Create/Update UX Structure
134
135**Only after user approves the README:**
136
1371. **Create files as specified in the approved README.md:**
138
139 **IMPORTANT:** The file structure below is a SAMPLE only. The actual files you create must follow what was approved in the README.md in Step 1.
140
141 **Typical structure (example):**
142 ```
143 05-ux/
144 ├── README.md (already created and approved in Step 1)
145 ├── user-flows.md (if specified in README)
146 ├── interaction-specs.md (if specified in README)
147 ├── edge-cases.md (if specified in README)
148 ├── accessibility.md (if specified in README)
149 └── mockups/ (if specified in README - for UI-based applications)
150 ├── index.html
151 ├── styles.css
152 ├── script.js
153 └── assets/
154 ```
155
156 **Create only the files listed in the README's "Deliverables planned" section.**
157
158 **Note**: For UI-based web/mobile/desktop apps, the `mockups/` folder with static HTML/CSS/JS files is **CRITICAL** as it showcases the product to non-technical stakeholders.
159
160### Step 3: Create/Update UX Documentation
161
162**IMPORTANT: Only create UX documentation after README is approved in Step 1.**
163
164**NOTE:** The content structure below provides GUIDELINES for typical UX documentation. Adapt based on the approved README and project needs.
165
166**user-flows.md (if specified in README):**
167
168Define user flows with diagrams and descriptions:
169
1701. **Critical User Flows:**
171
172 For each critical flow from the PRD:
173
174 **Format:**
175 ```
176 ### Flow: [Flow Name]
177
178 **Related Requirements:** [FR-XXX, FR-YYY from PRD]
179 **User Persona:** [Primary/Secondary persona]
180 **Goal:** What the user wants to accomplish
181
182 **Flow Steps:**
183 1. **Entry Point:** Where does the user start?
184 - Screen/page: [Name]
185 - Trigger: [What initiates this flow]
186
187 2. **Step 1:** [Action/Screen]
188 - User action: [What user does]
189 - System response: [What happens]
190 - Next state: [Where user goes]
191
192 3. **Step 2:** [Action/Screen]
193 - User action: [What user does]
194 - System response: [What happens]
195 - Next state: [Where user goes]
196
197 ... continue for all steps ...
198
199 N. **Success State:** [End goal achieved]
200 - Screen/page: [Name]
201 - Confirmation: [How user knows they succeeded]
202
203 **Alternative Paths:**
204 - If [condition]: User goes to [alternative step]
205 - If [error condition]: Show [error state]
206
207 **Flow Diagram:** (Use Mermaid or text-based diagram)
208 ```
209
210 Use Mermaid diagrams when possible:
211 ```mermaid
212 graph TD
213 A[Entry Point] --> B[Step 1]
214 B --> C{Decision?}
215 C -->|Yes| D[Step 2a]
216 C -->|No| E[Step 2b]
217 D --> F[Success]
218 E --> F
219 ```
220
2212. **User Flow Categories:**
222 - **Onboarding Flow**: First-time user experience
223 - **Authentication Flows**: Login, signup, password reset
224 - **Core Feature Flows**: Main user journeys for key features
225 - **Settings & Profile Flows**: User account management
226 - **Error & Recovery Flows**: What happens when things go wrong
227
228**interaction-specs.md:**
229
230Define interaction rules, states, and transitions:
231
2321. **Component States:**
233
234 For each interactive component:
235 ```
236 ### Component: [Component Name]
237
238 **States:**
239 - **Default**: Normal state appearance and behavior
240 - **Hover**: When user hovers (desktop only)
241 - **Focus**: When component has keyboard focus
242 - **Active/Pressed**: When user clicks/taps
243 - **Disabled**: When component is not interactive
244 - **Loading**: When action is in progress
245 - **Error**: When validation fails or error occurs
246 - **Success**: When action completes successfully
247
248 **Transitions:**
249 - Default → Hover: [How it changes]
250 - Hover → Active: [How it changes]
251 - Active → Loading: [How it changes]
252 - Loading → Success/Error: [How it changes]
253
254 **Interaction Rules:**
255 - Click/tap behavior: [What happens]
256 - Keyboard interaction: [Enter, Space, Arrow keys, etc.]
257 - Screen reader behavior: [What is announced]
258 ```
259
2602. **Interaction Patterns:**
261 - **Buttons**: Primary, secondary, tertiary, icon buttons
262 - **Forms**: Input fields, dropdowns, checkboxes, radio buttons
263 - **Navigation**: Menus, tabs, breadcrumbs
264 - **Feedback**: Toast notifications, alerts, modals, confirmations
265 - **Loading States**: Spinners, skeleton screens, progress indicators
266 - **Animations & Transitions**: Durations, easing functions
267
2683. **Touch & Gesture Support (if mobile/tablet):**
269 - Tap targets (minimum 44x44px)
270 - Swipe gestures
271 - Pull to refresh
272 - Long press actions
273
274**edge-cases.md:**
275
276Define edge cases and expected outcomes:
277
2781. **Data Edge Cases:**
279 ```
280 ### Edge Case: [Scenario Name]
281
282 **Scenario:** What is the unusual condition?
283
284 **Examples:**
285 - Empty state: No data available
286 - Very long text: Name with 200 characters
287 - Special characters: Unicode, emojis, symbols
288 - Large numbers: Billions, scientific notation
289 - Zero values: Empty cart, $0.00 balance
290
291 **Expected Behavior:**
292 - What should the UI show?
293 - How should the system handle it?
294 - What message should the user see?
295
296 **Mockup Reference:** [Link to mockup showing this state]
297 ```
298
2992. **Edge Case Categories:**
300 - **Empty States**: No content, no results, no data
301 - **Extreme Values**: Very large, very small, zero, negative
302 - **Boundary Conditions**: Max length, min length, limits reached
303 - **Unusual Input**: Special characters, different languages, emojis
304 - **Network Issues**: Offline, slow connection, timeout
305 - **Permission Issues**: Access denied, unauthorized
306 - **Concurrent Actions**: Multiple users, race conditions
307
3083. **Error Scenarios:**
309 - **Validation Errors**: Invalid input, missing required fields
310 - **System Errors**: Server errors, database errors, API failures
311 - **Business Logic Errors**: Insufficient balance, item out of stock
312 - **User Errors**: Wrong password, duplicate email, expired session
313
314**accessibility.md:**
315
316Define accessibility requirements and checklist:
317
3181. **Accessibility Standards:**
319 - **Target Compliance**: WCAG 2.1 Level AA (or higher)
320 - **Supported Assistive Technologies**:
321 - Screen readers (NVDA, JAWS, VoiceOver)
322 - Keyboard navigation
323 - Voice control
324 - Screen magnification
325
3262. **WCAG 2.1 Checklist:**
327
328 **Perceivable:**
329 - [ ] All images have alt text
330 - [ ] Color is not the only means of conveying information
331 - [ ] Text has sufficient contrast (4.5:1 for normal text, 3:1 for large text)
332 - [ ] Content is responsive and adapts to different screen sizes
333 - [ ] Videos have captions and transcripts
334 - [ ] Audio content has transcripts
335
336 **Operable:**
337 - [ ] All functionality available via keyboard
338 - [ ] No keyboard traps
339 - [ ] Skip navigation links provided
340 - [ ] Focus order is logical
341 - [ ] Focus indicator is visible
342 - [ ] Interactive elements have minimum 44x44px touch target
343 - [ ] No content flashes more than 3 times per second
344
345 **Understandable:**
346 - [ ] Language of page is declared (lang attribute)
347 - [ ] Navigation is consistent across pages
348 - [ ] Forms have clear labels and instructions
349 - [ ] Error messages are clear and helpful
350 - [ ] Form validation provides specific feedback
351
352 **Robust:**
353 - [ ] Valid HTML markup
354 - [ ] ARIA labels used correctly
355 - [ ] Compatible with current and future assistive technologies
356
3573. **Keyboard Navigation:**
358 - Tab order and focus management
359 - Keyboard shortcuts (if any)
360 - Escape key behavior (close modals, cancel actions)
361 - Enter/Space key behavior (activate buttons, submit forms)
362
3634. **Screen Reader Support:**
364 - ARIA labels and roles
365 - Live regions for dynamic content
366 - Meaningful link text (not "click here")
367 - Form field labels and error associations
368
369**mockups/ (CRITICAL for UI-based applications):**
370
371Create interactive HTML/CSS/JS mockups to showcase the product:
372
373**Purpose of Mockups:**
374- **Visualize the product** for non-technical stakeholders
375- **Define theme, style, and branding** (colors, fonts, spacing)
376- **Showcase basic user flows** interactively
377- **Serve as a project proposal** to help customers understand what they'll get
378- **Provide a reference** for developers during implementation
379
380**mockups/index.html:**
381
382Create a static HTML mockup with:
383
3841. **Structure:**
385 - Proper HTML5 document structure
386 - Navigation section for site navigation
387 - Main content area with multiple screen sections
388 - Footer section
389 - Link to styles.css and script.js
390
3912. **What to Include:**
392 - **Multiple key screens**: Home, main features, settings, profile
393 - **Interactive navigation**: Click to switch between screens
394 - **Component examples**: Buttons, forms, cards, modals
395 - **State examples**: Default, hover, active, disabled, loading, error
396 - **Responsive design**: Works on desktop, tablet, mobile
397 - **Real content examples**: Use realistic text and data (not Lorem Ipsum if possible)
398
399**mockups/styles.css:**
400
401Define the complete design system:
402
4031. **CSS Variables for Theme:**
404 - Define color palette (primary, secondary, accent, background, surface, text, border, semantic colors)
405 - Define typography (font families, font sizes, font weights, line heights)
406 - Define spacing system (xs, sm, md, lg, xl, 2xl)
407 - Define border radius values (sm, md, lg, full)
408 - Define shadow values (sm, md, lg)
409 - Define transition timing (fast, base, slow)
410
4112. **Component Styles:**
412 - Buttons (primary, secondary, outline, ghost)
413 - Forms (inputs, selects, checkboxes, radio buttons)
414 - Cards and containers
415 - Navigation (navbar, sidebar, tabs)
416 - Modals and dialogs
417 - Alerts and notifications
418 - Tables and lists
419 - Loading states and skeletons
420
4213. **Responsive Breakpoints:**
422 - Define breakpoints for mobile, tablet, desktop, and wide screens
423 - Implement responsive behavior with media queries
424
425**mockups/script.js:**
426
427Add interactivity to the mockup:
428
4291. **Screen Navigation:**
430 - Implement navigation function to switch between screens/pages
431 - Hide inactive screens and show active screen
432 - Handle navigation events (clicks on nav links)
433
4342. **Interactive Elements:**
435 - Button click handlers
436 - Form interactions (show validation states)
437 - Modal open/close
438 - Dropdown menus
439 - Tab switching
440 - Accordion expand/collapse
441 - Toast notifications
442
4433. **State Demonstrations:**
444 - Show loading states
445 - Show error states
446 - Show success states
447 - Show empty states
448
449**mockups/assets/:**
450
451Include any visual assets:
452- Logo (SVG preferred)
453- Icons (use icon libraries like Font Awesome or create custom SVGs)
454- Sample images (if needed for mockup)
455- Custom fonts (if not using web fonts)
456
457### Step 4: Ensure Alignment
458
459Make sure UX design aligns with:
460- Functional requirements from 04-prd/functional-requirements.md
461- User journeys from 04-prd/prd.md
462- User personas from 02-personas/
463- MVP scope from 03-mvp/ (prioritize core features in mockups)
464- Accessibility requirements from 04-prd/non-functional-requirements.md
465
466Verify that:
467- All critical user flows are documented
468- All edge cases are considered
469- Accessibility checklist is complete
470- Mockups showcase the product effectively (for UI-based apps)
471- Interactions are clearly specified
472
473### Step 5: Final User Review
474
4751. **Inform user that UX design is complete**
4762. **Update README.md:**
477 - Change **Status** from "In Progress" to "Completed"
478 - Add a **Summary** section with key insights (2-3 paragraphs)
479 - Add a **Created Files** section listing all created files
480
4813. **Present completed work to user:**
482 - Show the interactive mockups (if UI-based app)
483 - Walk through critical user flows
484 - Demonstrate interaction patterns
485 - Explain accessibility considerations
486
4874. **Highlight key insights:**
488 - Number of user flows documented
489 - Key interaction patterns defined
490 - Accessibility compliance level (WCAG 2.1 Level AA)
491 - Mockup screens created (if applicable)
492 - Theme and design system defined
493
4945. **For mockups specifically:**
495 - Open `mockups/index.html` in browser
496 - Demonstrate navigation between screens
497 - Show responsive behavior (resize browser)
498 - Point out theme consistency (colors, fonts, spacing)
499 - Explain how this represents the final product
500
5016. **Ask questions:**
502 - Does the design align with their vision?
503 - Are there any flows missing?
504 - Any concerns about accessibility?
505 - Should any mockup screens be added/changed?
506 - Ready to proceed to next stage (architecture)?
507
5087. Make adjustments based on user feedback if needed
509
510### Step 6: Commit to Git (if user confirms)
511
5121. **If user confirms UX design is complete:**
513 - Ask if they want to commit to git
5142. **If user wants to commit:**
515 - Stage all changes in `05-ux/`
516 - Commit with message: "Design UX flows, interactions, and mockups (Stage 5)"
517
518## Expected Project Structure
519
520```
521project-root/
522├── 00-init-ideas/
523│ └── [existing files]
524├── 01-market-research/ (optional)
525│ └── [existing files if present]
526├── 02-personas/
527│ └── [existing files]
528├── 03-mvp/
529│ └── [existing files]
530├── 04-prd/
531│ └── [existing files]
532└── 05-ux/
533 ├── README.md (with owners and summary)
534 ├── user-flows.md (flow diagrams with Mermaid)
535 ├── interaction-specs.md (states, transitions, rules)
536 ├── edge-cases.md (edge cases + expected outcomes)
537 ├── accessibility.md (WCAG 2.1 checklist)
538 └── mockups/ (CRITICAL for UI apps)
539 ├── index.html (interactive mockup)
540 ├── styles.css (complete design system)
541 ├── script.js (interactivity)
542 └── assets/ (images, icons, fonts)
543```
544
545## Key UX Design Principles
546
5471. **User-Centered**: Design for user needs, not technical constraints
5482. **Consistent**: Use consistent patterns, components, and interactions
5493. **Accessible**: WCAG 2.1 Level AA compliance minimum
5504. **Responsive**: Works on all devices and screen sizes
5515. **Clear**: Intuitive navigation and clear feedback
5526. **Forgiving**: Handle errors gracefully with helpful messages
5537. **Efficient**: Minimize steps to complete tasks
5548. **Delightful**: Pleasant to use, not just functional
555
556## Mockup Best Practices (UI-Based Applications)
557
5581. **Use realistic content**: Avoid Lorem Ipsum, use actual product-like content
5592. **Show multiple states**: Default, hover, active, loading, error, success, empty
5603. **Make it interactive**: Allow clicking through key flows
5614. **Keep it simple**: Don't over-engineer, focus on showcasing design
5625. **Use design system**: Define colors, fonts, spacing in CSS variables
5636. **Show responsiveness**: Test on mobile, tablet, desktop sizes
5647. **Include branding**: Logo, color palette, typography that represent the brand
5658. **Document theme**: Comment the CSS to explain design decisions
566
567## Why Mockups Matter
568
569For UI-based applications, mockups serve multiple purposes:
570- **Stakeholder Buy-in**: Non-technical customers can see and interact with what they're getting
571- **Design Validation**: Test the design before writing production code
572- **Developer Reference**: Provides exact spacing, colors, fonts for implementation
573- **User Testing**: Can be used to test flows with real users
574- **Proposal Tool**: Helps sell the product vision to investors or clients
575- **Alignment**: Ensures everyone has the same visual understanding
576
577## Deliverables
578
579By the end of this stage, you should have:
580- Complete user flow documentation with diagrams (5-15 critical flows)
581- Detailed interaction specifications for all components
582- Edge case documentation with expected behaviors
583- Accessibility checklist and compliance plan (WCAG 2.1 Level AA)
584- **Interactive HTML/CSS/JS mockups** showcasing theme, style, and user flows (for UI apps)
585- Complete design system defined in CSS
586- Foundation for architecture design (next stage)
587- Visual reference for implementation