Piv Create PR
Push the current feature branch and open a pull request, ready for review.
Install
npx skills add coleam00/skills --skill piv-create-pr -g -a claude-code -y- Repository
- coleam00/skills726
- Category
- Git and review
- Updated
- 5d ago
- License
- MIT
- Context cost
- Lightabout 868 tokens
- Runs scripts
- No, instructions only
What it does
Push the current feature branch and open a pull request, ready for review. Use after a ticket's implementation is committed on its own branch, it detects the base branch, pushes, opens the PR with a clear body (summary · what changed · validation status), and returns the URL to hand to a reviewer.
Create PR: Open the Pull Request, Hand Off for Review
This is the ship step of the PIV loop: the implementation is committed on a feature branch; now open the PR
so it can be reviewed (by the piv-review-pr agentic gate, then a human).
Phase 0, Detect the base branch
Don't hardcode main. Resolve it:
- If
$ARGUMENTScontains--base <branch>, use that. - Else:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' - Fallback:
git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' - Last resort:
main. Store as{base}.
Phase 1, Validate git state
git branch --show-current
git status --short
git log origin/{base}..HEAD --oneline
| State | Action |
|---|---|
On {base} | STOP: "Create a feature branch first (the ticket should be on its own branch)." |
| Uncommitted changes | STOP: "Commit (or stash) before opening the PR." |
No commits ahead of {base} | STOP: "Nothing to PR." |
Existing PR for this branch (gh pr list --head $(git branch --show-current) --json url) | STOP and print the URL. |
| Clean, commits ahead, no PR | PROCEED |

