# 🧾 Commit Message Convention To maintain a clean, readable Git history and support automated tools like versioning, changelogs, and CI workflows, we follow the **Conventional Commits** standard. ## βœ… Format (type)(scope): (description) - **type**: the category of change (required) - **scope**: the affected module or feature (required) - **description**: a brief, imperative summary of the change (required) --- ## 🎯 Allowed Commit Types | Type | Description | |-------------|---------------------------------------------| | `feat` | A new feature | | `fix` | A bug fix | | `build` | Build system or dependency changes | | `chore` | General maintenance (e.g., config tweaks) | | `docs` | Documentation-only changes | | `style` | Code style, formatting (no logic changes) | | `refactor` | Code refactoring (no new features/fixes) | | `perf` | Performance improvements | | `test` | Adding or updating tests | | `revert` | Reverting a previous commit | --- ## πŸ“ Examples feat(auth): add password reset functionality fix(dashboard): resolve NaN chart bug docs(code): update README with env setup instructions style(code): format utils.ts using Prettier build(aids): upgrade Node.js to v18 in CI pipeline --- ## πŸ“¦ Scoped Commit Messages Every commit must specify a **service/module name** in parentheses after the type. ### 🎯 Allowed Scopes - `auth` - `dashboard` - `settings` - `notifications` - `common` - `code` ### βœ… Examples feat(auth): add OTP login flow fix(aids): prevent double application chore(code): update docker image name --- ## ❌ Common Mistakes to Avoid - β›” `Updated code` β†’ Not valid (missing type and format) - β›” `Bug fixes` β†’ Should be: `fix(module): describe the fix` - β›” `Fix login` β†’ Better: `fix(auth): fix login redirect issue` --- ## πŸ’‘ Tips - Keep the summary short (under 72 characters). - Use **imperative tone** (e.g., β€œadd” not β€œadded”). - Use `yarn commit` (Commitizen) to follow the format easily. --- ## πŸ”’ Enforced By This format is **automatically validated** on commit using: - `Husky` Git hook: `.husky/commit-msg` - `Commitlint` config: `commitlint.config.js` Badly formatted commits will be blocked. ---