← All Guides

Conventional Commits Cheatsheet

gitworkflow

We follow the Conventional Commits spec with a few of our own additions. This is the cheatsheet.

Format

<type>(<scope>): <description>

[optional body]

[optional footer]

Types

TypeWhen to useExample
featNew featurefeat(auth): add SSO login
fixBug fixfix(api): handle null response from upstream
docsDocumentation onlydocs: update API examples in README
styleFormatting, no code changestyle: fix indentation in config
refactorCode change that neither fixes nor addsrefactor(db): extract query builder
perfPerformance improvementperf(search): add index on user_email
testAdding or fixing teststest(auth): add login flow integration tests
choreBuild, CI, toolingchore: update GitHub Actions to v4
ciCI/CD changesci: add nightly build schedule
buildBuild system or dependenciesbuild: upgrade Astro to 5.x
revertReverting a previous commitrevert: undo feat(auth) SSO login

Scopes

Scopes are optional but useful. Use the area of the codebase being changed:

  • auth, api, ui, db, config, ci, deps
  • Keep them short, consistent, and lowercase

Breaking Changes

Add ! after the type/scope or use the BREAKING CHANGE: footer:

feat(api)!: change authentication to OAuth2

BREAKING CHANGE: API key authentication is no longer supported.
All clients must migrate to OAuth2 tokens.

Good Commit Messages

  • Start with lowercase after the colon
  • Use imperative mood (“add” not “added” or “adds”)
  • Keep the first line under 72 characters
  • Use the body for “why”, not “what” (the diff shows what)

Examples

feat(projects): add star count to project cards

Show GitHub star count on each project card to help
visitors gauge project popularity at a glance.
fix(nav): prevent menu staying open after navigation

The mobile hamburger menu remained open when clicking
a nav link. Now closes on any link click.
chore(deps): update astro to 5.2.0