Commit messages
Commit Messages¶
For a clean git history, clear version history, and clarifying your PRs for reviewers, use the following structure:
Modules¶
MODULE identifies the primary area of the codebase that changed:
| Module | Area | Description |
|---|---|---|
INFRA |
- | The project as a whole. Structural changes, workspace and CI configuration |
API |
Backend | Backend routes and handlers |
DB |
Backend | Database models and migrations |
AUTH |
Backend | Authentication and authorization |
APP |
Frontend | The mobile app |
ADMIN |
Frontend | The admin web panel |
If a commit touches multiple modules, list them ordered from most significant to least significant change:
Actions¶
Action describes the type of change:
| Action | When to use |
|---|---|
Update |
New features, new functionality, or new additions |
Refactor |
Same behaviour, different implementation |
Bug |
A fix or partial fix for a known bug |
Docs |
Documentation-only changes (not treated as code changes) |
Message¶
Write the message in imperative form, as if you are commanding the codebase what to do. Think: "If applied, this commit will ___."
Good:
Add retry logic for failed requests
Bad:Added retry logic/Adds retry logic/Retry logic
Really Bad:Fix/Fixed some stuff/Claude
AI-assisted commits¶
If any part of a commit was written with the help of an AI tool (Copilot, Claude, etc.), add a Co-Authored-By trailer to the commit body so that reviewers know to apply extra scrutiny:
[API] (Update): Add date range filter to activity endpoint
Co-Authored-By: GitHub Copilot <copilot@github.com>
The trailer goes in the commit body, separated from the subject line by a blank line. Reviewers treat AI-assisted commits as needing a closer read; AI tools can produce plausible-looking code that is subtly incorrect.
Examples¶
[DB] (Bug): Handle None value when deserializing optional ticket fields
[API-DB] (Refactor): Extract shared error types into common module
[INFRA] (Docs): Update README with local development instructions
[AUTH] (Bug): Fix off-by-one error in session token expiry check
[APP] (Update): Add ticket transfer flow to ticket detail screen
[ADMIN] (Refactor): Replace manual date picker with shared date component