Create a draft GitHub PR with auto-filled template from repo's pull_request_template.md
Create a draft GitHub PR for the current branch, auto-filling the repo's PR template.
Pre-flight Checks
gh repo view --json defaultBranchRef -q .defaultBranchRef.namegit status --porcelaingit rev-parse --abbrev-ref @{upstream} — if not pushed, ask user to push first and abortDetermine Base Branch
$ARGUMENTS provided, use as base branchGather Context
git log --oneline $(git merge-base HEAD origin/<base>)..HEAD for commit historygit diff origin/<base>...HEAD for full diff.claude/tasks/*/plan.md exists matching current branch or ticket ID, read it as supplemental contextFind PR Template
git ls-files | grep -i pull_request_templatePULL_REQUEST_TEMPLATE/ directory with multiple files), list them and ask user which to useFill Template
Fixes #123, Fixes FOO-123). If none found, skip.github/ for title validation rules (e.g., pr-title-checker-config.json, workflows with title checks, commitlint/semantic-release configs). If found, generate a title matching the required pattern. If none found, generate a concise title (under 70 chars)Fetch Available Labels
gh label list --limit 200Confirm and Create
gh pr create --draft --base <base> --title "<title>" --body-file <temp file>gh pr edit <number> --add-label <labels>gh pr create without approval