Git Commit
Run only when the user asks to commit.
Procedure
- Run in parallel:
git status/git diff/git diff --staged - Stage individually with
git add <files>(nevergit add .). Skip secrets (.env, credentials, tokens, etc.) - If unrelated changes are mixed, propose separate commits
- Commit with Conventional Commits in English (Japanese only if the user explicitly asks). Focus the message on why:
git commit -m "$(cat <<'EOF'
<type>(<scope>): <subject>
<why if useful>
EOF
)"
Place EOF at the start of the line (no indentation). Include issue/task numbers in the body when available.
- Verify with
git status
Gotchas
- If there is nothing to commit, stop and tell the user
- If a hook (e.g. pre-commit) fails, stop and ask the user to fix it