My commit history was a graveyard of "fix", "update", "wip". Reviewing my own PRs a month later was archaeology.
I wired a prompt into a pre-commit hook that reads the staged diff and drafts a Conventional Commits message, but the real value was forcing a "why" line that the diff alone can't explain, so it asks me one question when the intent is ambiguous.
Anyone found a clean way to feed it the linked issue context automatically?
You will receive a staged git diff. Produce a commit message in Conventional Commits format.
- Subject: type(scope): summary, imperative mood, <= 50 chars, no trailing period.
- Body: wrap at 72 cols. Explain WHAT changed in one line and WHY in one line. The WHY must be information not derivable from the diff itself (the motivation, the bug's user-facing symptom, the constraint that forced this approach).
- If the diff touches behavior, add a 'BREAKING CHANGE:' footer only when an API/contract actually changed.
If you cannot determine the WHY from the diff, do NOT invent it: output exactly one clarifying question prefixed with 'NEED:' and stop. Never write 'various fixes', 'update code', or 'misc changes'.