Create a high-quality draft PR for the current branch. Use when the user says "create a PR", "draft PR", "open a PR", "make a PR", "push and create PR", or "submit PR".
Create a concise, reviewer-friendly draft PR from the current branch.
git branch --show-currentgit log trunk..HEAD --format="%h %s" --reverse 2>/dev/null || echo "No commits ahead of trunk"git diff trunk...HEAD --stat 2>/dev/nullgit status --shortgit diff trunk...HEAD --name-only -- '*/changelog/*' 2>/dev/nullcat .github/PULL_REQUEST_TEMPLATE.mdVerify from dynamic context: not on trunk (ask which branch if so), commits exist ahead of trunk (stop if none), no uncommitted changes (ask user to commit/stash if dirty).
Base branch: use if the branch was created from one, otherwise .
release/*trunkFrom the dynamic context above (read full diffs only if the stat summary is ambiguous), determine:
#12345, fix/issue-12345)client/, templates/, CSS/SCSS, JSX/TSXExtract issue/PR refs from commits and branch name. Ask the user (combine into one prompt):
Use the PR template from the dynamic context above.
Title (under 70 chars, verb-first — the repo convention):
Fix <what was broken>, Add <what>, or other verb (Restore, Bump, Prepare, etc.)[Email Editor] Fix double margin-top in flex layoutfix:/feat: prefixes. No Linear ticket refs — Linear is internal, PRs are public.Body — depends on whether the change is plugin-affecting:
.ai/skills/, workflows)Use a simplified body with only these sections:
Skip Screenshots, Testing instructions, Testing done, Milestone, and Changelog sections entirely.
Use the full template:
Closes #1234. if applicable. For bugs: Bug introduced in PR #XXXX. (omit this line entirely if not a bug fix).[x] if plugin-affecting.[x] with Significance, Type, and a user-facing Message.Strip all HTML comments (<!-- -->) and unfilled placeholder lines (e.g., Closes # ., Bug introduced in PR # .) from output.
Show the user the generated title and body. Apply any corrections before proceeding.
git push -u origin $(git branch --show-current)
gh pr create --draft --title "<title>" --base <base-branch> --body "$(cat <<'PRBODY'
<full PR body>
PRBODY
)"
Output the PR URL. If UI changes need screenshots, remind the user.