commit
Professional Commit Messages
Section titled “Professional Commit Messages”Follow these conventions when creating commits.
Prerequisites
Section titled “Prerequisites”IMPORTANT: Always check formatting before committing. Run the format check first to ensure CI will pass:
# Check formatting (run this FIRST before any commit)bun run format:check
# If there are formatting issues, fix them:bun run formatBefore committing, also ensure you’re working on a proper branch, not the main branch. Use the /checkout skill if you need to checkout a new branch.
# Check current branchgit branch --show-currentIf you’re on main or master, create a new branch first:
# Create and switch to a new branchgit checkout -b <type>/<short-description>Branch naming should follow the pattern: <type>/<short-description> where type matches the commit type (e.g., feat/add-user-auth, fix/null-pointer-error, ref/extract-validation).
Format
Section titled “Format”<type>(<scope>): <subject>
<body>
<footer>The header is required. Scope is optional. All lines must stay under 100 characters.
Commit Types
Section titled “Commit Types”| Type | Purpose |
|---|---|
feat | New feature |
fix | Bug fix |
ref | Refactoring (no behavior change) |
perf | Performance improvement |
docs | Documentation only |
test | Test additions or corrections |
build | Build system or dependencies |
ci | CI configuration |
chore | Maintenance tasks |
style | Code formatting (no logic change) |
meta | Repository metadata |
license | License changes |
Subject Line Rules
Section titled “Subject Line Rules”- Use imperative, present tense: “Add feature” not “Added feature”
- Capitalize the first letter
- No period at the end
- Maximum 70 characters
Body Guidelines
Section titled “Body Guidelines”- Explain what and why, not how
- Use imperative mood and present tense
- Include motivation for the change
- Contrast with previous behavior when relevant
Footer: Issue References
Section titled “Footer: Issue References”Reference issues in the footer using these patterns:
Fixes GH-1234Fixes #1234Refs #5678Fixescloses the issue when mergedRefslinks without closing
AI-Generated Changes
Section titled “AI-Generated Changes”When changes were primarily generated by a coding agent (like Claude Code), include the Co-Authored-By attribution in the commit footer:
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>This is the only indicator of AI involvement that should appear in commits. Do not add phrases like “Generated by AI”, “Written with Claude”, or similar markers in the subject, body, or anywhere else in the commit message.
Examples
Section titled “Examples”Simple fix
Section titled “Simple fix”fix(api): Handle null response in user endpoint
The user API could return null for deleted accounts, causing a crashin the dashboard. Add null check before accessing user properties.
Fixes #5678Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>Feature with scope
Section titled “Feature with scope”feat(alerts): Add email notifications for alerts
When an alert is triggered, send email notification to configuredrecipients. This keeps users informed of critical events.
Refs #1234Refactor
Section titled “Refactor”ref: Extract common validation logic to shared module
Move duplicate validation code from three endpoints into a sharedvalidator class. No behavior change.Breaking change
Section titled “Breaking change”feat(api)!: Remove deprecated v1 endpoints
Remove all v1 API endpoints that were deprecated in version 2.0.Clients should migrate to v2 endpoints.
BREAKING CHANGE: v1 endpoints no longer availableFixes #9999Revert Format
Section titled “Revert Format”revert: feat(api): Add new endpoint
This reverts commit abc123def456.
Reason: Caused performance regression in production.Principles
Section titled “Principles”- Each commit should be a single, stable change
- Commits should be independently reviewable
- The repository should be in a working state after each commit
References
Section titled “References”- Professional Commit Messages - Industry standards from Sentry