Switch to:
Conventional Commits: the commit message as a technical document

Conventional Commits: the commit message as a technical document

Most teams have never explicitly discussed how to write commit messages. An unspoken convention forms over time, often shaped by the style of the first developer to open the repository, and that convention persists until the team grows and coherence quietly deteriorates. The commit message is the most pervasive historical document a project produces: every technical decision, every bug fix, every refactoring leaves a trace. Treating that trace as a free-form field to fill in however one likes means squandering one of the most valuable understanding tools available to anyone working on the code, today or years from now.

The structure of the format

Conventional Commits is a lightweight specification that defines a minimal set of rules for message structure. The format includes a type, an optional scope, and a short description, followed by an optional body and footers. The canonical types are few and immediately intuitive: feat for a new feature, fix for a bug correction, docs for documentation, refactor for reorganisations that do not change external behaviour, chore for maintenance tasks such as dependency updates. An exclamation mark after the type signals a breaking change, information that would otherwise require reading the full diff to identify.

# A new feature with a scope
feat(auth): add password strength meter

# A bug fix
fix(api): handle null response from payment gateway

# Documentation only
docs: update installation steps in README

# A breaking change, signalled by the exclamation mark
feat(api)!: drop support for legacy v1 endpoints

This structure is not arbitrary. It derives from the observation that commit messages serve to answer different questions depending on who reads them and when: a developer investigating a bug needs to know what changed and why, a technical lead preparing a release needs to understand what goes in the changelog and which semantic version to assign, a new team member needs to reconstruct the evolution of a piece of code without opening every individual diff. The format answers all these needs with the same structure.

The value of tooling

The most immediate and measurable benefit of adopting Conventional Commits is access to an ecosystem of tools that operate directly on message structure. Semantic-release analyses commits since the last tag, automatically determines the version type to release based on the conventions present (patch for fixes, minor for features, major for breaking changes), and publishes the release with the generated changelog. Google’s Release-please does the same for projects hosted on GitHub, automatically opening a release pull request whenever commits have accumulated on the main branch. Conventional-changelog produces readable documents in any format without requiring additional configuration.

These tools are not marginal advantages. They eliminate a category of repetitive, error-prone manual work: deciding which version to assign, writing the changelog, coordinating the release among team members. When the release process is determined by the structure of commits it is no longer a decision requiring a meeting or subjective judgement, but an automatic consequence of what the team has already documented in its normal workflow.

Readability as a project requirement

There is a less visible dimension of the value of Conventional Commits that concerns onboarding and long-term maintenance. A repository with a coherent, structured commit history is one in which a new developer can find their footing without having to ask anyone. Filtering commits by type, finding all fixes applied to a given module, reconstructing the history of a feature: operations that with free-form messages require reading and interpreting every entry become direct queries against structured metadata.

Conventional Commits specification homepage

This has concrete consequences for how quickly a team can respond to an incident. When something breaks in production and the task is to identify which commit introduced the regression, the difference between a readable history and a list of messages like “fix”, “update”, “miscellaneous changes” can amount to hours of investigation. The structure does not serve the moment the commit is written, but every subsequent moment when that decision must be understood by someone who was not there.

Gradual adoption with commitlint

Adopting Conventional Commits in a team does not require a retroactive migration or significant upfront effort. The most widely used tool for enforcing the format is commitlint, configurable in a few minutes and integrable with Husky or Lefthook to run validation as a commit-msg hook. Any message that does not meet the structure is rejected immediately, before it reaches the remote repository, with an error message that indicates exactly what to correct.

The base configuration requires two packages and a minimal configuration file. Commitlint reads the message, validates it against the defined rules, and blocks the commit if the structure is not compliant. Adoption becomes gradual because every new commit written in the correct format moves the repository’s history toward coherence without touching existing commits. In teams using editors such as VS Code, extensions that suggest the format as you type further reduce the initial friction.

// commitlint.config.js
export default {
  extends: ['@commitlint/config-conventional'],
};

The best time to introduce Conventional Commits is at the start of a project, but the second-best time is now. A partially structured commit history is already more useful than a completely free-form one, and the tooling works correctly even on repositories that have non-compliant commits in the past because it only operates on the range since the last release tag. The investment required is minimal compared to the value it returns over time: fewer manual versioning decisions, automatically generated changelogs, and a project history that answers questions instead of multiplying them.

The full specification, with all the format rules and examples, is available on the official Conventional Commits website.

Ranieri Vannozzi

The author

Ranieri Vannozzi

Freelance software developer and consultant

I have been writing code since 2008, working on enterprise development, cloud-native architectures and technical leadership. On HeroHubs I write about what I run into every day on real projects, from code to architecture and artificial intelligence.

Article written with AI assistance and reviewed by the author.

Related Posts

Performant npm: the package manager that rethinks node_modules

Development

September 2026

Performant npm: the package manager that rethinks node_modules

Performant npm is not just a faster npm. The global store with hard links and the strict node_modules structure change the way a JavaScript project declares and uses its dependencies.

Brute force protection: authentication that holds

Development

June 2026

Brute force protection: authentication that holds

A brute force attack is not sophisticated, but it is persistent. Building a solid defence is an architectural question first, a configuration question second.

Why is ignoring package-lock architectural suicide?

Development

May 2026

Why is ignoring package-lock architectural suicide?

Many developers treat the lock file as background noise in commits. In reality, it is the only thing standing between your code and a sudden crash in production.

Biome: the modern toolchain that simplifies web development

Development

October 2025

Biome: the modern toolchain that simplifies web development

Discover Biome: the unified toolchain for linting, formatting, and code analysis in JavaScript/TypeScript. Benefits, integration, and productivity for modern developers.

Test driven development: a silent ally for software heroes

Development

October 2025

Test driven development: a silent ally for software heroes

Learn about Test Driven Development (TDD): benefits, Red-Green-Refactor cycle, practical examples, and how TDD and BDD improve software quality and maintainability.

Astro: islands architecture and hybrid rendering for performant content

Development

October 2025

Astro: islands architecture and hybrid rendering for performant content

A guide to Astro: the modern framework for static and hybrid sites, islands architecture, server-first rendering, SEO, performance, and integration with React, Vue, and Svelte.

Feature flags: the key to safe, controlled, and continuous releases

Development

October 2025

Feature flags: the key to safe, controlled, and continuous releases

Learn how feature flags revolutionize software releases: gradual rollout, instant rollback, A/B testing, and best practices for DevOps and CI/CD.

Pull and merge requests: same goals but different approaches

Development

September 2025

Pull and merge requests: same goals but different approaches

Pull requests vs merge requests: differences, advantages, and best practices for code review on GitHub and GitLab, with a focus on DevOps and team collaboration.

Hono: simplicity and power for modern web applications

Development

September 2025

Hono: simplicity and power for modern web applications

A guide to Hono: the minimalist JavaScript web framework for building modern, fast, and maintainable applications. Features, examples, and benefits for developers.