GH Create PR
Workflow
- Confirm branch and working tree are ready.
- Run
git status -sb. - Ensure commits are complete and branch is pushed.
- Collect PR context.
- Read
.github/PULL_REQUEST_TEMPLATE.mdwhen present. - Gather summary of changes and executed checks from commits and task artifacts.
- Prefer factual check results and avoid claiming manual tests that were not run.
- Create or update PR with
gh.
- Create:
gh pr create --base main --head <branch> --title "<title>" --body-file <body.md>
- Update existing PR description:
gh pr edit <number-or-url> --body-file <body.md>
- Use template-accurate checkboxes.
- Mark only items that were actually completed.
- Leave unchecked items for unperformed steps.
- Keep wording from the template unchanged; only fill values/check states.
- Verify PR state.
- Open or print PR URL from
ghoutput. - Optionally run:
gh pr view <number-or-url> --json number,title,url,headRefName,baseRefName
Body Authoring Rules
- Keep description short and concrete.
- Include changed areas, bug/task ID when available, and validation commands.
- Mention warnings or non-blocking caveats if present.
- Do not include markdown sections not in the template when template compliance is requested.
Fast Patterns
Template-first PR update:
- Read template.
- Create
body.mdfollowing the exact headings/order. - Apply with
gh pr edit <pr> --body-file body.md.
New PR from current branch:
- Build
body.mdfrom template. - Run
gh pr create --base main --head $(git branch --show-current) ....