monitor-prlisted
Install: claude install-skill sageox/ox
# monitor-pr
Drives a pull request to green by **streaming** its state through the
`Monitor` tool and reacting the moment a check fails or a new review
comment lands. Designed for CodeRabbit-reviewed PRs but works for human
reviewers too.
## Architecture: use the `Monitor` tool, not a sleep loop
**This is load-bearing — do not substitute a Bash `sleep` loop.** A loop
in a single `Bash` call blocks the agent until it exits, so the agent
can't react to events concurrently and misses interleaved work.
`Monitor` streams each stdout line as a notification into the
conversation, so the agent keeps full agency between events.
Start exactly one monitor at the top of the task with:
- `persistent: true` — PR reviews can take hours; don't let a timeout
kill the watch mid-review.
- `description` — specific, e.g. `"PR #493 state changes"`, because it
appears in every notification.
- The polling script below as `command`.
Stop the monitor with `TaskStop` only when the exit condition is met or
the user cancels.
## The polling script
Resolve PR metadata first (once, before starting the monitor):
```bash
gh pr view --json number,url,headRepository,headRepositoryOwner,baseRepository
```
Then start the `Monitor` with this command (substitute `PR`, `OWNER`,
`REPO`). It emits **one line only when state changes** — a quiet PR
produces zero events, an eventful PR produces one event per transition.
```bash
PR=<number>; OWNER=<owner>; REPO=<repo>
last=""
while true; do
checks=$(gh pr