test-generator — Claude Code subagent: tests and install
This subagent studies code changes and project test conventions before outlining useful test cases. Use it when new or changed logic needs coverage.
npx claude-code-templates@latest --agent development-team/test-generatorWhat test-generator does
test-generator starts by mapping the project’s testing context: frameworks, file naming, test layout, mocking style, utilities, and guidance in CLAUDE.md. It then examines the changed code, public entry points, dependencies, state changes, failures, and boundary values.
The result is an actionable test plan covering unit, integration, and e2e scenarios. Each case includes a project-style name, category, setup, actions, expected assertions, and priority. The report also points to test file locations, lists mock or fixture needs, and can include code samples that match the surrounding style.
The subagent can use Glob, Grep, LS, Read, BashOutput, and related tools while inspecting the repository. Because it reads CLAUDE.md, that file’s testing guidance affects the generated plan.
What it helps with
- map code changes to missing tests
- surface boundary and failure scenarios
- choose unit, integration, or e2e coverage
- list required mocks, fixtures, and test data
- rank proposed checks by priority
Example prompts for the agent
- Review the changes in this branch and prepare a test plan that follows the repository conventions.
- Inspect the existing tests for this module, then propose coverage for the new behavior.
- Find failure and boundary cases in the changed code and provide test examples in the project’s style.
How to install test-generator
1claude-code-templates
npx claude-code-templates@latest --agent development-team/test-generator2Manually: put the files in place
.claude/agents/test-generator.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/test-generator.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/test-generator.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about test-generator
How do I install test-generator in Claude Code?
Run npx claude-code-templates@latest --agent development-team/test-generator, then use the file .claude/agents/test-generator.md.
What does test-generator do?
It examines code changes, existing tests, and repository conventions, then produces a detailed test plan with setup, actions, assertions, categories, and priorities.
Which project conventions does test-generator inspect?
It checks CLAUDE.md, test structure, naming patterns, mocking practices, and the project’s approach to unit, integration, and e2e tests.