Git Conventions
Follow these rules every time you create a commit or a branch. The goal is a consistent, readable git history where each commit and branch name immediately communicates the task it belongs to and what was changed.
Commit Message Format
<type>(<taskId>): <brief description>
- One line only — no body, no footer
type:fix|feat|refactor|choretaskId: the Jira-style ID (e.g.CDC-123,LA-1427,EL-106)brief description: imperative mood, lowercase, no period at the end
Examples:
fix(CDC-590): fix login redirect on session expiry
feat(LA-1427): add call feature in TMS
refactor(EL-106): remove eslint warnings in consents lib
chore(CDC-100): update dependencies in shared lib
Branch Name Format
<type>/<taskId>_<brief-description>
brief-description: kebab-case, must include the affected lib or module name- Separator between
<taskId>and description is an underscore_ - Use hyphens
-within the description
Examples:
fix/CDC-590_fix-login-redirect-auth-lib
feat/LA-1427_add-call-feature-tms
refactor/EL-106_eslint-warnings-consents-lib
chore/CDC-100_update-deps-shared-lib
Resolving the Task ID
When you don't already know the task ID:
- Run
git branch --show-currentto get the current branch name - Extract the task ID using the pattern:
(fix|feat|refactor|chore)/([A-Z]+-\d+)_- Example:
fix/CDC-590_fix-login→ task ID isCDC-590
- Example:
- If found, use it and briefly note to the user what you extracted
- If not found (e.g. on
main,master, or an unformatted branch), ask the user:"What's the task ID for this work? (e.g. CDC-123)"
Workflow
Creating a commit
- Resolve the task ID (see above)
- Infer the
typefrom the nature of the staged changes:- Bug fix →
fix - New capability →
feat - Code restructure without behavior change →
refactor - Tooling, config, deps →
chore
- Bug fix →
- Write a short imperative description of what changed
- Assemble:
<type>(<taskId>): <brief description> - Run:
git commit -m "<message>"
Creating a branch
- Resolve the task ID (see above)
- Determine the
typefor the work being done - Write a kebab-case description that includes the lib/module name
- Assemble:
<type>/<taskId>_<brief-description> - Run:
git checkout -b <branch-name>