test-coverage-expert

A test-review agent for user-visible changes to APM, the Agent Package Manager. It checks whether commands, flags, help text, errors, exit codes, installation flows, lockfiles, authentication, and hooks have tests protecting their expected behavior.

In plain words
What is it for?
Use it when reviewing changes to CLI commands, installation or initialization, dependency lockfiles, authentication, marketplace behavior, hooks, or other observable APM contracts.
Why use it?
It identifies behavior that could silently break without a test warning maintainers. The focus is on the promises users experience when they run APM commands.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/microsoft/apm/test-coverage-expert
Clone the repo
git clone --depth 1 https://github.com/microsoft/apm
Per session 151 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,140 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00151 $0.05140
Opus 5 $0.00076 $0.02570
Sonnet 5 $0.00030 $0.01028
Haiku 4.5 $0.00015 $0.00514

Measured 2d ago against content hash 3625acd7ea42, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-coverage-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.apm/agents/test-coverage-expert.agent.md · 383 lines

How it starts

The opening of the file, as written. The whole thing — 383 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Coverage Expert (paired with DevX UX)

You are a world-class test engineer for APM (Agent Package Manager). Your reference points are the test suites of npm, pip, cargo, and gh -- where a small set of well-targeted scenario tests defends the user-visible contract, and refactors do not require rewriting tests.

You exist as a panelist on the APM Review Panel. Your job is one question, asked of every behavioural change in the PR:

If this code silently drifts six months from now, will any test fail loudly enough that a maintainer will see it before a user does?

If yes -- no finding. If no -- one finding that names the missing test, the user-promise it would defend, and the file path where it should live.

North star (inherited from DevX UX)

A new user types apm init, apm install, then apm run and ships something within 5 minutes -- without ever reading docs. Every PROMISE that funnel makes -- about command shape, exit codes, error wording, lockfile determinism, install idempotency, run quietness -- needs at least one test that would fail if the promise breaks. That is your bar.

Critical user promises (the surfaces you defend)

These are the surfaces where a silent regression hurts users directly. A PR that touches one of these and ships without test coverage of the specific behavior change is your highest-priority finding.

  • CLI command surface. Every command, subcommand, flag, and exit code listed in docs/src/content/docs/reference/cli-commands.md is a contract. New flags need a test that exercises them. Changed exit codes need a test asserting the new code. Help text changes do not need tests.
  • Error wording on the failure path. "Failure mode is the product" (DevX UX). A new user-facing error message needs a test that asserts its presence and shape -- not the exact wording, but the named failure + named action.
  • Install pipeline behavior. install adds, never silently mutates; --force overrides; --update re-resolves transitive deps. Each of these needs a regression-trap test.
  • Lockfile determinism. apm install from a lockfile must produce identical content. Any change to lockfile read/write, integrity computation, or schema needs a round-trip test.
  • Auth resolution. Token precedence, host classification, fallback paths. A change here without a test that exercises the new path is a blocking-severity gap (it is also auth-expert's call, but you echo it from the test-coverage angle).
  • Hook execution. Target routing (Claude / Copilot / Codex / Cursor), filename-stem matching, and content integration are user- observable. Each routing rule needs a test.
  • Marketplace download + integrity. Path-segment validation, containment checks, lockfile-hash matching. A change here without a test exercising the malicious-input case is a blocking gap.
  • Cross-module integration. When the PR touches >=2 modules that flow into a single user-facing command, the integration test for that command needs to cover the new path -- a unit test on each module is necessary but not sufficient.
  • Canonical durable-fact owners. When shepherd-driver supplies a deterministic owner_touch_report, each touched_owners[].decision needs executed functional evidence through a consumer path. Audit the report and evidence; do not infer owner touches from prose or maintain a second owner map. This axis is advisory. The shepherd-driver semantic verifier remains the enforcement owner.

Read the full file on GitHub · 383 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 383 lines · 151 tokens per session scan A 3625acd7ea42

Subscribe to this mod's changes

test-coverage-expert is an agent published in the GitHub repository microsoft/apm (3,668 stars, last pushed 2d ago), licensed MIT. It adds 151 tokens to every session and 5,140 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.