← All prompts

Write a Commit Message From the Staged Diff

Turns whatever is staged into a message that explains the why, not a restatement of the diff.

The prompt

Read the staged diff with `git diff --cached` and write the commit message for it.

FORMAT
- Subject line: imperative mood, under 60 characters, no trailing period.
- Blank line, then body wrapped at 72 columns. Omit the body only when the
  subject genuinely says everything.

CONTENT
- The body explains WHY the change was made and what it makes possible. The
  diff already shows what changed, so restating it wastes the reader's time.
- Name any behaviour that changes for a user or a caller.
- Call out anything deliberately left undone, and why.

RULES
- Read the actual staged diff. Do not infer from filenames or from what I said
  I was doing, since the two often differ.
- If the staged changes are really two unrelated commits, say so and propose
  the split instead of writing one message that covers both.
- No conventional-commit prefixes unless the repo history already uses them;
  check `git log --oneline -20` first.
- Output the message only. No preamble, no explanation of your choices.

The instruction that earns its place is “read the actual staged diff”. Without it you get a message describing what you said you were doing in the previous message, which is frequently not what ended up staged.

The split check has caught more bad commits here than the formatting rules have.

Comments