test-audit

A test audit is a review of automated tests that judges whether each test provides useful protection against real problems. This command scores tests using a project rubric and recommends keeping, rewriting, combining, deleting, or escalating them.

In plain words
What is it for?
Use it to review all tests or a selected folder, apply exclusions, and produce a report of recommended actions for each test.
Why use it?
Test suites can become slow, repetitive, or difficult to maintain without improving confidence in the code. The audit identifies low-value tests without running the suite.

Command

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 commands/skullninja/coco-workflow/test-audit
Clone the repo
git clone --depth 1 https://github.com/skullninja/coco-workflow
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,782 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.00035 $0.01782
Opus 5 $0.00017 $0.00891
Sonnet 5 $0.00007 $0.00356
Haiku 4.5 $0.00003 $0.00178

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

Security

Grade A, and why

test-audit 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.

commands/test-audit.md · 153 lines

How it starts

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

User Input

$ARGUMENTS

$ARGUMENTS can contain:

  • A path scope (e.g. tests/auth or src/) -- limits the audit to that subtree. Default: the whole repo.
  • --summary -- print the report to the terminal only, do not write a file.

Setup

  1. Read .coco/config.yaml for:

    • testing.test_audit_report_dir (default: docs/test-audit)
    • testing.test_audit_exclude -- path globs to skip
    • testing.test_command -- context only; this command never runs the suite
    • project.specs_dir (default: specs)
  2. Load the test value rubric, resolving in order:

    • .coco/templates/test-value-rubric.md (project override)
    • ${CLAUDE_PLUGIN_ROOT}/templates/test-value-rubric.md (default)
  3. Get the current date for the report filename:

    date -u +%Y-%m-%d
    

Execution

1. Inventory the suite

Find test files by convention, honoring the scope argument and test_audit_exclude:

git ls-files

Filter the output for test paths -- test_*, *_test.*, *.test.*, *.spec.*, tests/**, spec/**, __tests__/** -- and drop anything matching an exclude glob. Use git ls-files rather than find so untracked scratch files and build artifacts never enter the audit.

Report the count before proceeding. If it is zero, follow Edge Cases.

2. Load the stated intent

For each feature directory under {specs_dir}/, read the ## Test Strategy section of design.md if present. Collect the FRs marked Test? = yes, the levels chosen, and everything listed under Not worth testing.

This is evidence, not authority. Designs are written before implementation and are never rewritten afterward, so a stale "not worth testing" note penalizes a test's behavioral anchoring but never by itself justifies deleting it. Record which designs were found -- the report states what the audit had to work with.

3. Score

If the inventory is 40 files or fewer: score inline, reading each test file and enough of the code under test to answer "what defect would ship without this?"

Read the full file on GitHub · 153 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 · 153 lines · 35 tokens per session scan A b65baba16317

Subscribe to this mod's changes

test-audit is a command published in the GitHub repository skullninja/coco-workflow (7 stars, last pushed 2d ago), licensed MIT. It adds 35 tokens to every session and 1,782 once invoked, about $0.0002 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-31.