| name | open-pr |
| description | Push a reviewed ticket branch and open a pull request with a structured title and body, after review-changes has passed. Use when a ticket is reviewed and ready to ship, or the user says "open a PR" / "create the pull request". Stops at opening the PR — never merges. |
| model | sonnet |
| effort | medium |
| allowed-tools | ["Read","Bash"] |
| argument-hint | <ticket id> |
| triggers | ["open a pr","create the pull request","push and open pr","ship it"] |
| tags | ["pr","github","git","pipeline"] |
Open PR
Turn a reviewed branch into a pull request. This is pipeline step 5 (plan → track → implement → review → pr) and the last step — it opens the PR and stops.
Never merge; a human reviews and lands it.
Gate: review must have passed
node "${CLAUDE_PLUGIN_ROOT}/hooks/pipeline.mjs" show <ticket-id>
If the review step isn't done, STOP and run review-changes first. Do not
open a PR for unreviewed code.
Open it
BR=$(node "${CLAUDE_PLUGIN_ROOT}/hooks/pipeline.mjs" branch <ticket-id>)
git checkout "$BR"
git push -u origin "$BR"
DEFAULT=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|origin/||' || echo main)
Compose the PR with a HEREDOC body (never a fragile one-line --body):
gh pr create --base "$DEFAULT" --head "$BR" \
--title "[<ticket-id>] <ticket title>" \
--body "$(cat <<'EOF'
## Summary
<what changed and why, 1-3 bullets>
## Ticket
<ticket-id> — <title>
## Changes
<the notable files/areas touched>
## Test plan
<how it was verified: the suite that passed, key cases; review findings resolved>
EOF
)"
gh pr view "$BR" --json number,url
Persist
node "${CLAUDE_PLUGIN_ROOT}/hooks/pipeline.mjs" step <ticket-id> pr done --note "<pr url>"
node "${CLAUDE_PLUGIN_ROOT}/hooks/memory.mjs" keep "<ticket-id> PR opened: <url>" --kind summary --tags pr
Rules
- Review-gated. No PR unless
review is done.
- Never merge, never force-push, never bypass hooks. Opening the PR is the end.
- Body from run state, not from memory of the conversation — summarize the
actual diff and the tests that passed.
- If
gh is missing or unauthenticated, tell the user the fix (gh auth login)
and stop — don't fabricate a PR.
Finish
Report the PR number and URL, and that it's ready for human review + merge. Under
ship, this is the terminal step — return the PR URL.