PR Watch — status-driven routing

VerifiedCaution

Watches a PR's live status and routes to the appropriate next action (merge, fix-loop, block, cleanup) based on a deterministic table.

Sby Skills Guide Bot
DevelopmentIntermediate
7/24/2026
Claude Code
#pr-watch#pull-request#ci#auto-respond#routing

Recommended for

Automated summary

Watches a pull request and automatically routes to the next step (merge, fix loop, wait, cleanup) based on CI status and comments.

Strengths

  • Automates PR monitoring without manual intervention
  • Deterministic routing based on six precise statuses
  • Integrates with other Divecode tools (push, merge, cleanup)
  • Logs each watch cycle for traceability

Limitations

  • Requires the PR to have been created by /divecode-push-pr first
  • Does not handle complex merge conflicts
  • Depends on the gh CLI and GitHub API
When to use it

After pushing a PR and before automatically merging it when conditions are met.

When not to use it

For a manual PR or outside the Divecode flow, or if you prefer human oversight at every step.

Security analysis

Caution
Quality score85/100

The skill delegates to an external binary that interacts with GitHub via `gh`, which could be a risk if the binary is compromised or misused. No destructive actions are instructed, but the binary’s behaviour is not controlled within the skill.

Findings
  • •Relies on external binary `divecode-pr-watch` without integrity verification
  • •Uses Bash and network access (gh) which may expose credentials or tokens
How this analysis is made

Examples

Watch current PR and auto-route
divecode pr-watch
Poll PR status and decide next action
watch pr
Check PR and route according to status
poll pr

name: divecode-pr-watch description: | Watch a PR — auto-respond to comments and CI failures. Uses bin/divecode-pr-watch which polls via gh and emits a routing decision (status + route). 6-status / 7-route routing per agent-flow: green→merge, has_comments→fix-loop, ci_failed→fix-loop, pending→block, closed→block, merged→cleanup, error→block. Use after /divecode-push-pr, before /divecode-merge. triggers:

  • divecode pr-watch
  • watch pr
  • poll pr allowed-tools:
  • Bash
  • Read
  • Write

divecode-pr-watch — status-driven routing

You are running divecode-pr-watch. Read the PR's live status, decide the next route per agent-flow's 6-status contract.

Iron Laws

  1. Status is computed, not assumed. Always actually fetch the PR.
  2. One status → one route. No "maybe try X then Y" — the routing table is deterministic.
  3. Block ≠ fail. Pending CI is not a failure; just don't merge yet.
  4. Closed (not merged) requires user input. Never auto-cleanup a closed-without-merge PR.

Preamble

PROJ_DIR="${DIVECODE_PROJECT_DIR:-$PWD}"
DIVECODE_HOME="${DIVECODE_HOME:-$HOME/.divecode}"
[ -x "$DIVECODE_HOME/bin/divecode-pr-watch" ] || DIVECODE_HOME="$HOME/Trappist/divecode"

# Find PR number from push-pr.md
PR=$(grep -E '^url:' "$PROJ_DIR/divecode/push-pr.md" 2>/dev/null | head -1 | grep -oE '/pull/[0-9]+' | grep -oE '[0-9]+')
[ -z "$PR" ] && { echo "could not find PR in divecode/push-pr.md"; exit 1; }
echo "PR: $PR"

Workflow

Step 1 — Fetch + route

bash "$DIVECODE_HOME/bin/divecode-pr-watch" "$PR" > "$PROJ_DIR/divecode/pr-watch.md"
cat "$PROJ_DIR/divecode/pr-watch.md"

Routing table (matches agent-flow exactly):

| status | route | action | |---|---|---| | green | merge | invoke /divecode-merge | | has_comments | fix-loop | invoke /divecode-fix-loop with PR comments converted into must-fix items | | ci_failed | fix-loop | invoke /divecode-fix-loop; reproduce the failure locally, fix, push | | pending | block | sleep / wait — re-invoke pr-watch after ~5min | | closed (not merged) | block | ask user before proceeding | | merged | cleanup | invoke /divecode-cleanup | | error | block | surface error; do not retry until user input |

Step 2 — Branch per route

Per the table. For pending, suggest the user re-invoke later or set a timer.

Step 3 — Append round entry to pr-watch.md

Each poll/action is recorded:

## Round <N> — <date>
status: <s>
route:  <r>
action: <what was done>

Done criteria

  • pr-watch.md shows latest status
  • Next skill invoked (or user prompted for pending/closed)

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/pr-watch-status-driven-routing-mryiqgno/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/pr-watch-status-driven-routing-mryiqgno' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/pr-watch-status-driven-routing-mryiqgno/download' --output '.skill-downloads/pr-watch-status-driven-routing-mryiqgno/SKILL.md.part' && mv '.skill-downloads/pr-watch-status-driven-routing-mryiqgno/SKILL.md.part' '.skill-downloads/pr-watch-status-driven-routing-mryiqgno/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/pr-watch-status-driven-routing-mryiqgno/SKILL.md' && test -s '.skill-downloads/pr-watch-status-driven-routing-mryiqgno/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/divecode-pr-watch' && cp -R '.skill-downloads/pr-watch-status-driven-routing-mryiqgno' '.claude/skills/divecode-pr-watch'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/pr-watch-status-driven-routing-mryiqgno'

openskills read 'pr-watch-status-driven-routing-mryiqgno'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/pr-watch-status-driven-routing-mryiqgno/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills