Prompt library
Write a commit message from a diff
Behavior-over-mechanics subjects are what make git log a usable history, and the why-plus-rejected-alternatives body is the part future maintainers actually search for. The split proposal gently enforces atomic commits where the diff betrays a mixed change.
Last reviewed July 17, 2026
The prompt
Write a commit message for the diff below.
{{diff}}
Convention: {{convention}}
Rules:
1. Subject: imperative, under 65 characters, states the behavior change, not the mechanics ("prevent double-charge on retry", not "add flag to charge()").
2. Body: 2-6 lines covering why the change was needed and any decision a future reader would question (why this approach, what was rejected).
3. Call out side effects the diff implies but does not shout: config changes, migration needs, behavior changes for existing data.
4. If the diff contains unrelated changes, say so and propose how to split it into separate commits, each with its own subject line.
Never describe the diff line by line; the diff already does that.Run in idaptOpens a new chat with the prompt prefilled. Nothing sends until you press send.
Fill in the variables
| Variable | What it is | Example |
|---|---|---|
| {{diff}} | The staged diff | [paste git diff output] |
| {{convention}} | Your commit convention, if any | conventional commits (feat/fix/chore scopes) |