tidy-commits
Installation
SKILL.md
Tidy Commits
Tidy an existing branch into a clear, reviewable commit story while preserving the intended final tree.
Quick start
For local branch history cleanup only — for ordinary new commits use the repo's normal commit workflow.
Inspect state → refuse unclear or unrelated working-tree changes → create a backup ref → plan base..HEAD (keep / squash / fixup / reword / reorder / split / drop) → show the plan and exact commands → rebase non-interactively → verify the final tree and tests before any push.
Preflight
- Determine the base with repo evidence: PR base,
origin/HEAD, or the user-provided base. - Fetch first:
git fetch --prune --all. - Require a clean, understood state. If
git statusshows a rebase, merge, cherry-pick, or mixed unrelated changes, stop and ask. - Record current state with
git log --oneline --decorate --stat <base>..HEAD,git diff --stat <base>...HEAD, and nearby branch context. - Create a backup ref, for example:
git branch backup/tidy-commits-$(date +%Y%m%d-%H%M%S) HEAD