cleanup

Installation
SKILL.md

Cleanup

Make the branch's diff as small as it can be while every observable behaviour stays identical. The bar is not "tidier" — it is "could this be written in half the lines with what the project already has?" The only behaviour change allowed is a real bug found on the way, reported as one.

1. Setup

  • Read the project's agent instructions (CLAUDE.md, AGENTS.md, …) and every rule file they index that the diff touches. They outrank this skill.
  • Compatibility code (shims, aliases, fallbacks, migrations) is owed only to consumers outside the repo — a published package, a public API, persisted data, a released app. Find out which exist.
  • Pick BASE, first match wins. git diff $BASE includes uncommitted work. An argument overrides it (a ref becomes BASE) or narrows it (a path).
    1. The branch has an open PR: BASE=$(git merge-base HEAD origin/$(gh pr view --json baseRefName -q .baseRefName)).
    2. The branch has commits ahead of the default branch: BASE=$(git merge-base HEAD $(git rev-parse --abbrev-ref origin/HEAD)).
    3. Only uncommitted changes: BASE=HEAD.
    4. None: say so and stop.
git fetch -q origin
git diff --shortstat $BASE   # the number to beat
git status --short           # untracked files are part of the target
Installs
1
Repository
letstri/skills
GitHub Stars
1
First Seen
1 day ago