Skip to content
Back to skills

Commit Message

ASecurity

Use when the user asks to commit, write a commit message, or stage-and-commit changes. Produces a Conventional Commits message derived from the actual staged diff, never from memory of what was edited.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 12, 2026
ai-agentsbashgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 12, 2026

npx -y skills add Skillkeel/skillkeel-starter --skill commit-message --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit Message?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit Message
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/skillkeel-commit-message/badge)](https://www.skillsdirectory.com/skills/skillkeel-commit-message)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commit-message
description: Use when the user asks to commit, write a commit message, or stage-and-commit changes. Produces a Conventional Commits message derived from the actual staged diff, never from memory of what was edited.
---

# commit-message

Write commit messages from evidence (the diff), not from recollection.

## Procedure
1. Run `git status --porcelain` and `git diff --cached --stat`. If nothing is staged, ask whether to stage all tracked changes (`git add -u`) or specific paths. Never `git add -A` silently (untracked junk, secrets).
2. Read the staged diff: `git diff --cached`. If it exceeds ~400 lines, read `--stat` plus the hunks of the 5 largest files.
3. Classify the change: `feat`, `fix`, `refactor`, `perf`, `docs`, `test`, `build`, `ci`, `chore`. Pick ONE. If the diff mixes types, say so and offer to split into two commits.
4. Scope = the top-level directory or module most touched (`auth`, `api`, `cli`). Omit when the change is cross-cutting.
5. Subject: imperative, ≤ 50 chars, no trailing period. `fix(auth): reject expired refresh tokens`.
6. Body only when the *why* is not obvious from the diff: 1 to 3 lines, wrap at 72. Reference issues as `Refs #123` / `Closes #123` on their own line.
7. Show the message, then commit with a heredoc so newlines survive:
   ```bash
   git commit -m "$(cat <<'MSG'
   fix(auth): reject expired refresh tokens

   Tokens past `exp` were accepted because the check used `<` instead of `<=`.
   Closes #412
   MSG
   )"
   ```
8. Print `git log -1 --stat` as proof.

## Rules
- Never describe changes that are not in the staged diff.
- Never include secrets, tokens, or internal URLs in the message.
- Do not add "Co-Authored-By" or tool attribution unless the repo's CONTRIBUTING or the user asks for it.
- If tests were not run, do not claim they pass in the message.

## Verify
Maintainers: `bash evals/run.sh /tmp/skillkeel-evals commit-message` from the plugin root runs this case and grades it; records and transcripts sit in `evals/commit-message/`.
`evals/commit-message/`: fixture repo with a staged two-file bug fix; expected: `fix(...)` subject ≤ 50 chars, body mentions the off-by-one, no unrelated files described.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.