ci-monitoring
Scannednpx machina-cli add skill troykelly/claude-skills/ci-monitoring --openclawCI Monitoring
Monitor CI pipeline, resolve failures, address review feedback, and merge when ready.
Core principle: CI failures AND unresolved review feedback are blockers.
Announce: "I'm monitoring CI and review feedback, and will resolve any issues before merging."
The Loop
PR Created
│
▼
┌─────────────┐
│ Wait for CI │
└──────┬──────┘
│
┌───┴───┐
│ │
Green Red ──► Fix → Push → Loop back
│
▼
┌──────────────────────┐
│ Unresolved Reviews? │
└──────────┬───────────┘
┌───┴───┐
│ │
None Yes ──► For each: Evaluate → Fix/Pushback → Reply → Resolve → Push → Loop back
│
▼
┌─────────────┐
│ MERGE PR │
└─────────────┘
Gate: Green CI + No Unresolved Reviews = Merge
When both conditions met, merge immediately:
gh pr merge [PR_NUMBER] --squash --delete-branch
gh issue edit [ISSUE_NUMBER] --remove-label "status:in-review" --add-label "status:done"
Do NOT stop to report or ask. Continue to next issue.
Exception: PRs with do-not-merge label.
Checking CI
gh pr checks [PR_NUMBER]
gh pr checks [PR_NUMBER] --watch
Handling CI Failures
- Identify:
gh run view [RUN_ID] --log-failed - Reproduce locally
- Fix and push
- Wait for CI, repeat if needed
Detailed patterns: See reference/ci-failures.md
Handling Review Feedback
After CI green, check for unresolved threads:
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100) {
nodes { id isResolved isOutdated comments(first: 1) { nodes { body author { login } path } } }
}
}
}
}' -f owner="[OWNER]" -f repo="[REPO]" -F pr=[PR_NUMBER]
For each unresolved thread (isResolved: false):
| Step | Action |
|---|---|
| 1 | Read and understand feedback |
| 2 | Verify: technically valid for this codebase? |
| 3 | Fix, defer (with issue), or push back with reasoning |
| 4 | Reply in thread: gh api repos/.../pulls/.../comments/[ID]/replies -f body="..." |
| 5 | Resolve: gh api graphql -f query='mutation { resolveReviewThread(...) }' |
| 6 | Push fixes, loop back to CI |
Detailed commands: See reference/review-feedback.md
Security Feedback
Security flags from automated reviewers (Codex, CodeRabbit, etc.) should be treated seriously and verified against the codebase.
Best Practices
Run locally first. CI validates, doesn't discover.
pnpm lint && pnpm typecheck && pnpm test && pnpm build
If CI finds bugs you didn't find locally, your local testing was insufficient.
Checklist
CI:
- All checks green
- Failures fixed (if any)
Review feedback:
- All threads resolved
- Each: evaluated → fixed/pushback → replied → resolved
Merge:
-
gh pr merge --squash --delete-branch - Issue marked Done
- Continue to next issue
Integration
Called by: issue-driven-development, autonomous-orchestration
Follows: pr-creation
Uses: receiving-code-review (principles for evaluating feedback)
Completes: PR lifecycle
Source
git clone https://github.com/troykelly/claude-skills/blob/main/skills/ci-monitoring/SKILL.mdView on GitHub Overview
CI Monitoring tracks the PR pipeline and feedback, guiding fixes until all gates pass. It treats CI failures and unresolved reviews as blockers and streamlines the path to merge when both are cleared.
How This Skill Works
It watches PR checks, identifies CI failures, reproduces issues locally, and pushes fixes to retrigger CI. When CI is green, it checks for unresolved review threads and proceeds to merge only if none remain, updating labels as needed.
When to Use It
- A new PR is opened and you need to wait for CI checks to finish.
- CI shows failures; you reproduce locally, fix, and push to trigger a retry.
- CI is green but there are unresolved review threads that require action.
- A PR has the do-not-merge label and requires action before any merge.
- All gates are green and reviews are resolved; proceed to merge and update the issue status.
Quick Start
- Step 1: Wait for PR checks to report status and review threads for the PR.
- Step 2: If CI is green and there are no unresolved reviews, merge the PR with squash and delete-branch, and update the issue label to Done.
- Step 3: If CI fails or reviews are unresolved, reproduce locally, fix, push the changes, and loop back to Step 1.
Best Practices
- Run locally first: pnpm lint && pnpm typecheck && pnpm test && pnpm build to pre-validate changes.
- Reproduce CI failures locally to confirm the root cause before pushing fixes.
- After CI green, read unresolved review feedback, verify technical validity, fix or push back, and reply in the thread before resolving.
- Use gh pr checks and gh pr merge commands to manage PR state and labels consistently.
- Treat security feedback seriously and verify it against the codebase before merging.
Example Use Cases
- Green CI with no unresolved reviews: merge the PR using gh pr merge --squash --delete-branch and update the issue label to status:done.
- CI fails: identify the failed run with gh run view, reproduce locally, fix, push, and loop back to CI checks.
- CI green but unresolved threads exist: iterate through each thread, read feedback, fix as needed, reply, and resolve before merging.
- PR with do-not-merge label: pause merging and address issues until the label is removed or guidance is updated.
- All gates clear: merge the PR and proceed to the next issue in the queue.