npx claudepluginhub michaelknopf/claude-code-profile --plugin savi[PR# | branch | run-id]/ci-fixDiagnoses CI pipeline issues from URLs, logs, or descriptions, previews fixes via agents, and applies changes with interactive user approval. Supports --dry-run, --auto-apply flags.
/ci-fixCI/CD パイプラインの障害を体系的なログ分析と的確な修正で診断・解決する(必要条件: GitHub Actions 用の GitHub CLI 'gh')
/ci-fixAutonomously fix CI failures in a loop until all checks pass or a stop condition is reached.
/ci-fixAuto-remediate CI, staging, and production failures. 3-attempt retry with investigation. Discord alert on exhaustion. Usage: /ci-fix [ci|staging|prod] [branch]
/ci-fix現在のブランチのPRでCI失敗を自動修正する
Target: $ARGUMENTS (defaults to current branch's PR if empty)
Determine the PR/branch:
$ARGUMENTS is empty: get current branch with git rev-parse --abbrev-ref HEAD, then find its open PR$ARGUMENTS is a number: treat as PR number$ARGUMENTS is a URL: extract PR number from it$ARGUMENTS looks like a branch name: use that branch$ARGUMENTS is numeric and large (8+ digits): treat as workflow run IDFetch workflow runs for the target:
gh run list --branch <branch> --limit 10 --json databaseId,name,status,conclusion,event,headBranch,workflowName
Identify failing runs and check for workflow chains:
conclusion: "failure"event field for workflow_run (indicates this was triggered by another workflow)Present chain to user:
For the selected failing workflow(s):
gh run view <run-id> --log-failedCategorize the failure:
.github/workflows/*.yml)Before pushing any fix, validate locally when possible:
Discover local tooling:
just -l
cd cdk && just -l, cd frontend && just -l, etc.Run equivalent local commands:
just <recipe> over constructing raw commandsnpm test → run just testpytest → run just test-pythoncd cdk && just synthOnly proceed to push when:
You orchestrate an autonomous Opus→Sonnet loop to diagnose and fix CI failures until all workflows pass. Each iteration is visible to the user so they can follow along.
For each attempt (1 through 10):
Detect if this is a type error:
Check the CI error output for patterns indicating type errors:
mypy, pyright, typecheck, type-checkerror: with type-related messages like Incompatible, has no attribute, Missing return, Argument of typeSelect the appropriate diagnostician:
| Error Type | Agent | Why |
|---|---|---|
| Type errors (mypy, pyright) | savi:type-fix-planner | Applies type safety principles |
| All other errors | savi:fix-diagnostician | General-purpose debugging |
Spawn the selected agent (opus) with:
gh run view <run-id> --log (the workflow that failed)Both agents return a structured plan with these sections:
### Root Cause (type-fix-planner also includes ### Principles Applied)### Fix Plan### Status — either CONTINUE or BLOCKED: <reason>### Blockers (if any)CRITICAL: Output the full diagnosis plan verbatim. After receiving the Task result, you MUST include the complete plan text in your next response message — this is how the user sees it. Do not summarize, truncate, or skip any part of the plan. Format it as:
---
## Attempt {N} / 10: Diagnosis
{full opus plan output}
---
Parse the ### Status section from the opus plan:
BLOCKED: <reason> → stop the loop, report the blocker to the userCONTINUE → proceed to implementationSpawn a sonnet implementation agent (use Task tool with subagent_type: "general-purpose", model: "sonnet") with the full opus plan. The agent should:
### Fix Plan sectionBefore pushing, validate locally if the failure can be reproduced:
just recipes to test fixes locally (see Phase 3)git add <changed-files>
git commit -m "ci: <brief description of fix>"
git push
Wait for the new workflow run to complete:
gh run list --branch <branch> --limit 5 --json status,conclusion,name,databaseId,event,workflowName
Wait until status: "completed", then check conclusion.
After the immediate workflow completes:
Check if it triggers downstream workflows:
event: "workflow_run"Wait for all downstream workflows to complete:
status: "completed"conclusion fieldsVerify the entire chain passes:
Example chain:
Record:
If you've reached 10 attempts, stop.
conclusion: "success")BLOCKED: <reason> statusAfter the loop completes, report:
On Success:
On Blocked:
On Max Attempts:
When a workflow triggers another workflow:
workflow_run indicates a chained workflowgh run view <id> --json event,workflowName,triggeredBy to trace relationships