PR Create Skill
Push the current branch and create (or update) a GitHub pull request with a structured description derived from the branch plan document.
Usage
/pr-create [<base-branch>] [--ready]
- •
/pr-create— create a draft PR (base branch auto-detected) - •
/pr-create develop— create a draft PR targetingdevelop - •
/pr-create --ready— create a non-draft PR (for finished work)
PRs are created as drafts by default — open them early after your first commit and update as you go.
What This Skill Does
- •Detect base branch — use explicit argument, or auto-detect (see below)
- •Check for existing PR on this branch — update it if one exists, create if not
- •Locate the branch plan for the current branch (with fallback)
- •Read the plan to extract goal, changes, and decisions
- •Push the branch to the remote (with
-uflag) - •Create or update the PR using
gh pr createorgh pr edit
Instructions for Claude
Step 1: Determine the base branch
If the user provides a base branch, use it. Otherwise, auto-detect:
- •Check if a
developbranch exists (git rev-parse --verify develop) - •If
developexists and the current branch is not a release branch (release/*), usedevelop - •If on a release branch, ask the user — both
main/masteranddevelopare reasonable targets - •Otherwise, use
main— ormasterifmaindoes not exist
Step 2: Check for an existing PR
Run gh pr view --json number,title,url 2>/dev/null to check if a PR already exists for this branch.
- •If a PR exists, this is an update — use
gh pr editin step 6 - •If no PR exists, this is a create — use
gh pr createin step 6
Step 3: Gather context
Run these in parallel:
- •
git log <base>..HEAD --onelineto see all commits on this branch - •
git diff <base>...HEAD --statto see files changed - •Read the branch plan document (
CLAUDE.<branch-name>.mdreferenced inCLAUDE.local.md)
If no branch plan exists, fall back to deriving the PR description from the commits and diff alone. Use the commit messages to infer the summary, and the diff stat to understand scope.
Step 4: Derive PR content
When a branch plan exists — extract from it:
- •Summary: from the plan's Goal section — 1-3 sentences on what this PR achieves.
- •Plan: from the plan's Tasks section — a checklist of work items. Completed items are checked off; remaining items are unchecked. This lets reviewers see both what's done and what's planned.
- •Changes: from commits and the plan's completed tasks — what was actually implemented, organized by concern. Only include this section if the plan checklist alone doesn't convey the changes clearly enough.
- •Design notes: from the plan's Architecture Decisions or Questions sections — only non-obvious decisions a reviewer needs to understand. Omit if straightforward.
When no branch plan exists — derive from commits and diff:
- •Summary: synthesize from commit messages — what does this PR achieve overall?
- •Changes: group commits by concern into a concise list of what changed.
- •Omit the Plan section (no plan document to reference).
Step 5: Write the PR title
Follow the pattern: <category>(<scope>): <purpose>
- •All lowercase
- •Under 70 characters
- •Categories:
feat,fix,docs,chore(alsostyle,refactor) - •Scope in parentheses (e.g.,
backend,frontend,fullend,database,app,api,worker) — omit if the project has a single scope - •Purpose describes the outcome, not the mechanism
Examples:
- •
feat(app): add new survey chart - •
fix(backend): make service layer generate survey correctly - •
docs: split workflow docs into semver and trunk-based
Step 6: Push and create or update PR
git push -u origin <branch>
Creating a new PR (default is draft):
gh pr create --draft --title "..." --body "..." --base <base>
If --ready was specified:
gh pr create --title "..." --body "..." --base <base>
Updating an existing PR:
gh pr edit --title "..." --body "..."
PR Structure
## Summary [1-3 sentences from the plan's Goal. What does this PR achieve?] ## Plan - [x] [completed item] - [x] [completed item] - [ ] [remaining item] ## Changes [Group by concern — use whatever groupings suit the project. Skip if the plan checklist is sufficient.] **[Concern]** — [one-line summary]: - [specific change] - [specific change] ### Design note [Only if there's a non-obvious decision reviewers need. Otherwise omit this section.]
Principles
- •Orient the reviewer: the PR description's job is to help someone review the diff. Keep it concise.
- •Plan is a living checklist: the plan section reflects the branch plan document — check off items as they're completed, add new ones as discovered.
- •Changes, not plans: the Changes section describes what was done, not what was considered.
- •No duplication: each section has a distinct purpose. Don't repeat information across Summary, Plan, and Changes.
Important
- •Do NOT add a
Co-Authored-Byline or reference AI in the PR title or description. - •Do NOT push to
mainormasterdirectly — always create the PR against the base branch. - •Return the PR URL when done so the user can review it.