group-commit
Installation
SKILL.md
Group Commit (group-commit)
Turn every uncommitted change into a sequence of atomic commits, one per issue, where:
- Grouping is by change, not by file. If issues 1, 2 and 3 all touched
a.ts, each commit contains only the hunks/lines ofa.tsthat belong to its issue. - Order follows dependencies. An earlier commit never depends on anything introduced by a later commit, so checking out any commit in the sequence yields code that builds and runs.
Ground rules
- Only the index changes, never the working tree. Do not run
git checkout,git restore,git stash, or edit files to build a commit. The working tree already holds the final state; each commit is assembled in the index. This makes the whole run reversible. - Record the starting point first:
BASE=$(git rev-parse HEAD). To undo everything at any point:git reset --soft $BASE && git reset -q(all changes come back as unstaged, nothing is lost). - Never
git add ./git add -A, never amend, never push, never--no-verify.
Hunk tool
scripts/hunks.mjs (next to this file) lists and stages changes at hunk or line granularity. It needs only Node.js (no npm install) and always operates from the repo root.