Code Committing
Format
Language Requirement
Always write in English only
<type>(<scope>): summary
- Summary: ≤50 chars, imperative mood, no period
- Scope: Module/package name (monorepo: exact package name or
all) - Body (optional): Bullet list
- {emoji} {text}(≤100 chars/line). One bullet = one logical change. Do not group multiple items on a single line. - Breaking: Add
!after type andBREAKING CHANGE:footer - Issues: End the body with a bullet like
- Fixes #123or- Fixes PROJ-456
Types: feat ✨, fix 🐛, docs 📚, style 💄, refactor ♻️, perf ⚡, test ✅, build 🔧, ci 👷, chore 🔨, revert ⏪
Workflow
Staging behavior
When both staged and unstaged changes exist in the working directory, and interaction is available:
- Ask the user whether to:
- Stage all files before committing
- Commit only the currently staged changes
Running git commit
After executing git commit, wait for the process to exit on its own — do not interrupt or kill it. Pre-commit hooks (linters, type checkers, test runners) can run for a long time without producing any output. Killing the process mid-run causes an exit code 130 (SIGINT) and leaves the working tree in a dirty state.
Commit error handling
Exit code 130 (interrupted):
The commit process was interrupted — this is not a validation failure. Do not auto-retry. Report that the commit was interrupted and ask the user whether to:
- Try again
- Cancel
Any other non-zero exit code (validation failure):
If the commit fails (e.g., due to pre-commit hooks, linting failures, or other validation errors):
- Report the exact error message and reasons for the failure
- Ask the user whether to:
- Commit with
--no-verifyflag to bypass hooks - Attempt to fix the issues automatically
- Let the user fix the issues manually
- Commit with
Examples
Simple feature:
feat(button): add loading state
- ✨ Add spinner icon during async operations
- 📦 @ui/icons: v1.0.0 → v1.1.0
- Fixes #42
Breaking change:
feat(theme)!: redesign color tokens
- ✨ Replace RGB values with HSL format
- 💄 Update all component styles to use new tokens
- 📦 @ui/theme: v2.1.0 → v3.0.0
BREAKING CHANGE: Color token values changed from RGB to HSL format
For more examples, see references/examples.md
