Smart Commit
CodingBeginner
Analyzes git diff to identify the nature of changes and automatically generates commit messages following the Conventional Commits format.
Trigger
/commitFrequencyDaily
Developer who hates spending time on commit messages? Run /commit to auto-analyze and generate messages
GitAutomationCommits
How It Works
Run /commit -> analyze git diff --staged
↓
Phase 1: 2 analyses in parallel
type-detect
Detect change type
scope-detect
Identify impact scope
↓
Generate Conventional Commits message -> user confirmation
↓
✓ Clean commit complete
Skill Code
# Smart Commit Skill
## Trigger: /commit
When invoked:
1. Run `git diff --staged` to check staged changes
2. If nothing staged, run `git diff` and suggest what to stage
3. Analyze changes to determine type:
- feat: new feature
- fix: bug fix
- refactor: code restructuring
- docs: documentation
- style: formatting
- test: adding tests
- chore: maintenance
4. Generate commit message:
- Format: `type(scope): description`
- Keep under 72 characters
- Use imperative mood ("add" not "added")
5. Show the message and ask for confirmation
6. On approval, execute: `git commit -m "message"`
Copy and paste into your CLAUDE.md to start using immediately.
How Smart Commit Works
Smart Commit analyzes your staged git diff to detect the type of change (feature, fix, refactor, docs), identifies the impact scope, and generates a Conventional Commits message that you can approve or edit before committing.
When to Use Smart Commit
Perfect for developers who make frequent commits but dislike writing commit messages manually — especially when changes span multiple files and the intent needs to be captured precisely for future git log searches.
Key Strengths
- Follows Conventional Commits standard automatically
- Detects change type and scope from actual code diff
- One-command workflow from staged changes to clean commit
- Consistent commit history improves code review and changelog generation