with one click
pr-watch
// Use when waiting for CI checks on a PR. Watches status, auto-fixes failures via ci-fix (max 2 retries), reports merge-ready. Triggers: watch PR, watch CI, wait for checks.
// Use when waiting for CI checks on a PR. Watches status, auto-fixes failures via ci-fix (max 2 retries), reports merge-ready. Triggers: watch PR, watch CI, wait for checks.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | pr-watch |
| description | Use when waiting for CI checks on a PR. Watches status, auto-fixes failures via ci-fix (max 2 retries), reports merge-ready. Triggers: watch PR, watch CI, wait for checks. |
| metadata | {"dependencies":["ci-fix"]} |
Watch a PR's CI checks until they complete. If checks fail, attempt to fix them automatically. Report the result with a suggested next step.
These commands run automatically when the skill loads — output replaces each line below:
gh pr view --json number,title,url,state,headRefName 2>/dev/null || truegh api repos/{owner}/{repo}/actions/workflows --jq '.total_count' 2>/dev/null || trueIf the user provides a PR number, use that instead of the detected one.
If no PR exists or state is not OPEN, stop and report.
If the workflow count is 0, report and suggest merge:
No CI workflows configured — nothing to watch.
Ready to merge: gh pr merge #42 --squash --delete-branch
Run:
gh pr checks --watch --interval 30
This blocks until all checks complete.
After checks finish, get the full status:
gh pr checks --json name,state,conclusion
Report and suggest merge:
Watching PR #42 (feat/add-tdd-and-test-write-skills)...
CI: 5/5 passed
Result: All checks passed
Ready to merge: gh pr merge #42 --squash --delete-branch
If this is the 1st or 2nd failure, attempt an automatic fix:
gh pr checks --watch --interval 30 againTrack fix attempts. Maximum 2 fix attempts total.
Watching PR #42...
CI: 1/5 failed (test-unit)
Running ci-fix... fixed and pushed
Re-watching...
CI: 5/5 passed
Result: All checks passed (1 fix applied)
Ready to merge: gh pr merge #42 --squash --delete-branch
If 2 fix attempts have been made and checks still fail, stop and report:
Watching PR #42...
CI: 1/5 failed (test-unit)
Running ci-fix... fixed and pushed (attempt 1)
Re-watching...
CI: 1/5 failed (test-unit)
Running ci-fix... fixed and pushed (attempt 2)
Re-watching...
CI: 1/5 failed (test-unit)
Result: 1/5 checks still failing after 2 fix attempts
FAIL: test-unit
Needs manual investigation.
When the user asks to merge after watching:
gh pr merge <number> --squash --delete-branchgh api repos/{owner}/{repo}/pulls/{number}/merge -X PUT -f merge_method=squash
gh api repos/{owner}/{repo}/git/refs/heads/{branch} -X DELETE