Git Status
!git status
Recent Commits (for style reference)
!git log --oneline -5
Staged Diff
!git diff --cached --stat
Unstaged Diff
!git diff --stat
Instructions
Group the current changes into logical, conventional commits. Each commit should be a cohesive unit of work.
Step 1: Analyze and Group
- •Review all changed, staged, and untracked files above
- •Read file contents where needed to understand what changed and why
- •Group files into logical commits — each group should represent one coherent change (e.g., "new feature X", "refactor Y", "update config Z"). Files that were changed together for the same reason belong in the same commit.
- •Exclude files that look like secrets (.env, credentials) or build artifacts — flag these to the user
- •Draft a commit message for each group:
- •Short imperative subject line (under 72 chars)
- •Optional body explaining "why" not "what"
- •If the user provided a hint via
$ARGUMENTS, use it to guide grouping and messaging
Step 2: Confirm with User
Present the proposed commits to the user using AskUserQuestion. Show each commit as an option with:
- •The commit message as the label
- •The file list as the description
Ask if they're happy with the grouping, or want to adjust. If there's only one logical commit, still confirm the file list and message.
Step 3: Commit
For each approved commit (in logical order):
- •Stage only the files for that commit:
git add <specific files> - •Commit using a HEREDOC:
code
git commit -m "$(cat <<'EOF' Subject line here Optional body here. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> EOF )"
- •Run
git statusafter the final commit to verify success
IMPORTANT:
- •Never amend existing commits unless explicitly asked
- •Never force push
- •Never skip hooks (no --no-verify)
- •If a pre-commit hook fails, fix the issue and create a NEW commit
- •Always confirm with the user before committing anything