From pr-watch
This skill should be used when the user asks to "watch this PR", "monitor the PR", "keep an eye on CI", "watch for reviews", "babysit this PR", or wants autonomous PR monitoring that detects and responds to CI failures, review comments, and merge conflicts on the current branch's PR.
npx claudepluginhub jaidhyani/jai-cc-plugins --plugin pr-watchThis skill uses the workspace's default tool permissions.
Monitor the current branch's PR autonomously — detect and respond to CI failures, review comments, and merge conflicts. Consumes zero LLM tokens while waiting.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Analyzes competition with Porter's Five Forces, Blue Ocean Strategy, and positioning maps to identify differentiation opportunities and market positioning for startups and pitches.
Monitor the current branch's PR autonomously — detect and respond to CI failures, review comments, and merge conflicts. Consumes zero LLM tokens while waiting.
Commit and push after every logical fix. Never batch unrelated fixes. Formatting/lint fixes from dev_checks get their own commit.
PR=$(gh pr view --json number --jq .number)
REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
PREV_COMMENTS=$(gh pr view $PR --json comments --jq '.comments | length')
PREV_REVIEWS=$(gh pr view $PR --json reviews --jq '.reviews | length')
Confirm the PR is open. If merged or closed, report status and stop.
Report: "Watching PR #N — polling every 60s for CI, reviews, comments, and conflicts."
Start a background poll loop (run_in_background: true Bash command):
PR=<number>
PREV_COMMENTS=<baseline>
PREV_REVIEWS=<baseline>
ITER=0; MAX_ITER=120
while [ "$ITER" -lt "$MAX_ITER" ]; do
sleep 60
ITER=$((ITER + 1))
CI=$(gh pr checks $PR --json state --jq '.[].state' 2>/dev/null | sort -u)
if echo "$CI" | grep -q "FAILURE"; then
echo "ALERT:CI_FAILURE"
gh pr checks $PR
exit 0
fi
NEW_COMMENTS=$(gh pr view $PR --json comments --jq '.comments | length')
if [ "$NEW_COMMENTS" -gt "$PREV_COMMENTS" ]; then
echo "ALERT:NEW_COMMENTS count=$NEW_COMMENTS prev=$PREV_COMMENTS"
exit 0
fi
NEW_REVIEWS=$(gh pr view $PR --json reviews --jq '.reviews | length')
if [ "$NEW_REVIEWS" -gt "$PREV_REVIEWS" ]; then
echo "ALERT:NEW_REVIEW"
exit 0
fi
MERGEABLE=$(gh pr view $PR --json mergeable --jq '.mergeable')
if [ "$MERGEABLE" = "CONFLICTING" ]; then
echo "ALERT:MERGE_CONFLICT"
exit 0
fi
STATE=$(gh pr view $PR --json state --jq '.state')
if [ "$STATE" = "MERGED" ] || [ "$STATE" = "CLOSED" ]; then
echo "INFO:PR_$STATE"
exit 0
fi
DECISION=$(gh pr view $PR --json reviewDecision --jq '.reviewDecision')
ALL_PASS=$(gh pr checks $PR --json state --jq '.[].state' 2>/dev/null | sort -u)
if [ "$DECISION" = "APPROVED" ] && ! echo "$ALL_PASS" | grep -qE "FAILURE|PENDING"; then
echo "INFO:READY_TO_MERGE"
exit 0
fi
done
echo "INFO:TIMEOUT"
When the monitor exits, act on the signal, then restart from step 2 with updated baselines.
gh pr checks $PRgh run view <run_id> --log-failedgh pr view $PR --json comments --jq '.comments | .[-<delta>:] | .[] | "@\(.author.login): \(.body[0:500])"'
gh api repos/$REPO/pulls/$PR/comments --jq '.[] | "\(.path):\(.line // .original_line) — \(.user.login): \(.body)"'
gh pr view $PR --json reviews --jq '.reviews[-1] | "@\(.author.login) (\(.state)): \(.body)"'
BASE=$(gh pr view $PR --json baseRefName --jq '.baseRefName')
git fetch origin $BASE && git merge origin/$BASE
Report status. Stop monitoring.
Report: "PR #N is approved and all checks pass. Ready to merge." Continue monitoring — never merge autonomously.
Report timeout (~2 hours). Suggest re-running /pr-watch to restart.
Polling is a stopgap. The long-term plan is ephemeral Cloudflare Worker webhooks — spin up a temporary endpoint, register it with GitHub, relay events to the local session, tear it down when the PR closes. When that infra exists, replace the poll loop with it.
For each comment:
After all items:
"$(git rev-parse --show-toplevel)/scripts/dev_checks.sh"When operating as a teammate, use SendMessage to notify the lead of changes: