Claude-skill-registry git-incremental-commits
Create small, incremental Git commits from uncommitted changes using Conventional Commits. Use when asked to review git status and split changes into small commits (by file or chunk), especially when dependency changes require lockfiles, and to finish with a clean working tree.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/git-incremental-commits" ~/.claude/skills/majiayu000-claude-skill-registry-git-incremental-commits && rm -rf "$T"
manifest:
skills/data/git-incremental-commits/SKILL.mdsource content
Git Incremental Commits
Goal
Turn all uncommitted changes into a sequence of small, clear Conventional Commits, stopping when
git status is clean.
Workflow
- Run
andgit status -sb
to understand scope.git diff --stat - Identify logical groups: dependencies, config, feature code, tests, docs, refactors, fixes.
- Commit in smallest safe slices:
- Prefer single-purpose commits.
- Use
to stage hunks when files mix concerns.git add -p - Use whole-file staging when the file is cohesive.
- After each commit, re-check
and repeat.git status -sb - Stop only when the working tree is clean and no untracked files remain (unless explicitly told to leave them).
Grouping Heuristics
- Dependencies: If package manifests change (e.g.,
), commit them with their lockfiles in the same commit.package.json - Config/Build: Commit build or CI config separately (e.g.,
,tsconfig
, CI files).eslint - Feature work: Prefer one commit per feature slice.
- Fixes: Keep bug fixes isolated from refactors when possible.
- Tests: Pair tests with the change they validate, unless tests are a separate logical unit.
- Docs: Keep docs-only changes separate.
Conventional Commit Rules
- Use
ortype(scope): subject
.type: subject - Keep subject short, imperative, and specific.
- Suggested types:
,feat
,fix
,chore
,refactor
,docs
,test
,build
.ci - Dependency changes: prefer
orbuild(deps): add <pkg>
.chore(deps): bump <pkg>
Safety Checks
- Do not include unrelated changes in the same commit.
- If a file mixes unrelated edits and hunk-splitting is ambiguous, ask before proceeding.
- If there are generated files or large diffs, confirm intent before committing.
Command Pattern
- Inspect:
,git status -sb
,git diff --stat
.git diff - Stage:
orgit add -p
.git add <file> - Commit:
.git commit -m "type(scope): subject" - Repeat until clean.