skills/git-commit/SKILL.md
Create well-structured git commits following conventional commits. Trigger: When committing changes, writing commit messages, or staging files.
npx skillsauth add 333-333-333/agents git-commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
| Type | Description | Example |
|------|-------------|---------|
| feat | New feature | feat: add user authentication |
| fix | Bug fix | fix: resolve login timeout issue |
| docs | Documentation only | docs: update API reference |
| style | Code style (formatting, semicolons) | style: format with prettier |
| refactor | Code change that neither fixes nor adds | refactor: extract validation logic |
| perf | Performance improvement | perf: optimize database queries |
| test | Adding or fixing tests | test: add unit tests for auth |
| chore | Maintenance tasks | chore: update dependencies |
| ci | CI/CD changes | ci: add GitHub Actions workflow |
| build | Build system changes | build: upgrade webpack to v5 |
Indicates the section of the codebase:
feat(auth): add OAuth2 support
fix(api): handle null response
docs(readme): add installation steps
feat: add password strength indicator
- Show visual feedback for password strength
- Validate minimum requirements
- Display helpful suggestions
Closes #123
fix: prevent duplicate form submissions
Add debounce to submit button to prevent
multiple API calls when user clicks rapidly.
# Too vague
fix: fix bug
# Not descriptive
update code
# Too long for subject
feat: add new feature that allows users to reset their password by clicking a link sent to their email
| Rule | Example |
|------|---------|
| Subject line max 50 chars | feat: add login page |
| Use imperative mood | add not added or adds |
| No period at end of subject | fix: resolve issue not fix: resolve issue. |
| Blank line between subject and body | See examples above |
| Body wraps at 72 chars | For readability in terminals |
| Explain what and why, not how | Code shows how |
# Check status
git status
# Review changes
git diff
# Review staged changes
git diff --staged
# Stage specific files
git add path/to/file.js
# Stage all changes in directory
git add src/
# Stage all tracked files
git add -u
# Interactive staging (select hunks)
git add -p
# Commit with message
git commit -m "feat: add user profile page"
# Commit with body (opens editor)
git commit
# Commit with multi-line message
git commit -m "feat: add user profile page" -m "Includes avatar upload and bio editing"
Each commit MUST represent one logical change. When the user asks to commit, analyze git diff and split into multiple commits if the changes span different concerns.
Ask: "If I needed to revert this, would I want to revert ALL of these changes together?" If the answer is no, split them.
| Signal | Action | |--------|--------| | Changes touch different domains/features | Split by domain | | Mix of infra + feature code | Separate commits | | New dependency + feature using it | Can be one commit (dependency serves the feature) | | Tests + implementation they test | Same commit (they're one logical unit) | | Formatting/linting + feature changes | Separate commits | | Migration + repository + domain changes | Split if they're independently meaningful |
When splitting, commits MUST be ordered so the repo compiles and passes tests at every point:
# BAD: One giant commit mixing everything
git add -A
git commit -m "feat(auth): add multi-role support, postgres, gateway proxy, docker-compose"
# 1. Domain change
git add api/auth/internal/auth/domain/
git commit -m "feat(auth): refactor user entity from single role to multi-role
- Change Role field to []Role with HasRole/AddRole/RemoveRole
- Add NewRoles validator with dedup and ErrNoRoles
- Update domain tests for multi-role scenarios"
# 2. Infrastructure adapters
git add api/auth/internal/auth/infrastructure/ api/auth/migrations/ api/auth/go.*
git commit -m "feat(auth): add PostgreSQL repository with pgx and sqlc
- Add user_roles migration and sqlc-generated queries
- Implement PostgresUserRepository and PostgresTokenBlacklist
- Add DB_PROVIDER switch in main.go (memory/postgres)"
# 3. Independent service change
git add api/gateway/
git commit -m "feat(gateway): add reverse proxy forwarding to auth service"
# 4. DevOps/tooling
git add docker-compose.yml Makefile skills/
git commit -m "chore: add docker-compose and local dev workflow"
| Action | Risk |
|--------|------|
| git commit --amend after push | Rewrites public history |
| git push --force to shared branches | Overwrites others' work |
| Commit secrets/credentials | Security breach |
| Commit large binary files | Bloats repository |
Only amend if ALL conditions are met:
# Safe: amend unpushed commit
git commit --amend -m "feat: corrected message"
# Check if pushed
git status # Shows "Your branch is ahead of..."
# Secrets
.env
.env.local
*.pem
credentials.json
secrets.yaml
# IDE
.idea/
.vscode/
*.swp
# Dependencies
node_modules/
vendor/
__pycache__/
# Build artifacts
dist/
build/
*.pyc
# View recent commits
git log --oneline -10
# View commit details
git show <commit-hash>
# Undo last commit (keep changes staged)
git reset --soft HEAD~1
# Undo last commit (keep changes unstaged)
git reset HEAD~1
# Discard last commit entirely (DANGEROUS)
git reset --hard HEAD~1
# Create commit with sign-off
git commit -s -m "feat: add feature"
# Create commit skipping hooks (use sparingly)
git commit --no-verify -m "wip: work in progress"
testing
Review Flutter components and screens for UX/UI compliance. Trigger: When user invokes /ux-review command or requests UX audit.
development
TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).
testing
Testing philosophy and strategy for every feature: test pyramid, mandatory levels per change type, completion checklist, and skill delegation. Trigger: When planning tests for a feature, reviewing test coverage, defining acceptance criteria, or asking what tests a change needs.
development
Terraform security practices: sensitive variables, secret management, state protection, .gitignore patterns, and CI/CD credential handling. Trigger: When handling secrets in Terraform, configuring state backends, reviewing .gitignore for Terraform, or setting up CI/CD pipelines for infrastructure.