/git-tools:git-commitsfrom git-tools
Git commit best practices and message formatting guidelines. Use when creating commits, improving commit messages, learning commit conventions, or when user mentions commit messages, commit formatting, or commit guidelines.
Ships in git-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Expert guidance for creating well-formatted, meaningful commits that tell a clear story.
git statusgit diff --stagedgit diffgit log --oneline -10git branch --show-current# Stage specific files
git add src/auth.ts src/types.ts
# Commit with clear message
git commit -m "Add JWT authentication
Implements token-based authentication with refresh tokens.
Includes middleware for protected routes and token validation."
Key Rules:
type(scope): Summary in imperative mood
More detailed explanatory text if needed, wrapped at 72 characters.
Explain the "what" and "why" of the change, not the "how".
Closes #issue-number
Types: feat, fix, docs, style, refactor, perf, test, chore
Examples:
feat(auth): Add user authentication endpoint
fix(cache): Resolve race condition in invalidation
refactor(api): Extract validation into middleware
perf(db): Add indexes for user dashboard queries
One logical change per commit. Fixing two bugs? Two separate commits.
# Good: Separate commits
git add auth.py
git commit -m "Fix authentication token validation"
git add database.py
git commit -m "Add index to users table for performance"
# Bad: Unrelated changes
git add auth.py database.py
git commit -m "Fix various issues"
Small, frequent commits are easier to understand and revert if needed.
Benefits:
Pre-commit checklist:
# Run tests
pytest # Python
npm test # JavaScript
# Run linters
pylint src/ # Python
eslint src/ # JavaScript
# Check formatting
black --check src/ # Python
prettier --check src/ # JavaScript
# Review changes
git status # What will be committed
git diff --staged # Actual changes
MAKE SURE NEW CHANGES ARE COVERED BY AUTOMATED TESTS AND ALL TESTS PASS.
Only commit when a logical component is complete. Use git stash for incomplete work:
# Need to switch branches but work isn't complete
git stash save "WIP: User authentication form validation"
git checkout other-branch
# Come back later
git checkout feature/auth
git stash pop
Good:
Add user profile page
Implements the user profile page with the following:
- Display user information (name, email, avatar)
- Edit profile form with validation
- Upload avatar with image preview
- Update API endpoint integration
Tests included for form validation and API calls.
Bad:
Add stuff
Good:
Fix race condition in cache invalidation
The cache was not being properly invalidated when multiple
requests updated the same resource simultaneously, causing
stale data to be served to users.
Changed the invalidation logic to use atomic operations with
a distributed lock to ensure cache consistency.
Fixes #1234
Bad:
Fix bug
Good:
Extract authentication logic into middleware
Moved authentication checks from individual route handlers
into reusable middleware. This reduces code duplication and
makes authentication logic easier to maintain and test.
No functional changes - all existing tests pass.
Bad:
Update code
❌ Vague messages: "Fix bug", "Update code", "Changes", "WIP", "asdf"
❌ Too much in one commit: "Fix login, add dashboard, update deps, refactor tests"
❌ Misleading messages: Commit message says "Fix typo" but actually rewrites authentication system
❌ No context: Summary line only, no body when body is needed
❌ Half-done work: Committing code that doesn't compile or fails tests
Every commit should include tests and pass all existing tests.
New features:
Bug fixes:
Refactoring:
@git-stacked-prs@git-advancedGit is not a backup system. Each commit should tell a story:
Good commit history enables:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nilpath/nilpath-marketplace --plugin git-toolsOther plugins' skills for the same job
6 skills in this plugin
/gh-address-commentsAddress review/issue comments on the open GitHub PR for the current branch. Fetches all comments and review threads, summarizes what needs attention, and helps apply fixes. Use when responding to PR feedback, resolving review comments, or when user mentions "address comments" or "fix review feedback"./gh-pr-reviewGitHub PR review operations via gh CLI. Create pending reviews with line comments, submit reviews (approve/reject/comment). Use when adding PR comments, submitting reviews, or managing GitHub code reviews./git-advancedAdvanced git operations (rebase, cherry-pick, reflog, stash, reset, clean), analysis tools (bisect, blame, history), and command reference. Use for complex git tasks, recovery operations, or when user mentions rebase, cherry-pick, reflog, stash, reset, bisect, or needs git command reference.