Conventional Commit Helper
Overview
Create readable, semantic-release friendly commit messages with a consistent type(scope): subject header plus optional body and footer. Support message drafting, validation, and optional non-interactive git commit execution.
Workflow
- Inspect changes with
git status --shortandgit diff --cached --name-only. - Select
typefrom the allowed set:feat,fix,perf,revert,docs,style,refactor,test,build,ci,chore
- Infer
scopefrom the affected module, path, or subsystem. - Draft subject:
- imperative/present tense (
add,fix,update,remove) - lowercase
- no trailing period
- prefer <= 50 chars
- imperative/present tense (
- Add body text only when extra context helps review.
- Add footer lines for issue refs or breaking changes.
- Validate message using
scripts/validate_commit_message.sh. - If requested, commit with non-interactive git commands only.
Message Template
<type>(<scope>): <subject>
[optional body]
[optional footer]
## Breaking Change Rules
Use either:
- `type(scope)!: subject`
- `BREAKING CHANGE:` footer
## Resources
- Detailed guidance and examples: `references/commit-conventions.md`
- Message validator: `scripts/validate_commit_message.sh`
## Commands
Validate a message string:
```bash
./scripts/validate_commit_message.sh --message "fix(auth): reject expired refresh token"
Validate a message file:
./scripts/validate_commit_message.sh --file .git/COMMIT_EDITMSG