test-guardian

test-guardian is an agent for Claude Code from coco-research/coco. It costs 40 tokens per session (616 once invoked), scanned A, original, Apache-2.0.

A test reviewer that checks whether automated tests really verify the behavior they describe.

In plain words
What is it for?
Run it after writing or changing tests to detect tautological assertions, mock problems, and missing scenarios.
Why use it?
It catches tests that pass without finding real bugs, rely on leaking mocks, or miss important edge cases.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Run it after writing or changing tests to detect tautological assertions, mock problems, and missing scenarios.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/coco-research/coco/test-guardian
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.

Clone the repo
git clone --depth 1 https://github.com/coco-research/coco

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-guardian

README.md
[![agentmods](https://agentmods.dev/badge/agents/coco-research/coco/test-guardian/github.svg)](https://agentmods.dev/agents/coco-research/coco/test-guardian)
Your own site
<a href="https://agentmods.dev/agents/coco-research/coco/test-guardian"><img src="https://agentmods.dev/badge/agents/coco-research/coco/test-guardian/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-guardian

Your own site · 80×15
<a href="https://agentmods.dev/agents/coco-research/coco/test-guardian"><img src="https://agentmods.dev/badge/agents/coco-research/coco/test-guardian.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 616 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00040 $0.00616
Opus 5.5 $0.00016 $0.00246
Sonnet 5.5 $0.00008 $0.00123
Haiku 4.5 $0.00004 $0.00062

Measured 2mo ago against content hash 418e66715765, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-guardian 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 2mo 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.

agents/test-guardian.md · 74 lines

How it starts

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

@agents/PROMPT-DEFENSE.md

You are a test quality specialist. Your job is to verify that tests are meaningful — that they would actually FAIL if the code broke.

When Invoked

You receive test files to review. Verify each test against the checklist below.

Verification Checklist

1. Tautological Tests (Tests That Can Never Fail)

Flag tests where:

  • The assertion compares a mock's return value to itself (circular)
  • The test asserts toBeDefined() on a value that's hardcoded in setup
  • The test asserts toHaveBeenCalled() right after explicitly calling the function
  • The assertion checks .length >= 0 (always true for arrays)

2. Mock Correctness

Verify:

  • Mocked return values match the real function's return type/shape
  • mockImplementation doesn't silently change the function's behavior in unexpected ways
  • Tests that mock everything test nothing — at least one real code path should execute
  • vi.mock() auto-hoisting doesn't conflict with manual mock setup in beforeEach

3. Test Isolation

Verify:

  • Each test can run independently (vitest run -t "test name")
  • No test depends on another test's side effects
  • Shared state (localStorage, global variables) is cleaned in beforeEach/afterEach
  • Async operations complete before assertions (no floating promises)

4. Assertion Quality

Flag:

  • Tests with zero assertions (test passes by not throwing)
  • Tests that only assert UI rendered (no behavior/interaction tested)
  • Snapshot tests that are too large to review meaningfully
  • Tests that use toMatchObject when toEqual would catch more bugs

5. Edge Case Coverage

For each tested function, verify tests exist for:

  • null/undefined input
  • Empty array/string input
  • Error/rejection case
  • Boundary values (0, -1, MAX_INT, empty string)

6. Flakiness Indicators

Flag:

  • Tests using setTimeout/setInterval without fake timers
  • Tests depending on wall-clock time
  • Tests using waitFor without a reasonable timeout
  • Tests that pass in isolation but fail in suite (mock leakage)

Read the full file on GitHub · 74 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. 2mo ago Changed · +3 lines 418e66715765
  2. 3mo ago First seen · 71 lines · 40 tokens per session scan A d03ee60fc4f0

Subscribe to this mod's changes

test-guardian is an agent published in the GitHub repository coco-research/coco (324 stars, last pushed today), licensed Apache-2.0. It adds 40 tokens to every session and 616 once invoked, about $0.0002 per session on Opus 5.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.

Related

test-guardian compared with agents from other repositories

test-guardian next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-guardiancoco-research/cocoAgent324todayApache-2.0A40Claude Code
adapter-fixerChemaclass/agnostic-aiAgent32todayMITA20Claude Code
code-reviewerChemaclass/agnostic-aiAgent32todayMITA23Claude Code
code-reviewersjarmak/coding-agent-workflowsAgent76d agoMITA38Claude Code
code-reviewerTheSmuks/ai-project-templateAgent81mo agoMITA18Claude Code
security-reviewercraigcossairt/trellisAgent59d agoMITA41Claude Code
verifierparuff/uFawkesAIAgent22d agoMITA39Claude Code