Manage PR
Titles, style, and remote naming follow the git-conventions skill. PRs live on the repo's primary remote; this skill supports GitHub through gh. An explicit repo convention (PR template, title check, contributing doc) wins over these defaults.
Create or update
- Inspect first:
git log <base>..HEAD --oneline,git diff <base>...HEAD --stat, andgh pr viewfor existing PR state. - Title:
type(scope): description. - Body from the template below through
--body-file; pass explicit flags soghnever prompts. - Push the branch to the primary remote first (
git push -u <primary> <branch>; repos usually have two remotes, and an unset upstream makesghprompt). - Create ready for review and self-assigned:
gh pr create --assignee @me --base <base> --title <title> --body-file <file>. - Fill Verification only with commands actually run and their results.
Template (omit Notes when empty):
## Summary
- 2-5 plain bullets: what changed and why.
- Stacked on #N. (stacked PRs only)
## Verification
- Commands run and their results.
## Notes
- Risk, migration order, or review pointers.
Stacks
When work spans several PRs, chain branches bottom-up: the first PR bases on the default branch, each later PR bases on the previous branch. Keep every PR independently green and order the stack so it reads as an argument.
Merge loop
On "let's get the PRs merged": map the stack bottom-up, record every branch's current tip, hand back the bottom PR's link, and wait. On each "merged #N" (any merge method, often squash):
- Fetch the primary remote and fast-forward the local default branch.
- Rebase the next branch onto the fresh default using the recorded tips:
git rebase --onto <default> <old-base-tip> <branch>. Then rebase each remaining branch onto its rewritten parent the same way:git rebase --onto <parent> <old-parent-tip> <branch>. Record the new tips. - On conflict, stop and report; a half-resolved rebase never gets pushed.
- Confirm each branch's content survived:
git range-diff <old-base-tip>..<old-tip> <new-base>..<branch>shows only the base change. Push with--force-with-leaseonly then. - Retarget the next PR (
gh pr edit <next> --base <default>), reply with its link, and wait for the next "merged #N". Resync this way even when the merge was not a squash. After the last PR, confirm the stack is complete and offer local cleanup (a branch checked out in a worktree needsgit worktree removefirst).
Guardrails
- Merging is the user's action; this skill never merges.
- Resolve the primary remote by name; a remote called
origindoes not exist in these repos. - Keep plan and milestone context out of titles and bodies.
Output
The PR URL, or during the merge loop the next PR's link and remaining stack.