/test-coverage - Run Tests with Coverage Report
Usage
/test-coverage usecase
/test-coverage storage
/test-coverage rest RegisterUserController
/test-coverage usecase --focus # only classes touched in recent git diff
Arguments
First word is the module:
usecase→:usecasestorage,rest,email,scheduling,security→:adapters:{name}domain→ measured through the suites exercising domain codefrontend→ frontend coverage tooling from the active technology profile
Optional second word filters the report to classes matching that name.
Optional --focus restricts the report to changed production files. In staged
lanes, pass the recorded baseline and explicit owned paths, including already
committed changes; use last-commit focus only when no explicit scope was supplied.
Pass report-only mode for every staged lane so the coordinator owns tracking.
Action
Delegate to .claude/agents/coverage-agent.md with module, focus paths/baseline,
and report-only mode. It resolves backend or frontend tooling from the active
technology profile and uses .claude/templates/testing/coverage-commands.md for
scope, report format, gap mapping, and remediation.
Steps:
- Run tests with coverage (stop if tests fail)
- Compute each touched module summary from its coverage report
- List classes with gaps (apply filter/focus if specified)
- Extract uncovered lines/branches, read source to show actual code
- Report results
- In
--focusmode: map gaps to scenarios and classify reachability; return staged-lane findings to the coordinator, otherwise update progress.md for reachable gaps. Flag dead code for refactor.
Agent
.claude/agents/coverage-agent.md— workflow for gap analysis, reachability classification, progress.md updates
Templates
.claude/templates/testing/coverage-commands.md— universal workflow: focus mode, module mapping, report format.claude/tech/{backend}/templates/testing/coverage-commands.md— tool-specific commands: run, parse, extract