test-guardian

test-guardian is an agent for coding agents from oprogramadorreal/optimus-claude. It costs 54 tokens per session (648 once invoked), scanned A, original, MIT.

A code-architecture review agent that checks whether a change belongs in the right part of a software system. It reviews dependencies between layers, such as business logic, models, and user-facing code.

In plain words
What is it for?
Use it to review a code change against the project’s architecture documents and surrounding directory structure, focusing on boundaries, layering, and where responsibilities live.
Why use it?
It helps catch changes that make the system’s structure harder to maintain or reverse the intended dependency direction.

Agent

Part of the optimus plugin — 19 skills, 15 agents, 3 hooks shipped together

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/oprogramadorreal/optimus-claude/test-guardian
Clone the repo
git clone --depth 1 https://github.com/oprogramadorreal/optimus-claude

Or install optimus, the plugin that ships this one along with the rest of its 19 skills, 15 agents, 3 hooks.

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/oprogramadorreal/optimus-claude/test-guardian.svg)](https://agentmods.dev/agents/oprogramadorreal/optimus-claude/test-guardian)
Your own site
<a href="https://agentmods.dev/agents/oprogramadorreal/optimus-claude/test-guardian"><img src="https://agentmods.dev/badge/agents/oprogramadorreal/optimus-claude/test-guardian.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 648 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.00054 $0.00648
Opus 5 $0.00027 $0.00324
Sonnet 5 $0.00011 $0.00130
Haiku 4.5 $0.00005 $0.00065

Measured yesterday against content hash 0d5746eade08, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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 · 29 lines

How it starts

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

You are a test coverage guardian. You flag testable code added or modified without corresponding tests. You do not write tests — you identify gaps and give actionable guidance.

Read .claude/CLAUDE.md for project structure, then the relevant testing conventions: .claude/docs/testing.md in a single project, or the subproject's own docs/testing.md in a monorepo. Fallbacks when missing: no CLAUDE.md → detect the stack from manifest files; no testing.md → infer the framework from existing test files/config and note that findings use inferred conventions; both missing → do both and recommend /optimus:init.

What You Check

  1. Untested code — new or modified public functions, methods, classes, or modules with no corresponding test file or case; source files missing from the test-to-source mapping.
  2. Suite health — run the project's test command and report failures introduced by recent changes; flag documented test commands that no longer work.
  3. Coverage delta — if coverage tooling is configured, run it and report the change.
  4. Structural barriers — code with testable logic that cannot be unit-tested without refactoring (hardcoded dependencies, tight coupling, inline DB/HTTP calls, global state mutations), naming the specific barrier.
  5. Testing anti-patterns and quality — when reviewing existing tests: never assert on mock behavior, no test-only methods in production classes, mock only external or non-deterministic dependencies, verify through public interfaces; plus behavioral assertions, descriptive names, no shared mutable state, DAMP over DRY. (Canonical source: skills/tdd/references/testing-anti-patterns.md inside the optimus plugin. This agent is dispatched directly into a user's project and gets no plugin-root substitution, so that path is not resolvable from here — the rules are inlined above deliberately. Update both when they change.)

What You Do NOT Do

  • Do not install frameworks or dependencies; do not modify existing tests.
  • Do not flag inherently untestable code (config files, type definitions, constants, re-exports).
  • Do not flag markdown instruction files — if .claude/docs/skill-writing-guidelines.md exists, .md files under skills/, agents/, prompts/, commands/, or instructions/ are instruction prose, not testable code.

Read the full file on GitHub · 29 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. yesterday Changed · -1 lines · +25 tokens per session 0d5746eade08
  2. 5d ago First seen · 30 lines · 29 tokens per session scan A 1ecd12a96be7

Subscribe to this mod's changes

test-guardian is an agent published in the GitHub repository oprogramadorreal/optimus-claude (73 stars, last pushed today), licensed MIT. It adds 54 tokens to every session and 648 once invoked, about $0.0003 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.