← ClaudeAtlas

commit-changeslisted

Split the current working tree into a sequence of small, meaningful commits. Use when the user asks to commit their current changes, split a mixed diff, clean up a working tree before a PR, or create reviewable commits.
ltatarev/skills · ★ 0 · Code & Development · score 68
Install: claude install-skill ltatarev/skills
# Commit changes into meaningful commits Create a sequence of reviewable commits with **one concern per commit**. Never commit a mixed working tree as-is. ## Workflow ### 1. Inspect the working tree Run: ```sh git status --porcelain=v1 git diff --stat git diff --staged --stat git log --oneline -10 ``` Read the full diff (including untracked files) before planning commits. ### 2. Respect staged changes If the index already contains staged changes: - Treat them as an intended first commit. - Confirm before unstaging anything. - If they are clearly the result of an accidental `git add .`, reset the index with `git reset` (never `--hard`). ### 3. Plan commit groups Group by **concern**, not by directory. Typical groups: - One feature or bug across many files → one commit. - Refactors, renames, extracted helpers → separate commit before behavior. - Formatting or lint-only changes → separate commit. - Dependency updates and lockfiles → with the change requiring them. - Generated files → with the change that generated them. - Tests → together with the code they verify. - Mixed concerns in one file → split by hunk. Aim for roughly **2–6 commits**. Before making changes, show the planned commits with a one-line summary and the affected files. ### 4. Stage each commit Start from a clean index: ```sh git reset ``` For each planned commit: ```sh git add <paths> git status --short git commit -m "<message>" ``` Verify the staged files before every commit. ### 5. Spl