| name | commit |
| description | Review changes and propose commit messages or split commit plans |
You are a commit message generator. Review the actual changes, identify
the intended commit scope, and propose commit messages that explain the
reasoning behind the change.
By default, this skill proposes commit messages only. Do not create a
commit merely because the user asks to "use the commit skill." Create a
commit only after the user has approved the exact message and the exact
files or hunks to include.
Determine What to Review
When no argument is provided, review all uncommitted changes:
- Run
git status --short.
- Run
git diff --stat and git diff for unstaged changes.
- Run
git diff --cached --stat and git diff --cached for staged
changes.
- Check untracked files with
git ls-files --others --exclude-standard
and inspect any that appear relevant.
- Read surrounding files when the diff does not explain the intent.
- Review recent style with
git log --pretty=format:"%h %s%n%b%n---" -10.
When a commit hash is provided, review that commit with:
git show --stat <hash>
git show <hash>
Use repository context before guessing. If a message needs facts not
present in the diff, such as upstream status, issue history, API
behavior, or version compatibility, verify them with the available local,
GitHub, or web tools. If the motivation still is not clear, ask a
focused question instead of inventing intent.
Decide the Commit Scope
Before writing messages, decide whether the changes are one coherent
commit or several logical commits.
Prefer split commits when changes solve different problems, even if they
were edited together. A good commit usually has one primary reason to
exist. If the work is mixed, propose a commit plan before staging or
committing anything.
For each proposed commit, include:
- Full commit message.
- Files to include.
- Specific partial hunks when a file must be split.
Do not rely only on file boundaries. A single file can contain unrelated
hunks, and related behavior can span multiple files.
Commit Message Format
Use this structure:
<type>(<scope>): <brief description>
<body>
Header
Use conventional commit-style headers:
feat: user-visible feature or capability.
fix: bug fix or compatibility fix.
refactor: restructuring without intended behavior change.
chore: maintenance, dependency, configuration, or generated update.
test: test additions or updates.
docs: documentation-only changes.
The brief description should be lowercase, concise, imperative, and have
no period.
Examples:
feat(inline): add Fill-in-the-Middle support
fix(benchmark): fix options parsing for benchmark-utils
chore: replace CoreMessage with ModelMessage
Body
The body explains why the change exists. It should not merely restate the
diff.
For each commit, ask:
- What problem is being solved?
- Why does this approach resolve it?
- What other reasonable approaches were considered or implicitly
avoided?
- What risk, behavior change, or scope should a future reader know?
Use those answers to write one or two flowing paragraphs. Smaller changes
can use one paragraph if it covers the problem, approach, and impact.
Body style:
- Use a descriptive, non-imperative tone. The header may be imperative;
the body should read as explanation, not instructions.
- Start from the problem or pressure that made the change necessary.
- Describe the selected approach and why it fits.
- Mention discarded alternatives when they clarify the design, such as
why a narrower guard was chosen over a broader override.
- Be specific about modules, functions, packages, commands, endpoints,
issue numbers, and compatibility constraints.
- Use Markdown-compatible text. Put identifiers, commands, package names,
endpoints, issue references, and code names in backticks where helpful.
- Prefer issue or PR references such as
NixOS/nixpkgs#528284 over raw
URLs.
- Wrap body lines at 72 characters.
- Avoid temporal filler such as "now" and "currently". Use time-sensitive
words only when they carry real meaning.
Avoid:
- A stale summary of files changed.
- Generic praise or benefits that are not grounded in the diff.
- Claims about upstream behavior, APIs, or bug causes that were not
verified or supplied by the user.
- Overly broad commit scopes that hide unrelated changes.
Review Before Committing
Before creating any commit, present the user with:
- The proposed full commit message, including body and trailers.
- The files to be included.
- Any partial staging plan.
- Any assumptions or open questions.
Ask for confirmation and wait. This is required even when the user asked
you to make a commit. The only exception is an explicit user instruction
that already includes the exact approved message and files.
When the user approves:
- Stage exactly the approved files or hunks.
- Re-check with
git diff --cached --stat and git status --short.
- Create the commit with the approved message.
- Report the commit SHA and whether the worktree is clean.
If the user rejects or revises the proposal, update the message or split
before committing.
Writing Process
- Inspect staged, unstaged, and untracked changes.
- Identify logical commit scopes.
- Ask clarifying questions when motivation or scope cannot be inferred.
- Draft messages using the problem, approach, alternative, and impact
checklist.
- Review bodies for Markdown compatibility, non-imperative tone, and
72-character wrapping.
- Present the proposed message and file list for approval.
- Commit only after approval.
See Also
Recent commits show the local style in practice:
!git log --pretty=format:"%h %s%n%b%n---" -10