agentleFS
oktawianwybieralskioktawianwybieralski/coagent8/.agents/skills/pr-merge/SKILL.md

pr-merge

Skill2 starsChanged 11 days agoMITView on GitHub

Merge pull requests that the owner lists explicitly into develop of this repository. Use when the owner says "merge #15, #16" or similar. Rebases each PR onto develop, checks the commits, waits for the six CI jobs and squash-merges with a message that follows rule 12. Not for reviewing, fixing or creating pull requests, and not for release PRs.

  • Deletes or force-pushes
  • Commits and pushes

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 4 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

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

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

    Run each command as its own terminal call.

    line 18
  2. Very specific:

    Never open an editor: continue a rebase with git -c core.editor=true rebase --continue.

    line 25
  3. Very specific:

    Never use git stash, git worktree, git merge, git reset, git rebase --skip or git rebase --abort.

    line 27
  4. Very specific:

    Never push to develop. Push only a listed PR's branch, with a lease bound to the commit you observed (step 7).

    line 30
  5. Distinctive:

    Never add AI attribution (Co-Authored-By, "Generated with") anywhere.

    line 32
  6. Very specific:

    Stop unless state is OPEN, baseRefName is develop and isCrossRepository is false (the branch lives in this repository).

    line 48
  7. Very specific:

    Stop if headRefName starts with release/: a release PR is merged by the owner per rule 12 section 5, and its changelog needs --tag.

    line 50
  8. Very specific:

    Stop unless the body's Verification section records an independent review with verdict READY in the format of core rule 03.

    line 52
  9. Distinctive:

    Stop if the PR has an open review finding or unresolved conversation: rebasing is allowed only after the review is complete (rule 12 …

    line 56
  10. Very specific:

    If mergeStateStatus is CLEAN, go to step 8.

    line 62
  11. Distinctive:

    Update the branch (each must succeed):

    line 63
  12. Very specific:

    run the CoAgent8 review tool with scope origin/develop...<branch> and that reviewer's backend (model as the owner named, else the default).

    line 110
  13. Very specific:

    update the PR body's Verification section with gh pr edit N --body-file <file>: mark the old review line superseded and add the new one in …

    line 117
  14. Distinctive:

    Write the squash message body (rule 12 section 2) to a file outside the repository, for example in the system temp directory:

    line 124
  15. Very specific:

    Wait for the CI run of that merge commit: run gh run list --workflow CI --commit <mergeCommit.oid> every two minutes until it lists a …

    line 137

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “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

Merge pull requests into develop

Merging is an owner action (rule 12): run this only when the owner lists the PR numbers in the request, and merge only those, one at a time, in the order given (ascending if no order was given). Never touch any other PR. The owner's list also authorizes rebasing and force-pushing the listed PRs' branches; it covers nothing else. The standing go-ahead of 2026-11-02 in project.md counts as such a list for the agent's own clean topic PRs; it does not cover force-pushing.

How to run commands

  • Run each command as its own terminal call. Do not chain with && or ;, and do not use command substitution.
  • Any command that fails or prints something this file does not expect: stop and report the command and its output. Do not improvise a fix. Two non-zero exits are expected: git rebase and rebase --continue stopping on a conflict (handled in step 5), and gh pr checks exiting with 8 while checks are pending (step 8).
  • Never open an editor: continue a rebase with git -c core.editor=true rebase --continue.
  • Never use git stash, git worktree, git merge, git reset, git rebase --skip or git rebase --abort. Merge commits break npm run changelog:check; branches are updated by rebase only.
  • Never push to develop. Push only a listed PR's branch, with a lease bound to the commit you observed (step 7).
  • Never add AI attribution (Co-Authored-By, "Generated with") anywhere.

Before the first PR

  1. git status --short must be empty. If it is not, stop and report: the files belong to someone else.
  2. Note the current branch (git branch --show-current) for the report.
  3. git fetch origin, then git rev-parse origin/develop gives the current develop commit; gh run list --workflow CI --commit <that SHA> must list a finished run with conclusion success. If it is red or missing, stop: rule 12 allows no further merge until a fix restores green CI.

For each PR number N

  1. Read the PR: gh pr view N --json state,title,body,headRefName,headRefOid,baseRefName,isCrossRepository,mergeStateStatus
    • Stop unless state is OPEN, baseRefName is develop and isCrossRepository is false (the branch lives in this repository).
    • Stop if headRefName starts with release/: a release PR is merged by the owner per rule 12 section 5, and its changelog needs --tag.
    • Stop unless the body's Verification section records an independent review with verdict READY in the format of core rule 03. If its reviewed head differs from headRefOid, step 9 reviews the head again.
    • Stop if the PR has an open review finding or unresolved conversation: rebasing is allowed only after the review is complete (rule 12 section 3, "Review and merge").
    • Remember title, body, headRefName (the branch) and headRefOid (the observed head).
  2. gh pr checks N: stop if any job failed; never rerun jobs.
  3. If mergeStateStatus is CLEAN, go to step 8.
  4. Update the branch (each must succeed):
    • git fetch origin
    • git checkout <branch>
    • git pull --ff-only
    • git rev-parse HEAD must equal headRefOid; otherwise stop (someone else changed the branch, or the local copy has unpushed commits).
    • git rebase origin/develop
  5. Rebase conflicts. git status --short lists them; for each conflicted file:
    • CHANGELOG.md: a topic branch must not change it (rule 12 section 6); stop and report.
    • docs/ROADMAP.md: run git show REBASE_HEAD -- docs/ROADMAP.md to see the exact edit of the commit being replayed. Keep the <<<<<<< HEAD side whole and apply to it exactly that edit (typically an issue link or a status line). Remove all conflict markers and check that none remain, then git add docs/ROADMAP.md. Stop if the edit does not apply cleanly to the HEAD side (both sides changed the same lines), or if you are unsure.
    • Any other file: stop and report the file names. Do not resolve code or test conflicts: they need a new review.
    • Then git -c core.editor=true rebase --continue; repeat until the rebase finishes.
  6. Checks (each must exit 0):
    • git diff --name-only origin/develop -- CHANGELOG.md must print nothing: only a release PR changes the changelog; otherwise stop and report.
    • npm run changelog:check -- --with-commit "<title>"
    • npm run typecheck
    • For each test file the PR changes (git diff --name-only origin/develop -- tests), node tests/run.cjs <file>, which must report fail 0.
  7. git rev-parse HEAD gives the new local head. Push with git push --force-with-lease=<branch>:<headRefOid> --force-if-includes origin <branch> (rule 12 section 1), then gh pr view N --json headRefOid must equal the new local head (otherwise stop: someone else pushed). From now on headRefOid is that SHA.
  8. CI on the current head: gh pr view N --json headRefOid must still equal headRefOid; run gh pr checks N every two minutes until no job is pending. Exactly six jobs must be listed and all must be pass, also when step 3 skipped the update. On a failure, stop and report the last 60 lines of gh run view <run id> --log-failed; never rerun jobs.
  9. Independent review of the current head (core rule 03, rule 13). A rebase or new commit supersedes earlier review evidence. Reuse the review recorded in the PR body only if it names head headRefOid, scope <base>...<head> with base equal to git merge-base origin/develop <headRefOid> (the whole PR, not one commit), coverage COMPLETE and 0 unresolved P1/P2, for every required reviewer in project.md (Codex and agy). Otherwise, for each required reviewer without such a review:
    • git fetch origin, git checkout <branch>, git pull --ff-only; git rev-parse HEAD must equal headRefOid;
    • run the CoAgent8 review tool with scope origin/develop...<branch> and that reviewer's backend (model as the owner named, else the default);
    • require VERDICT: READY and COVERAGE: COMPLETE; on BLOCKED, stop and report the findings (do not fix them: that is the Author's work);
    • afterwards git rev-parse HEAD and gh pr view N --json headRefOid must both still equal headRefOid, else the review covered another snapshot: stop;
    • update the PR body's Verification section with gh pr edit N --body-file <file>: mark the old review line superseded and add the new one in the core rule 03 format (verdict, head, base, scope, coverage, unresolved P1/P2, session handle as evidence). Change nothing else in the body.
  10. gh pr view N --json mergeStateStatus must be CLEAN; if it is BEHIND again, go back to step 4. CLEAN also means that the ruleset's conditions (resolved conversations, required checks) hold.
  11. Write the squash message body (rule 12 section 2) to a file outside the repository, for example in the system temp directory:
    • the text of the PR body's ## Summary section (why the change is needed and what behavior changes), wrapped at 72 characters;
    • a blank line, then one footer per line, collected from the whole PR body: Fixes #123, Refs #123, Refs: <roadmap card> and every BREAKING CHANGE: footer;
    • nothing else: no Verification table, checklist, file list or AI attribution. Stop if the Summary is missing or a footer is ambiguous.
  12. gh pr merge N --squash --match-head-commit <headRefOid> --subject "<title> (#N)" --body-file <file>. The repository deletes the merged branch itself.
  13. gh pr view N --json state,mergeCommit: state must be MERGED; remember mergeCommit.oid. Delete the message file.
  14. Wait for the CI run of that merge commit: run gh run list --workflow CI --commit <mergeCommit.oid> every two minutes until it lists a finished run, and require conclusion success before the next PR. If it is red, stop the batch and report: the cause is found and fixed in a new PR before anything else is merged.

Report

A table: PR, title, conflicts and how they were resolved, local checks (PASS/FAIL with the command), CI result, merged yes/no, develop CI after the merge. Name every step that was skipped and why, and the branch noted at the start.

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.