Get information about the state of a git repo, get diffs, make commits, make PRs, etc.. Use this skill when the user needs to accomplish git tasks.
Use AskUserQuestion before these potentially destructive operations:
git commit)git push)gh pr create)gh pr merge)No confirmation needed for read-only or local operations:
git status, git diff, git log, git branchgit add (staging)git checkout, git switch (switching branches)git fetchgh pr view, gh pr list, gh issue list--amend unless explicitly requestedadd-user-auth, fix-null-pointer, refactor-api-clientgit status
git log --oneline -10
git branch -a
Staged changes (ready to commit):
git diff --cached # full diff
git diff --cached --stat # summary
Unstaged changes (modified but not staged):
git diff # full diff
git diff --stat # summary
All changes in current branch vs base (for PR context):
git diff main...HEAD --stat # summary
git diff main...HEAD # full diff
git log main..HEAD --oneline # commits that would be in PR
git add <files>
git commit -m "Commit message here."
For multi-line messages:
git commit -m "$(cat <<'EOF'
Short summary of changes.
Additional context if needed.
EOF
)"
git checkout -b descriptive-branch-name
# ... make changes and commits ...
git push -u origin HEAD
gh pr create --title "Title here" --body "$(cat <<'EOF'
## Description
Brief description of changes.
## Testing
How this was tested.
## Deployment
Steps to deploy this change.
EOF
)"
gh pr view --json number -q .number # get PR number for current branch
gh pr list # list open PRs
gh pr view <number>
gh pr diff <number>
gh pr checks <number>
gh api repos/{owner}/{repo}/pulls/<number>/comments # view PR comments
gh pr review <number> --approve
gh pr review <number> --request-changes --body "Feedback here"
gh pr merge <number> --squash --delete-branch
gh issue list
gh issue view <number>
gh issue create --title "Title" --body "Description"
gh issue close <number>
--no-verify unless explicitly requested