skills/commit/SKILL.md
Git commit message conventions and formatting
npx skillsauth add jcsaaddupuy/badrobots 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.
Create git commits using Conventional Commits format with clear, concise messages.
User says "commit" → ✅ Commit only, do NOT push User says "commit and push" → ✅ Commit AND push User says "push" (after previous commit) → ✅ Push only
<type>(<scope>): <summary>
type REQUIRED. Use feat for new features, fix for bug fixes. Other common types: docs, refactor, chore, test, perf.scope OPTIONAL. Short noun in parentheses for the affected area (e.g., api, parser, ui, docker, ci).summary REQUIRED. Short, imperative, <= 72 chars, no trailing period.| Type | When to Use | Example |
|------|-------------|---------|
| feat | New feature or capability | feat(auth): add OAuth2 support |
| fix | Bug fix | fix(api): handle null response |
| docs | Documentation only | docs(readme): update install steps |
| refactor | Code change with no feature/fix | refactor(parser): simplify logic |
| chore | Maintenance, dependencies | chore(deps): update numpy to 2.4.2 |
| test | Adding or updating tests | test(auth): add login edge cases |
| perf | Performance improvement | perf(db): optimize query |
| style | Code style/formatting | style: apply black formatting |
| ci | CI/CD changes | ci: add coverage report |
| build | Build system changes | build: update webpack config |
Common scopes by project type:
Python Projects:
api, cli, models, services, utils, tests, depsDocker Projects:
docker, compose, dockerfile, ciFrontend Projects:
ui, components, styles, router, storeInfrastructure:
ci, deploy, config, scriptsTo find commonly used scopes:
git log -n 50 --pretty=format:%s | grep -E '^\w+\(' | sed 's/.*(\(.*\)):.*/\1/' | sort | uniq -c | sort -rn
# ✅ GOOD
feat(auth): add JWT token validation
fix(docker): update libglib2.0-0 to available version
chore(deps): upgrade numpy to 2.4.2
test(api): add edge cases for empty input
docs(readme): clarify installation steps
# ❌ BAD
feat: stuff # Too vague
Fix bug # No scope, not imperative, vague
feat(auth): Added the JWT token validation. # Past tense, period
WIP # No type, meaningless
Updated dependencies # No type, too generic
Pre-commit hooks may run automatically and:
# 1. Read the error message
# Hook will show what failed (formatting, linting, security)
# 2. Fix the issues
# - For formatting: Let hook auto-fix, then re-stage
git add <files>
git commit -m "message" # Hook auto-fixes
git add <fixes> # Stage hook's fixes
git commit -m "message" # Commit again
# - For linting: Fix manually
# Review linter output and fix issues
git add <files>
git commit -m "message"
# - For security: Remove secrets, never use --no-verify
# Remove the secret from code
git add <files>
git commit -m "message"
# 3. NEVER skip hooks with --no-verify unless absolutely necessary
# --no-verify bypasses security checks - only use in emergencies
# Make changes
vim src/module.py
# Stage changes
git add src/module.py
# Attempt commit
git commit -m "feat(api): add new endpoint"
# If black reformats:
# black will auto-format and show changes
# Files were modified by hook
# Commit was blocked
# Re-stage formatted files
git add src/module.py
# Commit again (should succeed now)
git commit -m "feat(api): add new endpoint"
# 1. Check status
git status
# 2. Review changes
git diff
# 3. Stage files
git add <file1> <file2>
# or stage all
git add .
# 4. Check commonly used scopes (optional)
git log -n 50 --pretty=format:%s | head -20
# 5. Commit with message
git commit -m "type(scope): summary"
# 6. If hooks fail, fix and re-commit
# See "Handling Pre-commit Hooks" section
# 7. Push if user requested it
git push
# or
git push -u origin branch-name # First time pushing branch
git commit -m "type(scope): summary" -m "
More detailed explanation of the change.
- Bullet points for multiple changes
- Can include reasoning
- Can reference issues
"
# Fix something in last commit (not pushed yet)
git add <forgotten-file>
git commit --amend --no-edit
# Change last commit message
git commit --amend -m "corrected message"
# ⚠️ NEVER amend commits that have been pushed (unless on feature branch alone)
If changes don't belong together:
# Commit in logical groups
git add src/auth.py tests/test_auth.py
git commit -m "feat(auth): add OAuth2 support"
git add src/api.py tests/test_api.py
git commit -m "fix(api): handle null response"
# Stage only parts of a file
git add -p file.py
# Will prompt for each change:
# y - stage this hunk
# n - don't stage
# s - split into smaller hunks
# q - quit
# Save uncommitted changes temporarily
git stash
# Do other work, make commits
# Restore stashed changes
git stash pop
-m twice if needed (one for subject, one for body)Signed-off-by)Common patterns:
Examples:
# User: "commit the api changes"
# → Stage api-related files, use scope "api"
# User: "commit src/auth.py with message about OAuth"
# → Stage only src/auth.py, use message mentioning OAuth
# User: "commit all changes"
# → Stage all files (git add .)
Infer from prompt
Review changes
git status to see what's changedgit diff to understand the changesCheck common scopes (optional)
git log -n 50 --pretty=format:%s to see commonly used scopesHandle ambiguity
Stage files
git add <files> or git add .Commit
git commit -m "<type>(<scope>): <summary>"-m "<body>" if a body is neededPush (if requested)
git push or git push -u origin <branch> for new branches| User Request | Action |
|--------------|--------|
| "commit" | Commit only |
| "commit and push" | Commit then push |
| "push" | Push only (after commit) |
| "commit the api changes" | Stage api files, commit with scope "api" |
| "commit everything" | Stage all files, commit |
| "amend" or "fix last commit" | Use git commit --amend |
# Feature
git commit -m "feat(auth): add OAuth2 authentication flow"
# Bug fix
git commit -m "fix(docker): update libglib2.0-0 to available version 2.80.0-6ubuntu3.8"
# Chore/dependency
git commit -m "chore(deps): upgrade numpy to 2.4.2 and polars to 1.38.1"
# Tests
git commit -m "test(api): add edge case tests for null responses"
# Documentation
git commit -m "docs(readme): add installation instructions for Docker"
# Refactoring
git commit -m "refactor(parser): simplify regex matching logic"
# Performance
git commit -m "perf(db): optimize user query with index"
# CI/CD
git commit -m "ci: add pipeline job for integration tests"
# With body
git commit -m "fix(api): handle timeout errors gracefully" -m "
Added retry logic with exponential backoff for API timeouts.
Prevents cascading failures when external service is slow.
"
development
DuckDB patterns for JSON/JSONL analysis, array unnesting, and common gotchas. Use when querying JSON files, nested data, or encountering "UNNEST not supported here" errors.
development
Mealie recipe manager API: recipes, shopping lists, meal plans. Requires MEALIE_BASE_URL and MEALIE_API_KEY.
business
TimeWarrior time tracking: start/stop intervals, query durations by tag or issue, compute totals for issue tracker time reporting
development
Bookmark manager for saving, searching, and annotating web content. Use when: (1) saving a webpage for later reference, (2) searching previously saved bookmarks, (3) adding highlights/annotations to saved content, (4) user asks to 'bookmark this' or 'save this article'. Requires READECK_BASE_URL and READECK_API_KEY environment variables.