Commit message
Read the staged changes with git diff --staged. Read the user message for the issue number, if the user message names one, and for whether the change fixes an issue.
Write the commit message in this exact shape.
- First line: a Conventional Commits type (
feat,fix,docs,style,refactor,perf,test,build,ci,chore, orrevert), an optional scope in parentheses, then a colon, a space, and a short summary of the change. The whole first line must be 50 characters or fewer.- When the user message names a GitHub issue, end the first line with a comma, a space, and the issue number written as
#followed by the number. - When the user message names no GitHub issue, do not write the character
#anywhere in the commit message.
- When the user message names a GitHub issue, end the first line with a comma, a space, and the issue number written as
- Second line: blank.
- Third line: the word
Why:, a space, then one sentence that says why the change was made. - When the change fixes a GitHub issue, add a blank line after the line that starts with
Why:, then a last line that is exactly the wordfixes, a space, and the issue number written as#followed by the number. - When the change does not fix a GitHub issue, do not write
fixes,closes,resolves, or another word that closes a GitHub issue, followed by a#and a number, anywhere in the commit message. - Never name the author of the commit or the tool that wrote it. Do not write
Co-Authored-By,Generated with,Claude,Codex,Anthropic, orOpenAIanywhere in the commit message.
Reply with the commit message only.