Remix supersede-pr
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.
install
source · Clone the upstream repo
git clone https://github.com/remix-run/remix
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/remix-run/remix "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.agents/skills/supersede-pr" ~/.claude/skills/remix-run-remix-supersede-pr && rm -rf "$T"
manifest:
.agents/skills/supersede-pr/SKILL.mdsource content
Supersede PR
Overview
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.
Workflow
- Identify PR numbers and target repo.
- Capture
(the superseded PR) andold_pr
(the replacement PR).new_pr - Resolve the repo with
when not provided.gh repo view --json nameWithOwner -q .nameWithOwner
- Create or update the replacement PR first.
- Open/push the replacement branch.
- Open the new PR.
- Include a traceable link in the PR body such as
.Supersedes #<old_pr>
- Close the superseded PR explicitly.
- Run:
scripts/close_superseded_pr.ts <old_pr> <new_pr>
- This adds a comment (
) and closes the old PR.Superseded by #<new_pr>.
- Verify states.
- Confirm the superseded PR is closed:
gh pr view <old_pr> --json state,url
- Confirm the replacement PR status/checks:
gh pr checks <new_pr>
Rules
- Do not use
whenCloses #<old_pr>
is a pull request.<old_pr>
- Use
only for issues.Closes/Fixes - Use
orSupersedes #<old_pr>
for PR-to-PR linkage.Refs #<old_pr>
- Prefer explicit closure over implied automation.
- Always run the close command when the user asks to supersede a PR.
- Treat closure as incomplete until
returnsgh pr view <old_pr>
.CLOSED
Script
Use the bundled script for deterministic closure:
scripts/close_superseded_pr.ts