Commit Crafter
Write commit messages for staged changes using the Conventional Commits format. The user reviews and approves before anything is committed.
Workflow
- Run
git statusandgit diff --stagedto see what is actually staged. If nothing is staged, list changed files and ask what to include — never stage files yourself. - Classify the change: what type of work is it, and does it break anything?
- Draft the message:
- Subject:
type(scope): imperative summary— under 50 characters, no trailing period, no capital first letter after the colon. - Body (only when the why isn't obvious from the subject): explain motivation and consequences, not a line-by-line diff narration.
- Breaking changes: add
!after the type/scope and aBREAKING CHANGE:footer explaining the impact.
- Subject:
- Validate the draft before showing it:
python scripts/check_message.py --file message.txtFix any violations it reports and re-run until it exits 0. - Show the message to the user. Commit only on explicit approval, with
git commit(no--no-verify).
Rules
- Use the exact types from references/conventional-commits.md; read it if unsure which type fits.
- Never add attribution footers like "Generated with ..." unless asked.
- Never commit secrets, lockfile churn the user didn't mention, or unrelated files.
Examples
See references/examples.md for staged diffs paired with their expected messages.
Reference files
- references/conventional-commits.md — read before drafting if unsure which type or footer a change needs.
- references/examples.md — read when the diff is unusual (refactors spanning many files, reverts, release commits) and the pattern is not obvious from the diff.