Git Commit Writer
Writes conventional commit messages from staged changes.
When to Use
- When the user asks to "commit", "write a commit message", or "stage and commit"
- After completing a set of related changes
Process
- Run
git diff --cached --statto see what's staged - If nothing is staged, inform the user and suggest what to stage
- Run
git diff --cachedto analyze the actual changes - Write a commit message following this format:
<type>(<scope>): <short summary>
<body — what changed and why, not how>
Types
feat— new featurefix— bug fixrefactor— code restructuring without behavior changedocs— documentation onlystyle— formatting, whitespace (no logic change)test— adding or fixing testschore— build, CI, dependencies, toolingperf— performance improvement
Rules
- Summary line: imperative mood, lowercase, no period, max 72 chars
- Body: wrap at 72 chars, explain what and why (not how)
- If changes span multiple concerns, suggest splitting into multiple commits
- Include
Co-authored-bytrailer when appropriate - Reference issue numbers if apparent from context (e.g.,
Fixes #42)