Git Commit Skill
Analyzes staged changes and generates appropriate semantic commit messages.
Usage
/git-commit [options]
Options
--scope <scope>- Specify the scope (e.g., ui, api, db)--type <type>- Override commit type (feat, fix, docs, etc.)--dry-run- Preview without committing
Commit Types
| Type | Description |
|---|---|
| feat | New feature |
| fix | Bug fix |
| docs | Documentation only |
| style | Formatting, no code change |
| refactor | Code restructuring |
| test | Adding tests |
| chore | Maintenance tasks |
| perf | Performance improvements |
Process
- Reads staged changes via
git diff --cached - Analyzes the nature of changes
- Identifies affected files and scope
- Generates semantic commit message
- Presents for user approval
- Commits with message
Examples
Basic usage:
/git-commit
With scope:
/git-commit --scope api
Preview only:
/git-commit --dry-run
Output
Analyzing staged changes...
Detected changes:
- 3 files modified
- 1 file added
- Primary scope: api
Suggested commit:
feat(api): add user authentication endpoint
- Add /auth/login and /auth/logout endpoints
- Implement JWT token generation
- Add rate limiting middleware
Proceed with commit? [Y/n]