From incremental-commit
Use this skill when the user asks to "commit incrementally", "incremental commit", "separated commits", "split commits", "commit changes separately", "commit my changes as incremental", or wants to break their pending changes into multiple logical atomic commits instead of one big commit. Also triggers when the user says "use incremental commits" or "make incremental commits for these changes".
How this skill is triggered — by the user, by Claude, or both
Slash command
/incremental-commit:incremental-commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Break pending changes into multiple logical atomic commits, each with a proper Conventional Commit message, ordered by dependency.
Break pending changes into multiple logical atomic commits, each with a proper Conventional Commit message, ordered by dependency.
Use this skill when the user wants to avoid a single large commit and instead have their changes committed in meaningful, separated chunks — one per logical concern.
Bash, Read, Glob, Grep
Use Conventional Commits format:
<type>(<scope>): <summary>feat, fix, docs, style, refactor, test, chore, improveIf the project has a commitlint config or commit convention documented (e.g., in CLAUDE.md, CONTRIBUTING.md, or .commitlintrc), follow that instead.
Run these commands to understand the full state of changes:
git status
git diff
git diff --cached
git log --oneline -5
Edge cases — stop and inform the user if:
git status shows no changes at all → nothing to commitgit status shows conflict markers (UU, AA, DD) → refuse until resolvedIf only staged changes exist: ask the user whether to commit staged as-is or re-analyze all staged + unstaged together.
Analyze the diffs semantically. Group files by logical concern, not file type or directory alone.
Grouping heuristics:
| Concern | What belongs together |
|---|---|
| Infrastructure / config | Build files, dependency lockfiles, environment configs, CI files, docker/, Makefile |
| Core / shared utilities | Shared library or utility code that other modules depend on |
| Database migrations | Migration files + the model/schema file they came from (same group) |
| Module / feature | All files within the same module/package that relate to the same feature change |
| Templates / UI | View templates or UI components — group with the feature if part of the same change, otherwise their own group |
| Tests | Group with the code being tested if part of the same feature commit; separate group if standalone test additions |
| Documentation | docs/, *.md, CLAUDE.md, CONTRIBUTING.md changes |
| Static assets | Static files, standalone |
Rules for grouping:
git add -p — file-level granularity only)Determine commit type from diff content:
featfixrefactorstyletestdocschoreimproveDetermine scope from the module or directory name (e.g., auth, api, core, ui) or a functional area like config, static, docker.
Present the proposed commit plan as a numbered list before executing anything:
Proposed incremental commits:
1. chore(config): update dependency versions
package.json, package-lock.json
2. refactor(core): extract shared pagination utility
src/core/pagination.ts, src/core/index.ts
3. feat(users): add user profile endpoint
src/users/routes.ts, src/users/service.ts, src/users/types.ts
4. test(users): add profile endpoint test coverage
tests/users/profile.test.ts
Shall I proceed? You can ask me to reorder, merge, or split any group.
This is a hard gate — wait for explicit user approval before executing.
For each approved commit group, in order:
Stage only the specific files for that group:
git add src/core/pagination.ts src/core/index.ts
Never use git add ., git add -A, or git add --all.
Create the commit using a HEREDOC to ensure correct formatting:
git commit -m "$(cat <<'EOF'
refactor(core): extract shared pagination utility
EOF
)"
Verify the commit succeeded with git status. Confirm the staged files are gone.
If a pre-commit hook fails: stop immediately, report the error, fix the underlying issue, re-stage the same files, and create a new commit — never use --amend.
Proceed to the next group only after the previous commit succeeds.
After all commits are created, show the result:
git log --oneline -N
where N is the number of commits just created. Never push automatically — leave that to the user.
When ordering commits, follow this dependency sequence:
If the user passes arguments (e.g., /incremental-commit focus on the auth changes first), use the hint to adjust grouping priority or scope. Clarify if the hint is ambiguous before proceeding.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub angryfoxx/stack --plugin incremental-commit