Claude skill · Developers
Commit message
Commits written as a change log a colleague can read: what changed and why.
When Claude uses it (the skill's own description)
Write a git commit message for the staged changes that says what changed and why, in the style a colleague reading the log in six months would want. Use when asked to commit, write a commit message, or when a change is finished and needs committing. Reads the diff first; never commits unrelated work together.
claude-code-setup-kit/skills/commit-message/SKILL.md
The skill, as Claude reads it
Plain text you can open, read and edit.
# Commit message A commit message is the only documentation most changes ever get. It states the change, the reason, and anything a reader must know to not undo it by mistake. ## Method 1. **Read what is staged**: `git diff --cached --stat` then `git diff --cached`. If nothing is staged, look at `git status` and propose what to stage, grouped by purpose. Never stage everything blindly. 2. **Check it is one change.** If the diff does two unrelated things, split it into two commits and say so. 3. **Find the why.** From the task, the conversation, or the code. If the reason is not knowable, say what the change does and leave the why out rather than invent one. 4. **Write the subject line**: under 72 characters, present tense, what the change does from the reader's point of view. "Stop the checkout double-charging when the return page is reloaded", not "Fix bug" or "Update orders.ts". 5. **Write the body when the subject cannot carry it**: the reason, the alternative considered, the behaviour before and after, anything that must not be reverted without reading. Wrap at 72. Bullets are fine. 6. **Reference the ticket or issue** at the end if there is one, in the project's format. 7. **Commit** with the message, using a heredoc so the quoting survives, and show `git log -1 --stat` afterwards. ## Shape ``` <What the change does, under 72 characters> <Why, in one to four sentences. What was wrong or missing, and what is now true. Mention the behaviour a reviewer or a future reader would be surprised by.> <Optional: how it was verified. "vitest run: 112 passed".> Refs: <ticket> ``` ## Rules - Present tense, no trailing full stop on the subject, no "This commit". - No "WIP", "misc", "fixes", "updates", "changes" as the whole subject. - Never mention file names in the subject unless the file is the point. - No secrets, no customer names, no personal data in a message. - Do not amend or rewrite a commit that has been pushed; make a new one. - If the project's `CLAUDE.md` sets a convention (conventional commits, a trailer, an attribution line), follow it over this skill.