Analyze test coverage and identify gaps. Use when the user says /testcoverage, asks about test coverage, wants to improve coverage, find untested code, or reach a coverage target. Triggers: test coverage, coverage report, untested code, coverage gap, coverage target, uncovered lines, branch coverage.
Analyze test coverage and generate tests to fill gaps.
Run coverage analysis:
npx jest --coverage or npx vitest --coverage or npx nyc mochapytest --cov=<package> --cov-report=term-missinggo test -coverprofile=coverage.out ./... && go tool cover -func=coverage.outcargo tarpaulin or cargo llvm-covAnalyze coverage gaps:
Present a coverage report:
Coverage Summary: XX.X% (target: YY%)
Critical Gaps:
src/auth/login.ts 45% — lines 23-40, 67-89 (authentication logic)
src/api/payments.ts 38% — lines 12-35 (payment processing)
Important Gaps:
src/utils/validator.ts 62% — lines 44-58 (error handling)
Files at 100%: 12/30
Generate tests for the highest-priority gaps:
Re-run coverage to verify improvement.