| name | megacode-ci-fix |
| description | Diagnose and fix failures from local test, lint, and typecheck output only. Use when pnpm verify, npm test, or npm run typecheck fails. Do not use for GitHub Actions or remote CI logs. |
MegaCode Local CI Fix
Interpret local verification failures and produce a minimal fix plan or patch. This skill does not fetch or parse GitHub Actions workflow runs.
Accepted inputs
- Terminal output from
pnpm verify, pnpm test, npm test, npm run typecheck, eslint, tsc, or project-specific local scripts.
- File paths and line numbers from the failure output.
- Optional: which workflow phase failed (
verify, local-verify-watch).
Rejected inputs
- GitHub Actions run URLs, check suite IDs, or
actions/runs API payloads.
- Remote CI dashboards (CircleCI, Buildkite, etc.) unless the user pasted local-reproducible excerpts.
If only remote CI logs are available, ask the user to reproduce locally and paste terminal output.
Procedure
- Classify the failure: compile error, test assertion, lint rule, flaky timeout, environment/setup.
- Locate the failing file and root cause (not just the stack top frame).
- Scope the fix — smallest change that makes local verify pass.
- Re-run targeted commands before full
pnpm verify.
- Report structured summary:
{
"failure_class": "test | typecheck | lint | setup | unknown",
"root_cause": "Brief explanation",
"files_changed": ["path/a.ts"],
"commands_run": ["pnpm test packages/foo"],
"commands_passed": true,
"residual_risks": []
}
Rules
- Prefer fixing product code over weakening tests unless the test is wrong.
- Do not disable hooks or skip verification flags unless the user explicitly approves.
- Implementer profile should run in a worktree when applying fixes.
- Never add
.github/workflows/ — local CI only per project constraints.