Commit message
Run git diff --staged and read every change before writing the message. Also check whether the user's message or the branch name gives a GitHub issue number (e.g. fix/15-delete-invalid-index → issue 15).
Format
Line 1 — summary:
<type>: <short summary>[, #<issue>]
<type>is one of: feat, fix, refactor, docs, test, chore, perf, style, build, ci.- Append
, #<issue>only when an issue number is known. Omit it entirely otherwise — do not invent a number. - The whole line, issue suffix included, must be 50 characters or fewer. Cut words from the summary until it fits; never drop the type prefix or the issue suffix to make it fit.
Line 2 — always blank.
Line 3 — the reason, one line, no blank line after it:
Why: <the motivation or root cause, not a restatement of line 1>
Last line — only when the staged change fixes the known issue, add one line, on its own, with a blank line before it if the message has other body text:
fixes #<issue>
Skip this line entirely if there is no known issue, or the change does not fix it (e.g. it's partial work, a related change, or the user did not say it fixes it).
Never add a Co-Authored-By, "Generated with", or any other attribution or tool-signature line — leave the message with nothing after the last content line.
Examples
Known issue #12, fixes it:
fix: crash in completeTask on bad index, #12
Why: index lookup ran before the bounds check.
fixes #12
Known issue #15, fixes it:
fix: delete command fails silently, #15
Why: invalid indexes returned ok instead of an error.
fixes #15
No known issue:
feat: add task count to list output
Why: users asked to see totals without counting rows.
Checklist before replying
- First line starts with a valid type and a colon.
- First line is ≤50 characters, counting any
, #Nsuffix. - First line ends with
, #Nif and only if an issue number is known. - Line 2 is blank; line 3 starts with
Why:and gives a reason, not a repeat of line 1. - Last line is exactly
fixes #Nif and only if the change fixes a known issue. - No attribution, co-author, or "generated by" line anywhere in the message.