Multi-phase test suite optimization with adversarial review
Analyze, optimize, and clean a project's test suite through a multi-phase workflow with adversarial review. Produces machine-readable output and feeds findings into compound-agent memory.
Spawn multiple analysis subagents in parallel:
Synthesize analysis results into a refined optimization plan:
This is THE KEY PHASE -- the most important phase in the entire workflow. NEVER skip, NEVER rush, NEVER settle for "good enough."
Expose the plan to two neutral reviewer subagents:
Both reviewers challenge assumptions, identify risks, and suggest improvements.
Mandatory iteration loop: After each reviewer pass, if ANY issues, concerns, or suggestions remain from EITHER reviewer, revise the plan and re-submit to BOTH reviewers. Repeat until BOTH reviewers explicitly approve with ZERO reservations. Do not proceed to Phase 4 until unanimous, unconditional approval is reached.
This is the critical quality gate. Loop as many times as needed. The test suite must be bulletproof before execution begins.
Apply the agreed changes:
ERROR [file:line] type: descriptionREMEDIATION suggestions and SEE referencespnpm test:segment, pnpm test:random, pnpm test:critical for targeted validationnpx ca learnpnpm test:segment <module> -- Test specific module in isolationpnpm test:random <pct> -- Deterministic random subset (seeded per-agent)pnpm test:critical -- P1/critical tests only (fast CI feedback)npx ca search "test optimization" before startingnpx ca learn