SkilVaultSign inStart free

Catalogue / commit-message-conventions

commit-message-conventions

Older skill: source not recordedSignedFormats git commit messages in Conventional Commits style so changelog generators and semantic versioning tools can read the history reliably. Covers choosing the commit type, optional scope, lowercase imperative summary lines within length limits, bodies, footers, and breaking-change markers. Use w…
---
name: commit-message-conventions
description: >-
  Formats git commit messages in Conventional Commits style so changelog
  generators and semantic versioning tools can read the history reliably.
  Covers choosing the commit type, optional scope, lowercase imperative
  summary lines within length limits, bodies, footers, and breaking-change
  markers. Use when creating a git commit, drafting or rewording a commit
  message, checking a message against the convention, or when the user
  mentions commits, git history, or automated versioning. Not for choosing
  what to stage, writing changelogs or release notes, or formatting non-git
  text such as pull request descriptions.
---

Commit Message Conventions

Write every git commit message you create, draft, or repair in Conventional Commits form. The payoff is mechanical: release tooling reads the type prefix to decide version bumps and changelog entries, and humans scanning git log get a uniform, searchable history.

Message layout

type(scope)!: imperative summary

Optional paragraphs of context.

Optional footer lines, one per token.

Rules for the layout:

  • The header (type through summary) is a single line.
  • Separate header, body, and footers with exactly one blank line each.
  • The scope and the ! are optional; the type and summary never are.

Step 1: choose the type

Pick exactly one prefix from the table. When two seem plausible, prefer the one describing user-visible effect (a fix that also refactors is a fix).

| Type | Choose it when the change... | Version effect | |------|------------------------------|----------------| | feat | introduces a new capability | minor bump | | fix | repairs incorrect behavior | patch bump | | docs | touches documentation only | none | | style | adjusts formatting without changing logic | none | | refactor | restructures code with unchanged behavior | none | | perf | improves speed or resource use, same behavior | none | | test | adds or updates tests | none | | build | changes build tooling or dependency versions | none | | ci | alters pipeline or workflow configuration | none | | chore | handles maintenance outside source and tests | none | | revert | undoes an earlier commit | mirrors the reverted commit |

Example headers:

  • feat(notify): queue delivery receipts for the nightly digest
  • fix(parser): handle empty optional arguments
  • docs: document the rollback procedure for migrations
  • refactor: collapse the three retry helpers into one
  • perf(search): reuse the compiled query between result pages
  • test: cover the expired-coupon edge case
  • build: lock the image toolkit at 6.4.0
  • ci: skip the browser matrix on documentation changes
  • revert: undo the flash-message redesign

Step 2: narrow with a scope

Add a scope in parentheses when the change targets a identifiable module, package, or layer. Keep it to one lowercase word, hyphens allowed (auth, data-export, ui). Omit it for repo-wide changes such as license updates or dependency sweeps — a scope that means "everything" adds noise.

Step 3: write the summary

The summary follows the colon and one space. These rules exist because tools truncate the line and people skim it:

  • Imperative verb first: phrase it as an instruction to the codebase —

"round tax after discount", never "rounded" or "rounds".

  • Lowercase first letter, matching the lowercase type prefix; some linters

reject capitalized summaries outright.

  • No trailing period; it buys nothing and breaks the visual rhythm of logs.
  • Target 50 characters for the whole header; 72 is the hard ceiling counted

from the type to the last word, because terminals and hosting UIs cut there.

  • Name the concrete behavior or component. "update stuff" forces readers to

open the diff to learn anything.

Step 4: explain in the body

Add a body when the "why" is not obvious from the summary.

  • Cover motivation and consequences, not an implementation walkthrough —

the diff already records the how.

  • Wrap lines near 72 characters and put a blank line between paragraphs.
  • If the body describes several unrelated fixes, stop and propose separate

commits instead; one logical change per commit keeps reverts and picks clean.

Step 5: flag breaking changes

Use both mechanisms together for maximum visibility:

  • Place ! immediately before the colon (feat!: or fix(api)!:) so the

marker survives short-log views that hide footers.

  • Add a footer beginning BREAKING CHANGE: that states what consumers must

do, not merely that something changed.

Step 6: add footers

Footers are Token: value lines after the body, one per line. Tokens are a single capitalized word, hyphens allowed. Typical uses:

Closes: #482
Reviewed-by: Priya Raman
Refs: #390, #417

Version bumps the type drives

  • fix → patch, e.g. 3.9.1 → 3.9.2
  • feat → minor, e.g. 3.9.1 → 3.10.0
  • a breaking marker or footer → major, e.g. 3.9.1 → 4.0.0
  • every other type → no release

Worked examples

Small change:

feat: add keyboard shortcuts to the order table

Fix with a body explaining the cause:

fix(export): stop dropping the last row of CSV exports

The paginator advanced its cursor before reading the final page, so
any dataset sized as an exact multiple of the page length lost one
row. Request the next page until the server reports completion
instead of inferring the end from row counts.

Breaking change:

feat!: require HTTPS for webhook delivery

BREAKING CHANGE: webhook receivers must accept TLS connections.
Plain HTTP callbacks are refused with status 426 from 5.0.0 onward;
regenerate endpoints in the dashboard to migrate.

Body plus issue footers:

fix: silence duplicate alerts during midnight rollover

Alerts fired twice because two workers held overlapping scheduler
leases. Renew the lease only after the previous window closes.

Closes: #482
Refs: #390

Frequent errors and corrections

  • Fixed cart total rounding — no type, past tense, capitalized.

Use fix(cart): round tax after discount, not before.

  • chore: update stuff — too vague to be worth a history entry.

Use chore: prune abandoned feature flags.

  • feat: Adds pagination. — third-person verb and a stray period.

Use feat: paginate the customer list.

  • fix!: resolve crash on empty query — a breaking marker on ordinary fix

misleads tooling into a major release. Use fix: resolve crash on empty search query.

Hard rules

  • Never let the header exceed 72 characters.
  • Never attach the ! marker or a BREAKING CHANGE footer unless consumers

genuinely must adapt; release automation converts it into a major bump.

  • Never append attribution, co-author, or promotional trailers the user did

not ask for.

  • Commit only when the user asks you to. If asked to reword a message that

already exists on a shared remote, get explicit confirmation before rewriting history or forcing the remote branch to update.

  • Do not invent a scope for repo-wide changes.

This skill does not cover deciding what to stage or splitting a dirty working tree into logical commits; ask the user how they want the changes divided.