wait-ci
Skill31 starsChanged 6 months agoMITView on GitHub
Polls CI check status for the current branch's pull request and reports pass/fail/pending/comments, surfacing PR review comments even when CI is green. Use when the user says "wait for CI", "check CI", "poll CI", or invokes "codagent:wait-ci".
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use the bundled scripts for all API calls — they encode the correct field names, jq patterns, and GraphQL queries.
- Very specific: line 39
Use timeout: 120000 on the Bash call.
- Very specific: line 47
After each exit-2 result, set ever_had_checks = ever_had_checks OR result.had_checks.
- Distinctive: line 49
Timeout handling: When all runs are exhausted (exit code 2 on the last run):
- Very specific: line 50
If ever_had_checks is false → treat CI as non-blocking, then still run Step 3 before reporting a final status
- Distinctive: line 83
Keep the last 100 lines if output is longer.
- Distinctive: line 87
Run this step after checks are terminal, checks time out as pending, or no checks exist:
- Very specific: line 107
When checks are terminal, time out as pending, or do not exist, inspect informational_bot_comments.
- Very specific: line 124
Status upgrade: If checks returned passed, timed out as pending, or were absent, but get-pr-comments.sh returns has_comments: true, report …
- Very specific: line 129
No-checks handling: If polling timed out with no checks ever observed, run get-pr-comments.sh before reporting success.
- Very specific: line 182
Default: 10 runs × 90 seconds = ~15 minutes max wait.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
codagent:wait-ci
Poll CI check status for the current branch's PR and report the result, enriching failures with log output and checking for blocking reviews.
Use the bundled scripts for all API calls — they encode the correct field names, jq patterns, and GraphQL queries. Do not rewrite API calls inline.
NEVER pause to ask the user for permission to wait. Always run the full polling duration silently. Asking mid-execution breaks automation and is never needed — the caller already decided to invoke this skill.
How polling works
check-ci.sh is a single-invocation script. It polls every 10 seconds for up to 90 seconds, then exits. Claude calls it in a loop to cover the full max wait time. This keeps each Bash call bounded to ~2 minutes rather than blocking the agent for the full duration.
Each Bash call to check-ci.sh must use timeout: 120000 (2 minutes).
Steps
1. Run the polling loop
Compute max_runs = ceil(max_minutes * 60 / 90), defaulting to max_minutes = 15 → 10 runs.
The skill accepts an optional --max-minutes N argument; pass it through to adjust max_runs.
Track ever_had_checks = false, run = 0, and the overall deadline across iterations. The deadline is max_minutes after polling starts and also bounds any review-bot waiting in Step 3.
For each run:
bash skills/wait-ci/scripts/check-ci.shUse timeout: 120000 on the Bash call. Check the exit code:
| Exit code | Meaning | Action |
0 | Terminal (passed or failed) | Break out of loop, proceed to Step 2 |
2 | Not yet terminal (pending or no_checks) | If run < max_runs, re-run; else preserve the result and proceed to Step 3 |
1 | Fatal error | Report error and stop |
After each exit-2 result, set ever_had_checks = ever_had_checks OR result.had_checks.
Timeout handling: When all runs are exhausted (exit code 2 on the last run):
- If
ever_had_checksis false → treat CI as non-blocking, then still run Step 3 before reporting a final status - Otherwise → preserve
pendingand the list of still-running checks, then run Step 3 before classifying the final status
The script outputs a JSON object with these fields:
| Field | Type | Description |
status | string | passed, failed, pending, no_checks, or comments (set by caller; may coexist with pending-check evidence) |
pr_url | string | PR URL |
pr_number | number | PR number |
head_sha | string | PR head commit queried for this invocation; preserve it when upgrading the status to comments |
owner / repo | string | Repo coordinates for subsequent calls |
had_checks | bool | Whether any checks were seen on this invocation |
failed_checks | array | Checks with bucket == "fail" |
passed_checks | array | Checks with bucket == "pass" |
pending_checks | array | Checks still running |
blocking_reviews | array | Reviews with CHANGES_REQUESTED (latest per reviewer) |
failed_run_ids | array | GitHub Actions run IDs extracted from failed check links |
mergeable | string | GraphQL mergeable: MERGEABLE, CONFLICTING, or UNKNOWN |
mergeStateStatus | string | GraphQL merge state (DIRTY when conflicting) |
conflicting_files | array | Paths that conflict with the PR base when git merge-tree can see both commits |
CONFLICTING is terminal failed even when checks are green. Keep polling while mergeable is UNKNOWN; do not emit passed. Include conflicting_files in the JSON when the PR base is available locally.
2. Fetch failure logs (if status == "failed")
For each run ID in failed_run_ids:
gh run view <run-id> --log-failedKeep the last 100 lines if output is longer. External checks (no run ID) get no logs.
3. Gather PR comments
Run this step after checks are terminal, checks time out as pending, or no checks exist:
bash skills/wait-ci/scripts/get-pr-comments.sh <owner> <repo> <pr-number> [<pr-author-login>]Uses GraphQL to check isResolved on review threads directly — no jq != workarounds needed.
Output fields:
| Field | Type | Description |
has_comments | bool | True if any actionable comments exist |
unresolved_threads | array | {file, line, author, body} per actionable unresolved review thread |
deferred_threads | array | {file, line, author, body} per unresolved thread deferred by the PR author or fix-pr session |
issue_comments | array | {author, body} blocking top-level human comments (excluding PR creator) |
informational_bot_comments | array | {author, body} non-blocking top-level bot comments retained as evidence |
has_comments is true only for actionable unresolved threads plus blocking issue comments. A thread is deferred (non-actionable) when fix-pr replied without resolving: the latest significant comment after stripping trailing reviewer-bot acks is from the PR author or from a different bot than the original finding bot (factory session identity). Later bot acknowledgments do not re-block; a later human reviewer reply is actionable again. Green CI with only deferred threads is passed. Keep deferred threads visible under their own heading. Do not add a fourth CI status marker.
When checks are terminal, time out as pending, or do not exist, inspect
informational_bot_comments. If a bot explicitly reports that its review is pending or in progress,
or asks the caller to check back, wait 10 seconds and call get-pr-comments.sh again while time
remains before the overall deadline. Re-evaluate the latest evidence on every poll. Do not hard-code
bot vendors or exact phrases; use the comment's meaning. A terminal current-head check from that bot
supersedes an older progress notice. Completed summaries and ordinary status notices remain
informational and do not delay completion.
At the overall deadline, use this precedence:
failedfor failed checks,CONFLICTINGmerge state, or blocking reviews.commentswhen actionable unresolved feedback exists, even if a review bot is still unfinished.pendingwhen checks or a review bot remain unfinished and no actionable feedback exists.passedwhen CI is green or explicitly absent, no actionable feedback exists, and no review bot remains unfinished.
Preserve unfinished bot notices in the report even when actionable feedback makes the status comments. Never extend the overall deadline while waiting for review bots.
Status upgrade: If checks returned passed, timed out as pending, or were absent, but
get-pr-comments.sh returns has_comments: true, report the final status as comments unless failed
checks or blocking reviews require failed. Preserve the check result, including pending_checks,
when upgrading the status.
No-checks handling: If polling timed out with no checks ever observed, run get-pr-comments.sh
before reporting success. Report comments when has_comments is true, pending when a review bot
remains explicitly unfinished at the deadline or mergeable is UNKNOWN, and otherwise passed.
Output Format
## CI Status: <passed | failed | pending | comments>
**PR:** <url>
**Elapsed:** ~<N> minutes
### Failed Checks
- **<check-name>** (FAILURE)
Link: <details-url>
Logs: <log output>
```Merge Conflicts
<conflicting-path>
Blocking Reviews
<reviewer>:<review body>
PR Comments
<author>on<file>line<N>:<comment body><author>(issue comment):<comment body>
Deferred Threads
<author>on<file>line<N>:<comment body>
Informational Bot Comments
<author>:<comment body>
Passing Checks
<check-name>(SUCCESS)
Still Running
<check-name>(PENDING/IN_PROGRESS)
Status meanings:
- `passed` — CI green, mergeable, no blocking reviews or actionable comments, and no bot review still in progress. Deferred threads may still be listed.
- `failed` — CI failures, `CONFLICTING` merge state, or `CHANGES_REQUESTED` reviews (with logs and conflicting paths when available)
- `comments` — actionable PR comments need addressing; known actionable feedback takes precedence
over unfinished checks or review automation, whose pending evidence remains in the report
- `pending` — checks, unknown mergeability, or an explicitly unfinished bot review remain after max wait, with no actionable feedback available
## Notes
- Can be invoked standalone without prior workflow state
- Default: 10 runs × 90 seconds = ~15 minutes max wait; pass `--max-minutes N` to override
- **Never ask the user for permission mid-execution** — always run the full duration
- `CHANGES_REQUESTED` is a hard block; `APPROVED` and `COMMENTED` alone do not block
- `CONFLICTING` is a hard block; `UNKNOWN` mergeability is not `passed`
- Comment gathering runs after polling ends, including pending-check timeouts and the no-checks path
- Log enrichment only works for GitHub Actions checks (not external status checks)
## Scripts Reference
| Script | Purpose |
|---|---|
| `scripts/check-ci.sh` | Single-invocation poller (90s, 10s interval) — call in a loop from the skill |
| `scripts/get-pr-comments.sh` | GraphQL comment fetcher — returns actionable review feedback, deferred threads, and informational bot comments |Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- snowzhaozhj/claude-devtools-rs★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- releaseSkill
- releaseSkill
- ask-questionsSkill
- call-agentSkill
- designSkill
- finalize-prSkill
- fix-prSkill
- handoffSkill
- implement-changeSkill
- initSkill
- orchestrate-changeSkill
- plan-tasksSkill
- prepare-acceptanceSkill
- proposal-reviewSkill
- proposeSkill
- push-prSkill
- review-approachSkill
- review-assumptionsSkill
- review-specSkill
- review-tasksSkill
- session-reportSkill
- simple-planSkill
- specSkill
- task-complianceSkill
- test-flowsSkill
- test-planSkill
- verify-behaviorSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

