Use before code review - determine if change is minor (review new code only) or major (review impacted code too)
Determine the appropriate scope for code review based on change size.
Core principle: Major changes need broader review. Minor changes need focused review.
Question to answer: Is this a minor change or a major change?
Review only NEW code.
Indicators:
| Indicator | Example |
|---|---|
| Few files changed | 1-3 files |
| Isolated change | Single function modification |
| No API changes | Internal implementation only |
| No new dependencies | Uses existing code |
| Localized impact | Doesn't affect other modules |
Examples:
Review scope:
Review NEW code AND IMPACTED code.
Indicators:
| Indicator | Example |
|---|---|
| Many files changed | 4+ files |
| Cross-cutting change | Touches multiple modules |
| API changes | Public interface modified |
| New dependencies | Adds libraries or modules |
| Behavioral changes | Affects existing functionality |
| Architecture impact | Changes patterns or structure |
Examples:
Review scope:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā FILES CHANGED ā
āāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāā
ā > 3 files? ā
āāāāāāāāāā¬āāāāāāāāā
ā
āāāāāāāāāāā“āāāāāāāāāā
ā ā
Yes No
ā ā
ā¼ ā¼
MAJOR āāāāāāāāāāāāāāāāāāā
ā Public API ā
ā changed? ā
āāāāāāāāāā¬āāāāāāāāā
ā
āāāāāāāāāā“āāāāāāāāā
ā ā
Yes No
ā ā
ā¼ ā¼
MAJOR āāāāāāāāāāāāāāāāāāā
ā Behavioral ā
ā change? ā
āāāāāāāāāā¬āāāāāāāāā
ā
āāāāāāāāāā“āāāāāāāāā
ā ā
Yes No
ā ā
ā¼ ā¼
MAJOR MINOR
For major changes, identify impacted code:
# Find all files that import the changed module
grep -r "import.*from.*'./changed-module'" src/
# Find all usages of changed function
grep -r "changedFunction" src/
# What does the changed code import?
grep "import" src/changed-file.ts
# Trace the dependency chain
Changed function
ā
āāā Called by: parentFunction() ā Review this
ā ā
ā āāā Called by: grandparent() ā Review if behavior changed
ā
āāā Calls: childFunction() ā Review if inputs changed
ā
āāā Calls: database.save() ā Review if data shape changed
Before starting review, document scope:
## Review Scope: MINOR
**Changed files:**
- src/utils/format.ts (10 lines)
**Review focus:**
- New formatDate() function
- Associated tests
**Not reviewing:**
- Callers of format module (unchanged behavior)
## Review Scope: MAJOR
**Changed files:**
- src/services/auth.ts
- src/middleware/authenticate.ts
- src/routes/login.ts
- src/models/session.ts
- tests/auth.test.ts
**Impacted code to review:**
- src/routes/protected/* (use auth middleware)
- src/services/user.ts (calls auth service)
**Integration points:**
- Login flow end-to-end
- Session management
- Protected route access
**Review focus:**
- All changed code
- All callers of auth service
- Auth middleware consumers
- Session handling throughout
All of minor, PLUS:
If unsure whether change is minor or major:
Default to major. Better to over-review than miss issues.
Sometimes few lines have large impact:
// Small change, but MAJOR scope
// Changing default timeout affects all HTTP calls
const DEFAULT_TIMEOUT = 30000; // Was 5000
Review all code affected by the changed behavior.
Many files changed but pure refactor:
// Renamed variable across 20 files
// No behavior change
Still MAJOR for structural review, but behavioral review is lighter.
This skill is called by:
issue-driven-development - Step 9comprehensive-review - Before starting reviewThis skill informs: