Commit Skill
Create well-formatted commits by detecting and following the repository's commit style.
Quick Reference
| Type | When to use |
|---|---|
| feat | New feature |
| fix | Bug fix |
| docs | Documentation only |
| refactor | Code restructuring |
| test | Adding/fixing tests |
| chore | Maintenance tasks |
Workflow
- •Detect style:
git log --oneline -20 - •Review changes:
git statusandgit diff --staged - •Stage files:
git add <files> - •Commit using detected pattern (or conventional commits as fallback)
Pattern Detection
| Pattern | Example |
|---|---|
type: desc | feat: add login |
type(scope): desc | fix(api): handle null |
type desc | add login feature |
Capitalized | Add login feature |
Examples
bash
git commit -m "feat: add user authentication" git commit -m "fix(auth): resolve token expiry"