pr
Purpose
Create a high-quality PR for this repo with mandatory local preflight checks.
Defaults
- •Default PR mode: Draft.
- •Default base branch:
main. - •Use repository PR template if present.
- •Always run
just pre-flightbefore opening the PR.
Workflow
- •Confirm current branch is not
mainwithgit branch --show-current. - •Inspect state with:
- •
git status - •
git log --oneline main...HEAD - •
git diff main...HEAD
- •
- •Run preflight checks:
just pre-flight. - •Ensure changes are committed before opening PR.
- •Find PR template:
- •
.github/pull_request_template.md - •
.github/PULL_REQUEST_TEMPLATE.md - •
.github/PULL_REQUEST_TEMPLATE/*
- •
- •Draft PR body by combining template structure with branch changes:
- •concise summary
- •why/context
- •test notes
- •linked issues when available
- •Push branch if needed:
git push -u origin HEAD. - •Create PR with
gh pr createusing:- •
--draft - •
--base main - •
--head <current-branch> - •
--title ... - •
--body-file ...or HEREDOC-based body
- •
Safety Rails
- •Never open a PR from
mainbranch. - •Preserve template headings/checklists where they exist.
- •If
just pre-flightfails, stop and report the failing step and output. - •Do not claim checks were run unless actually run.
- •If gh auth/permissions fail, report the exact blocker and command to fix.