name: commit-changes description: Write a Conventional Commits message for staged changes and commit them. Use when the user asks to commit, wants a commit message written, or says they're ready to commit.
Commit changes
Turn staged changes into a Conventional Commit in one gated step.
Rules
- The user handles staging. Do not run
git add. - Commit format: follow
commitlintconfig if present, else.gitmessageif present, else Conventional Commits (type: short summary). One-line subject, no body. - Never run
git commitwithout explicit user approval.
Workflow
1. Inspect the staged diff
git status --short
git diff --cached --stat
git diff --cached
If nothing is staged, stop and tell the user to stage first.
2. Propose 2–3 options
Numbered list, each a single Conventional Commits one-liner (different
angles on the same diff — e.g. fix: vs refactor:, or different
scopes/wordings). Wait for the user to pick, edit, or supply their own.
3. Commit — only after approval
git commit -m "<type>: <subject>"
Then show the result:
git log -1 --oneline