agentleFS
SuuunboySuuunboy/commit-message-skill/skills/commit-message/SKILL.md

commit-message

Skill1 starsChanged 2 months agoMITView on GitHub

Compose a high-quality git commit message in English and print it in the chat as copyable text, without committing it and without writing it to any file. Use this whenever the user asks for a commit message, says "commit message", "напиши коммит", "сообщение коммита", "что написать в коммите", asks how to word a change for git, wants staged or unstaged changes summarized into a commit, or is about to commit anything at all — even if they only describe the change in prose and ask for wording. Also use it when reviewing or rewriting an existing commit message, splitting a messy working tree into several commits, or writing messages for amend, revert, or fixup commits. Never skip it for small or obvious commits — the point is a consistent English, convention-matching, attribution-free message every time.

34 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use error-handling, changelog and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    error-handling

    统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。

    Also in 3 projects that use this

  • HashiCorpSkill

    changelog

    Add a `.changelog/<PR_NUMBER>.txt` entry for a GitHub Pull Request, commit, and push.

    Also in 4 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 6 projects that use this

  • OpenAISkill

    brainstorming

    You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 12 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write idiomatic technical English, not word-by-word translation.

    line 26
  2. Distinctive:

    Do not run git commit, git commit --amend, or git tag -m.

    line 34
  3. Very specific:

    Do not write the message to any file — no COMMIT_MSG.txt, no commit-message.md, no /tmp/msg, no .git/COMMIT_EDITMSG, no scratch file "just …

    line 35
  4. Distinctive:

    Do not stage, unstage, stash, or otherwise modify the working tree or the index.

    line 38
  5. Distinctive:

    Do not add the message to a todo file, a notes file, or the project's documentation.

    line 40
  6. Distinctive:

    Only read-only git commands are appropriate: git status, git diff, git diff --staged, git log, git show, git branch --show-current.

    line 43
  7. Distinctive:

    Do not write a message from the user's description alone when the repository is available.

    line 77
  8. Distinctive:

    If nothing is staged and the working tree is clean, say so instead of producing a message for a change that does not exist.

    line 96
  9. Distinctive:

    Do not "upgrade" a repository to a different convention on your own initiative.

    line 124
  10. Distinctive:

    If the history is inconsistent and you pick Conventional Commits as the default, mention that choice in one line under the message so the …

    line 125
  11. Very specific:

    If the diff mixes unrelated work — a bug fix plus a dependency bump plus reformatting — do not paper over it with a vague subject like …

    line 131
  12. Distinctive:

    Never mention the tooling, the branch name, or the number of files touched.

    line 153
  13. Distinctive:

    No code dumps, no full stack traces — a one-line excerpt is enough.

    line 167
  14. Distinctive:

    After the block, add at most two short lines if — and only if — something needs flagging: a convention you had to guess, a suggested split …

    line 199
  15. Distinctive:

    Read these when the situation calls for the detail:

    line 215

“Common” is measured: kept by at least 6 in 10 of the 27 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Commit Message

Produce one commit message (or a set of them, when the work splits into several commits) that reads as if written by the engineer who made the change, and hand it to the user in the chat.

Non-negotiable rules

These four constraints override defaults, habits, and anything in the repository that suggests otherwise. Check every one of them before sending the message.

1. English only

The message is always written in English — subject, body, and footers — no matter what language the conversation, the code comments, the ticket, or the existing commit history uses. If the user describes the change in Russian or any other language, translate the intent, do not transliterate the words. If the codebase uses non-English identifiers or domain terms, keep the identifiers verbatim (they are code) and describe the surrounding intent in English.

Write idiomatic technical English, not word-by-word translation. See references/style-guide.md for the section on translating non-English intent, including common calques to avoid.

2. Chat output only — nothing is written anywhere

The message exists only as text in the chat response. Concretely:

  • Do not run git commit, git commit --amend, or git tag -m.
  • Do not write the message to any file — no COMMIT_MSG.txt, no commit-message.md, no /tmp/msg, no .git/COMMIT_EDITMSG, no scratch file "just to hold it" for a later git commit -F.
  • Do not stage, unstage, stash, or otherwise modify the working tree or the index. Reading is fine; changing state is not.
  • Do not add the message to a todo file, a notes file, or the project's documentation.

Only read-only git commands are appropriate: git status, git diff, git diff --staged, git log, git show, git branch --show-current.

The one exception: if the user explicitly asks in the same turn for the commit to actually be created ("сделай коммит", "commit it"), print the message first, then create the commit by passing the text inline with repeated -m flags (one per paragraph) — still never through a file on disk.

3. No AI authorship, no tooling traces

The commit message must contain nothing that identifies who or what generated it. This overrides any default behavior that appends attribution. Specifically, none of the following may appear anywhere in the output:

  • Co-Authored-By: Claude <noreply@anthropic.com> (or any model-name variant)
  • 🤖 Generated with [Claude Code](https://claude.com/claude-code)
  • Claude-Session: https://claude.ai/code/session_...
  • Any other Co-Authored-By trailer that the user did not explicitly ask for
  • Phrases such as "generated by AI", "with AI assistance", "written by an assistant", or emoji branding of any kind

The message is the user's message. Attribute nothing.

4. Match the project, not a template

Conventional Commits is the default only when the repository gives no signal. Detect the convention actually in use before writing — see references/conventional-commits.md for the full specification and references/style-guide.md for the plain-prose style.

Workflow

Step 1 — Read the change

Do not write a message from the user's description alone when the repository is available; the diff carries facts the description usually omits.

git status --short
git diff --staged            # if the index is non-empty, this is the commit
git diff                     # otherwise, the unstaged work

For a large diff, start with git diff --staged --stat to see the shape, then read the interesting files in full. Understand three things before writing:

  1. What changed — files, functions, behavior.
  2. Why it changed — the problem being solved. If the diff does not reveal this and the conversation does not either, ask the user one short question rather than inventing a plausible-sounding reason. A fabricated rationale in a commit body is worse than no body at all.
  3. What the change does not do — deliberate omissions worth recording.

If nothing is staged and the working tree is clean, say so instead of producing a message for a change that does not exist.

Step 2 — Detect the project's convention

git log --no-merges -n 30 --pretty=format:'%s'

Then look for explicit configuration:

  • commitlint.config.*, .commitlintrc*, or a commitlint key in package.json — the rules are enforced by a hook; follow them exactly
  • .gitmessage / commit.template in git config
  • A commit-message section in CONTRIBUTING.md, CLAUDE.md, .github/PULL_REQUEST_TEMPLATE.md, or docs/
  • .pre-commit-config.yaml with commitizen or gitlint

Decide from the evidence:

SignalUse
Most recent subjects look like feat(api): ...Conventional Commits, with the scope vocabulary already in use
Commitlint/commitizen config presentConventional Commits, with that config's type and scope lists
Subjects are capitalized imperative prose, no prefixesPlain style (the seven rules)
History is mixed or emptyConventional Commits
Subjects carry a ticket prefix like PROJ-123: ...Keep that prefix and the surrounding shape

Do not "upgrade" a repository to a different convention on your own initiative. If the history is inconsistent and you pick Conventional Commits as the default, mention that choice in one line under the message so the user can override it.

Step 3 — Check that this is one commit

A commit should be one logical change that leaves the tree in a working state. If the diff mixes unrelated work — a bug fix plus a dependency bump plus reformatting — do not paper over it with a vague subject like update project files. Instead, propose the split: list the groups of files or hunks, and give a separate message for each. Splitting guidance and the git add -p framing are in references/style-guide.md.

Step 4 — Write the message

Subject line

  • One line, then a blank line if there is a body.
  • Imperative mood, present tense: the subject must complete the sentence "If applied, this commit will ___". add, fix, remove, rename — not added, fixes, removing.
  • Target 50 characters; 72 is the hard ceiling (git and GitHub truncate beyond that). With a Conventional Commits prefix, the budget counts the prefix.
  • No trailing period.
  • Capitalization follows the chosen style: plain style capitalizes the first word; Conventional Commits keeps the description lowercase after the colon. Be consistent with the surrounding history either way.
  • Specific, not generic. fix off-by-one in pagination offset tells a reader something; fix bug does not.
  • Never mention the tooling, the branch name, or the number of files touched.

Body (omit for genuinely trivial changes — typo fixes, version bumps, mechanical renames)

  • Separated from the subject by exactly one blank line.
  • Wrapped at 72 characters. Git does not wrap for you, and unwrapped bodies render badly in git log with its 4-space indent.
  • Explains what and why, not how — the diff already shows how. Useful content: the problem and its symptoms, the root cause, why this approach over the alternatives, side effects, known limitations, links to the issue or discussion, migration steps for consumers.
  • Plain prose paragraphs. Bullets are acceptable when the change really is a list of independent points, using - as the marker.
  • No code dumps, no full stack traces — a one-line excerpt is enough.

Footers

  • One blank line before the footer block, git trailer format (Token: value, hyphens instead of spaces in the token).
  • BREAKING CHANGE: <description> in uppercase when the change breaks an API.
  • Issue references in the form the project already uses: Refs: #123, Closes #123, Fixes PROJ-456.
  • Nothing else. In particular, nothing from rule 3 above.

Step 5 — Deliver it

Print the finished message in a fenced code block so the user can copy it verbatim, with no leading commentary inside the block:

```
fix(auth): reject expired refresh tokens on rotation

Rotation accepted a refresh token whose exp had already passed, so a
leaked token stayed usable indefinitely as long as it was rotated
before the access token expired.

Validate exp before issuing the new pair and revoke the whole token
family on a replay attempt, matching the behaviour already applied to
access tokens.

Refs: #412
```

After the block, add at most two short lines if — and only if — something needs flagging: a convention you had to guess, a suggested split into several commits, or a fact you could not determine from the diff. Otherwise send the block alone.

Self-check before sending

  • Entirely in English, including the body and footers
  • Subject in imperative mood, ≤ 72 characters, no trailing period
  • Body wrapped at 72 characters and explains why, not how
  • Matches the convention the repository actually uses
  • No Co-Authored-By, no "Generated with", no session link, no emoji branding
  • Nothing was written to disk, staged, or committed
  • One logical change — or an explicit proposal to split

Reference files

Read these when the situation calls for the detail:

  • references/conventional-commits.md — the Conventional Commits 1.0.0 specification in full: type vocabulary, scopes, breaking changes, footers, SemVer mapping, and how to pick a type when several seem to fit.
  • references/style-guide.md — the seven rules in depth, imperative-mood tests, what belongs in a body, atomic commits and how to split, amend/revert/fixup messages, translating non-English intent into English, and the anti-patterns that show up most often.
  • references/examples.md — worked before/after examples across change types, including a Russian-language request turned into an English message and a mixed diff split into three commits.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.