/nexa-claude-audit:test-efficacy-auditfrom nexa-claude-audit
Writes a dated test efficacy audit report for the current repository: runs unit and Testcontainers integration tests with code coverage, compares line coverage against thresholds. Runs in a temporary git worktree without modifying the working tree.
Ships in nexa-claude-audit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
/test-efficacy-audit.This skill measures which code the tests run. It does not run mutation testing, because a
mutation run takes much time. The mutation score belongs to /mutation-audit. Static metrics
(complexity, duplication, CBO, DIT) belong to /code-metrics-audit.
This skill runs installs and tests. The contract rule "do not run tests, builds, installs" does not apply. These rules replace it:
HEAD, outside the repository. Never run a tool
in the user's working tree.HEAD. Uncommitted changes are not measured. When the contract header
records Uncommitted changes: yes, say so in the Summary.Before the first install, show the user the install commands and the test commands, and ask for approval. An install can run package scripts. When the user declines, stop and write no report.
These rules apply to every step that runs tests.
Coverage includes the integration tests. Run the unit tests and the integration tests that use Testcontainers, so that the coverage includes the code that only an integration test runs. Exclude only E2E tests (Playwright, Cypress) and tests that need a live external service.
Run one test process at a time. Do not start a test run or an install while another one runs. Wait for a background command to finish before you start the next one.
Use the serial options. Set the runner to one worker:
| Tool | Serial option |
|---|---|
| Vitest / Jest | --no-file-parallelism / --runInBand |
| Go test | -p 1 |
| pytest | no -n (pytest-xdist) option |
| Maven / Gradle | -DforkCount=1 / --max-workers=1 |
| Metric | Pass | Warn | Fail |
|---|---|---|---|
| Line coverage (unit and integration tests) | ≥ 80 % | ≥ 60 % and < 80 % | < 60 % |
Report branch coverage when the tool gives it. It has no threshold.
Read and follow ${CLAUDE_PLUGIN_ROOT}/shared/AUDIT_CONTRACT.md: establish the report context,
detect the stack, and select the report path. Skill name: test-efficacy-audit.
Title: Test Efficacy Audit.
TMP="$(mktemp -d)"
WT="$TMP/wt"
git worktree add --detach "$WT" HEAD
Record $TMP and $WT. Put tool output in $TMP. Every later command runs in $WT. Every path in the report is relative to the
repository root, not to $WT.
Install: select the command from the lockfile. Examples: npm ci,
pnpm install --frozen-lockfile, yarn install --immutable, go mod download, uv sync,
python -m venv .venv && .venv/bin/pip install -e .[test], dotnet restore, cargo fetch,
bundle install, composer install. Maven and Gradle download during the test run.
Tests with coverage: start from the manifest test scripts (test, test:unit,
test:integration, Makefile targets). Add the coverage option and the serial option of
the runner:
| Runner | Coverage option |
|---|---|
| Vitest / Jest | --coverage --coverage.reporter=json-summary (Vitest) / --coverage --coverageReporters=json-summary (Jest) |
| Go | go test -coverprofile="$TMP/cover.out" ./..., then go tool cover -func |
| pytest | --cov --cov-report=json:$TMP/coverage.json |
| Maven / Gradle | JaCoCo report goal or task (jacoco:report, jacocoTestReport) |
| .NET | dotnet test --collect:"XPlat Code Coverage" |
| Rust | cargo llvm-cov --json |
Integration tests: include the Testcontainers tests. Enable their build tag, project, or
marker (-tags=integration, a Vitest project, a pytest marker). When they are in a separate
package, add -coverpkg=./... (Go) or the equivalent, so that the coverage counts the code
that they call. When the unit and integration tests need two commands, run them one after
the other and merge the coverage reports.
Docker: run docker info. When it fails, ask the user to start Docker. When the user
declines, run the unit tests only, and record the coverage as partial in Gaps.
Exclusions: exclude E2E tests and tests that need a live external service. Use the runner filter, and record it.
Show the commands to the user and ask for approval (see Scope exception).
git worktree remove --force "$WT"
git worktree prune
rm -rf "$TMP"
Do this also when an earlier step failed.
Use this template after the contract header, ## Summary, and ## Gaps. Gaps include every
metric with a warn or fail status, every Not measured metric, every failing test, and partial
coverage.
## Environment and tools
| Item | Value |
|------|-------|
| Measured commit | <full hash> (HEAD, uncommitted changes not measured) |
| Install command | |
| Test commands | <unit and integration commands, with the serial options> |
| Integration tests | included (Testcontainers) / excluded: <reason> |
| Excluded tests | <filter and reason> |
| Coverage tool | |
## Metrics and thresholds
| Metric | Value | Threshold (pass) | Status |
|--------|-------|------------------|--------|
| Line coverage | <n> % | ≥ 80 % | |
| Branch coverage | <n> % | — | — |
## Test run
| Passed | Failed | Skipped | Duration |
|--------|--------|---------|----------|
(failing tests, when any: test file#line, test name, error line)
## Coverage by folder
| Folder | Line coverage | Status |
|--------|---------------|--------|
Confirm the contract checklist, then:
git worktree list shows no worktree from this run.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nexadevapp/nexa-claude-skills-marketplace --plugin nexa-claude-audit8 skills in this plugin
/architecture-auditWrites a dated architecture audit report for the current repository: links to the existing architecture documents, diagrams, and ADRs; the dependencies found in the implementation; C4 context, container, and component diagrams, sequence diagrams, and entity relationship diagrams in Mermaid, drawn from the code; a 4+1 view coverage map; and a trace of the non-functional requirements. Works on any repository and any tech stack. Writes only docs/audit/architecture-audit/architecture-audit-YYYY-MM-DD-<hash>.md. This skill must only be invoked explicitly via /architecture-audit — never inferred from user messages.
/cicd-auditWrites a dated CI/CD audit report for the current repository: the CI/CD system and local gates, a table of every pipeline with its triggers, jobs, test categories, and deploy target, a Mermaid flowchart of the main pipeline, the quality gates, and the gaps. Works on any repository and any CI system (GitHub Actions, GitLab CI, Jenkins, CircleCI, Azure Pipelines, Bitbucket, and others). Writes only docs/audit/cicd-audit/cicd-audit-YYYY-MM-DD-<hash>.md. This skill must only be invoked explicitly via /cicd-audit — never inferred from user messages.
/code-metrics-auditWrites a dated code metrics audit report for the current repository: cyclomatic complexity, duplicated code percentage, coupling between objects (CBO), and depth of inheritance tree (DIT), each with a pass / warn / fail status against a fixed threshold. Static analysis only; runs no tests and no builds. Works on any repository and any tech stack. Writes only docs/audit/code-metrics-audit/code-metrics-audit-YYYY-MM-DD-<hash>.md. This skill must only be invoked explicitly via /code-metrics-audit — never inferred from user messages.
/infra-auditWrites a dated infrastructure audit report for the current repository: where and how the infrastructure is defined (Terraform, Pulumi, CDK, Helm, Kubernetes, Dockerfiles, Compose, serverless configs), the environments and how one is selected, the secret references (names only), and the local development infrastructure. Works on any repository and any tech stack. Writes only docs/audit/infra-audit/infra-audit-YYYY-MM-DD-<hash>.md. This skill must only be invoked explicitly via /infra-audit — never inferred from user messages.
/mutation-auditWrites a dated mutation audit report for the current repository: a serial unit test run, a time-boxed mutation testing run on the core business logic first, and a second unit test run, with the mutation score against a fixed threshold. Runs one test process at a time, in a temporary git worktree, so the working tree does not change. Works on any repository and any tech stack. Writes only docs/audit/mutation-audit/mutation-audit-YYYY-MM-DD-<hash>.md. This skill must only be invoked explicitly via /mutation-audit — never inferred from user messages.
/qa-auditWrites a dated QA audit report for the current repository: an inventory of every automated test, each put in exactly one category (unit, integration, E2E, misc), plus the explicitly tagged smoke tests and the skipped or disabled tests. Works on any repository and any tech stack. Writes only docs/audit/qa-audit/qa-audit-YYYY-MM-DD-<hash>.md. This skill must only be invoked explicitly via /qa-audit — never inferred from user messages.
Other plugins' skills for the same job