agentleFS
tbhbtbhb/vale-ai-tells/.claude/skills/review-commit-message/SKILL.md

review-commit-message

Skill118 starsChanged 37 days agoMITView on GitHub

Review a drafted commit message in COMMIT_AGENTMSG against the staged diff, as an independent agent, for the things mechanical linting can't see: claims the diff doesn't support, counting, provenance filler, restating the diff, subject mood and bounds, plain-text form, and whether the staged change is one logical change. The commit skill invokes this before every commit, passing the repository root.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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
  1. Distinctive:

    Treat the first word as the repository under review.

    line 19
  2. Distinctive:

    Run these before judging anything:

    line 29
  3. Distinctive:

    No trailing period on the subject.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “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

Review a drafted commit message

Review a drafted commit message against its staged diff and return a verdict. You're the independent check. You didn't write this message and you didn't watch the work happen, so read what the message claims rather than what its author meant to claim.

The repository

$ARGUMENTS

Treat the first word as the repository under review. An empty value means the current working directory. Bind it once and use it throughout:

REPO="${ARGUMENTS:-$(pwd)}"

A second word of --amend says this commit replaces the one at HEAD instead of following it. That changes which diff you read. The rest of your job is unchanged.

Gather the inputs

Run these before judging anything:

  • cat "$REPO/COMMIT_AGENTMSG" for the draft
  • git -C "$REPO" diff --cached --name-status for the staged paths
  • git -C "$REPO" diff --cached for the staged diff
  • git -C "$REPO" log -5 --pretty=format:'%h %s' for project style

Where the caller passed --amend, swap the two staged-diff commands for these:

  • git -C "$REPO" diff --cached --name-status HEAD~1
  • git -C "$REPO" diff --cached HEAD~1

Those show the amended commit's full contents: the existing commit plus whatever the author has staged since. Reading the plain staged diff during an amend shows the delta alone, so a message describing the whole commit looks like it claims things the diff never supported. That mistake produces confident, wrong findings.

A missing or empty draft, or an empty staged diff, is itself a finding. Report it and stop.

What to check

Work these four groups. Quote the exact offending text in each finding and give the fix.

Truthfulness

The message describes this diff and no other.

  • Flag any claim the staged diff doesn't support. A message that mentions a file, function, flag, or behavior absent from the diff is wrong, whatever else it gets right.
  • Flag counts of any kind: files, lines, tests, functions, commits, percentages. A count goes stale as soon as other work merges, and it pads a message rather than informing it.
  • Flag results nobody verified: benchmark figures, fixes the flake, no longer leaks, claims about what CI does.

Substance

The body answers why the change exists. The diff already says what changed.

  • Flag body text that restates the diff. Adds a helper to foo.go and calls it from bar.go describes a diff the reader can already read.
  • Flag provenance filler: requests, review rounds, sessions, prompts, iterations, models, assistants, tools. Attribution belongs in the Assisted-by trailer and nowhere else.
  • Flag selling: robust, comprehensive, significantly, seamlessly, powerful, elegantly, and their neighbors.
  • Flag a body that repeats the subject in longer words, or that doesn't explain anything the reader couldn't recover from the diff.

Form

  • Subject shape <type>(<scope>)?(!)?: <description>, with a type that suits the change: docs for documentation, feat for a new capability, fix for a defect, refactor for behavior-preserving work.
  • Subject in imperative mood and present tense: explain the tools, never explains, explained, or explaining.
  • No trailing period on the subject. Subject length between 10 and 80 characters.
  • Body lines wrap at 72 characters. Footer and trailer lines wrap at 100.
  • Plain text throughout, with no fenced code blocks, headings, markdown emphasis, links, or tables. Backticks around a literal identifier are fine.
  • Assisted-by appears before Signed-off-by. No model or assistant credited through Co-authored-by.

Atomicity

Judge the staged diff, not the message.

  • Does it carry one logical change, one the reader can state in a sentence, one that reverts cleanly as a unit?
  • Flag a diff that mixes a behavior change with an unrelated refactor, a fix with a formatting sweep, or two independent features. List the groups it should split into.
  • A change plus its tests, or a change plus the documentation describing it, counts as one logical change. Leave that alone.

What to return

Your verdict is what lets the commit proceed. A hook on the caller's side reads the line below and signs the draft you cleared. Keep the wording exact, because a verdict that hook can't parse leaves the commit blocked. Write nothing to disk yourself, and don't edit the draft to make it pass. Reporting the finding is the job.

Return the verdict block and stop there. Skip the preamble, the diff summary, and the praise.

VERDICT: PASS

or

VERDICT: CHANGES REQUIRED

1. [truthfulness] <what is wrong>
   text: <the exact offending text>
   fix:  <the specific correction>

2. [form] <what is wrong>
   text: <the exact offending text>
   fix:  <the specific correction>

Tag each finding truthfulness, substance, form, or atomicity.

Return PASS when the draft holds up. A clean message counts as a real outcome, and inventing a finding to look thorough wastes the round trip. Report only what you can point at in the draft or the diff.

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.