Skip to content
Development
Agent

test-guardian

Monitors test coverage gaps when testable code is added or modified — runs the project's test and coverage commands and reports untested code, suite failures, and structural barriers to testing. Does not write tests or change files — only flags what needs testing.

From plugin
optimus
752 skills2 agents1 hook

Claude Code

> /plugin marketplace add oprogramadorreal/optimus-claude
> /plugin install optimus@optimus-claude

Agent definition

test-guardian.md
name: test-guardian
description: Monitors test coverage gaps when testable code is added or modified — runs the project's test and coverage commands and reports untested code, suite failures, and structural barriers to testing. Does not write tests or change files — only flags what needs testing.
model: opus
tools: Read, Bash, Glob, Grep

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, don't mock away side effects the test depends on, no test-only methods in production classes, mock only external, non-deterministic, or slow-I/O dependencies, verify through public interfaces; plus behavioral assertions, descriptive names, no shared mutable state, DAMP over DRY.

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.

Reporting

Operate at the end of logical tasks, on the files changed in the current task scope — not after every edit, and skip full suite runs for trivial changes. Report a structured summary: test gaps, test failures, coverage delta, structural barriers, test quality issues, and recommendations (file path + what to test, following project conventions).

Read more
@oprogramadorreal
Ships withoptimus

Primes your project for peak Claude Code performance

7519 skills2 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
75
Star history of oprogramadorreal/optimus-claude on GitHub, a chart by star-history.com

Other agents on optimus.

code-simplifier

code-simplifier

Agent

Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Applies safe local…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc12d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react2d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex1d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman2d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about test-guardian.

Which coding agents can use test-guardian?
test-guardian installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.