agentleFS
Cloud-PeekCloud-Peek/agent-skills/skills/gh-release-train-merge/SKILL.md

gh-release-train-merge

Skill1 starsChanged 4 months agoApache-2.0View on GitHub

Use when Codex needs to create or maintain a GitHub release/integration branch and draft PR by merging multiple existing PRs into it one at a time, especially when the user requires the original PRs to be commented on, retargeted if needed, merged through GitHub, and recorded as MERGED rather than merely having their commits manually merged into another branch.

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 15 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this workflow for release-train branches such as V0.7.0 where several existing PRs must be integrated into one branch and the original …

    line 10
  2. Distinctive:

    If the user says "lowest to highest", sort by numeric PR number.

    line 21
  3. Distinctive:

    Create the release branch and draft PR when requested:

    line 29
  4. Distinctive:

    create a draft PR from release branch to target base

    line 32
  5. Distinctive:

    Prefer retargeting the original PR to the release branch and merging it via GitHub with the repository's expected merge method.

    line 36
  6. Distinctive:

    If the PR's code was already manually integrated into the release branch and GitHub rejects retargeting because there are no new commits, …

    line 38
  7. Distinctive:

    Add a top-level PR comment explaining that the PR is being merged into the release integration branch and will be recorded as merged.

    line 50
  8. Distinctive:

    If a retargeted PR has real conflicts:

    line 58
  9. Distinctive:

    Stop the sequence at that PR.

    line 59
  10. Distinctive:

    After every PR, or at minimum before reporting done, verify each original PR:

    line 67
  11. Distinctive:

    Run project-required gates after code/conflict changes and after final bookkeeping, for CloudPeek normally:

    line 86
  12. Distinctive:

    Do not claim the originals are merged just because their commits are present on the release branch.

    line 98
  13. Distinctive:

    Do not close PRs manually when the user asked for "closed as merged".

    line 100
  14. Distinctive:

    Do not process out of order when the user requested numeric ordering.

    line 101
  15. Distinctive:

    Do not squash/rebase unless the user or repo policy explicitly calls for it.

    line 102
  16. Distinctive:

    If GitHub says there are no commits between the release branch and PR head, add and push an empty marker commit to the source branch, then …

    line 104

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

GitHub Release Train Merge

Overview

Use this workflow for release-train branches such as V0.7.0 where several existing PRs must be integrated into one branch and the original PR pages must end in GitHub's MERGED state.

The core rule: manual merge commits on the release branch do not make GitHub mark the original PRs as merged. To close originals as merged, merge each original PR through GitHub after its base is the release branch.

Workflow

  1. Resolve the repo, release branch, release PR, target base, PR list, and order. If the user says "lowest to highest", sort by numeric PR number. Process one PR fully before starting the next.
  2. Inspect local state before writes:
    • git status --short --branch
    • current branch and upstream
    • any unrelated dirty files to avoid touching
  3. Create the release branch and draft PR when requested:
    • branch from the requested target base, usually origin/main
    • push the branch
    • create a draft PR from release branch to target base
  4. For each source PR, integrate through the PR object:
    • Fetch/view PR metadata: number, title, base, head branch, head SHA, state.
    • Prefer retargeting the original PR to the release branch and merging it via GitHub with the repository's expected merge method.
    • If the PR's code was already manually integrated into the release branch and GitHub rejects retargeting because there are no new commits, create an empty marker commit on the source branch:

      git fetch origin SOURCE_BRANCH
      git switch --detach origin/SOURCE_BRANCH
      git commit --allow-empty -m "chore: mark PR #NNNN integrated into RELEASE_BRANCH"
      git push origin HEAD:SOURCE_BRANCH
    • Retarget the original PR to the release branch.
    • Add a top-level PR comment explaining that the PR is being merged into the release integration branch and will be recorded as merged.
    • Merge the PR through GitHub, using expected_head_sha when available.
    • Fetch the release branch and fast-forward local checkout to the new remote tip before moving to the next PR.
    • Push immediately after every local commit made for the workflow, including source-branch marker commits and bookkeeping commits.
  5. If a retargeted PR has real conflicts:
    • Stop the sequence at that PR.
    • Resolve conflicts on the PR head branch or a clearly named repair branch, preserving the original PR relationship when possible.
    • Push the conflict-resolution commit, rerun appropriate tests, then merge that PR through GitHub before continuing.

Verification

After every PR, or at minimum before reporting done, verify each original PR:

gh pr view NNNN --repo OWNER/REPO --json number,state,mergedAt,baseRefName,headRefName,mergeCommit,url

Required final state for every source PR:

  • state is MERGED
  • baseRefName is the release branch
  • mergedAt is non-empty

Also verify the release PR:

gh pr view RELEASE_PR --repo OWNER/REPO --json number,state,isDraft,baseRefName,headRefName,mergeable,url
gh pr checks RELEASE_PR --repo OWNER/REPO

Run project-required gates after code/conflict changes and after final bookkeeping, for CloudPeek normally:

bun fmt
bun lint
bun typecheck
git diff --check

Pitfalls

  • Do not claim the originals are merged just because their commits are present on the release branch. Verify the PR objects.
  • Do not close PRs manually when the user asked for "closed as merged".
  • Do not process out of order when the user requested numeric ordering.
  • Do not squash/rebase unless the user or repo policy explicitly calls for it; when the user says "as if merging to main", use the normal GitHub merge path.
  • If GitHub says there are no commits between the release branch and PR head, add and push an empty marker commit to the source branch, then retarget and merge through GitHub.

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.