github-prlisted
Install: claude install-skill swaroopsm/skills
# 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.
If the branch is not fully pushed, **always confirm before pushing** using the `AskUserQuestion` tool (selectable, so the user can reject with one click):
- **Push and continue** — push `<head>` to `origin` (`git push -u origin <head>` if there's no upstream yet, otherwise `git push`), then continue.
- **Cancel** — stop here without pushing and without opening a PR.
Do not push without an explicit confirmation. If the user picks Cancel, stop.
If the branch is already fully pushed, skip straight to Step 2.
## Step 2 — Determine the issue number