name: edge-case-discovery
description: Use when user requests exhaustive edge case analysis. Enforces TodoWrite with 15+ items (5 categories). Triggers: "all edge cases", "what could break", "bulletproof", "failure modes". If thinking "main path is sufficient" - use this.
Edge Case Discovery
Systematic 5-category analysis for exhaustive edge case enumeration.
MANDATORY FIRST STEP
CREATE TodoWrite with these 5 categories (15+ items total):
| Category |
Minimum Items |
| Boundary Value Analysis |
3+ |
| Equivalence Partitioning |
3+ |
| State Transition Analysis |
3+ |
| Error Condition Enumeration |
3+ |
| Assumption Challenging |
3+ |
Do not proceed to implementation or testing until TodoWrite is verified.
Verification Checkpoint
After creating TodoWrite, verify 3 random items pass this test:
Each item must have ALL THREE:
- ✓ Specific input/condition ("empty string", "null value", "overflow at 2^31")
- ✓ Expected behavior ("returns error", "throws exception", "defaults to X")
- ✓ Test scenario ("when user submits form with...", "if API returns...")
| ❌ FAILS |
✅ PASSES |
| "Test boundaries" |
"Test numeric input: min (-2^31), max (2^31-1), zero, negative (-1), overflow (2^31)" |
| "Check errors" |
"Network timeout after 30s: retry 3x with exponential backoff, return error 503 to client" |
| "Test state changes" |
"User logout during file upload: cancel upload, clean temp files, redirect to login" |
DO NOT PROCEED until 15+ items AND quality check passes.
Framework
1. Boundary Value Analysis
Test min/max/zero/null/empty/overflow for ALL inputs:
- Numeric: min, max, zero, negative, overflow
- Strings: empty, null, very long, special chars, encoding
- Collections: empty, single item, max size, duplicates
- Time: past, future, now, leap years, timezones
2. Equivalence Partitioning
Group inputs into classes, test one representative from each:
- Valid inputs (happy path)
- Invalid inputs (expected errors)
- Boundary inputs (edge of valid/invalid)
3. State Transition Analysis
Map ALL valid + invalid state transitions:
- Valid transitions
- Invalid transitions (should reject)
- Edge states (init, cleanup)
- Concurrent access scenarios
4. Error Condition Enumeration
List ALL failure modes for each operation:
- Network failures, timeouts
- Resource exhaustion (memory, disk, connections)
- Concurrent access conflicts
- Partial failures, external dependency failures
5. Assumption Challenging
Question every "always", "never", "impossible":
- "This will always be valid" → What if not?
- "Users won't do that" → What if they do?
- "This is impossible" → Under what conditions could it happen?
Red Flags - STOP When You Think:
| Thought |
Reality |
| "Main path is sufficient" |
Edge cases cause 60% of production bugs - exhaustive analysis prevents incidents |
| "This is overkill for a simple feature" |
15 items takes 10 minutes, prevents hours of debugging and hotfixes |
| "We'll catch issues in testing" |
Manual testing misses 70% of edge cases - systematic enumeration is essential |
| "Users won't do that" |
Users do unexpected things constantly - assume nothing about behavior |
| "This analysis takes too long" |
Post-release bug fixes cost 10-100x more than upfront analysis |
Response Templates
"Just test the happy path"
❌ BLOCKED: Happy path testing leaves production vulnerable to edge case failures.
Required to override:
- Documented risk acceptance from technical lead
- Explicit scope limitation with rationale ("internal tool with controlled inputs")
- Post-release budget allocated for edge case fixes (2-4 engineer-weeks)
- Monitoring/alerting plan for unexpected edge cases in production
Reality check:
- 60% of production incidents stem from unhandled edge cases
- Average incident costs: $5-50K in lost productivity, reputation damage
- Systematic edge case analysis: 30-60 minutes upfront
"We don't have time for this"
❌ BLOCKED: Edge case discovery is NOT optional for production code.
Time investment:
- TodoWrite creation: 10-15 minutes
- Analysis per category: 5-10 minutes (25-50 minutes total)
- Total: 35-65 minutes
Compared to:
- One production incident investigation: 4-8 hours
- Hotfix deployment: 2-4 hours
- Customer impact/reputation damage: immeasurable
Verification Before Complete
After completing TodoWrite and analysis, verify:
| Category |
Requirements |
| Boundary Value |
✓ Min/max/zero/null tested ✓ Overflow scenarios identified ✓ Empty collections handled |
| Equivalence |
✓ Valid inputs ✓ Invalid inputs ✓ Boundary cases |
| State Transition |
✓ Valid transitions ✓ Invalid transitions ✓ Concurrent access |
| Error Conditions |
✓ Network failures ✓ Resource exhaustion ✓ Partial failures |
| Assumptions |
✓ All "always"/"never" challenged ✓ Impossible scenarios explored |
If any category incomplete, do not proceed to implementation.
Output
Edge case catalog with test scenarios for each category.
1---2name: edge-case-discovery3description: Use when user requests exhaustive edge case analysis. Enforces TodoWrite with 15+ items (5 categories). Triggers: "all edge cases", "what could break", "bulletproof", "failure modes". If thinking "mai4---5
6---
7name: edge-case-discovery
8description: Use when user requests exhaustive edge case analysis. Enforces TodoWrite with 15+ items (5 categories). Triggers: "all edge cases", "what could break", "bulletproof", "failure modes". If thinking "main path is sufficient" - use this.
9---
10
11# Edge Case Discovery
12
13Systematic 5-category analysis for exhaustive edge case enumeration.
14
15---
16
17## MANDATORY FIRST STEP
18
19**CREATE TodoWrite** with these 5 categories (15+ items total):
20
21| Category | Minimum Items |
22|---------|---------------|
23| Boundary Value Analysis | 3+ |
24| Equivalence Partitioning | 3+ |
25| State Transition Analysis | 3+ |
26| Error Condition Enumeration | 3+ |
27| Assumption Challenging | 3+ |
28
29**Do not proceed to implementation or testing until TodoWrite is verified.**
30
31---
32
33## Verification Checkpoint
34
35After creating TodoWrite, verify 3 random items pass this test:
36
37**Each item must have ALL THREE:**
38- ✓ Specific input/condition ("empty string", "null value", "overflow at 2^31")
39- ✓ Expected behavior ("returns error", "throws exception", "defaults to X")
40- ✓ Test scenario ("when user submits form with...", "if API returns...")
41
42| ❌ FAILS | ✅ PASSES |
43|----------|-----------|
44| "Test boundaries" | "Test numeric input: min (-2^31), max (2^31-1), zero, negative (-1), overflow (2^31)" |
45| "Check errors" | "Network timeout after 30s: retry 3x with exponential backoff, return error 503 to client" |
46| "Test state changes" | "User logout during file upload: cancel upload, clean temp files, redirect to login" |
47
48**DO NOT PROCEED until 15+ items AND quality check passes.**
49
50---
51
52## Framework
53
54### 1. Boundary Value Analysis
55Test min/max/zero/null/empty/overflow for ALL inputs:
56- Numeric: min, max, zero, negative, overflow
57- Strings: empty, null, very long, special chars, encoding
58- Collections: empty, single item, max size, duplicates
59- Time: past, future, now, leap years, timezones
60
61### 2. Equivalence Partitioning
62Group inputs into classes, test one representative from each:
63- Valid inputs (happy path)
64- Invalid inputs (expected errors)
65- Boundary inputs (edge of valid/invalid)
66
67### 3. State Transition Analysis
68Map ALL valid + invalid state transitions:
69- Valid transitions
70- Invalid transitions (should reject)
71- Edge states (init, cleanup)
72- Concurrent access scenarios
73
74### 4. Error Condition Enumeration
75List ALL failure modes for each operation:
76- Network failures, timeouts
77- Resource exhaustion (memory, disk, connections)
78- Concurrent access conflicts
79- Partial failures, external dependency failures
80
81### 5. Assumption Challenging
82Question every "always", "never", "impossible":
83- "This will always be valid" → What if not?
84- "Users won't do that" → What if they do?
85- "This is impossible" → Under what conditions could it happen?
86
87---
88
89## Red Flags - STOP When You Think:
90
91| Thought | Reality |
92|---------|---------|
93| "Main path is sufficient" | Edge cases cause 60% of production bugs - exhaustive analysis prevents incidents |
94| "This is overkill for a simple feature" | 15 items takes 10 minutes, prevents hours of debugging and hotfixes |
95| "We'll catch issues in testing" | Manual testing misses 70% of edge cases - systematic enumeration is essential |
96| "Users won't do that" | Users do unexpected things constantly - assume nothing about behavior |
97| "This analysis takes too long" | Post-release bug fixes cost 10-100x more than upfront analysis |
98
99---
100
101## Response Templates
102
103### "Just test the happy path"
104
105❌ **BLOCKED**: Happy path testing leaves production vulnerable to edge case failures.
106
107**Required to override:**
1081. Documented risk acceptance from technical lead
1092. Explicit scope limitation with rationale ("internal tool with controlled inputs")
1103. Post-release budget allocated for edge case fixes (2-4 engineer-weeks)
1114. Monitoring/alerting plan for unexpected edge cases in production
112
113**Reality check:**
114- 60% of production incidents stem from unhandled edge cases
115- Average incident costs: $5-50K in lost productivity, reputation damage
116- Systematic edge case analysis: 30-60 minutes upfront
117
118### "We don't have time for this"
119
120❌ **BLOCKED**: Edge case discovery is NOT optional for production code.
121
122**Time investment:**
123- TodoWrite creation: 10-15 minutes
124- Analysis per category: 5-10 minutes (25-50 minutes total)
125- **Total: 35-65 minutes**
126
127**Compared to:**
128- One production incident investigation: 4-8 hours
129- Hotfix deployment: 2-4 hours
130- Customer impact/reputation damage: immeasurable
131
132---
133
134## Verification Before Complete
135
136After completing TodoWrite and analysis, verify:
137
138| Category | Requirements |
139|----------|-------------|
140| Boundary Value | ✓ Min/max/zero/null tested ✓ Overflow scenarios identified ✓ Empty collections handled |
141| Equivalence | ✓ Valid inputs ✓ Invalid inputs ✓ Boundary cases |
142| State Transition | ✓ Valid transitions ✓ Invalid transitions ✓ Concurrent access |
143| Error Conditions | ✓ Network failures ✓ Resource exhaustion ✓ Partial failures |
144| Assumptions | ✓ All "always"/"never" challenged ✓ Impossible scenarios explored |
145
146**If any category incomplete, do not proceed to implementation.**
147
148---
149
150## Output
151
152Edge case catalog with test scenarios for each category.