conventional-commits-writing
When to use
Use this skill when:
- Committing in a repository whose conventions you have not established this
session — run ## Procedure: Establish the house convention first
- Generating a commit message from staged changes
- Generating a squash merge title from a PR
- Deciding the correct Conventional Commit type for a change
- Reviewing whether a commit message is correct
- Splitting one vague change into multiple commit messages
Do NOT use when:
- Only explaining the Conventional Commits standard (just reference the rule)
- The message is already correct and does not need review
- Following the Git workflow (use
git-workflowskill)
Procedure: Establish the house convention (run FIRST, before any message)
Conventional Commits is this suite's fallback, not a universal truth. A
repository that has demonstrably converged on another grammar gets that grammar;
imposing the shipped default there produces commits that read as foreign in
git log and in review. The precedence, highest first:
| Tier | Source | Binding? |
|---|---|---|
| 1 — configured | commitlint.config.* · .gitmessage · a commit-msg hook (husky / lefthook / .git/hooks) · CONTRIBUTING.md § Commits · a CI job that validates subjects · release automation that PARSES subjects (semantic-release, changesets, git-cliff, conventional-changelog) | yes — Class A, no approval needed |
| 1b — declared | git.commit_format in .git-convention.yml, the team's committed carrier at the repository root (ADR-283), where either value is a declaration — a team that commits ticket-scope chose it. Without the carrier, git.commit_format: ticket-conventional in a developer settings file, where only the non-default value declares anything: ticket-scope is also what a copied template carries, so it proves no choice. agent-config git:convention show --key commit_format names the file and the state; malformed or invalid declares nothing and is reported, never read as the default | yes — the user's own word, so no measurement and no ask |
| 2 — measured + approved | the consensus pass below, after the user says yes | yes, for this repository |
| 3 — measured, unapproved | the same pass before the user answers | no — advisory; report the mismatch, write Conventional |
| 4 — default | Conventional Commits | yes |
agent-config git:convention subject validates against tiers 1b–4 only. A
tier-1 commitlint config or commit-msg hook is named in a note: line as also
running at commit, possibly stricter; the verb never infers what it accepts and
never changes its exit for it.
Release automation is the trap that makes tier 1 outrank tier 2 even when the
history disagrees: a repo whose git log is 85 % [JIRA-123] Fix thing but
whose manifest (package.json, composer.json, pyproject.toml, Cargo.toml)
runs semantic-release or its ecosystem equivalent is a repo migrating toward
Conventional Commits, and the measurement is reading its past, not its intent.
Check for the parser before you trust the prevalence.
1. Look for tier 1 before measuring anything
agent-config git:convention show --key commit_format # tier 1b: valid from .git-convention.yml (either value), or ticket-conventional from a settings file
ls commitlint.config.* .commitlintrc* .gitmessage .czrc 2>/dev/null
git config --get commit.template
ls .husky/commit-msg .git/hooks/commit-msg 2>/dev/null
grep -rniE 'semantic-release|git-cliff|conventional-changelog|release-please|commitlint' \
package.json composer.json pyproject.toml Cargo.toml .github/workflows/ .gitlab-ci.yml \
2>/dev/null | head
**Every one of these produces candidates, not verdicts — open the file before
you act on the hit.** A commit.template proves a template exists, not that it
constrains the subject: a .gitmessage carrying only a body checklist ends
nothing. CONTRIBUTING.md is prose and cannot be grepped for a convention —
grep -i commit matches "please commit early and often" — so read its commits
section if it has one and take the grammar from the sentences, not from the
match. Only a confirmed source ends the procedure, and when it does, say
which file answered.
changesets is deliberately not in the parser list: it reads .changeset/*.md
files and never parses a commit subject, so its presence says nothing about the
convention. The four that do parse subjects — semantic-release, git-cliff,
conventional-changelog, release-please — count only when the hit is a real
dependency or a wired job, not a mention in a comment.
The tier table above calls a confirmed hit Class A. That is exact for a machine
-readable config and loose for CONTRIBUTING.md, which carries no digest and is
read by a human judgement — treat a prose source as tier 1 in precedence and
as a quoted sentence in the report, so the next reader can check it.
2. Measure the history — `agent-config git:convention measure`
The measurement is code. `agent-config git:convention measure [--limit N]
[--family F] [--json]` samples the history, classifies, caps, aggregates and
judges it, and writes nothing. The sample size, the exclusions and every
threshold it applies are the measure rows of the generated block in