Write a commit message
Writes a commit message that states what changed and why, in the repo's own convention, and flags staged changes that should be split. Use before committing.
A commit message is read months later by someone running git log, git blame or git bisect who needs to know why a line exists. The subject says what changed in words a reader can scan; the body says why, because the diff already shows how. A message that narrates the diff, or one that bundles unrelated changes behind "and", fails that reader.
Write a commit message for this change:
Only if [CHANGES] is given:
If no change is given above, read the staged changes (git diff --staged). If nothing is staged, say so in one line and stop.
Only if [WHY] is given:
Reason given by the author:
- Read the whole diff and name its single purpose in one sentence. If the diff mixes unrelated purposes (a fix plus a refactor, two features), do not write one message. Propose a split instead: list each commit with its files or hunks and its subject line.
- Pick the convention: .
match-repo: read the last 20 subjects (git log --format=%s -20) and copy their pattern: type prefixes, scopes, capitalisation, ticket references. If there is no history or no clear pattern, useplain.conventional: Conventional Commits 1.0.0.type(scope): description, with type one of feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert. Use the scope only if the repo has clear modules. Mark a breaking change with an exclamation mark before the colon (feat(api)!: ...) and aBREAKING CHANGE:footer that says what users must do.plain: a capitalised imperative subject with no prefix.
- Subject: imperative mood ("Fix", not "Fixed" or "Fixes"), names the thing that changed, no trailing period, at most 72 characters and ideally under 50.
- Body, after one blank line, wrapped at 72 characters: the problem, why this approach, and any side effect or follow-up a reviewer must know. Skip the body when the subject says everything (typo fixes, version bumps).
- Footers only for facts you have: issue references from the input,
BREAKING CHANGE:, or trailers the repo already uses.
- Never invent a reason, ticket number, issue link, benchmark or test result. If the motivation is not in the diff or the input, write a body with only what the diff proves and add one line after the message asking for the reason.
- Do not add tool or assistant attribution trailers (such as
Co-authored-by) unless the author asks. - Do not run
git commitor change the index. Output the message only. - Describe behaviour, not files: "Reject expired tokens at login" beats "Update auth.ts".
The message inside one fenced text block, exactly as it should be committed.
After the block, at most two lines starting with Note: for a proposed split or missing information. Nothing else.
For a split, output one fenced block per proposed commit, each preceded by the files or hunks it contains.
Input: a diff that changes retry.ts so that fetchWithRetry stops retrying on HTTP 4xx responses, with a new test.
Stop retrying client errors in fetchWithRetry A 4xx response means the request itself is wrong, so retrying it only adds latency and load: a bad token was retried 5 times per call before failing. Retry only network errors and 5xx responses, and add a test that a 401 fails on the first attempt.
Every required value is filled in. Copy gives the finished prompt.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- Git and version control
- level
- Beginner
- made for
- Software engineer
- needs
- git
- risk
- read-only
- version
- v1.0.0 · experimental
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install write-commit-message --target claude-codenpx skills add hermes-hq/hodios-dist --skill write-commit-message -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
pairs well with
All of Git and version controlConventional Commits rules
Makes the assistant write every commit in Conventional Commits 1.0.0 format, one logical change per commit, with honest breaking-change footers. Use in repos that release from commits.
conventional-commits-rulesWrite a pull request description
Writes a pull request description that tells reviewers why the change exists, what to look at first, how to test it and what could break. Use when opening a PR.
write-pr-descriptionRecover lost Git work
Recovers commits, branches, stashes and staged files lost to a reset, rebase or dropped stash, using reflog and fsck after a backup, explaining each command. Use right after a git mistake.
recover-lost-git-workResolve a merge conflict
Resolves merge, rebase or cherry-pick conflicts by reading both sides and their common base, keeps the intent of each, and asks when the intents contradict. Use when git stops on a conflict.
resolve-merge-conflictChoose a branching strategy
Recommends a branching and release strategy such as trunk-based, GitHub flow or release branches for a team's size, cadence and environments, with rules, protections and migration steps.
choose-branching-strategyClean up a branch's commit history
Plans an interactive rebase that turns a messy branch into logical, reviewable commits, with a backup, the exact todo list and a check that the code is unchanged. Use before merging a WIP branch.
clean-up-commit-history