Skip to content
AI Skill Index
CodingVersion 1.0.0

Commit message writer

Writes commit messages that explain why, from the staged diff.

Works with: Claude Code, Cursor, Any agent

Reads what is actually staged and writes a message whose body tells a future reader why the change was made, not what changed. The diff already says what changed; a message that restates it costs a line and adds nothing.

Files in this package

---
name: commit-message-writer
description: Write a commit message from the staged diff. Use when the user asks to commit, or asks for a commit message.
---

# Commit message writer

## When this applies

The user is about to commit, or has asked for a message. If nothing is staged, say so and stop — do not write a message for unstaged work, and do not stage files on the user's behalf.

## Procedure

1. Read the staged diff. Not the working tree — what is staged is what is being committed, and the difference is a common source of wrong messages.
2. Work out the *reason* for the change. The diff shows what moved; the message has to supply what the diff cannot.
3. Write:
   - **Subject**, imperative mood, under 72 characters, no trailing period.
   - **Blank line.**
   - **Body**, wrapped at 72, explaining why. Include what you considered and rejected if that is what a reader would ask.
4. If the diff contains two unrelated changes, say so and suggest splitting it. Do not paper over it with a subject containing "and".

## Never

- Never restate the diff. "Update user.ts" is worthless — the file name is already in the commit.
- Never invent a motivation you cannot see. If the reason is not inferable, write the subject and ask the user for the why.
- Never mention the tool that wrote the code.
- Never write "various fixes", "misc", or "cleanup" as a subject.

## Examples

Bad: `Fix bug in parser`
Good: `Reject empty CSV rows instead of importing blanks`

Bad: `Update auth middleware`
Good: `Check session on every admin route, not just the layout`

The second of each pair is a sentence a reader can act on a year later.

How to install

Unzip into .claude/skills/ in your project, or ~/.claude/skills/ to make it available everywhere. The agent picks it up from the folder name and the description in the front matter. There is no registration step.

ShareXLinkedIn

Related skills

Coding

Test writer

Writes tests that fail for the right reason and refuse to test the framework.

Coding

Code reviewer

Reviews a diff for defects, and refuses to pad the list with style opinions.

Coding

Release notes writer

Writes release notes and a changelog from a commit range, leaving out the commits users never notice.

Cookies

We use only the cookies this site needs to work. Optional analytics helps us see which content is worth writing more of — nothing loads until you say yes.

Read the privacy policy