Safely replace one GitHub pull request with another. Use when a user says a PR supersedes/replaces an older PR, asks to auto-close a superseded PR, or needs guaranteed closure behavior after merge. This skill explicitly closes the superseded PR with gh CLI and verifies final PR states instead of relying on closing keywords.
Use this skill to handle PR supersession end-to-end.
Do not rely on Closes #<number> to close another PR. GitHub closing keywords close issues, not pull requests.
old_pr (the superseded PR) and new_pr (the replacement PR).gh repo view --json nameWithOwner -q .nameWithOwner when not provided.Supersedes #<old_pr>.scripts/close_superseded_pr.ts <old_pr> <new_pr>
Superseded by #<new_pr>.) and closes the old PR.gh pr view <old_pr> --json state,url
gh pr checks <new_pr>
Closes #<old_pr> when <old_pr> is a pull request.Closes/Fixes only for issues.Supersedes #<old_pr> or Refs #<old_pr> for PR-to-PR linkage.gh pr view <old_pr> returns CLOSED.Use the bundled script for deterministic closure:
scripts/close_superseded_pr.ts