agentleFS
its-everdredits-everdred/skills/reopen-pr/SKILL.md

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.

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
  1. Very specific:

    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 …

    line 10
  2. Distinctive:

    Use this after a source PR has been reviewed and explicitly approved for promotion to a target repository.

    line 14
  3. Distinctive:

    Run from a clean checkout of the target repository.

    line 20
  4. Very specific:

    Run for real by dropping --dry-run:

    line 36
  5. Distinctive:

    Run one PR at a time. The script changes branches in the target checkout.

    line 52
  6. Distinctive:

    If a cherry-pick conflicts, the script aborts the cherry-pick, deletes the new branch, and returns to the original branch.

    line 53
  7. Distinctive:

    Always dry-run after changing the source PR, because the exact PR commit list may have changed.

    line 54

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 status shows the account that should author and push the target PR.
  • jq, gh, and git are available.
  • Run from a clean checkout of the target repository.
  • The target checkout's origin remote points at the target repository.
  • Record the current branch before running; the script leaves the checkout on the new branch after success.

Procedure

  1. 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
  2. Confirm the dry-run lists only commits that belong to the source PR.
  3. 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.
  4. Run for real by dropping --dry-run:

    /path/to/reopen.sh <source-pr-url> <target-owner/target-repo> --title --target-issue <issue-number>
  5. Inspect the new PR body. If --target-issue was 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.
  6. Record the source PR, target issue, and new target PR mapping wherever the project tracks promotion status, outside the target PR body or comments.
  7. Return the target checkout to the previous branch if needed.

Gotchas

  • The script validates that the checkout's origin appears 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-issue rewrites common closing/reference phrases such as Closes #123, Fixes owner/repo#123, Resolves https://github.com/owner/repo/issues/123, and Refs https://github.com/owner/repo/pull/123. It does not rewrite every issue-like string in the body.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.