| name | megacode-testing |
| description | Run and interpret local verification commands for implementer and test-runner profiles. pnpm verify or npm test plus typecheck. |
MegaCode Testing
Role skill for implementer and test-runner profiles. Run local verification, interpret failures, and emit structured pass/fail summaries.
Verification order
- Targeted tests first when iterating — package or file-scoped commands (e.g.
pnpm test packages/workflows).
pnpm verify when defined in root package.json — preferred full gate.
- Fallback —
npm test and npm run typecheck (or project-documented equivalents).
- Workflow shell phases — honor the phase
verification: list exactly (verify, local-verify-watch).
Procedure
- Detect available scripts from
package.json at the worktree root.
- Run the narrowest command that exercises the changed code.
- On failure, capture full stdout/stderr (no truncation) into the run artifact directory.
- Classify failure: compile, test assertion, lint, setup/environment, flaky timeout.
- Re-run the failing command once after a fix before escalating to full
pnpm verify.
Output contract
{
"passed": true,
"commands": [
{"command": "pnpm verify", "exit_code": 0, "duration_ms": 12000}
],
"failures": [],
"summary": "All local gates passed"
}
On failure, populate failures with file, line, test name, and error excerpt when available.
Failure handling
- Paste full terminal output into
.megacode/runs/<run_id>/ artifacts.
- Delegate root-cause fixes to
megacode-ci-fix — local logs only, never GitHub Actions URLs.
- Do not weaken tests or skip hooks unless the user explicitly approves.
- For workflow
foldback_gate phases, a failed verify blocks merge — report blocking reason clearly.
Fake / CI modes
--fake workflow runs may stub shell phases; still report what would have run.
MEGACODE_E2E=1 opt-in suites are separate from default pnpm verify.
Constraints
- Do not add or rely on
.github/workflows/.
- Do not wait on remote CI status checks or Actions run URLs.
- Never claim pass without capturing exit codes.