Write or check a git commit message that a reader can trust a month later: the kind of change, for a fix the proven cause, and for a fix, feature, speed or security change the command that was run and what it showed. Use when the user types /commit-trail, asks to write a commit message, to commit with a proper message, or to check a commit message before pushing. Not for deciding what goes into the commit, and not for release notes or a changelog. Viết hoặc kiểm một lời commit git mà người đọ...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Commit Trail?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anhle9x-commit-trail)
---
name: commit-trail
description: "Write or check a git commit message that a reader can trust a month later: the kind of change, for a fix the proven cause, and for a fix, feature, speed or security change the command that was run and what it showed. Use when the user types /commit-trail, asks to write a commit message, to commit with a proper message, or to check a commit message before pushing. Not for deciding what goes into the commit, and not for release notes or a changelog. Viết hoặc kiểm một lời commit git mà người đọc tin được sau một tháng: loại thay đổi, với commit sửa lỗi thì nguyên nhân đã chứng minh, và với sửa lỗi, tính năng, tốc độ hay bảo mật thì lệnh đã chạy cùng kết quả của nó. Dùng khi người dùng gõ /commit-trail, nhờ viết lời commit, nhờ commit với lời commit đàng hoàng, hoặc nhờ kiểm lời commit trước khi đẩy. Không dùng để quyết định commit gồm những gì, cũng không dùng cho ghi chú phát hành hay changelog."
---
# Commit trail
Answer the user in their language. Write the commit message in the language the repository's history uses (look at `git log --oneline -10`); English when there is no history.
Purpose: someone who reads the history later, without this conversation, can tell what kind of change a commit is, why a bug happened, and how far the change was checked.
## The message
```
type(scope): summary
What changed and why, in a few plain lines.
Root cause: <the proven cause, with file:line> (a fix)
Measured: `<the command that was run>` → <what it showed> (fix, feat, perf, security)
```
- **Subject:** `type(scope): summary`. The type is one of `feat fix perf refactor docs chore test ci build style security release revert`. The scope is the part of the project, in a word or two. At most 72 characters, no period at the end.
- **`Root cause:`** only for a `fix`. The cause that was proven, with the file and line where it sits. When the cause was not proven, write `Root cause: unknown — hypothesis: …` and say what the guess rests on. Never write a guess as a fact.
- **`Measured:`** for `fix`, `feat`, `perf` and `security`. The command that was really run, in backticks, and the result it really gave, with its number: `` `npm test` → 214 pass, 0 fail ``. Several lines when several things were run.
- **Not run:** when nothing could be run, say so and why: `Measured: not run — needs the production mailbox`. A bare "not run" is not enough.
- **Part not checked:** when one part was checked and another was not, add a line `Not measured: …` that names the part and the reason.
- **A field that does not apply is left out,** never filled with "N/A" or "none".
- `docs`, `chore`, `refactor`, `test`, `ci`, `build`, `style`, `release` and `revert` need the subject only; a body is welcome.
- A merge commit, `Revert "…"`, `fixup!`, `squash!` and `amend!` are left as git writes them.
## How to do it
1. **Read the change.** `git status --short`, then `git diff --cached` (or `git diff` when nothing is staged yet). The message describes what is in the commit, not what the conversation was about.
2. **Pick the type** from what the change does for the person who uses the project: a bug that is gone is `fix`, a new ability is `feat`, the same behaviour made faster is `perf`, a closed hole is `security`. If one commit holds two kinds, say so and suggest two commits.
3. **For a fix, name the cause.** Point at the file and line. If you only have a theory, write it as a hypothesis.
4. **Collect what was measured.** Use only commands that were run in this session, after the last edit to the files in the commit, and the output they gave. If a check was run before a later edit, run it again or do not cite it. If nothing was run, run the project's own checks now when that is safe and quick; otherwise write "not run" with the reason.
5. **Show the message to the user** before committing, and commit only when they ask for a commit. Stage only the files that belong to this change.
6. **After the commit,** if the message lacks something and the commit is not pushed yet, fix it with `git commit --amend`, keeping what it says and adding what is missing. Do not amend a commit that is already pushed: tell the user what is missing.
## Checking a message someone else wrote
Go through the rules above and list what is missing, one short line each. Do not rewrite a result: if `Measured:` has no command or no number, ask what was run.
## Never
- Never invent a result, a number or a cause. A message that says "not run" is worth more than one that claims a check nobody ran.
- Never put a secret, a customer's name or an internal address in a message: it stays in the history for good.
- Never copy an error's text that holds private data; say which check failed.
## With the AI Worker plugin
The plugin can check the same rules by itself after each commit Claude makes: set `"commitTrail": true` in the computer's `config.js` (`~/.local/share/ai-worker/config.js`). It reminds, and never holds a commit back. This skill is the same rules used beforehand, and works where that check is off.
## Source
The rules follow `commit-trail` in kennetvn/nextcore-skills (MIT, see `LICENSE` in this folder), without its demand for an issue number.