design-system-specification; this document governs behavior.
design-system-specification (also conditional) or admin-access-control-specification.Best for
- Mapping the full user journey through a product or major new feature before implementation begins
- Defining the information architecture and navigation structure of an application
- Specifying every UI state (loading, empty, error, success, permission-denied) so none are left to improvisation during build
- Giving an AI coding agent or new engineer enough detail to build every screen without a visual mockup
What it produces
The generated document covers:- Overview — which flow(s) the document covers, primary tasks served
- Information architecture — site map (ASCII or structured list) of every screen and nesting relationship
- User journeys — end-to-end narrative for each primary task, including cross-session and multi-channel steps
- Screen-by-screen flow — for each screen: entry points, primary action, all four states (loading / empty / error / success), and every exit point
- Flow diagram — Mermaid flowchart showing the primary path, branching decision points, error branches, and recovery loops
- Responsive behavior — layout changes per breakpoint (desktop / tablet / mobile), hidden elements, touch adaptations, cross-device state continuity
- Error taxonomy — per error type: example scenario, user message pattern, recovery action
- Confirmation patterns — when to use a modal vs. an undo toast vs. double confirmation for catastrophic actions
- Notification patterns — toast, banner, in-app notification, inline message: use case, duration, dismissability, position
- State management — form persistence, undo support, offline behavior, stale data handling
- Edge cases and recovery paths — table of every non-happy-path scenario with trigger, behavior, and recovery (no dead ends)
- Accessibility notes — per-screen keyboard/tab order, focus management after actions, “completable without mouse” verification
How to invoke it
Example scenarios
Onboarding flow
Dashboard IA
Checkout flow
Settings and permissions
Key concepts
The four states every screen must specify
The four states every screen must specify
Information architecture vs. user journeys vs. screen flows
Information architecture vs. user journeys vs. screen flows
Error taxonomy — classify every failure
Error taxonomy — classify every failure
Confirmation patterns — modal vs. undo
Confirmation patterns — modal vs. undo
- Destructive, irreversible actions: Blocking confirmation modal with the action name and consequence stated (“Delete payment link — this cannot be undone”)
- Reversible actions: Prefer undo toast (toast with “Undo” button, 5–10 second auto-dismiss) over a blocking dialog — less friction, same safety
- Catastrophic actions (delete organization, revoke all access): Require the user to type the resource name — double confirmation
- Confirmation placement: Inline for minor actions, modal for significant actions, full-page for account-level changes
Accessibility as a flow concern
Accessibility as a flow concern
- Keyboard tab order: The sequence focus moves through interactive elements on each screen
- Focus management after actions: Where does focus land after a modal closes? After form submission? After an error?
- Completable without mouse: Every screen flow must be traversable via keyboard alone — specified in the accessibility notes table
Dead-end screens — a UX defect
Dead-end screens — a UX defect
Responsive and cross-device flow
Responsive and cross-device flow
- Breakpoint behavior: What elements collapse, hide, or reflow at each breakpoint (desktop / tablet / mobile)
- Touch vs. pointer: Hover states that become tap-and-hold, swipe replacing click-and-drag
- Context-aware defaults: Which actions are prominent on mobile vs. desktop
- Cross-device continuity: What state is preserved if a user switches devices mid-flow
Interview process
Phase 1: Socratic clarification (mandatory)
.engineering-docs/ files first. Up to 3 questions: primary task (the single most important thing a user is trying to accomplish), and known edge cases (failure modes, permission levels, unusual paths that must be handled).Phase 2: Information architecture (60 min)
Phase 3: User journey mapping (40–60 min)
Phase 4: Screen-by-screen flow (2–3 hrs)
Phase 5: Edge cases and recovery paths (40–60 min)
Phase 6: Accessibility pass (30–40 min)
Phase 7: Revision (after user review)
last_updated.Output structure
The generated.engineering-docs/10-ux-flow-specification.md follows this structure:
Handoff
Reads from
3-user-personas.md— persona goals, journey context, friction tolerance1-business-plan.md— scope, feature priorities, user types4-technical-specification.md— functional requirements defining screen behavior
Feeds into
design-system-specification— component needs, interaction patterns, state requirementssystem-architecture-document— frontend component structure, API interaction points- Implementation — screen-by-screen build specification for engineers and AI agents
Quality gate
- Every screen in the flow specifies all four states: loading, empty, error, and populated/success
- No screen is a dead end — every screen has explicit exit points including for error states
- The information architecture (site map) is complete and every screen in the flow appears in it
- Edge cases and recovery paths are documented in a table with no scenario resulting in an unrecoverable state
- Each screen includes accessibility notes covering keyboard navigation order and focus management
