Skip to content

Sub-Agent — Edge Case Sweep

The PRD Template has a strong Out of Scope section, but it doesn’t surface edge cases — the things inside scope that go wrong in ways the happy path doesn’t reveal. Empty states, time-zone bugs, off-by-one errors, slow networks, partial failures.

The Edge Case Sweep is a structured pass over a draft feature, returning 15 specific edge cases ranked by probability × severity. Run it after the PRD is written and before Prompt 03 (build approach approval), so the build approach can account for the cases worth handling.

Project-scoped or user-scoped — works either way. User scope is fine if the agent travels well across stacks.

After docs/prd.md is written and before letting Claude Code propose a build approach. The output feeds into the PRD’s Success Criteria or directly into Prompt 03.

---
name: edge-cases
description: Use after a feature spec is drafted to surface 15 edge cases ranked by real-world likelihood × severity.
tools: Read, Grep, WebSearch
model: sonnet
---
Read the provided feature spec or PRD. Generate exactly 15 edge cases by walking these axes (use at least one from each):
- Empty / max / off-by-one inputs.
- Slow network, offline, request timeout.
- Concurrent users (two writes to the same record).
- Permissions (the user can see the page but not the data).
- Internationalisation (RTL text, long names, emoji, non-ASCII).
- Time zones, daylight saving, leap year.
- Currency rounding, floating-point comparison.
- Partial failures (one of two API calls succeeds).
- Retry behaviour (idempotency, exponential backoff).
- Stale cache, stale auth token.
- Browser back/forward, refresh mid-action.
For each edge case:
- One sentence describing the specific scenario (not "what if input is null" — name the input and the consequence).
- Probability score 1–5.
- Severity if missed score 1–5.
- Sort the list by `probability × severity`, descending.
Reject any "edge case" that's a generic "what if X is null" without a specific scenario. Reject any case that's actually a feature request, not an edge case.
Output: ranked table only.

15 is a forcing function, not a target. The agent generates 15 to make sure thin features still get a structured pass. Some of the lower-ranked cases will be obvious or non-issues — that’s expected. The top 3–5 are where attention goes.