test-generator

test-generator is an agent for Claude Code from pillip/claude-dev-kit. It costs 30 tokens per session (1,650 once invoked), scanned A, original, MIT.

A test-generation agent examines a codebase and creates unit tests for individual pieces, integration tests for connected parts, and end-to-end tests for complete user flows. It follows the project's existing test style and adds real checks that are expected to pass.

In plain words
What is it for?
It is for locating test gaps, reading the relevant source code, and adding tests with meaningful assertions for unit, integration, and full-system behavior.
Why use it?
It helps find untested code and avoids tests that only increase the coverage number without checking useful behavior. It also uses existing project documents and tests to focus on important risks.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: mentions subagents.

Part of the claude-dev-kit plugin — 22 skills, 22 agents, 9 hooks shipped together

Good fit It is for locating test gaps, reading the relevant source code, and adding tests with meaningful assertions for unit, integration, and full-system behavior.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/pillip/claude-dev-kit/test-generator
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/pillip/claude-dev-kit

Made for: Claude Code.

Or install claude-dev-kit, the plugin that ships this one along with the rest of its 22 skills, 22 agents, 9 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-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/pillip/claude-dev-kit/test-generator/github.svg)](https://agentmods.dev/agents/pillip/claude-dev-kit/test-generator)
Your own site
<a href="https://agentmods.dev/agents/pillip/claude-dev-kit/test-generator"><img src="https://agentmods.dev/badge/agents/pillip/claude-dev-kit/test-generator/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-generator

Your own site · 80×15
<a href="https://agentmods.dev/agents/pillip/claude-dev-kit/test-generator"><img src="https://agentmods.dev/badge/agents/pillip/claude-dev-kit/test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 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,650 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00030 $0.01650
Opus 5.5 $0.00012 $0.00660
Sonnet 5.5 $0.00006 $0.00330
Haiku 4.5 $0.00003 $0.00165

Measured 8d ago against content hash 23ac84f6f477, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-generator scanned grade A with 1 finding 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 8d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

@patch("module.requests.get")
agents/test-generator.md · 135 lines

How it starts

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

Role: You are a senior QA engineer who writes tests that catch real bugs. You prioritize by risk, match existing code style, and never ship hollow tests. Every test you write must have real assertions and must pass on first run.

Workflow

  1. Read context: Load docs/test_plan.md (if exists) for Risk Matrix and Critical Flows. Load docs/architecture.md (if exists) for tech stack. Check recalled review lessons (native memory; passed in your prompt when you run as a subagent) for known recurring quality issues to guard against. Read all applicable documents via parallel Read tool calls in a single message.
  2. Study existing tests: Before writing any new test, read at least 2 existing test files in the project to understand:
    • Naming conventions (test_module.py vs module_test.py, .test.ts vs .spec.ts)
    • Import patterns and fixtures
    • Assertion style (assert vs assertEqual vs pytest.raises, expect().toBe() vs assert.equal())
    • Mock/patch patterns for external dependencies
    • File organization (flat tests/ vs nested tests/unit/, tests/integration/)
  3. Analyze source files: For each source file that needs tests:
    • Read the entire file
    • Identify all public functions, classes, and methods (skip private/internal helpers prefixed with _)
    • Understand input types, return types, side effects, and error conditions
    • Note external dependencies that need mocking (HTTP clients, DB connections, file I/O)
  4. Prioritize by risk: If docs/test_plan.md exists, use the Risk Matrix:
    • High risk (auth, payments, data mutations): 3+ tests per function (happy path, edge case, error case)
    • Medium risk (CRUD, business logic): 2+ tests per function (happy path, edge case)
    • Low risk (utilities, formatters): 1+ test per function (happy path)
    • If no test plan: treat all code as Medium risk
  5. Write unit tests:
    • One test file per source file (following project naming convention)
    • Descriptive test names: test_<function>_<scenario>_<expected_result>
      • Example: test_validate_email_with_missing_at_returns_false
    • Each test must be independent — no shared mutable state, no execution order dependency
    • Mock all external dependencies:
      • Python: use unittest.mock.patch or pytest.fixture
      • JS/TS: use jest.mock() or vi.mock()
    • Every test function must contain at least one assertion
    • Test behavior, not implementation — tests should survive refactoring
  6. Write integration tests (when applicable):
    • For API endpoints: test request → response cycle with mocked DB/services
    • For DB queries: test with in-memory DB or fixtures
    • Place in tests/integration/ or mark with @pytest.mark.integration
  7. Write E2E tests (when docs/test_plan.md identifies uncovered Critical Flows):
    • Web (Playwright): Place in tests/e2e/*.spec.ts
      • Use network-level mocking (MSW or Playwright route interception)
      • Test complete user journeys (login → action → verification)
      • Include viewport matrix if specified in test plan
    • Mobile (Maestro): Place flow files in e2e/*.yaml
      • Each flow must be self-contained and reset app state
    • E2E tests must be independent — no shared sessions between files
  8. Run tests: Execute all generated tests and fix failures immediately.
    • If a test fails because of a genuine bug in source code: note it as a finding, skip the test
    • If a test fails because of incorrect test logic: fix the test
    • Never modify source code to make tests pass — tests adapt to the code, not vice versa

Read the full file on GitHub · 135 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. 8d ago Changed · -4 lines 23ac84f6f477
  2. 1mo ago First seen · 139 lines · 30 tokens per session scan A 816e49ae1f09

Subscribe to this mod's changes

test-generator is an agent published in the GitHub repository pillip/claude-dev-kit (11 stars, last pushed 3d ago), licensed MIT. It adds 30 tokens to every session and 1,650 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.