reopen-pr
Skill2 starsChanged 21 days agoMITView on GitHub
Replay a source pull request's exact GitHub PR commits onto a fresh branch in another repository, then open a draft pull request there with the current gh-authenticated user.
In this repository15 other files it gives its agents.
- global/CLAUDE.mdCLAUDE.md
- black-octoberSkill
- branch-cascadeSkill
- build-orderSkill
- full-review-auditSkill
- meta-improveSkill
- newSkill
- pr-monitorSkill
- publish-mobile-appSkill
- remindSkill
- research-spikeSkill
- setup-switch-loginSkill
- skill-syncSkill
- splice-youtube-quotesSkill
- switch-loginSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
When given --target-issue N, the script also prefixes the branch with N and rewrites common closing/reference issue links in the PR body to …
- Distinctive: line 14
Use this after a source PR has been reviewed and explicitly approved for promotion to a target repository.
- Distinctive: line 20
Run from a clean checkout of the target repository.
- Very specific: line 36
Run for real by dropping --dry-run:
- Distinctive: line 52
Run one PR at a time. The script changes branches in the target checkout.
- Distinctive: line 53
If a cherry-pick conflicts, the script aborts the cherry-pick, deletes the new branch, and returns to the original branch.
- Distinctive: line 54
Always dry-run after changing the source PR, because the exact PR commit list may have changed.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reopen PR
Promote a reviewed pull request from one repository into a new draft pull request on another repository. The bundled reopen.sh script reads the source PR metadata, fetches only the exact commits GitHub reports for that PR, cherry-picks them onto the target repository's origin/main, pushes a new branch, and opens a draft PR against the target repository's main with a sanitized copy of the source body.
When given --target-issue N, the script also prefixes the branch with N and rewrites common closing/reference issue links in the PR body to #N.
When to use
Use this after a source PR has been reviewed and explicitly approved for promotion to a target repository. Do not reopen unreviewed or unsigned-off PRs.
Preconditions
gh auth statusshows the account that should author and push the target PR.jq,gh, andgitare available.- Run from a clean checkout of the target repository.
- The target checkout's
originremote points at the target repository. - Record the current branch before running; the script leaves the checkout on the new branch after success.
Procedure
Dry-run first to preview the new branch name and exact commits:
/path/to/reopen.sh <source-pr-url> <target-owner/target-repo> --title --target-issue <issue-number> --dry-run- Confirm the dry-run lists only commits that belong to the source PR.
- Confirm any target issue references before opening the PR. Source and target repositories may have different issue numbers. Pass the target issue as
--target-issue <issue-number>when the new PR should reference a target issue. Run for real by dropping
--dry-run:/path/to/reopen.sh <source-pr-url> <target-owner/target-repo> --title --target-issue <issue-number>- Inspect the new PR body. If
--target-issuewas used, common closing/reference issue links should already point at the target issue. Exact source PR backlinks should be stripped so the target PR does not mention the source PR. - Record the source PR, target issue, and new target PR mapping wherever the project tracks promotion status, outside the target PR body or comments.
- Return the target checkout to the previous branch if needed.
Gotchas
- The script validates that the checkout's
originappears to match the requested target repository. If it does not, it prompts before continuing. - The new PR is a draft by design.
- Run one PR at a time. The script changes branches in the target checkout.
- If a cherry-pick conflicts, the script aborts the cherry-pick, deletes the new branch, and returns to the original branch.
- Always dry-run after changing the source PR, because the exact PR commit list may have changed.
--target-issuerewrites common closing/reference phrases such asCloses #123,Fixes owner/repo#123,Resolves https://github.com/owner/repo/issues/123, andRefs https://github.com/owner/repo/pull/123. It does not rewrite every issue-like string in the body.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

