| name | git-workflow |
| description | Smart git operations including conventional commits, PR creation, branch management, and conflict resolution. Activates for "commit", "create PR", "push", "merge", "resolve conflict", "git" operations. |
| allowed-tools | ["Bash","Read","Grep","Glob","Write"] |
Git Workflow Protocol
When This Skill Activates
- "Commit this", "commit changes", "save changes"
- "Create PR", "open pull request", "push to remote"
- "Merge", "rebase", "resolve conflicts"
- Any git-related operations
Commit Message Convention
Format
<type>(<scope>): <subject>
<body>
<footer>
Types
| Type | Use For |
|---|
feat | New feature |
fix | Bug fix |
refactor | Code restructuring (no behavior change) |
perf | Performance improvement |
docs | Documentation only |
test | Adding/fixing tests |
chore | Build, deps, config changes |
style | Formatting (no code change) |
Before Committing - Always Run:
git status
git diff --staged
git log --oneline -10
git diff --staged | grep -i -E "(password|secret|key|token|api_key)" || echo "No secrets found"
Commit Message Examples
Good:
feat(auth): add OAuth2 login with Google
- Implement GoogleAuthProvider with PKCE flow
- Add /api/auth/google callback endpoint
- Store refresh tokens in encrypted session
Closes #123
Bad:
fixed stuff
update
wip
Pull Request Workflow
Before Creating PR:
git fetch origin main
git rebase origin/main
npm test
npm run lint
git diff origin/main...HEAD
PR Title Format
Same as commit: type(scope): description
PR Body Template
## Summary
[1-3 bullet points of what this PR does]
## Changes
- [Specific change 1]
- [Specific change 2]
## Testing
- [ ] Unit tests pass
- [ ] Manual testing done
- [ ] Edge cases covered
## Screenshots (if UI change)
[Before/After images]
## Related Issues
Closes #XXX
PR Creation Command
gh pr create --title "feat(scope): description" --body "$(cat <<'EOF'
## Summary
- Change 1
- Change 2
## Test Plan
- [ ] Tests pass
- [ ] Manual verification done
---
Generated with Claude Code
EOF
)"
Branch Naming
feature/short-description
fix/issue-number-description
refactor/what-is-being-refactored
Conflict Resolution
Step-by-Step:
git fetch origin main
git rebase origin/main
git add <resolved-file>
git rebase --continue
git rebase --abort
git merge origin/main
Conflict Markers
<<<<<<< HEAD
Your changes
=======
Their changes
>>>>>>> branch-name
Safety Rules
- NEVER force push to main/master
- NEVER commit .env files or secrets
- ALWAYS review diff before committing
- ALWAYS run tests before pushing
- NEVER use
git add . without reviewing status first
Quick Reference
git reset --soft HEAD~1
git checkout -- .
git log origin/main..HEAD
git rebase -i HEAD~N