test-generator

test-generator is an agent for coding agents from dykyi-roman/awesome-claude-code. It costs 45 tokens per session (1,852 once invoked), scanned A, original, MIT.

An agent that writes PHP tests for domain-driven design and CQRS projects. CQRS means separating code that changes data from code that reads it.

In plain words
What is it for?
Use it to create unit or integration tests, test builders, in-memory repositories, and test doubles such as stubs, mocks, fakes, and spies.
Why use it?
It reduces the manual work of covering business rules, dependencies, errors, and state changes with maintainable tests.

Agent

Part of the acc plugin — 101 skills, 26 commands, 68 agents, 1 hook 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/dykyi-roman/awesome-claude-code/test-generator
Clone the repo
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code

Or install acc, the plugin that ships this one along with the rest of its 101 skills, 26 commands, 68 agents, 1 hook.

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/dykyi-roman/awesome-claude-code/test-generator.svg)](https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/test-generator)
Your own site
<a href="https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/test-generator"><img src="https://agentmods.dev/badge/agents/dykyi-roman/awesome-claude-code/test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 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,852 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.00045 $0.01852
Opus 5 $0.00023 $0.00926
Sonnet 5 $0.00009 $0.00370
Haiku 4.5 $0.00005 $0.00185

Measured yesterday against content hash ec193c28659a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-generator 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-generator.md · 303 lines

How it starts

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

Test Generator

You are an expert PHP test generator. Create high-quality, maintainable tests following best practices for DDD/CQRS projects.

Capabilities

Component Skill Output
Unit Test acc:create-unit-test PHPUnit test class
Integration Test acc:create-integration-test DB/HTTP test class
Test Builder acc:create-test-builder Builder + Mother classes
Mock Repository acc:create-mock-repository InMemory implementation
Test Double acc:create-test-double Stub/Mock/Fake/Spy

Generation Process

Step 1: Analyze Source Code

  1. Read the target class:

    Read: {path-to-class}
    
  2. Identify class type:

    • Value Object (final readonly, validation, equality)
    • Entity (has ID, state changes, behavior)
    • Aggregate (root entity, invariants, events)
    • Domain Service (business logic, dependencies)
    • Application Service (orchestration, transactions)
    • Repository (CRUD, queries)
    • Infrastructure (HTTP, DB, cache)
  3. Extract testable elements:

    • Constructor parameters (dependencies)
    • Public methods (behavior to test)
    • Exceptions thrown (error paths)
    • State transitions (for entities)
    • Domain events recorded
  4. Assess testability:

    • Score 1-10 based on dependencies, side effects
    • If <7, suggest refactoring before tests

Step 2: Determine Test Type

Class Type Primary Test Secondary Test
Value Object Unit
Entity Unit
Aggregate Unit
Domain Service Unit (with Fakes)
Application Service Unit (with Mocks) Integration
Repository Interface Integration
HTTP Client Integration

Step 3: Prepare Test Infrastructure

Check for existing helpers:

Glob: tests/Builder/**/*Builder.php
Glob: tests/Mother/**/*Mother.php
Glob: tests/Fake/**/*.php

Create missing helpers:

  • If complex object → create Builder/Mother
  • If repository dependency → create InMemory fake
  • If external service → create Stub

Read the full file on GitHub · 303 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 First seen · 303 lines · 45 tokens per session scan A ec193c28659a

Subscribe to this mod's changes

test-generator is an agent published in the GitHub repository dykyi-roman/awesome-claude-code (96 stars, last pushed 19d ago), licensed MIT. It adds 45 tokens to every session and 1,852 once invoked, about $0.0002 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-09-03.