--- name: creating-user-flows description: Generates user flow diagrams and documentation for Benmore client projects during Discovery phase. Use when asked to create user flows, map user journeys, visualize workflows, build workflow diagrams, create discovery deliverables, or document how different user types interact with a product. Produces paired .md and .html files with Mermaid.js flowcharts in Benmore dark theme. compatibility: Requires Claude Code with file write access. HTML output uses Mermaid.js CDN and Google Fonts (internet needed to render). metadata: author: Benmore Technologies version: 2.0.0 context: fork --- # Creating User Flows ## Overview User flows are visual diagrams that map how users navigate through an application. This skill produces **two deliverables per flow**: a Markdown file (for documentation context and version control) and an HTML file (for polished client presentations). Both use Mermaid.js for flowcharts. **REQUIRED:** Use `superpowers:brainstorming` before starting to explore user intent and requirements. **REQUIRED:** Use `superpowers:subagent-driven-development` to parallelize flow creation across multiple user types. ## Process ```dot digraph user_flow_process { rankdir=TB; node [shape=box]; gather [label="1. Gather Project Context"]; identify [label="2. Identify User Types & Touchpoints"]; draft [label="3. Draft Mermaid Flowcharts"]; validate [label="4. Validate Against Source Materials"]; generate_md [label="5a. Generate .md File"]; generate_html [label="5b. Generate .html File"]; review [label="6. Review & Iterate"]; gather -> identify -> draft -> validate; validate -> generate_md; validate -> generate_html; generate_md -> review; generate_html -> review; } ``` ### Step 1: Gather Project Context Read these files in the project directory (in order): 1. `CLAUDE.md` — Full project context, tech stack, constraints 2. `SCOPE_AGREEMENT.md` — What's in/out of MVP scope 3. `MEETING_LOG.md` or `meetings/MEETING_LOG.md` — Client discussions, decisions 4. Any files in `1-Discovery/deliverables/` — Research, technical architecture 5. Client-provided materials (requirements docs, blueprints, questionnaires) Extract: - User types (e.g., customer, vendor, admin) - Key actions each user performs - Conditional logic ("checkout requires account verification") - System behaviors ("failed login triggers lockout after 3 attempts") - Ethical/legal constraints - Client preferences for UX ### Step 2: Identify User Touchpoints For each user type, document: - **Entry point** (sign up, login, landing page) - **Core actions** they perform - **Decision points** and branches - **Exit points** - **Interactions with other user types** Focus on what the client described, not assumptions. If something wasn't discussed, it likely doesn't belong. ### Step 3: Draft Mermaid Flowcharts Create flowcharts using Mermaid.js `flowchart TD` syntax (top-down, vertical flow). > **Syntax reference:** Consult `references/mermaid-cheatsheet.md` for node shapes, arrow types, color classes, and subgraph syntax. **Design principles:** - Prefer vertical (`TD`) over horizontal (`LR`) — always - Keep parallel branches short (3 branches that reconverge after 1-2 steps) - Use descriptive node IDs (`CreateProfile` not `Step3`) - Keep label text concise (under 6 words) - Use consistent indentation (4 spaces) - Add blank lines between logical sections - Use batch `class NodeId className` at bottom — **never** inline `:::className` - **Split into multiple diagrams when flow has >8 nodes or complex branching** — consult `references/multi-diagram-patterns.md` ### Step 4: Validate Against Source Materials Re-read meeting transcripts and verify: - Every step traces back to source materials - No features outside MVP scope are included - Flow represents a single user type's perspective - Flow matches the client's described user journey ### Step 5: Generate Output Files **CRITICAL: Always generate BOTH files for each user flow.** #### 5a. Markdown File (.md) **Location:** `[ProjectDir]/1-Discovery/deliverables/user-flows/[FlowName].md` **Naming:** `[Subject]_User_Flow.md` for simple projects, `User_Flows_[ProjectName]_YYYY-MM-DD.md` for comprehensive docs **Structure:** ````markdown # [Project Name] - [Flow Name] User Flow > [One-line description of what this flow covers] **Created:** YYYY-MM-DD **Status:** Draft (Discovery Phase) **Version:** v1 --- ## Overview [2-3 sentences describing the flow scope and the user type] ## Key Workflow Principles - [Bullet list of important design decisions and constraints] --- ## User Flow Diagram ```mermaid flowchart TD [... mermaid diagram code ...] ``` ```` --- ## Workflow Steps Breakdown ### Step 1: [Step Name] [Description of what happens, why, and any conditions] ### Step 2: [Step Name] [Continue for each major step...] --- ## Design Decisions & Constraints | Decision | Rationale | | ---------- | -------------------------- | | [Decision] | [Why this choice was made] | --- ## Color Legend | Color | Meaning | | ------ | ------------------------- | | Green | Start/End/Success states | | Yellow | Important decision points | | Orange | Warnings/Alerts | | Purple | Special workflows | | Red | Error states | --- _Document created during Discovery Phase_ _Last Updated: YYYY-MM-DD_ ``` #### 5b. HTML File (.html) **Location:** `[ProjectDir]/1-Discovery/deliverables/user-flows/[FlowName].html` **Naming:** `[Subject]-[Type]-v[version].html` (e.g., `Mediator-Onboarding-Flow-v1.html`, `SalesRep-Primary-Intake-v2.html`) > **Template:** Read `assets/template.html` for the complete Benmore dark theme HTML/CSS. Copy its full `