Do github pr sentinel
Skill d-oit/do-web-doc-resolver/.agents/skills/do-github-pr-sentinel
LLM-ready web documentation resolver: Python cascade skill + web + Rust CLI (wdr) with semantic cache, multi-provider routing, and quality synthesis
npx -y skills add d-oit/do-web-doc-resolver --skill do-github-pr-sentinelAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Monitor a GitHub pull request until it's merged, green, or blocked. Polls CI checks, review comments, and mergeability state continuously. Diagnoses failures, retries flaky checks up to 3 times, auto-fixes branch-related issues when possible, and stops only when user help is required. Use when asked to "monitor a PR", "watch CI", "handle review comments", "sentinel a PR", or keep an eye on failures and feedback.
SKILL.md
9.3 KB, as published. Nobody here has run it
PR Sentinel
Monitor a GitHub pull request persistently until one of these terminal outcomes occurs.
Terminal Outcomes (stop when any is true)
- PR merged or closed — stop immediately on confirmation.
- PR ready to merge — CI green, no unaddressed review comments, not blocked on required review approval, no merge conflict risk.
- User help required — CI infrastructure issues, exhausted flaky retries (3 cycles), permission problems, or ambiguous situations that cannot be resolved safely.
Do not stop merely because a snapshot returns idle while checks are still pending.
Inputs
Accept any of:
- No argument: infer PR from current branch (
--pr auto) - PR number
- PR URL
Core Workflow
- When asked to "monitor"/"watch"/"babysit" a PR, start with
--watch(continuous mode) unless doing a one-shot diagnostic. - Run the watcher script to snapshot PR/CI/review state.
- Inspect the
actionslist in the JSON response. - If
diagnose_ci_failureis present, inspect failed run logs and classify the failure. - If branch-related: patch code locally, commit, and push.
- If
process_review_commentis present, inspect surfaced review items and decide whether to address them. - If a review item is actionable and correct, patch code locally, commit, and push.
- If likely flaky/unrelated and
retry_failed_checksis present, rerun failed jobs with--retry-failed-now. - If both actionable review feedback and
retry_failed_checksare present, prioritize review feedback first — a new commit retriggers CI, so avoid rerunning flaky checks on the old SHA. - On every loop, verify mergeability / merge-conflict status (e.g. via
gh pr view). - After any push or rerun, immediately return to step 1 and continue polling on the updated SHA.
- If you paused
--watchto patch/commit/push, relaunch--watchyourself in the same turn after the push. - Repeat polling until the PR is green + review-clean + mergeable,
stop_pr_closedappears, or a user-help-required blocker is reached. - Keep consuming watcher output in the same turn while babysitting is active — do not end the turn with a detached
--watchprocess.
Commands
One-shot snapshot
python3 .agents/skills/do-github-pr-sentinel/scripts/gh_pr_watch.py --pr auto --once
Continuous watch (JSONL)
python3 .agents/skills/do-github-pr-sentinel/scripts/gh_pr_watch.py --pr auto --watch
Trigger flaky retry cycle
python3 .agents/skills/do-github-pr-sentinel/scripts/gh_pr_watch.py --pr auto --retry-failed-now
Explicit PR target
python3 .agents/skills/do-github-pr-sentinel/scripts/gh_pr_watch.py --pr <number-or-url> --once
CI Failure Classification
Use gh commands to inspect failed runs before deciding to rerun:
gh run view <run-id> --json jobs,name,workflowName,conclusion,status,url,headSha
gh run view <run-id> --log-failed
Branch-related — logs point to changed code (compile/test/lint/typecheck in touched areas):
- Patch code locally, commit with conventional format, push.
Flaky/unrelated — transient infra issues (timeouts, runner failures, registry outages, rate limits):
- Rerun failed jobs.
Ambiguous — do one manual diagnosis attempt before choosing rerun.
See references/heuristics.md for the full checklist.
Review Comment Handling
The watcher surfaces review items from:
- PR issue comments
- Inline review comments
- Review submissions (COMMENT / APPROVED / CHANGES_REQUESTED)
It surfaces feedback from trusted human reviewers (repo OWNER/MEMBER/COLLABORATOR + authenticated operator) and approved review bots.
On a fresh state file, existing pending review feedback is surfaced immediately (not only new comments after monitoring starts).
When a comment is actionable and correct
- Patch code locally.
- Commit:
fix: address PR review feedback (#<n>) - Push to the PR head branch.
- Resume watching on the new SHA immediately — do not stop after reporting the push.
- If monitoring was in
--watchmode, restart--watchimmediately after the push.
When a comment is non-actionable
- Already resolved in GitHub → safely ignore.
- Ambiguous → record as handled, continue polling.
- Conflicts with user intent → stop and ask.
Git Safety Rules
- Work only on the PR head branch.
- Avoid destructive git commands.
- Do not switch branches unless necessary to recover context.
- Before editing, check for unrelated uncommitted changes. If present, stop and ask the user.
- After each fix, commit and
git push, then re-run the watcher. - If you interrupted
--watchto fix, restart--watchimmediately after the push. - Do not run multiple concurrent
--watchprocesses for the same PR. - A push is not a terminal outcome — continue monitoring unless a strict stop condition is met.
- Git failure recovery: If any git command fails, follow the retry sequence in AGENTS.md § Agent Guidance: stash → abort rebase → abort merge → fetch main → retry. Never retry more than 3 times.
- Before CI fixes: Always run
gh run list --limit 5 --json conclusion,headBranch,workflowNameto diagnose the latest failing runs. Fix the simplest failure first, commit, push, and wait for green before moving to the next. See AGENTS.md § CI Fix Workflow.
Commit message format
fix: fix CI failure on PR #<n>fix: address PR review feedback (#<n>)
Monitoring Loop Pattern
- Run
--once. - Read
actions. - Check if PR is merged/closed — if so, report terminal state and stop.
- Check CI summary, new review items, mergeability/conflict status.
- Diagnose CI failures; classify branch-related vs flaky.
- Process actionable review comments before flaky reruns when both are present.
- Retry failed checks only when
retry_failed_checksis present and you are not about to replace the current SHA. - If you pushed a commit or triggered a rerun, report briefly and continue polling.
- After a review-fix push, proactively restart
--watchin the same turn. - If everything is passing, mergeable, no unaddressed reviews, and not blocked on approval — report success and stop.
- If blocked on user-help issue — report the blocker and stop.
- Otherwise sleep per polling cadence and repeat.
Preferring --watch
When the user asks to monitor/watch/babysit a PR, use --watch for autonomous polling. Use --once only for debugging or one-shot checks.
Do not stop to ask whether to continue — poll autonomously until a strict stop condition or explicit user interruption.
Polling Cadence (Adaptive)
- CI not green: poll every 1 minute.
- CI green: start at 1 min, back off exponentially on no change (1m → 2m → 4m → 8m → 16m → 32m), cap at 1 hour.
- Reset to 1 min whenever anything changes (new SHA, check status change, new review, mergeability change).
- CI regresses (new commit, rerun failure): return to 1-minute polling.
- PR merged/closed: stop immediately.
Stop Conditions (Strict)
Stop only when:
| Condition | Action |
|---|---|
| PR merged or closed | Stop immediately |
| PR ready to merge (green + review-clean + mergeable) | Report success, stop |
| User intervention required (infra outage, exhausted retries, permissions) | Report blocker, stop |
Keep polling when:
actionscontains onlyidlebut checks are still pending.- CI is still running/queued.
- Review state is quiet but CI is not terminal.
- CI is green but mergeability is unknown/pending.
- CI is green and mergeable but waiting on review approval.
- CI is green but merge-conflict risk may change.
Output Expectations
During monitoring
- Concise progress updates on status changes only.
- Occasional heartbeat during long unchanged periods.
- Push confirmations, intermediate CI snapshots, and review-action updates are progress only — not final.
CI green celebration
One-time when CI first transitions to all green:
🚀 CI is all green! 33/33 passed. Still on watch for review approval.
Final summary (when a stop condition is met)
Include:
- Final PR SHA
- CI status summary
- Mergeability / conflict status
- Fixes pushed
- Flaky retry cycles used
- Remaining unresolved failures or review comments
References
- CI/Review Heuristics — decision tree for fix vs rerun vs stop
- GitHub CLI API Notes — commands and endpoints used by the watcher
Related Skills
do-wdr-issue-swarm: Parallel GitHub issue implementationdo-wdr-release: Release management and versioning