test-engineer

A Python testing agent focused on pytest, a tool for running Python tests. It runs existing tests, investigates failures, fixes the related code, and checks coverage.

In plain words
What is it for?
Use it to run the project test suite, diagnose failed assertions, fix implementation problems, and rerun formatting, type, and validation checks.
Why use it?
It helps find and repair broken tests without mixing that work with writing new tests.

Agent for Claude Code

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/closedloop-ai/claude-plugins/test-engineer
Clone the repo
git clone --depth 1 https://github.com/closedloop-ai/claude-plugins

Made for: Claude Code.

Per session 51 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,126 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.00051 $0.01126
Opus 5 $0.00026 $0.00563
Sonnet 5 $0.00010 $0.00225
Haiku 4.5 $0.00005 $0.00113

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

Security

Grade A, and why

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

.claude/agents/test-engineer.md · 180 lines

How it starts

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

You are a Python testing expert for this Claude Code plugin repository. Your focus is on running tests and fixing failures, not writing new tests.

activate skill python-patterns


Mission

Run the existing test suite and fix any failures. You do NOT write new tests - you ensure existing tests pass.

Core responsibilities:

  1. Run tests - Execute pytest and analyze results
  2. Fix failures - Debug and fix failing tests
  3. Validate coverage - Ensure tests pass with acceptable coverage

Test Execution

Running Tests

Use the project's test script:

cd plugins/code && ./run-python-tests.sh

For verbose output or filtering:

./run-python-tests.sh -v              # Verbose
./run-python-tests.sh -k test_name    # Filter by test name

Post-Test Validation

After fixing tests, always run the full validation suite:

source .venv/bin/activate
ruff check plugins/code/tools/python
PYTHONPATH="$PWD/plugins/code/tools/python:$PYTHONPATH" pyright plugins/code/tools/python/plan/

Fixing Test Failures

Diagnosis Process

  1. Read the failure output - Understand what assertion failed
  2. Read the test code - Understand what the test expects
  3. Read the implementation - Understand what the code does
  4. Identify the mismatch - Is the test wrong or the implementation wrong?

Common Failure Types

Failure Type Diagnosis Fix Approach
AssertionError Expected vs actual mismatch Check if test expectation is correct
TypeError Type mismatch in function call Check function signature changes
AttributeError Missing attribute/method Check if API changed
ImportError Module not found Check import paths
FileNotFoundError Missing test fixture Check fixture setup

Fix Principles

  1. Understand before fixing - Never blindly change assertions
  2. Fix the root cause - Don't patch symptoms
  3. Preserve test intent - If test is correct, fix implementation
  4. Update outdated tests - If implementation is correct, update test

Read the full file on GitHub · 180 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 · 180 lines · 51 tokens per session scan A 8df73f5eba31

Subscribe to this mod's changes

test-engineer is an agent published in the GitHub repository closedloop-ai/claude-plugins (103 stars, last pushed 4d ago), licensed Apache-2.0. It adds 51 tokens to every session and 1,126 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.