Write commit messages from actual repository changes. Prefer concise, intention-focused messages over file-by-file diff summaries. Treat
references/commit-convention.md
as the baseline style guide, then adapt scope and wording to the current repository.
-
Inspect the change set first.
- Prefer when changes are staged.
- Use when no staged diff exists or when the user asks about unstaged changes.
- Use to understand file scope.
- If the repository contains a commit convention file, read it before writing the message. Check likely names such as , ,
.github/COMMIT_CONVENTION.md
, or .
- Inspect recent commit subjects with
git log --format=%s -n 20
to infer the repository's preferred output language. Follow the dominant language used in history. If recent commit subjects are mixed with no clear dominant language, or if there is no commit history or another error prevents inspection, default to English.
-
Choose one commit intent.
- If changes contain unrelated intents, recommend splitting commits.
- If the user still wants one message, choose the dominant intent and explain the tradeoff briefly.
-
Choose the header:
For mixed changes, either split commits or use the dominant type in the header and type-prefixed bullets in the body.
Derive
from the current repository. Do not reuse scopes from the reference file unless they match actual changed paths or local conventions.
If no meaningful scope is required by the repository's convention, omit it only when the local style allows scope-less headers.
Write the subject as the core intent of the change. Keep it short, concrete, and action-oriented. Avoid vague subjects such as
,
, or
.
Match the output language to the repository's recent commit history. Use the dominant language when it is clear. If the recent history is inconsistent or mixed, or if there is no commit history or another inspection failure, write the commit message in English by default.
Read
references/commit-convention.md
for the baseline Conventional Commits rules and examples. Override its scope examples with the current repository's structure.