| name | test-review |
| description | Audit tests for missing edge cases after writing or reviewing test code. Use PROACTIVELY after implementing features or writing tests. Also available as /test-review. |
| allowed-tools | Read, Grep, Glob, Bash, Edit, Write |
Test Review — Edge Case Audit
Systematic second-pass review of tests after implementation. Catches the gaps that first-pass test writing consistently misses.
When to use
- Automatically after implementing a feature with tests (model-invocable)
- Manually via
/test-review when reviewing test coverage
- On PRs as a pre-merge quality gate
Arguments
path (optional): Specific test file or directory to audit, e.g. /test-review tests/test_merge.py
- If no argument, detect changed files via
git diff main...HEAD --name-only
Step 1: Identify scope
Determine what was implemented and what tests exist:
-
Find changed source files:
Bash: git diff main...HEAD --name-only -- 'src/'
-
Find changed/new test files:
Bash: git diff main...HEAD --name-only -- 'tests/'
-
Read each changed source file to understand the new/modified code paths
-
Read each test file to understand current coverage
Step 2: Run the edge case checklist
For every new function, method, class, or code path, systematically check each category. Do not skip categories — the value is in the exhaustive scan.
Category 1: Boundary Values
Category 2: Type Coercion and Representation
Category 3: State and Mutation
Category 4: Cross-Feature Interaction
Category 5: Error Paths and Degradation
Category 6: User-Facing Outputs
Category 7: Documented Non-Behavior
Step 3: Generate missing test cases
For each gap found, write a specific test case description:
MISSING: [Category] — [Description]
File: tests/test_xxx.py
Test: test_[descriptive_name]
Why: [What could go wrong without this test]
Group by priority:
- P0 — Correctness: Could cause wrong behavior in production
- P1 — Robustness: Edge cases that real users will hit
- P2 — Completeness: Nice to have, documents behavior
Step 4: Write the tests
For each missing test case (P0 and P1 at minimum):
- Write the test in the appropriate test file
- Follow existing test patterns and conventions in the file
- Run the new tests to verify they pass:
Bash: pytest {test_file} -v --tb=short -k {test_name}
Step 5: Final verification
Bash: pytest tests/ -v --tb=short
Bash: ruff check src/ tests/
Step 6: Report
Summarize:
- How many gaps found per category
- How many tests added (P0/P1/P2)
- Any gaps intentionally left (with reason)
Rules
- Don't duplicate existing tests. Read them first.
- Don't test framework internals. Only test our code's behavior.
- Don't add tests for hypothetical features. Only test what exists.
- Match the existing test style. Same fixtures, same helpers, same naming.
- Every test must assert something specific. No "smoke tests" that just check no exception.