Test Coverage
Native Subagent Protocol (Codex)
Codex supports native subagents. Delegate with spawn_agent, coordinate with send_input, collect via wait_agent, and clean up with close_agent.
Execution preference:
- Use native subagents first for independent workstreams (parallel when possible).
- Merge results in main thread and run final verification.
- Fallback only when delegation is blocked: use the
[ANALYST]/[ARCHITECT]/[EXECUTOR]/[REVIEWER]structure in a single response.
Minimal orchestration pattern:
spawn_agent -> send_input (optional) -> wait_agent -> close_agent
Analyze test coverage and generate missing tests:
Run tests with coverage: npm test --coverage or pnpm test --coverage
Analyze coverage report (coverage/coverage-summary.json)
Identify files below 80% coverage threshold
For each under-covered file:
- Analyze untested code paths
- Generate unit tests for functions
- Generate integration tests for APIs
- Generate E2E tests for critical flows
Verify new tests pass
Show before/after coverage metrics
Ensure project reaches 80%+ overall coverage
Focus on:
- Happy path scenarios
- Error handling
- Edge cases (null, undefined, empty)
- Boundary conditions