About ds-watch-pr
ds-watch-pr is a skill for monitoring one pull request until checks and review conditions are met. It uses a Python watcher with configurable wait conditions and provides a process for handling failures, comments, and branch updates.
Key features
- 01Watch PR checks, comments, and reviews
- 02Wait for readiness or green checks
- 03Handle new failures and review findings
- 04Rebase when the branch falls behind
- 05Use a Python watcher with configurable options
Use cases
- 01Track a PR while checks are running
- 02Respond to new review comments or failed checks
- 03Confirm a branch is current before reporting readiness
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ aicodeking/ deepseek-stack --skill ds-watch-prAfter installing, type/ds-watch-prin Claude Code to confirm it loaded.
Bundled filesscripts/watch_pr.py
Details
From the project READMEKeep one PR moving until it is green and reviewed, with as little noise as possible.
The watcher is scripts/watch_pr.py in this skill's folder. Call it by absolute path. It needs python3 and a logged-in gh.
python3 <skill>/scripts/watch_pr.py <pr> [--repo owner/name] [--until ready|green|any] [--interval 30] [--max-minutes 60]
It prints one line per new check failure, finished check run, comment or review, then a final stop: line. Exit 0 means the condition is met or the PR merged. Exit 1 means you must act. Exit 2 means bad input. ready waits for green checks, a mergeable branch and no change request. green waits for checks only.
Steps
- Handle what already exists: failed checks and comments newer than the last push.
- Start the watcher. Run it in the harness's background or monitor tool if it has one, so each line wakes you. Otherwise run it as one long foreground command.
- On each event, read the source before you change code. Decide if the finding is real.
- For a real bug or CI failure: make the smallest fix, run the failing check locally, push, then restart the watcher.
- For a false positive or out-of-scope request: reply with a short reason through
ds-pr-comments, resolve the thread and list it as a follow-up. - Tell real test failures apart from infrastructure flakes. Re-run a flake once before you call it a flake.
- If the base branch moved or the branch is behind, rebase, push with
--force-with-leaseand restart. - Before you call the PR ready,
git fetchand read the PR again. It must not be BEHIND or DIRTY.
Stop when
- The watcher exits 0. Report the PR as ready, or merged.
- Five fix-and-push cycles pass without exit 0. Report what still fails.
- Another PR makes this one obsolete. Stop and ask before closing it.
ghreports a rate limit. Checkgh api rate_limitand wait for the reset once. Do not loop.
Rules
- One watcher per PR. Never write your own sleep or polling loop.
- When an event needs no action, say nothing. No "still waiting" messages.
- Merge only if the user asked for it. Otherwise report ready.
- Keep the PR small. Prefer fixes that delete or narrow code.