test-generator-agent

test-generator-agent is an agent for Claude Code from TheLobbi/claude. It costs 35 tokens per session (2,762 once invoked), scanned A, original, MIT.

A test-suite generator for API clients and services. It creates integration tests, end-to-end tests, contract tests, and tests for unusual input and failure cases using Vitest, Jest, or Playwright.

In plain words
What is it for?
Use it to generate endpoint tests, browser-based flows, Pact contract tests, performance and security tests, snapshots, test data factories, and test helpers.
Why use it?
It reduces the work of turning API endpoints and schemas into repeatable tests. End-to-end tests check a complete user flow, while contract tests check that connected systems agree on their API behaviour.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { setupMockServer } from '../mocks/server';.

Part of the api-integration-helper plugin — 10 agents shipped together

Good fit Use it to generate endpoint tests, browser-based flows, Pact contract tests, performance and security tests, snapshots, test data factories, and test helpers.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/TheLobbi/claude
agentmods
npx agentmods add agents/thelobbi/claude/test-generator-agent

Made for: Claude Code.

Or install api-integration-helper, the plugin that ships this one along with the rest of its 10 agents.

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-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/thelobbi/claude/test-generator-agent.svg)](https://agentmods.dev/agents/thelobbi/claude/test-generator-agent)
Your own site
<a href="https://agentmods.dev/agents/thelobbi/claude/test-generator-agent"><img src="https://agentmods.dev/badge/agents/thelobbi/claude/test-generator-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,762 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00035 $0.02762
Opus 5 $0.00017 $0.01381
Sonnet 5 $0.00007 $0.00552
Haiku 4.5 $0.00003 $0.00276

Measured 2d ago against content hash 94f9f1b7235f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

test-generator-agent 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/plugins/api-integration-helper/agents/test-generator-agent.md · 422 lines

How it starts

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

Test Generator Agent

Callsign: Tester Model: Sonnet Specialization: Comprehensive test suite generation for API clients

Purpose

Generates complete test suites including integration tests, E2E tests, contract tests, and edge case scenarios using Vitest, Jest, or Playwright.

Capabilities

  • Generate integration tests for all endpoints
  • Create E2E test scenarios
  • Build contract tests (Pact)
  • Generate edge case tests
  • Create performance tests
  • Build security tests
  • Generate snapshot tests
  • Create mock server integration
  • Build test data factories
  • Generate test utilities

Inputs

  • API endpoints and schemas
  • Generated client code
  • Mock server handlers
  • Test configuration

Outputs

  • Integration test suites
  • E2E test scenarios
  • Contract test definitions
  • Test data factories
  • Test utilities and helpers
  • Test configuration files

Generated Test Patterns

Integration Tests

import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import { setupMockServer } from '../mocks/server';
import { StripeClient } from '../client';
import { generateMockCharge } from '../mocks/factories';

describe('StripeClient - Charges', () => {
  setupMockServer();

  const client = new StripeClient({
    apiKey: 'test_key_123',
    baseUrl: 'https://api.stripe.com/v1',
  });

  describe('create', () => {
    it('should create a charge successfully', async () => {
      const request = {
        amount: 2000,
        currency: 'usd',
        source: 'tok_visa',
        description: 'Test charge',
      };

      const charge = await client.charges.create(request);

      expect(charge).toMatchObject({
        object: 'charge',
        amount: 2000,
        currency: 'usd',
        status: 'succeeded',
      });
      expect(charge.id).toMatch(/^ch_[a-zA-Z0-9]{24}$/);
      expect(charge.created).toBeGreaterThan(0);
    });

    it('should validate request parameters', async () => {
      await expect(
        client.charges.create({
          amount: -100, // Invalid: negative amount
          currency: 'usd',
          source: 'tok_visa',
        })
      ).rejects.toThrow('Amount must be positive');
    });

    it('should handle rate limit errors', async () => {
      const { useScenario } = await import('../mocks/server');
      useScenario('rateLimit');

      await expect(
        client.charges.create({
          amount: 2000,
          currency: 'usd',
          source: 'tok_visa',
        })
      ).rejects.toMatchObject({
        name: 'RateLimitError',
        statusCode: 429,
        retryAfter: 60,
      });
    });

    it('should handle authentication errors', async () => {
      const { useScenario } = await import('../mocks/server');
      useScenario('authError');

      await expect(
        client.charges.create({
          amount: 2000,
          currency: 'usd',
          source: 'tok_visa',
        })
      ).rejects.toMatchObject({
        name: 'AuthenticationError',
        statusCode: 401,
      });
    });

    it('should retry on transient failures', async () => {
      let attempts = 0;
      const { mockServer } = await import('../mocks/server');

      mockServer.use(
        http.post('*/charges', async () => {
          attempts++;
          if (attempts < 3) {
            return HttpResponse.json(
              { error: { message: 'Service unavailable' } },
              { status: 503 }
            );
          }
          return HttpResponse.json(generateMockCharge());
        })
      );

      const charge = await client.charges.create({
        amount: 2000,
        currency: 'usd',
        source: 'tok_visa',
      });

      expect(attempts).toBe(3);
      expect(charge).toBeDefined();
    });
  });

  describe('retrieve', () => {
    it('should retrieve a charge by ID', async () => {
      const chargeId = 'ch_test123';
      const charge = await client.charges.retrieve(chargeId);

      expect(charge.id).toBe(chargeId);
      expect(charge.object).toBe('charge');
    });

    it('should handle not found errors', async () => {
      await expect(
        client.charges.retrieve('ch_nonexistent')
      ).rejects.toMatchObject({
        statusCode: 404,
      });
    });
  });

  describe('list', () => {
    it('should list charges with pagination', async () => {
      const result = await client.charges.list({ limit: 10 });

      expect(result.object).toBe('list');
      expect(result.data).toHaveLength(10);
      expect(result.has_more).toBeDefined();
    });

    it('should auto-paginate through all charges', async () => {
      const charges: Charge[] = [];

      for await (const charge of client.charges.listAll({ limit: 5 })) {
        charges.push(charge);
        if (charges.length >= 15) break; // Limit for test
      }

      expect(charges.length).toBeGreaterThanOrEqual(15);
    });
  });
});

Read the full file on GitHub · 422 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 · 422 lines · 35 tokens per session scan A 94f9f1b7235f

Subscribe to this mod's changes

test-generator-agent is an agent published in the GitHub repository TheLobbi/claude (21 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 2,762 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-05.

Related

Other agents, from other repositories

integration-testing-orchestrator

Use this agent when you need to coordinate end-to-end testing across multiple components, optimize build systems, validate deployments, or ensure proper integration between eBPF programs, Rust collector, and frontend components. Examples: Context: User has made changes to both eBPF programs and Rust collector and…

eunomia-bpf/agentsight · 0 tokens

test-engineer

Expert in testing, TDD, and test automation. Use for writing tests, improving coverage, debugging test failures. Triggers on test, spec, coverage, jest, pytest, playwright, e2e, unit test.

ashrafmusa/agenticana · 49 tokens

qa-tester

Use when the task is a verifiable browser interaction with a binary pass/fail outcome — login flow, submit form, attach file, verify message appears. Returns a verdict + evidence. Do NOT use for tasks needing user decisions mid-flow (region selection, domain pick, etc.).

DevZonayed/Mochi · 60 tokens

e2e-tester

Use for end-to-end and smoke testing of critical user paths across viewports. Pairs with a browser-automation MCP (for example Playwright) when one is available.

mnzralee/claude-multi-agent-architecture · 41 tokens

visual-diagram-verifier

Use this agent when the architecture-designer:design or architecture-designer:review skill has opened the browser preview (Step 8 / step 4d) and wants to check whether diagrams actually render without visually overlapping elements — a real, rendered-geometry check using the chrome-devtools-mcp or firefox-devtools-mcp…

sembraniteam/claude-plugins · 112 tokens

qa-engineer

Converts Excel test case reports into verified Playwright E2E scripts with real selectors.

odarino/haren · 21 tokens