Git Master Skill
Expert skill for Git operations.
Modes
COMMIT Mode
Create high-quality commits with well-crafted messages.
Usage:
code
/git-master commit /git-master commit -m "feat: add authentication"
Workflow:
- •
Analyze Changes
bashgit status git diff --staged git diff
- •
Detect Style
bash# Analyze recent commit messages git log --oneline -20
- •
Determine Commit Type
- •
feat: New feature - •
fix: Bug fix - •
refactor: Refactoring - •
docs: Documentation changes - •
style: Formatting - •
test: Test additions/modifications - •
chore: Build/tool changes
- •
- •
Write Commit Message
code<type>(<scope>): <subject> <body> <footer>
- •
Execute Commit
bashgit add <files> git commit -m "<message>"
REBASE Mode
Perform interactive rebase non-interactively.
Usage:
code
/git-master rebase <base-branch> /git-master rebase main --squash
Workflow:
- •
Check Current State
bashgit log --oneline <base>..HEAD
- •
Determine Rebase Strategy
- •squash: Combine all commits into one
- •fixup: Auto-merge fixup commits
- •reword: Edit messages
- •
Execute Rebase
bashgit rebase <base> # or git rebase -i <base> (with auto script)
- •
Resolve Conflicts
- •Identify conflicting files
- •Suggest fixes
- •
git rebase --continue
HISTORY_SEARCH Mode
Search Git history for specific changes.
Usage:
code
/git-master history "function name" /git-master history --file src/auth.ts /git-master history --author "username"
Search Options:
- •
Code Search
bashgit log -S "search term" --oneline git log -G "regex pattern" --oneline
- •
File History
bashgit log --follow --oneline -- <file> git blame <file>
- •
Author Search
bashgit log --author="name" --oneline
- •
Date Range
bashgit log --since="2025-01-01" --until="2025-01-31"
Commit Message Guidelines
Subject
- •50 characters max
- •Don't start with capital letter (conventional commits)
- •No period at end
- •Imperative mood ("add" not "added")
Body
- •Wrap at 72 characters
- •Explain "why" the change is needed
- •"What" is explained by the code
Footer
- •Breaking changes:
BREAKING CHANGE: description - •Issue references:
Closes #123,Fixes #456
Examples
Feature Addition
code
feat(auth): add JWT token refresh mechanism Implement automatic token refresh when the access token expires. The refresh token is stored in httpOnly cookie for security. - Add refreshToken endpoint - Implement token rotation - Add automatic retry on 401 Closes #234
Bug Fix
code
fix(api): handle null response from external service The external payment API occasionally returns null instead of an error object. Add null check and proper error handling. Fixes #567
Refactoring
code
refactor(database): extract query builder to separate module Move query building logic to dedicated module for better testability and reusability. No functional changes.
Cautions
- •Use
--forceonly when explicitly requested - •Warn before pushing to
main/master - •Prevent committing sensitive files (.env, credentials)
- •Warn about large binary files