Commit Groups
Analyze all uncommitted changes and propose logical groupings that each form an atomic, coherent commit.
Constraints
- •NEVER run
git add,git stage, or any command that modifies the index. The user stages files themselves. - •You may run
git commitwhen the user explicitly asks you to (via/commitor direct request). - •You may run read-only git commands:
git status,git diff,git log,git show, etc.
Steps
- •
Gather context by running the following in parallel:
- •
git statusto see all modified, staged, and untracked files - •
git diffto see unstaged changes with content - •
git diff --cachedto see already-staged changes
- •
- •
Analyze the changes and identify natural groupings based on:
- •Shared purpose (feature, bugfix, refactor, config, docs, tests)
- •Logical coupling (files that must ship together to stay consistent)
- •Dependency order (foundational changes before dependent ones)
- •
Present the outline using the output format below.
Output Format
An ordered list of groups. Each group has a short title and the files or chunks to stage:
code
1. <Short title> - path/to/file.ext - path/to/other.ext 2. <Short title> - path/to/file.ext (hunks: <description of which hunks>) - path/to/another.ext
When a file has unrelated changes that belong to different groups, list it with a (hunks: ...) note describing which parts of the diff belong to that group.
Guidelines
- •Order groups from most foundational to most dependent
- •Keep groups small and atomic — each should be a single logical change
- •If everything belongs in one commit, say so (don't force unnecessary splits)
- •If changes are already staged, note them as a pre-existing group