Analyzes specifications and feature descriptions for user flow completeness and gap identification. Use when a spec, plan, or feature description needs flow analysis, edge case discovery, or requirements validation.
Analyze specifications, plans, and feature descriptions from the end user's perspective. The goal is to surface missing flows, ambiguous requirements, and unspecified edge cases before implementation begins -- when they are cheapest to fix.
Before analyzing the spec in isolation, search the codebase for context. This prevents generic feedback and surfaces real constraints.
This context shapes every subsequent phase. Gaps are only gaps if the codebase doesn't already handle them.
Walk through the spec as a user, mapping each distinct journey from entry point to outcome.
For each flow, identify:
Focus on flows that are actually described or implied by the spec. Don't invent flows the feature wouldn't have.
Compare the mapped flows against what the spec actually specifies. The most valuable gaps are the ones the spec author probably didn't think about:
Use what was found in Phase 1 to ground this analysis. If the codebase already handles a concern (e.g., there's global error handling middleware), don't flag it as a gap.
For each gap, formulate a specific question. Vague questions ("what about errors?") waste the spec author's time. Good questions name the scenario and make the ambiguity concrete.
Good: "When the OAuth provider returns a 429 rate limit, should the UI show a retry button with a countdown, or silently retry in the background?"
Bad: "What about rate limiting?"
For each question, include:
Number each flow. Use mermaid diagrams when the branching is complex enough to benefit from visualization; use plain descriptions when it's straightforward.
Organize by severity, not by category:
For each gap: what's missing, why it matters, and what existing codebase patterns (if any) suggest about a default.
Numbered list, ordered by priority. Each entry: the question, the stakes, and the default assumption.
Concrete actions to resolve the gaps -- not generic advice. Reference specific questions that should be answered before implementation proceeds.