Commit Task
Create a commit for staged/unstaged changes following project conventions.
Steps
- Check
git statusfor changes - Analyze
git log --oneline -10to detect commit style - Categorize changes (feat/fix/docs/refactor/test/chore)
- Generate commit message matching detected style
- Present to user for approval
- Execute commit
Commit Style Detection
Use the detection script for accurate results:
# Returns JSON with style and confidence
"${CLAUDE_PLUGIN_ROOT}/scripts/detect-commit-style.sh"
Output example:
{
"style": "conventional-scoped",
"confidence": 80,
"stats": { "total": 10, "conventional_scoped": 8, "gitmoji": 2 }
}
| Pattern | Style |
|---|---|
type(scope): message | Conventional Commits (scoped) |
type: message | Conventional (no scope) |
:emoji: message | Gitmoji |
| Plain text | Simple |
Conventional Commits Types
| Type | Use For |
|---|---|
| feat | New features |
| fix | Bug fixes |
| docs | Documentation only |
| style | Formatting changes |
| refactor | Code restructuring |
| perf | Performance improvements |
| test | Adding/fixing tests |
| chore | Maintenance tasks |
Message Format
<type>(<scope>): <subject>
<body>
<footer>
Subject Rules:
- Imperative mood ("add" not "added")
- No period at end
- Max 50 characters
- Lowercase
Body (optional):
- Explain what and why
- Wrap at 72 characters
Footer (optional):
Closes #123BREAKING CHANGE: description
Output
Present message for approval before committing.
