Conventions for commits, branches, pull requests, and code review.
All commit messages follow the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
[optional footer]
| Type | When to Use |
|---|---|
feat |
A new feature or user-facing capability |
fix |
A bug fix |
docs |
Documentation changes only |
style |
Code style changes (formatting, semicolons, whitespace) |
refactor |
Code restructuring without changing behavior |
test |
Adding or updating tests |
chore |
Maintenance tasks (dependencies, CI config, build scripts) |
Use the module or area name in parentheses for targeted changes:
feat(auth): add JWT token refresh endpoint
fix(dashboard): resolve chart rendering on mobile
docs(api): update endpoint documentation for v2
refactor(orders): extract payment processing to dedicated service
test(users): add integration tests for profile updates
chore(deps): bump Spring Boot to 4.1.0
Scope is optional but recommended when the change is clearly within one module.
feat(directory): add search filters for business categories
fix(auth): resolve JWT token refresh loop
docs(api): update endpoint documentation for v2
style(web): apply prettier formatting to config files
refactor(orders): extract validation logic to value objects
test(inventory): add Testcontainers integration tests
chore(ci): update GitHub Actions to Node 22
- Imperative mood: "add feature" not "added feature" or "adds feature"
- Lowercase first word: "add search filters" not "Add search filters"
- No period at end: "add search filters" not "add search filters."
- 50-character limit for the subject line (soft limit, 72 hard)
- Body for the "why": If the commit needs explanation, add a blank line and a body paragraph
Use descriptive branch names with type prefixes:
| Prefix | Purpose | Example |
|---|---|---|
feature/ |
New features | feature/add-map-filters |
fix/ |
Bug fixes | fix/login-redirect-issue |
docs/ |
Documentation changes | docs/update-api-reference |
refactor/ |
Code restructuring | refactor/extract-auth-hook |
- Lowercase with hyphens:
feature/add-user-search(notFeature/AddUserSearch) - Descriptive but concise:
fix/login-redirect(notfix/issue-with-the-login-page-redirect-not-working) - Reference issue numbers when applicable:
fix/123-login-redirect
- Fork the repository (for external contributors) or create a branch (for team members)
- Create a feature branch from
main:git checkout -b feature/your-feature-name
- Make your changes following the coding standards
- Commit with conventional commit messages
- Update your branch with the latest
main:git fetch origin git rebase origin/main
- Push to your fork or remote branch:
git push origin feature/your-feature-name
- Open a Pull Request on GitHub with:
- A clear title describing the change
- A description explaining what and why
- Reference to related issues (e.g., "Closes #123")
- All CI checks must pass (lint, typecheck, tests, build)
- Code follows project style guidelines (enforced by pre-commit hooks)
- New features include appropriate tests
- Documentation is updated if behavior changes
- All contributions require review by at least one maintainer
- Focus on clarity, correctness, and maintainability
- Be constructive and specific in feedback
- Iterate based on review comments
- Approve only when all concerns are addressed
Pre-commit hooks (via Lefthook) run automatically before every commit:
- gitleaks: Scans for secrets (API keys, tokens, passwords)
- ESLint: Lints TypeScript/JavaScript with
--max-warnings=0 - Prettier: Formats frontend code and assets
- ktlint: Checks Kotlin code style
- detekt: Runs Kotlin static analysis
If any hook fails, the commit is blocked. Fix the issue and re-commit.
See Git Hooks for the full Lefthook configuration.
# Ensure main is up to date
git checkout main
git pull origin main
# Create feature branch
git checkout -b feature/add-user-search
# Make changes, commit as you go
git add src/components/search-bar.tsx
git commit -m "feat(search): add search bar component"
git add src/hooks/use-search.ts
git commit -m "feat(search): add search hook with debounce"# Rebase on latest main
git fetch origin
git rebase origin/main
# Push (force-push if rebased)
git push origin feature/add-user-search# Make requested changes
git add .
git commit -m "fix(search): address PR feedback on error handling"
git push origin feature/add-user-search| Convention | Standard |
|---|---|
| Commit format | Conventional Commits (type(scope): description) |
| Branch naming | feature/, fix/, docs/, refactor/ + kebab-case |
| PR base branch | main |
| Pre-commit hooks | Lefthook (gitleaks + ESLint + Prettier + ktlint + detekt) |
| Review required | At least one maintainer approval |