watch-pr-mr
Skill1 starsChanged 4 months agoMITView on GitHub
Wait on a pull or merge request's CI, review bots, and reviews, and act on what arrives. Use when asked to watch, monitor, or babysit a PR/MR on GitHub, GitLab, or Forgejo.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architecture-reviewSkill
- blast-radiusSkill
- codebase-designSkill
- code-reviewSkill
- councilSkill
- creating-a-pr-mrSkill
- diagram-designSkill
- docxSkill
- domain-modelingSkill
- drive-to-readySkill
- engineering-principlesSkill
- forgejo-cliSkill
- frontend-designSkill
- git-conventional-commitsSkill
- git-working-agreementSkill
- glab-cliSkill
- grillingSkill
- json-canvasSkill
- leaving-pr-mr-commentsSkill
- obsidian-basesSkill
- obsidian-cliSkill
- obsidian-markdownSkill
- openspec-workflowSkill
- pdfSkill
- pptxSkill
- prototypeSkill
- sharpenSkill
- skill-minerSkill
- technical-writingSkill
- unslopSkill
- whySkill
- writing-for-agentsSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Run scripts/pr-mr-watch from this skill's directory by its absolute path.
- Very specific: line 20
Run pr-mr-watch snapshot [REF] first.
- Distinctive: line 73
Verify every finding against the source before you change code.
- Distinctive: line 76
Keep the PR/MR at the size its goal needs.
- Very specific: line 85
When the branch is behind or conflicts, rebase it onto its base branch as the git-working-agreement skill describes.
- Distinctive: line 88
If an overlapping PR/MR makes this one obsolete, stop watching and ask the user before closing it.
- Very specific: line 93
Stop when wait exits 0 for the condition you need, or when the calling skill's gate passes.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Watch a PR/MR
Run scripts/pr-mr-watch from this skill's directory by its absolute path. It
needs Python 3 and the host's CLI with a working login: gh for GitHub, glab
for GitLab, and fgj for Forgejo, whose reference also uses fj. It detects
the host from a PR/MR URL or the origin remote. For commands the script does
not cover, such as marking a
PR/MR ready, turning off auto-merge, requesting a review, replying to or
resolving a thread, and rerunning a job, read the host reference:
GitHub, GitLab, or
Forgejo.
Read the state
Run pr-mr-watch snapshot [REF] first. REF is a number or URL; without it the
script uses the open PR/MR of the current branch. The JSON has the same fields
on every host. Its gate sorts what stands between the PR/MR and merging by
who has to act:
blockersare yours: failing checks, conflicts, a branch behind its base, review threads awaiting your reply, and host-specific merge blocks.pendingclears on its own: running or unreported required checks, requested bot reviews, and host-side merge checks.humanneeds a person: a missing approval or requested changes.
gate.verdict is blocked, pending, waiting-for-review (only human is
left), or ready. It ignores the draft flag, which gate.draft reports.
items lists comments, reviews, and thread comments with their author, URL,
and thread handle. Handle the existing blockers and unanswered items before
you wait.
Wait
pr-mr-watch wait [REF] [--until ready|green|any-change] [--timeout 3000] [--settle 120]ready(default): wait until the verdict isreadyorwaiting-for-review. Use it to babysit. It never exits 0 within--settleseconds of starting, so the reviews and workflows that a push or the ready flip starts can register first.green: wait for checks only. Required checks count when the host reports them, otherwise all checks. Conflicts and closing still exit 1.any-change: return 0 on the first event, whatever it is.
The script prints one line per event and exits at the first event that needs
you, so it works as a background command that notifies on completion or as
one long foreground command. Set the harness timeout above --timeout.
| Exit | Meaning |
| 0 | The condition holds, or the PR/MR merged. |
| 1 | You must act: a check failed, conflicts, the PR/MR closed, or the host stayed unreachable. With ready, also a gate blocker or a new comment or review from someone else. |
| 2 | Bad arguments, an unknown PR/MR, or another watcher already holds this PR/MR. |
| 3 | The timeout elapsed. |
Watch each PR/MR with this script only, one watcher at a time; it refuses a
second one. Start it again after each push, after you handle an exit 1, after
an exit 3, and after a resume. It remembers what it reported, so nothing that
arrived in between is lost. When an event needs no action, start it again
without posting or saying that you are still waiting. After two timeouts in a
row with the same pending item, stop waiting: find out why it does not
clear, and report it as a blocker.
Act on events
- Act only on checks and comments newer than the latest push.
- Verify every finding against the source before you change code. Fix real findings and failures in the intended case, preferring the fix that deletes or narrows code. Prove each fix before you push it.
- Keep the PR/MR at the size its goal needs. Review loops grow a change one cheap fix at a time. Decline unneeded tests, guards for edge cases that do not matter, extra compatibility, and small performance costs with a written reason, and list them as follow-ups.
- Tell repository failures from infrastructure flakes. Rerun a failed job only when the task covers it; otherwise report the flake.
- Answer every finding you fix or dismiss with the
leaving-pr-mr-commentsskill, in its thread when it has one. Resolve the thread after the reply posts, where the host allows it. - When the branch is behind or conflicts, rebase it onto its base branch as
the
git-working-agreementskill describes. Push with--force-with-lease, to this task's own branch only, when the task authorizes pushing. - If an overlapping PR/MR makes this one obsolete, stop watching and ask the user before closing it.
Stop
Stop when wait exits 0 for the condition you need, or when the calling
skill's gate passes. Merge only when the user explicitly asked for it. Report
the PR/MR link, the gate verdict, what you fixed, what you declined and why,
and what still waits on others.
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.

