diff-cleanuplisted
Install: claude install-skill gzb1128/skill-forge
# Diff Cleanup
Remove AI-generated bloat from a feature branch's diff.
## Three required rules
### 1. Diff against the base branch, not the working tree
```bash
git fetch origin --quiet 2>/dev/null
BASE=$(git merge-base HEAD origin/main 2>/dev/null \
|| git merge-base HEAD origin/master 2>/dev/null \
|| git rev-parse HEAD~1)
git diff "$BASE"...HEAD
```
`git diff` alone only shows the working tree. Branch-scope cleanup needs the whole feature branch. If you cannot determine the base, ask.
### 2. Check authorship before removing anything
For each candidate removal:
```bash
git blame -L <start>,<end> -- <file>
```
**Only remove lines whose commit is on the current feature branch (after `$BASE`).** Lines predating the branch are human-authored. Leave them alone, even if they look slop-like.
### 3. Respect the design vs. style boundary
You are removing **low-value tokens within a chosen design**. You are not redesigning.
| In scope | Out of scope |
|---|---|
| Restating-the-code comments | Whether a builder/factory pattern is justified |
| Type-system-redundant runtime guards | Whether the function should exist at all |
| Reflowed loops with no behavior change | Whether the data model is right |
| `IMPORTANT:`-style emphasis on trivia | Whether the public API is too wide |
If you find yourself wanting to redesign, **stop and flag it**. Do not silently rewrite.
## Never touch
- Comments explaining **why** (business reason, workaround, non-obvious constraint)