| name | commit |
| description | Git Commit Skill for creating well-structured, atomic commits following conventional-commits discipline |
Git Commit Skill
Create well-structured git commits following conventional-commits discipline. The examples below use a TypeScript / Node.js stack for concreteness; the discipline is stack-agnostic and applies equally to any language or framework.
When to Commit
Commit after every major step:
- After completing a feature
- After fixing a bug
- After code improvements
- After refactoring
- After any significant change
File-by-file approach:
- Stage and commit files individually or in small logical groups
- Each file or group gets its own descriptive commit message
- Do not batch unrelated changes into single commits
Keep it formal:
- No AI attribution (no "Co-Authored-By: Claude" or similar)
- No emojis in commit messages
- Professional, descriptive messages
Commit Message Format
<type>(<scope>): <description>
[optional body]
[optional footer]
Types
| Type | Description |
|---|
feat | New feature |
fix | Bug fix |
refactor | Code refactoring (no feature or fix) |
docs | Documentation only |
style | Formatting, missing semicolons (no logic change) |
test | Adding or updating tests |
chore | Maintenance, dependencies, configs |
perf | Performance improvement |
Scopes (adapt to your project structure)
Frontend: ui, auth, dashboard, settings, [CUSTOMIZE: your frontend apps/modules]
Backend: api, auth, db, jobs, [CUSTOMIZE: your backend services/modules]
Infra: docker, ci, config, k8s
General: deps, build, release
Replace the placeholders above with the actual apps and services in your project.
Workflow
Step 1: Check Status
git status
git diff --staged
git diff
Step 2: Stage Files
git add path/to/file1.ts path/to/file2.ts
git add src/components/
git add -p
Step 3: Create Commit
git commit -m "$(cat <<'EOF'
type(scope): short description
Longer explanation of the change if needed.
- Bullet points for multiple changes
- Keep lines under 72 characters
EOF
)"
Examples
Feature Commit
git commit -m "$(cat <<'EOF'
feat(dashboard): add saved search and filter feature
- Add saved search list with name and criteria display
- Implement save/edit/delete dialogs
- Create useSavedSearches query hook
- Add saved-search types and API integration
EOF
)"
Bug Fix
git commit -m "$(cat <<'EOF'
fix(auth): resolve registration flow not creating user profile
Root cause: the password-confirmation endpoint was not promoting
the pending-registration record to a full user profile after
the password was set.
- Add promotion logic in the password handler
- Set migratedToProfileId and migratedAt fields
- Create initial account record for new user
EOF
)"
Refactor
git commit -m "$(cat <<'EOF'
refactor(admin): simplify user management table component
- Extract column definitions to separate file
- Replace inline sorting with TanStack Table
- Remove unused filter state
EOF
)"
Chore
git commit -m "$(cat <<'EOF'
chore(deps): update TanStack Query to v5.17
EOF
)"
Multi-File Commits
When changes span multiple files, group them logically:
git add src/hooks/use-orders.ts
git add src/types/order.ts
git commit -m "feat(orders): add order API hooks and types"
git add src/app/orders/page.tsx
git add src/app/orders/_components/
git commit -m "feat(orders): add order management UI"
Rules
- No AI attribution - Do not add "Co-Authored-By: Claude" or similar
- No emojis - Keep commits formal and professional
- Imperative mood - "add feature" not "added feature"
- Present tense - "fix bug" not "fixed bug"
- 72 char limit - Wrap body text at 72 characters
- Atomic commits - One logical change per commit
- No secrets - Never commit .env files, credentials, or API keys
Pre-Commit Checklist
Apply to: $ARGUMENTS