Commit Message Drafting
Generate commit messages following conventional commit format and project style. Do NOT commit afterwards; user will commit, or ask to commit!
Process
Gather context (run in parallel):
git status --short git diff --stat git log -5 --onelineAnalyze changes by category:
- Features added (feat)
- Bug fixes (fix)
- Refactoring (refactor)
- Documentation (docs)
- Build/tooling (build, chore)
- Style/formatting (style)
Draft message using conventional commits:
type(scope): short description - Bullet point details - Another change
Commit Types
| Type | When to use |
|---|---|
| feat | New feature or capability |
| fix | Bug fix |
| refactor | Code restructuring without behavior change |
| docs | Documentation only |
| style | Formatting, whitespace (no code change) |
| build | Build system, dependencies |
| chore | Maintenance tasks |
| perf | Performance improvement |
| test | Adding or fixing tests |
Rules
- First line: type(scope): description (max 72 chars)
- Scope is optional, use component/area name
- Use imperative mood ("Add" not "Added")
- Body explains "what" and "why", not "how"
- Reference related issues if applicable
- For large changesets, consider suggesting multiple smaller commits
Examples
Single change:
fix(auth): Prevent session timeout on form submission
Multiple changes (same area):
feat(page-parts): Add usage tracking and link resolution
- Add get_link() for post:123/term:123/archive:type formats
- Show meta box with pages embedding each page part
- Add AJAX endpoint for usage checking
Major refactoring:
refactor: Remove vendored Bootstrap in favor of npm
- Delete 80K+ lines of Bootstrap 5.3.3 source files
- Add gitignore rules for compiled CSS and source maps
- Bootstrap now managed via package.json dependencies