hermes

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.

context

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.

task

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:

  1. 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.
  2. 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, use plain.
  • 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 a BREAKING CHANGE: footer that says what users must do.
  • plain: a capitalised imperative subject with no prefix.
  1. Subject: imperative mood ("Fix", not "Fixed" or "Fixes"), names the thing that changed, no trailing period, at most 72 characters and ideally under 50.
  2. 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).
  3. Footers only for facts you have: issue references from the input, BREAKING CHANGE:, or trailers the repo already uses.
constraints
  • 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 commit or change the index. Output the message only.
  • Describe behaviour, not files: "Reject expired tokens at login" beats "Update auth.ts".
output format

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.

examples

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

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install write-commit-message --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill write-commit-message -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

RuleGit and version control

Conventional 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-rules
PromptGit and version control

Write 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-description
PromptGit and version control

Recover 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-work
PromptGit and version control

Resolve 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-conflict
PromptGit and version control

Choose 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-strategy
PromptGit and version control

Clean 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