writing-commit-messages
Skill3 starsChanged 7 months agoMITView on GitHub
Use when drafting any commit message — sets format (imperative subject under 72 chars, explanatory body when the why isn't obvious from the diff) and prevents the "Fix X" one-liner reflex for non-trivial fixes
6 other projects use a version of this.
Adopted by
Most recently taken up by
- ZeroTokenClaw/agents-skillstheir own version, first seen Sep 21, 2026
- lucavb/skillstheir own version, first seen Aug 28, 2026
- indiosmo/skillstheir own version, first seen Jun 5, 2026
- matarpeles/skills-registry-demotheir own version, first seen May 5, 2026
- witi-projects/Skillstheir own version, first seen Apr 28, 2026
- Lugia123/poltertheir own version, first seen Mar 14, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- Lugia123/polter★ 15same name
- lucavb/skills★ 3same name
- witi-projects/Skills★ 2same name
- ZeroTokenClaw/agents-skills★ 1same name
- indiosmo/skills★ 0same name
- matarpeles/skills-registry-demo★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cleaning-existing-codebaseSkill
- gating-commitsSkill
- keeping-docs-freshSkill
- keeping-files-smallSkill
- orienting-to-repoSkill
- testing-new-codeSkill
- using-repo-hygieneSkill
- writing-docstringsSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Write a body when ANY of these are true:
- Distinctive: line 53
Leave out: play-by-play of the diff, redundant restatement of the subject, marketing speak.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing Commit Messages
Overview
A commit message is the only place future-you (or future-them) finds out WHY a change happened. The diff shows what; the message has to explain why. The honest agent default is a one-liner subject and no body — fine for trivial changes, lossy for everything else.
Core principle: The message answers "why," not "what." The diff already shows what.
The Format
<subject — imperative, under 72 chars, capitalize first letter, no period>
<blank line>
<body — wrap at 72 cols, explain WHY this change exists>
<blank line, optional>
<trailer — e.g. Fixes #123, Co-Authored-By: ...>Subject Line
- Imperative mood:
Fix login failure for apostrophe usernames— notFixed, notFixes, notFixing. - Under 72 chars (50 ideal). If you need more, the body should be doing that work.
- No trailing period.
- Capitalize the first letter.
When To Write a Body
Write a body when ANY of these are true:
- The change fixes a bug — the body explains the root cause and the failure mode
- The change is non-obvious from the diff alone
- The change has a non-obvious motivation (compliance, perf regression, deprecation)
- The change is part of a larger initiative — link to the spec or parent ticket
- The change has subtle behavior (silent failure, edge case, race-condition fix)
Skip the body for: pure renames, formatting / lint fixes, dep version bumps with no behavior change, typo fixes in non-code files.
Body Content
Include:
- Symptom / motivation — what was wrong, or why this exists
- Root cause — why the bug existed (for fixes)
- Approach — only if non-obvious (
We chose X over Y because Z) - Caveats / follow-ups — known limitations, deferred work
Leave out: play-by-play of the diff, redundant restatement of the subject, marketing speak.
Before / After
❌ One-liner reflex (loses the why):
Fix login bug❌ What-not-why (diff already shows this):
Update src/auth/validator.ts
Removed the .replace() call in validator.ts.✅ Subject + body that explains the why:
Fix silent login failure for usernames with apostrophes
The validator was stripping apostrophes via .replace(/'/g, '') before
the database lookup, so users like "O'Brien" were queried as "OBrien"
and silently never matched. Removing the replacement passes the
username through unchanged.
Fixes #482Common Mistakes
| Mistake | Fix |
Past-tense subject (Fixed apostrophe bug) | Imperative: Fix apostrophe bug |
| Subject longer than 72 chars | Move detail to the body |
| Body that restates the subject | Cut it; explain why instead |
| Body that walks through the diff | Cut it; reader can read the diff |
| No body on a non-trivial bug fix | Add one — what was broken, why, how this fixes it |
Misc improvements / Various fixes | One logical change per commit. Split first. |
| Mentioning a ticket number without context | Either explain in the body or just leave the trailer |
Red Flags — STOP
- Subject starts with a past-tense verb
- Subject is your only content for a non-trivial fix
- Body is a list of what you changed (= what the diff shows)
- Multiple unrelated changes in one commit — split first
- About to commit a bug fix with no body explaining the root cause
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

