Git split
🤖 My Claude Code config!
npx -y skills add TomerAberbach/claude-config --skill git-splitAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.4 KB, as published. Nobody here has run it
Split the current git commit into multiple focused, self-contained, easy to
review commits.
Current commit
git show
$ARGUMENTS
Principles
- One concern per commit: e.g. bug fix, feature, refactor, or config change
- Each commit passes all checks: format, lint, typecheck, build, test
- Tests travel with the code they test
- Refactors are never mixed with behavioral changes
- Prefer thin vertical slices, one complete feature end-to-end, over horizontal layers
- No orphaned code: every added API, abstraction, or stub must be used within the same commit. Don't split so small that dead code is introduced
Workflow
- Read the diff above. If the commit is already small and self-contained, tell the user and stop
- Identify logical groupings and order them from most foundational to most dependent. When a boundary is ambiguous, keep changes together
- Infer verification commands from project signals (e.g.
package.json,Makefile, CI config). If no signals are found, ask the user - Present the plan as a numbered list:
- Commit N:
<imperative-mood description>: <file or hunk list> - One sentence justifying each split boundary
- The verification commands you will run after each split
- Ask for confirmation before proceeding
- Commit N:
- Run
git reset HEAD~1so all changes return to the working tree - Stage and commit each group in order, running verification commands after
each:
git stash <verification commands> git stash pop - After all splits, run
git log --oneline -<commit count>and show the resulting stack
How to split
By file
Stage specific files for the first commit, then commit:
git add <files for first commit>
git commit -m "<first commit description>"
By hunk
When a single file contains changes that belong in different commits, use file manipulation:
- Edit the file to contain only the changes for the first commit (remove hunks that belong later)
- Stage and commit it
- Re-edit the file to restore the removed hunks before the next commit