Skip to content

Conventional Commits explained: format, types and why agents follow it well

Conventional Commits is a commit message format: type, optional scope, description. Examples, breaking changes, and links to versions and changelogs.

Published by Contextingo.

Conventional Commits is a specification for commit messages. Its structure makes history readable by people and by tools.

Format

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types

  • feat adds a feature (a minor version in SemVer).
  • fix fixes a bug (a patch version).
  • docs, style, refactor, perf, test, build, ci, chore for the rest.
  • A ! after the type, or a BREAKING CHANGE: footer, marks a breaking change (a major version).

Examples

feat(upload): reject files over 100 MB
fix(login): accept emails with a plus sign
refactor(billing)!: rename invoice status values

Why it works with agents

A format is easy to follow when it is written down. Put it in the instruction file, and agents will produce consistent messages. The body should say why, not only what.

Source

Related: semantic versioning explained and a changelog that helps.

Questions

Good to know.

Do I need a tool to enforce it?

A commit-message linter helps. Without one, review catches most mistakes.

Does it replace a changelog?

It can feed one, but users still need entries written for them.

Nothing learned is lost. Nothing unchecked is done.