agentleFS
anhle9xanhle9x/ai-worker/skills/commit-trail/SKILL.md

commit-trail

Skill4 starsChanged 22 days agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Root cause:: only for a fix. The cause that was proven, with the file and line where it sits.

    line 24
  2. Very specific:

    Not run: when nothing could be run, say so and why: Measured: not run — needs the production mailbox.

    line 26
  3. Very specific:

    Part not checked: when one part was checked and another was not, add a line Not measured: … that names the part and the reason.

    line 27
  4. Distinctive:

    Show the message to the user: before committing, and commit only when they ask for a commit.

    line 37
  5. Distinctive:

    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 …

    line 38
  6. Distinctive:

    Never invent a result, a number or a cause.

    line 46
  7. Distinctive:

    Never put a secret, a customer's name or an internal address in a message: it stays in the history for good.

    line 47
  8. Distinctive:

    Never copy an error's text that holds private data.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

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.
  • 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.

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.