Minimal Diff
Rule
Change only what the task requires. A reviewer should see one clear intent.
Scope checklist
Before editing, write (internally):
Goal:
Files allowed:
Files forbidden (unless user asked):
Default forbidden: unrelated files, style-only churn, renaming sprees, "while I'm here" cleanups.
Editing tactics
- Locate the single function/component/module that owns the behavior.
- Patch that unit — not its entire directory.
- Import instead of duplicating.
- Delete dead code only if you introduced a replacement in the same change.
Diff size targets
| Task type | Target |
|---|---|
| Bug fix | 1–3 files, often <20 lines |
| Small feature | Extend existing module before new file |
| New file | Justify why no existing file fits |
Forbidden without explicit user request
- Reformatting untouched lines
- Renaming unrelated symbols
- Adding tests for unrelated code
- New config/env/docs files
- Dependency upgrades
- "Improvements" outside the ask
Refactor requests
When user says "refactor":
- Confirm behavior unchanged.
- Refactor one cohesive unit per step.
- Do not mix refactor + feature in one diff.
Verify
git diffshows only task-related hunks- No new abstractions unless they remove more lines than they add