| name | commit |
| description | Create a git commit with a well-crafted conventional commit message. Use when the user asks to commit, create a commit, or says something like "commit this". |
| model | haiku |
| allowed-tools | Bash(git:*), Bash(fmt:*), Read |
Commit
Create conventional commit messages that explain the why, not the what.
The commit message helps:
- The PR reviewer understand the context quickly
- The devs in 6 months who will
git blame this code
Workflow
1. Get the staged diff
git diff --cached
If nothing is staged, stop and tell the user to stage changes first.
2. Get existing scopes
Extract scopes already used in the project to stay consistent:
git log --oneline --no-merges | sed -n 's/^[^ ]* [a-z]*(\([^)]*\)).*/\1/p' | sort | uniq -c | sort -rn
Use one of these scopes if it fits. Only invent a new scope if none matches.
3. Analyze the diff
Identify:
- Which files are touched
- Which functions/classes/components are modified