GitHub PR Creation
Workflow
- Read
.github/pull_request_template.mdbefore drafting the PR body. - Collect PR context from the current branch (base/head, scope, linked issues, testing status, breaking changes, release note content).
- Draft the PR body using the template structure exactly:
- Keep section order and headings.
- Keep checkbox and code block formatting.
- Fill every section; if not applicable, write
N/AorNone.
- Present the full Markdown PR body in chat for review before creating the PR.
- Ask for explicit confirmation to create the PR with that body.
- After confirmation, create the PR with
gh pr create --body-fileusing a unique temp file path. - Report the created PR URL and summarize title/base/head and any required follow-up.
Constraints
- Never skip template sections.
- Never rewrite the template format.
- Keep content concise and specific to the current change set.
- PR title and body must be written in English.
- Never create the PR before showing the full final body to the user.
- Never rely on command permission prompts as PR body preview.
Command Pattern
# read template
cat .github/pull_request_template.md
# show this full Markdown body in chat first
pr_body_file="$(mktemp /tmp/gh-pr-body-XXXXXX).md"
cat > "$pr_body_file" <<'EOF'
...filled template body...
EOF
# run only after explicit user confirmation
gh pr create --base <base> --head <head> --title "<title>" --body-file "$pr_body_file"
rm -f "$pr_body_file"