github-pr
Installation
SKILL.md
Contains Shell Commands
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
GitHub PR
Context
- Current branch: !
git branch --show-current - Upstream tracking: !
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo "NONE" - Default branch: !
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name 2>/dev/null || echo "main" - Unpushed commits: !
git log @{u}.. --oneline 2>/dev/null || git log --oneline -20 - Recent commits on this branch: !
git log --oneline -20 - PR template: !
cat .github/PULL_REQUEST_TEMPLATE.md docs/PULL_REQUEST_TEMPLATE.md PULL_REQUEST_TEMPLATE.md 2>/dev/null; ls .github/PULL_REQUEST_TEMPLATE/ 2>/dev/null || echo "NONE"
Let <base> be the default branch above and <head> be the current branch.
Step 1 — Make sure the branch is pushed
Determine whether <head> is fully pushed:
- If Upstream tracking is
NONE, the branch has never been pushed. - Otherwise, if Unpushed commits lists any commits, the branch is behind its upstream.