Create Pull Request
Opens a pull request in the browser for final review and submission.
Arguments
[additional context]
Optional context to incorporate into the PR description - details not covered in commits, important considerations, areas needing attention, or anything to emphasize for reviewers.
Instructions
1. Check for PR Template
Search for templates in order of precedence:
.github/pull_request_template.md .github/PULL_REQUEST_TEMPLATE/*.md pull_request_template.md PULL_REQUEST_TEMPLATE/*.md docs/pull_request_template.md docs/PULL_REQUEST_TEMPLATE/*.md
If multiple templates exist in a PULL_REQUEST_TEMPLATE/ directory, list them and ask which to use.
2. Gather Context
Run in parallel:
- •
git status- check for uncommitted changes - •
git log --oneline @{upstream}..HEAD 2>/dev/null || git log --oneline -10- commits to include - •
git diff --stat @{upstream}..HEAD 2>/dev/null || git diff --stat HEAD~5..HEAD- files changed
If there are staged changes ready to commit, ask whether to commit first or proceed. If there are only untracked files (not relevant to the PR), proceed without asking.
3. Draft PR Content
Title: Derive from branch name or commits. Use conventional format if repo follows it.
Body: If template found, fill it in. Otherwise use:
## Why [Problem/motivation - 1-3 sentences] ## What [Approach - brief, not a code walkthrough] ## Notes for reviewers [Non-obvious decisions, areas of uncertainty, or "looks wrong but isn't" explanations]
If user provided additional context in arguments, incorporate it appropriately into the PR body.
Draft the content but don't show it to the user for approval - proceed directly to creation.
4. Push and Create PR
Push first: If the branch hasn't been pushed or is behind:
git push -u origin <branch-name>
Then create PR using the shim:
Default command:
~/.claude/skills/pr/gh-pr-create-web --title "..." --body "..."
With template file:
~/.claude/skills/pr/gh-pr-create-web --template ".github/pull_request_template.md"
The shim enforces --web flag, ensuring PRs open in browser for human review.
5. Report Result
Simply note that the PR creation command was executed. The browser will open automatically for final review.
Examples
/pr → Standard PR, opens browser /pr This needs careful review of the DB migrations → Emphasizes DB migration review /pr The API changes are breaking but documented → Highlights breaking changes
Edge Cases
- •No upstream: Ask for base branch
- •Empty diff: Warn and confirm before creating empty PR
- •Draft PR: If user mentions "draft" or "WIP", add
--draftflag - •Multiple templates: List options, ask which to use