PR Edge Case Review
Review branch changes for logic correctness. This skill finds what breaks, not what looks bad - use /sculpt-code for code quality.
Instructions
- Identify the change scope - ask if unclear:
- Branch diff:
git diff <base-branch>...HEAD (the branch your work targets)
- Uncommitted:
git diff HEAD
- Specific files: user-provided list
- Read all changed files in full before reviewing - understand the context around the diff, not just the changed lines.
- Review each dimension below. For each finding, cite
file_path:line_number.
Dimensions
1. Test Gaps
- New code paths without corresponding tests
- Missing edge case coverage: empty inputs, zero values, nil/null, boundary values
- Error paths that aren't tested (what happens when the DB call fails? the API returns 500?)
- Testable helpers or utilities that lack unit tests
- Existing tests that may be invalidated by the changes
2. Logic Errors
Flag logic that produces wrong behavior, not merely code that could read more cleanly (that is /sculpt-code's job).
- Conditional branches that are unintentionally mutually exclusive or unreachable, so a case that should run never does
- Inverted or off-by-one comparisons (
< vs <=, && vs ||, negation errors) that select the wrong branch
- Complex boolean expressions whose operator precedence or short-circuiting yields the wrong result
- Switch/match statements missing a case, so valid inputs fall through to a wrong default
- Validation applied in one path but skipped in another that reaches the same sink
3. Edge Cases & Failure Modes
- What happens with empty collections, zero-length strings, negative numbers?
- Concurrent access: race conditions, double-submission, stale reads
- Partial failures: what if step 2 of 3 fails? Is state left consistent?
- Resource exhaustion: unbounded loops, unlimited retries, growing memory
- Time-dependent behavior: timezone issues, DST, clock skew, expiry edge cases
- Integer overflow, floating-point precision, string encoding issues
- Off-by-one errors in loops, pagination, slicing
4. Integration Risks
- Breaking changes to public APIs, function signatures, or data formats
- Database migration safety: can it be rolled back? Does it lock tables?
- Dependency version changes: breaking updates, deprecation warnings
- Configuration changes that could affect other environments
- Feature flags or environment checks that may behave differently in prod
- Backward compatibility: will existing clients/callers still work?
Output Format
For each dimension, output:
### [Dimension Name]
- **[file:line]** - Finding description
Risk: [what could go wrong]
Suggestion: [how to address it]
If a dimension has no findings, output: No issues found.
Final Summary
End with:
- Top 3-5 risks ranked by severity (what is most likely to cause a production incident?)
- Recommended test cases to add before merging
1---2name: pr-edge-cases3description: Review branch changes for test gaps, logic edge cases, failure modes, and integration risks. Use when you want the changes on a branch probed for what breaks - untested paths, boundary conditions, race conditions, and integration hazards - before merging.4---56# PR Edge Case Review78Review branch changes for logic correctness. This skill finds what breaks, not what looks bad - use `/sculpt-code` for code quality.910## Instructions11121. **Identify the change scope** - ask if unclear:13 - Branch diff: `git diff <base-branch>...HEAD` (the branch your work targets)14 - Uncommitted: `git diff HEAD`15 - Specific files: user-provided list162. **Read all changed files in full** before reviewing - understand the context around the diff, not just the changed lines.173. **Review each dimension** below. For each finding, cite `file_path:line_number`.1819## Dimensions2021### 1. Test Gaps2223- New code paths without corresponding tests24- Missing edge case coverage: empty inputs, zero values, nil/null, boundary values25- Error paths that aren't tested (what happens when the DB call fails? the API returns 500?)26- Testable helpers or utilities that lack unit tests27- Existing tests that may be invalidated by the changes2829### 2. Logic Errors3031Flag logic that produces _wrong behavior_, not merely code that could read more cleanly (that is `/sculpt-code`'s job).3233- Conditional branches that are unintentionally mutually exclusive or unreachable, so a case that should run never does34- Inverted or off-by-one comparisons (`<` vs `<=`, `&&` vs `||`, negation errors) that select the wrong branch35- Complex boolean expressions whose operator precedence or short-circuiting yields the wrong result36- Switch/match statements missing a case, so valid inputs fall through to a wrong default37- Validation applied in one path but skipped in another that reaches the same sink3839### 3. Edge Cases & Failure Modes4041- What happens with empty collections, zero-length strings, negative numbers?42- Concurrent access: race conditions, double-submission, stale reads43- Partial failures: what if step 2 of 3 fails? Is state left consistent?44- Resource exhaustion: unbounded loops, unlimited retries, growing memory45- Time-dependent behavior: timezone issues, DST, clock skew, expiry edge cases46- Integer overflow, floating-point precision, string encoding issues47- Off-by-one errors in loops, pagination, slicing4849### 4. Integration Risks5051- Breaking changes to public APIs, function signatures, or data formats52- Database migration safety: can it be rolled back? Does it lock tables?53- Dependency version changes: breaking updates, deprecation warnings54- Configuration changes that could affect other environments55- Feature flags or environment checks that may behave differently in prod56- Backward compatibility: will existing clients/callers still work?5758## Output Format5960For each dimension, output:6162```text63### [Dimension Name]6465- **[file:line]** - Finding description66 Risk: [what could go wrong]67 Suggestion: [how to address it]68```6970If a dimension has no findings, output: `No issues found.`7172## Final Summary7374End with:75761. **Top 3-5 risks** ranked by severity (what is most likely to cause a production incident?)772. **Recommended test cases** to add before merging