/git-commit:commitfrom git-commit
Guides the user through a structured Git commit pipeline: identifying atomic units, ordering commits, running quality gates, validating messages, and verifying post-commit state.
Ships in git-commit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Skill(git-commit:commit-message)
Do not start the pipeline before that skill is loaded.
<git-commit-config>
<validator-args>
<flag name="require-trailers" value="Task"/>
</validator-args>
<extra-instructions>
Project-specific commit guidance goes here.
</extra-instructions>
</git-commit-config>
Read the project CLAUDE.md file before the pipeline starts. Then obey the two elements:
<validator-args> — give each flag to the validator. <flag name="X" value="Y"/> becomes --X "Y" on the
command line.<extra-instructions> — the guidance with the highest priority for this commit. Obey it in each step. It
overrides the defaults of this skill.A permission prompt for git add or git commit in the middle of the pipeline shows that the grant expired. Invoke
this skill again to restore it.
Name the step when you report your position. Write "resuming the Commit Loop at Self-Review". If you are not sure, read
the staged changes again with git diff --cached.
Run this pipeline during the work. Do not save it for the end of the task.
git bisect cannot use it.coding skill of the-coder gives the change list and the size checkpoint.Run these commands in the repository that gets the commit:
git status --short --branch # staged, unstaged, and untracked files
git diff # unstaged changes to tracked files
git diff --cached # staged changes
git log --all --oneline --no-merges -10 # the subject form of the history
The first status column shows the staged state. The second column shows the unstaged state. The ?? mark shows an
untracked file. If the status shows no change, tell the user that there is nothing to commit. Then stop.
The two diff commands do not show an untracked file. Stage such a file with an explicit path. In a repo with no commits, all files are untracked.
Then find the separate units in the changes.
**Make one commit for each logical change. One logical change is one unit.** A unit is the smallest change that keeps the tree in a working state. A unit is not the whole task. One task gives many units.Two tests find the boundaries. Apply both:
These conditions show a boundary between two units:
Give a type to each unit. Then commit the types in this order:
Commit the style units and the refactor units first. This keeps the commits that change behavior clean.
Dependency order has priority over type order. If a fix builds on a feature, commit the feature first. Put the tests of a unit in the commit of that unit. Do not make a separate test commit, with one exception. Characterization tests pin the behavior of committed code before a change. They are a unit of their own. Commit them before that change.
Read <pipeline-awareness> again after you return from the fixes. Then continue at the first step of the Commit Loop.
Do not start the pipeline again. Do not skip a step.
The split test asserts that each unit builds and passes alone. This pipeline does not measure that assertion. A wrong
split leaves a broken commit in the middle of the history, and git bisect finds it much later.
Two habits keep the risk low. Commit a unit before the unit that depends on it. Give more care to the split test when a unit removes code, changes a signature, or moves a symbol, because these three cases break the callers that a later unit corrects.
Do the steps below for each unit, in the planned order.
git add <files>
Give an explicit path for each file. Do not use git add -p: it opens an interactive prompt, and the Bash tool has no
terminal to answer it.
To unstage the wrong file:
git restore --staged <file>
One file can hold two units. Do one of these two things:
Write the message of this unit. Obey the commit-message conventions. Save the message with the Write tool to a file in the temp directory of the system. A file gives git the multi-line message, the quotes, and the backticks without damage. Shell quoting damages them.
**Give each commit its own message file.** Parallel sessions and agents share the temp directory, so a fixed name lets one writer overwrite the message of another. Name the file `commit-msg---${CLAUDE_SESSION_ID}.txt`. `` is the absolute path of the repository, with `-` in place of each separator. `` is a short name for the unit.The Write tool overwrites an existing file without a warning. Two signs show that another writer uses the name:
Leave the file of the other writer alone. Never commit a message file that holds text you did not write.
Write the reason first, in one paragraph. Then cut: delete each sentence that the diff shows, and each paragraph that walks the reader through the new procedure.
git diff --cached
Verify each item before you continue:
.env file, a credential, or a secret.P1: keep -- <the fact that it records>
P2: cut -- shown by the diff
P3.1: keep -- <the fact that it records>
P3.2: cut -- inventory of the diff
A paragraph earns keep only when it records the cause of the change, or an item of the earns-its-lines list in the
commit-message conventions.
A paragraph can hold a list, with one line for each behavior change. Audit such a paragraph line by line, as P3.1 and
P3.2 above, against the list rules of the commit-message conventions.
A paragraph gets cut when it names a function, a call order, an empty case, a fallback, or a flag that gates the new
code. Such a paragraph reports the procedure, and the staged diff shows the procedure. Move the fact into the artifact
when the next maintainer needs it. Then delete the paragraph.
The number of paragraphs follows the number of reasons, never the size of the diff. Write the message file again after the deletions.
node ${CLAUDE_PLUGIN_ROOT}/scripts/validate-commit-message.mts --file <message file>
<validator-args> when the project config defines them.The validator does not check the ASCII rule, the 72-character body wrap, the scope format, the register, or AI attribution. You own those.
Show the full message to the user as a blockquote. Then commit:
git commit -F <message file>
A project hook can stop the commit or change the files. Read the output. A hook that exits with an error stops the
commit, and the message file stays for the next attempt. A hook that reformats a file does not stage that reformat: the
commit holds the content that you staged, and the reformat stays in the working tree as an unstaged change. Run
git status after the commit and amend the commit when the reformat belongs to the same unit. Do not pass
--no-verify.
Run each command in a separate Bash call after the last unit:
git log --stat -3 # -3 = the number of commits that you created
git status
Then show the new commits with their subjects, the state of the current branch, and the changes that are still not committed.
Prefer a migration series to one breaking commit when you can stage the break:
What SKILL.md sets; muted values are Claude Code's defaults
Invoke when work reaches a committable state — a verified step finished, or the user asked to commit, stage, or split a diff. Invoke during the work, before the tree grows past one unit, not once at the end of the task. Also invoke on the symptoms: a tree holding several unrelated changes, a commit that needs an amend, or a message the validator rejected.
Three short reads, in order
2 skills in this plugin
npx claudepluginhub xobotyi/cc-foundry --plugin git-commitOther plugins' skills for the same job