Review Changes
Pre-commit review of staged/modified changes for bugs, style issues, and missing tests.
Process
- •
Identify Changes Run
git statusandgit diff --staged(orgit diffif nothing staged) to see what's being changed. - •
For Each Changed File, Check:
Correctness
- • Logic errors or edge cases not handled
- • Null/nil safety issues
- • Off-by-one errors
- • Race conditions or concurrency issues
- • Error handling gaps (missing catch, unhandled throws)
Consistency
- • Follows existing patterns in the codebase
- • Naming conventions match surrounding code
- • No duplicate logic that should be extracted
- • Binding bridges used correctly (not bypassing ViewModel routing)
Security
- • No hardcoded secrets or API keys
- • User input validated
- • Sensitive data not logged
Performance
- • No expensive operations on main thread
- • No N+1 query patterns
- • Large data handled with pagination/lazy loading
SwiftUI Specific
- • @State/@StateObject/@Observable used correctly
- • No unnecessary view rebuilds
- • Proper use of task/onAppear for async work
- •
Test Coverage
- •Are there existing tests for the modified code?
- •Do the changes require new tests?
- •Will existing tests still pass?
Output Format
Summary
- •Files Changed: X
- •Risk Level: Low / Medium / High
- •Recommendation: Ready to commit / Needs fixes / Needs discussion
Issues Found
| File:Line | Severity | Issue | Suggested Fix |
|---|---|---|---|
Approval
If no issues: "✅ Changes look good. Ready to commit." If issues found: "⚠️ Found X issues. Please address before committing."