/synthex: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.
Loads config for coverage thresholds, the test runner, and priority modules.
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.
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.
Runs the Quality Engineer in Coverage Analysis mode with the report, scope, thresholds,
priority modules, and your test patterns.
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.
Reports results.
Coverage numbers alone aren't the verdict: the analysis always assesses test quality and the
shape of your test pyramid too.
Parameters
Parameter
Description
Default
Required
scope
File path, directory, or module to analyze
entire project
No
write_tests
Whether to write tests for identified gaps
false
No
config_path
Path to synthex project config
.synthex/config.yaml
No
Configuration
Key
Default
Purpose
quality.coverage_thresholds.line
80
Line coverage target
quality.coverage_thresholds.branch
70
Branch coverage target
quality.coverage_thresholds.function
80
Function coverage target
quality.test_runner
vitest
Runner 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.