writing-commit-messages

writing-commit-messages is a skill for Claude Code from gg-mo/repo-hygiene. It costs 51 tokens per session (874 once invoked), scanned A, original, MIT.

A set of rules for writing Git commit messages, which describe saved changes in a code repository. It specifies an imperative subject line, a length limit, and an explanatory body when the reason is not obvious.

In plain words
What is it for?
Use it when drafting commit messages for bug fixes, refactors, compliance changes, performance work, or any change whose motivation needs explanation.
Why use it?
It makes the purpose of non-trivial changes easier to understand later instead of relying only on the code diff. It also keeps commit messages consistent across a project.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the repo-hygiene plugin — 9 skills, 1 hook shipped together

Good fit Use it when drafting commit messages for bug fixes, refactors, compliance changes, performance work, or any change whose motivation needs explanation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gg-mo/repo-hygiene/writing-commit-messages
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gg-mo/repo-hygiene --skill writing-commit-messages
Clone the repo
git clone --depth 1 https://github.com/gg-mo/repo-hygiene

Made for: Claude Code.

Or install repo-hygiene, the plugin that ships this one along with the rest of its 9 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writing-commit-messages

README.md
[![agentmods](https://agentmods.dev/badge/skills/gg-mo/repo-hygiene/writing-commit-messages/github.svg)](https://agentmods.dev/skills/gg-mo/repo-hygiene/writing-commit-messages)
Your own site
<a href="https://agentmods.dev/skills/gg-mo/repo-hygiene/writing-commit-messages"><img src="https://agentmods.dev/badge/skills/gg-mo/repo-hygiene/writing-commit-messages/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for writing-commit-messages

Your own site · 80×15
<a href="https://agentmods.dev/skills/gg-mo/repo-hygiene/writing-commit-messages"><img src="https://agentmods.dev/badge/skills/gg-mo/repo-hygiene/writing-commit-messages.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 874 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.00874
Opus 5 $0.00026 $0.00437
Sonnet 5 $0.00010 $0.00175
Haiku 4.5 $0.00005 $0.00087

Measured 10d ago against content hash f3a209511c8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

writing-commit-messages scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/writing-commit-messages/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 — not Fixed, not Fixes, not Fixing.
  • 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.

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 100 lines · 51 tokens per session scan A f3a209511c8a

Subscribe to this mod's changes

writing-commit-messages is a skill published in the GitHub repository gg-mo/repo-hygiene (3 stars, last pushed 3mo ago), licensed MIT. It adds 51 tokens to every session and 874 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

branch-and-worktree-workflow

Isolates feature work in its own branch or worktree and integrates it cleanly when done. Use this when starting work that should not disturb the current workspace, when several efforts must proceed in parallel on one repository, or when implementation is finished and the change needs merging, rebasing, or splitting…

cbrock84/headcount · 70 tokens

review

Structured code review with parallel audit agents, confidence-scored triage, and optional auto-fix. Examines uncommitted changes, staged diffs, commit ranges, or specific paths. Produces a tiered report (MUST-FIX / RECOMMENDED / NIT) backed by evidence, then optionally applies fixes with verification.

greglas75/zuvo · 70 tokens

commit

Use when the user asks to commit changes (interactively, not inside an autonomous cycle). Runs code-simplifier + one reviewer (general code-reviewer OR the matching language reviewer, ECC agents/skills), then lint + targeted tests via evolve commit-gate run, writes a tree-SHA-bound attestation, commits + pushes via…

mickeyyaya/evolve-loop · 105 tokens

kanso-commit

Use when the user asks to commit changes, stage their work, write commit messages, or split the working tree into logical commits.

blakecyze/kanso · 31 tokens

ship

Use after audit returns Verdict PASS. Atomic git commit + tag + ledger update. Single-writer; cannot fan-out.

mickeyyaya/evolve-loop · 26 tokens

commit

Create a user-requested Conventional Commit from the staged changes.

reidemeister94/development-skills · 14 tokens