skills/check-ci/SKILL.md
Use when checking, analyzing, investigating, debugging, triaging, polling, waiting for, rebuilding, or canary-building CI builds, build failures, or test failures. Fixes code and loops until CI is green via a CI analysis API. Works with multiple CI systems.
npx skillsauth add abhiroopb/synthetic-mind check-ciInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze CI build failures, fix code issues, and loop until CI turns green via a CI analysis API. Works with multiple CI systems (e.g., Buildkite, Jenkins, GitHub Actions).
STOP if required CLI tools (gh) are not available.
This skill operates in a continuous loop until CI passes or the retry limit is reached. After every fix attempt, you MUST re-poll CI and check results again. Do NOT stop after a single fix.
LOOP (max 5 iterations):
1. Fetch CI analysis (Step 2)
2. If RUNNING → poll until complete (Step 3)
3. If PASSED → report success and EXIT loop
4. If FAILED → analyze failures, then:
a. Check change relevance of each failure (Step 5a.1)
b. For change-related code issues → fix code, build/test locally, commit, push
c. For unrelated code issues → report to user, do NOT fix
d. If every remaining failure is unrelated → report and EXIT loop
e. For flaky tests → rebuild failed parts (Step 4)
f. For infra issues → report to user and EXIT loop
5. After fix is pushed or rebuild triggered → go back to step 1
6. If iteration limit reached → report remaining failures and EXIT loop
Track the current iteration count and report it: "CI check attempt 2/5..."
Before checking CI, confirm the current commit exists on the remote.
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse origin/$(git rev-parse --abbrev-ref HEAD) 2>/dev/null || echo "none")
if [ "$LOCAL" != "$REMOTE" ]; then
echo "HEAD ($LOCAL) not pushed. Run: git push"
fi
gh pr view [PR_URL] --json statusCheckRollup \
--jq '.statusCheckRollup[] | select(.context == "CI Results") | {context, targetUrl, state}'
Save the exact PR URL or number as TARGET_PR.
Summarize all checks:
gh pr view [PR_URL] --json statusCheckRollup \
--jq '.statusCheckRollup[] | "\(.context // .name): \(.state // .conclusion)"'
Call your CI analysis API with the build identifier to retrieve:
build.state — SUCCEEDED, FAILED, RUNNINGbuild.web_url — link to CI consolebuild.jobs[] — individual jobs with id, step_name, state, web_urlissues[] — analyzed build issues with type, normalized_log_snippet, step_nametest_results[] — failed tests with test_name, class_name, normalized_stack_tracesleep 180 # 3 minutes between polls
# Re-run Step 2
Trigger a rebuild of only failed jobs (useful for flaky tests or transient infrastructure failures) via the CI API.
| Category | Indicators | Action | |---|---|---| | Code issue (change-related) | Failure in files/modules changed by the PR | Fix the code (Step 5b) | | Code issue (unrelated) | Failure in files/modules NOT changed by the PR | Report to user, do NOT auto-fix | | Flaky test | Timeouts, non-deterministic assertions, infra errors in test logs | Rebuild failed parts (Step 4) | | Infrastructure | OOM, network errors, CI agent issues | Report to user and stop |
Before fixing any code issue, determine if the failure is related to the PR:
gh api "repos/$OWNER/$REPO/pulls/$PR_NUMBER/files" --paginate --jq '.[].filename'
After pushing a fix or triggering a rebuild, loop back:
"🔄 CI check attempt 2/5..."After each iteration, report the attempt number, what was fixed, and current status. Separately report unrelated failures. Always include the CI console link.
testing
Track TV shows and movies with Trakt.tv. Search, get watchlist, history, up-next, recommendations, trending, calendar, ratings, stats, add/remove from watchlist, mark watched, rate, and check in. Use when asked about what to watch, TV shows, movies, watch history, or Trakt.
development
Send and receive SMS messages via Twilio API. Used for text message notifications, forwarding important alerts, and two-way SMS communication.
documentation
Organizes files in the local Downloads folder into proper folders. Use when asked to organize, sort, or file downloaded documents.
tools
Book and manage appointments on Sutter Health MyHealth Online portal. Uses browser automation via Playwright MCP to interact with the patient portal.