/apex-test-list:audit-testsfrom apex-test-list
Audits Apex test annotations in Salesforce DX projects, finding missing @Tests, stale annotations, mismatched suites, and coverage gaps. Reports issues and offers fixes.
Ships in apex-test-list. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Test annotations drift: tests get renamed or deleted, classes get added without annotations, and coverage moves as code changes. This skill finds those problems and shows exactly which tests a change would run, so the selection stays transparent instead of trusted blindly.
The audit runs the apex-test-map command from the apextestlist npm package
with npx -y -p apextestlist@1 apex-test-map, which needs no Salesforce CLI or plugin
install. It needs Node.js 22.19 or newer and doesn't change files in scan or
audit.
sfdx-project.json in the working directory or a parent and run
commands from its folder. Without one, stop.node --version is 22.19 or newer.--ignore-package-directory <path>.annotate-tests skill),
add --header-template <file> to the audit. It then also reports annotated
files whose annotations aren't inside a leading header of the template's
comment style (/** */ or //). Fix those with the user; don't rewrite
headers on your own.npx -y -p apextestlist@1 apex-test-map audit
It reports:
| Finding | What it means |
|---|---|
No @Tests or @TestSuites | changing this file selects no tests; apextestlist also warns about it on every run |
@Tests names that are not local classes | renamed, deleted, misspelled, or only in the org; --ignore-missing-tests silently drops them |
@Tests names that are classes without @isTest | points at a non-test class, usually a mistake |
@TestSuites names with no local suite | the suite file is missing, so its tests are never added |
| Suite entries that match no local test class | a suite lists a test (or Name*Test pattern) that doesn't exist |
| Annotations with more than N tests | --max-tests N (default 10); consider a suite or narrower tests |
.test-dependencies.yml problems | keys that aren't local tests, entries that aren't Type:Member |
If the user has an org with the code deployed and recent test results, export
coverage as described in the annotate-tests skill (Step 2), to a temporary
folder outside the project, then:
npx -y -p apextestlist@1 apex-test-map audit --coverage <temp folder>/coverage.json
This adds, per annotated class:
Coverage only reflects the last test run. If many classes show no coverage rows, say the data looks stale rather than reporting each one.
For "which tests will run for this change" or "why didn't X run":
Build the manifest the pipeline uses (often sfdx-git-delta:
sf sgd source delta --from <base> --to HEAD --output-dir <temp folder>).
Without one, write a package.xml in a temporary folder listing the changed
classes and triggers from git diff --name-only <base>.
Run the same selection sf apextests list makes, without the Salesforce CLI:
npx -y -p apextestlist@1 apex-test-map list --manifest <temp folder>/package/package.xml --ignore-missing-tests
Show the tests, the deploy flags, and the warnings. Add
--filter-by-metadata if the pipeline selects tests from
.test-dependencies.yml.
For a test that didn't run, point to the missing link: no annotation on the changed class, a misspelled name, or a suite that doesn't list it.
Summarize the findings by severity: unannotated classes and unknown names first, then coverage differences, then broad annotations. Don't edit anything until the user picks what to fix.
annotate-tests skill's plan and
apply flow; it only adds names.// @Tests: line directly, keeping the
comma-separated format on one // line. The script never removes names.testSuites/*.testSuite-meta.xml
or the annotation, whichever the user says is wrong.After fixing, run npx -y -p apextestlist@1 apex-test-map audit again and show the before and after counts.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wisefoxme/apex-test-list --plugin apex-test-list2 skills in this plugin
Other plugins' skills for the same job