| name | gh-create-pr |
| description | Create or update GitHub pull requests using the repository-required workflow and template compliance. Use when asked to create/open/update a PR so the assistant reads `.github/pull_request_template.md`, fills every template section, preserves markdown structure exactly, and marks missing data as N/A or None instead of skipping sections. |
GitHub PR Creation
Workflow
- Read
.github/pull_request_template.md before 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/A or None.
- 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-file using 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
cat .github/pull_request_template.md
pr_body_file="$(mktemp /tmp/gh-pr-body-XXXXXX).md"
cat > "$pr_body_file" <<'EOF'
...filled template body...
EOF
gh pr create --base <base> --head <head> --title "<title>" --body-file "$pr_body_file"
rm -f "$pr_body_file"