/fx-dev:resolve-ci-failuresfrom fx-dev
Analyzes failing CI checks on a PR, fetches failure logs, categorizes failures, and delegates fixes. Includes base-branch conflict detection and root-cause fixing rules.
Ships in fx-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Meta-skill that analyzes failing CI checks on a PR, fetches failure logs, categorizes failures, and delegates fixes to Implementer sub-agents (fx-dev:dev, Implementer role).
USE THIS SKILL when ANY of the following occur:
wait-for-ci-checks.sh exits with code 1CRITICAL: Load the fx-dev:github skill FIRST before running any GitHub API operations.
test.skip, it.skip, describe.skip are FORBIDDEN)GitHub Actions does NOT trigger CI on PRs that have merge conflicts with their base branch. If the PR shows no checks, missing checks, or checks stuck in Expected / never firing after a push, verify this before any other CI debugging:
gh pr view [PR_NUMBER] --json mergeable,mergeStateStatus -q '{mergeable, mergeStateStatus}'
mergeable: "CONFLICTING" or mergeStateStatus: "DIRTY" → CI is blocked by conflicts, not by code or workflow problems.git fetch origin
git rebase origin/[BASE_BRANCH]
# resolve any conflicts, then:
git push --force-with-lease
Do not start fetching gh run logs, inspecting workflow YAML, or delegating fixes until you have ruled out a base-branch conflict.
If not provided, get from current branch:
gh pr view --json number,headRefName -q '.number'
Query the PR for failed checks:
gh pr checks [PR_NUMBER] --json name,state,conclusion
Filter for checks with conclusion FAILURE, CANCELLED, TIMED_OUT, or ACTION_REQUIRED.
For each failing check, fetch detailed logs to understand the root cause.
Step 3a: Get the head SHA and repo info:
gh pr view [PR_NUMBER] --json headRefOid,headRefName -q '.headRefOid'
Step 3b: Get check run IDs for failing checks:
IMPORTANT: Use inline values, NOT $variable syntax. The $ character causes shell escaping issues.
# Replace OWNER, REPO, SHA with actual values
gh api repos/OWNER/REPO/commits/SHA/check-runs --jq '.check_runs[] | select(.conclusion == "failure") | {name: .name, id: .id}'
Step 3c: Fetch annotations (structured error details):
# Replace OWNER, REPO, CHECK_RUN_ID with actual values
gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID/annotations
Step 3d: Fetch GitHub Actions workflow run logs (if applicable):
# List failed workflow runs for the branch
gh run list --branch [BRANCH] --json databaseId,name,conclusion --jq '.[] | select(.conclusion == "failure")'
# View the failed run's log output (truncated to failed steps)
gh run view [RUN_ID] --log-failed
⚠️ NOTE: gh run view --log-failed can produce very large output. If the output is too large, try fetching specific job logs:
# List jobs in the run
gh run view [RUN_ID] --json jobs --jq '.jobs[] | select(.conclusion == "failure") | {name: .name, id: .databaseId}'
# View a specific job's log
gh api repos/OWNER/REPO/actions/jobs/JOB_ID/logs
| Category | Indicator | Action |
|---|---|---|
| Test failure | Test runner output, assertion errors, FAIL in test logs | Delegate to an implementer to fix test or code |
| Build error | Compilation errors, missing deps, tsc errors, module not found | Delegate to an implementer to fix build |
| Lint/Format error | ESLint, Prettier, stylelint, --fix suggestions | Delegate to an implementer to run formatter/fix lint |
| Security scan | Vulnerability alerts, npm audit, Dependabot | Delegate to an implementer to update deps or fix |
| Flaky test | Test passed locally, intermittent failure, no code change caused it | Note as flaky — may pass on re-run without changes |
| Infrastructure | Runner errors, timeout, network failures, Docker pull errors | Report to user — not fixable by code changes |
For each fixable failure, launch an Implementer sub-agent (fx-dev:dev, Implementer role):
Agent tool:
prompt: "Load the dev skill (Skill tool: skill='fx-dev:dev') and act in its Implementer role, then:
Fix the following CI failure on PR #[NUMBER]:
Check name: [CHECK_NAME]
Conclusion: [CONCLUSION]
Error details:
[LOGS/ANNOTATIONS FROM STEP 3]
- Analyze the error and fix the root cause
- Do NOT suppress errors or skip tests
- Commit with format: fix(ci): description
- Push changes after committing"
description: "Fix CI failure: [CHECK_NAME]"
If multiple checks failed with independent root causes, delegate fixes for ALL of them. Sequential delegation is preferred to avoid merge conflicts.
Verify all fixes are committed and pushed:
git status
git push
If the implementer sub-agent already pushed, verify with:
git log --oneline -3
gh pr view [PR_NUMBER] --json commits --jq '.commits[-1].oid'
Confirm the latest commit on the PR includes the fix:
# Local HEAD should match the PR's head
git rev-parse HEAD
gh pr view [PR_NUMBER] --json headRefOid -q '.headRefOid'
If they differ, push is needed:
git push
## CI Failure Resolution — PR #123
### Failing Checks Detected
- tests (FAILURE)
- lint (FAILURE)
- deploy (TIMED_OUT)
### Resolution
| Check Name | Category | Action Taken | Status |
|------------|----------|--------------|--------|
| tests | Test failure | Fixed assertion in foo.test.ts | ✅ Fixed |
| lint | Lint error | Ran prettier, fixed imports | ✅ Fixed |
| deploy | Infrastructure | Runner timeout — not code-related | ⚠️ Reported |
### Next Steps
- Fixes pushed. SDLC workflow will re-run wait-for-ci-checks.sh to verify.
- Infrastructure issue (deploy): Requires manual intervention or re-run.
fx-dev:dev, Implementer role) and committedgh run view --log-failed is too large: Fetch individual job logs insteadWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fx/cc --plugin fx-dev25 skills in this plugin
/coderabbit-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Handles CodeRabbit's PR-level review as an optional review adapter with Scope Brief triage and rate-limit degradation./codex-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Runs a scoped one-shot Codex CLI branch review as an external review adapter./copilot-feedback-resolverExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Processes and resolves existing GitHub Copilot review threads without creating PR-level comments.Other plugins' skills for the same job