Commit Message Generator
Generate short, concise commit messages from git diff --staged output.
Workflow
- •Get staged changes: Run
git diff --stagedto see what's being committed - •Analyze changes: Identify the primary type and scope of modifications
- •Generate message: Output a single-line conventional commit message
Commit Format
Use Conventional Commits format:
code
<type>(<scope>): <short description>
Types (pick ONE)
| Type | Use When |
|---|---|
feat | New feature or capability |
fix | Bug fix |
docs | Documentation only |
style | Formatting, whitespace (no logic change) |
refactor | Code restructure (no feature/fix) |
perf | Performance improvement |
test | Adding/updating tests |
chore | Build, config, dependencies |
Scope (optional)
File, module, or component name. Omit if changes span multiple areas.
Description Rules
- •50 characters max (hard limit)
- •Use imperative mood: "add", "fix", "update" (not "added", "fixes")
- •Lowercase, no period at end
- •Focus on WHAT changed, not HOW
Examples
code
feat(auth): add OAuth2 login flow fix: resolve null pointer in user service docs: update API endpoint documentation refactor(dashboard): extract chart components chore: bump numpy to 2.0 test(orders): add edge case coverage
Multi-file Changes
When changes span multiple files:
- •Find the common theme/purpose
- •Use broader scope or omit scope entirely
- •Summarize the overall intent
code
# Multiple related fixes fix: resolve data loading issues across services # Feature touching many files feat: implement dark mode theming
Output
Return ONLY the commit message on a single line. No explanations, no alternatives, no markdown formatting around the message itself.