pr-merge-sequence
Installation
SKILL.md
PR merge sequence
Use this workflow when several open pull requests must be merged without letting later PRs drift behind the base branch.
Before changing branches
- Confirm the repository, current branch, and
git status. Preserve any unrelated local work; do not reset or discard it. - List the requested PRs and inspect their base/head branches, draft state, mergeability, latest commit, checks, reviews, inline threads, and unresolved findings.
- Refresh the base branch from the remote. Read applicable repository instructions and the user's merge/rebase preferences.
- Do not mark a draft ready or merge any PR until the user has authorized that state change.
Rebase and merge loop
- Before the first merge, rebase every requested open PR branch onto the current remote base branch. Push rewritten history with
--force-with-lease, never plain--force. If a rebase conflicts or would overwrite unexpected work, stop and resolve carefully rather than dropping commits. - For the next PR in the user-specified order, verify its remote head matches the rebased commit, all required checks are green, and no unresolved valid review finding remains. Inspect new comments after each push/rebase; reply and resolve findings according to the user's established workflow. Do not dismiss a security finding merely to get a green review.
- Merge with a normal merge commit (for GitHub CLI,
gh pr merge <number> --merge). Never use squash or rebase merge when the user requires normal merge commits. - After each merge, fetch the new base and immediately rebase every remaining requested PR branch onto it. Push each updated branch with
--force-with-leaseand wait for checks/reviews on the new heads before the next merge. - Repeat until the requested sequence is complete. Do not merge unrelated PRs just because they are open or green.