DOCS · REFERENCE · COMMANDS · BUILD

test-coverage-analysis/synthex:test-coverage-analysis

Build

Risk-prioritised gap analysis. Optional fix mode writes tests.

Invocation

Run from inside Claude Code in any project where Synthex is installed:

/synthex:test-coverage-analysis

Some commands accept parameters; see the source-of-truth file linked below for the full parameter list and workflow.

Lifecycle phase

Build. Parallel-executed, peer-reviewed task delivery.

Source

The command's parameters, workflow, and sub-agent invocations are defined in markdown at bluminal/lumenai/blob/main/plugins/synthex/commands/test-coverage-analysis.md.

Last modified:

What it does, end-to-end

test-coverage-analysis/synthex:test-coverage-analysis has the Quality Engineer agent find where your tests are thin, judge how good the existing tests are, and — if you ask — write the missing ones.

  1. Loads config for coverage thresholds, the test runner, and priority modules.
  2. Gathers test context. It reads .synthex/facts.md first for the test runner and coverage command, falling back to detection (package.json, vitest.config.*, jest.config.*, pytest.ini) when the fact is missing or stale. It reads existing tests for conventions and mocking style, reads any existing coverage/ report, and sizes up your unit / integration / E2E ratio.
  3. Tries a fresh coverage run (e.g. npx vitest run --coverage --reporter=json, or the equivalent for your runner). If that fails, it continues with static analysis and says so.
  4. Runs the Quality Engineer in Coverage Analysis mode with the report, scope, thresholds, priority modules, and your test patterns.
  5. Writes tests (optional). When write_tests is true — or you ask after reading the analysis — the Quality Engineer switches to Test Writing mode for the top P1 gaps, matches your existing patterns exactly (no new frameworks or assertion styles), runs the new tests, and keeps fixing until they pass.
  6. Reports results.

Coverage numbers alone aren't the verdict: the analysis always assesses test quality and the shape of your test pyramid too.

Parameters

ParameterDescriptionDefaultRequired
scopeFile path, directory, or module to analyzeentire projectNo
write_testsWhether to write tests for identified gapsfalseNo
config_pathPath to synthex project config.synthex/config.yamlNo

Configuration

KeyDefaultPurpose
quality.coverage_thresholds.line80Line coverage target
quality.coverage_thresholds.branch70Branch coverage target
quality.coverage_thresholds.function80Function coverage target
quality.test_runnervitestRunner used for coverage reports
quality.priority_modules[]Modules that always need thorough coverage; empty auto-detects high-risk areas (auth, payments, data mutations)

Output

A markdown analysis printed to the console:

  • Summary — current coverage, highest-risk gaps, overall quality.
  • Coverage Report table — line %, branch %, risk level, and P1/P2/P3 priority per module.
  • Gap Analysis — each gap with location, what's untested, the production risk, and the specific tests to write. P1 means a regression would hurt the business: auth, payments, data mutations, API contracts.
  • Test Quality Assessment — behavior vs. implementation testing, independence, setup, names, edge cases, error paths.
  • Test Strategy Recommendations — pyramid ratio and infrastructure suggestions.

Then a short summary with gap counts by priority, coverage before → after and the number of tests written (when it wrote any), and the top remaining gaps. New test files land wherever your existing conventions put them; the command doesn't finish with failing tests.

Examples

/synthex:test-coverage-analysis
/synthex:test-coverage-analysis src/billing
/synthex:test-coverage-analysis src/auth write_tests=true

See also