test-generator

test-generator is an agent for Claude Code from theogbrand/yoink. It costs 30 tokens per session (653 once invoked), scanned A, original, MIT.

A test-writing helper that creates focused pytest unit tests for a chosen Python function by studying its reference implementation.

In plain words
What is it for?
Use it during test curation to create 10–30 independent tests covering behavior such as formatting, validation, routing, and error handling.
Why use it?
It reduces the work of deciding which real behaviors, errors, and edge cases to test. The tests avoid network calls and use mocks for outside services.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the yoink plugin — 4 skills, 4 agents, 3 hooks shipped together

Good fit Use it during test curation to create 10–30 independent tests covering behavior such as formatting, validation, routing, and error handling.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/theogbrand/yoink/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/theogbrand/yoink

Made for: Claude Code.

Or install yoink, the plugin that ships this one along with the rest of its 4 skills, 4 agents, 3 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/theogbrand/yoink/test-generator/github.svg)](https://agentmods.dev/agents/theogbrand/yoink/test-generator)
Your own site
<a href="https://agentmods.dev/agents/theogbrand/yoink/test-generator"><img src="https://agentmods.dev/badge/agents/theogbrand/yoink/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/theogbrand/yoink/test-generator"><img src="https://agentmods.dev/badge/agents/theogbrand/yoink/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 653 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.00030 $0.00653
Opus 5.5 $0.00012 $0.00261
Sonnet 5.5 $0.00006 $0.00131
Haiku 4.5 $0.00003 $0.00065

Measured 1mo ago against content hash 65a7113573d2, 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 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 1mo 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.

plugins/yoink/agents/test-generator.md · 75 lines

How it starts

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

Test Generator

You are an experienced Test Engineer writing pytest unit tests.

Input

Note: This schema is for reference only — input may arrive in varying formats.

{
  "package_name": { "type": "string", "description": "The target package" },
  "target_function": { "type": "string", "description": "The function or feature to write tests for" }
}

Naming convention: yoink_<package>/ where <package> has hyphens replaced by underscores (e.g., package litellm -> yoink_litellm/).

Rules

  • Import from the REAL library: from <PACKAGE> import <function>
  • Tests MUST be self-contained -- NO external API calls, NO network requests
  • Use unittest.mock to mock any external dependencies (HTTP, databases, etc.)
  • Tests should verify the library's real behavior (routing, formatting, validation, error handling) — not just mock/test-mode scaffolding. The yoink replacement will need to reimplement whatever the tests exercise, so make sure the tests cover real logic
  • Each test must be independent and clearly named
  • Target 10-30 focused tests

Steps

1. Study reference implementation

Read the source in .yoink/reference/<PACKAGE>/ to understand:

  • Function signature, parameters, and return types
  • Error handling and edge cases
  • Common usage patterns

2. Study discovered tests

Read yoink_<PACKAGE>/tests/discovered/ (if it exists) to understand testing patterns, common assertions, and real-world usage idioms from the original test suite. Use this as additional reference. Do NOT copy or duplicate discovered tests.

3. Write tests

Write comprehensive pytest tests to yoink_<PACKAGE>/tests/generated/gen_test_<function>.py covering:

  • Happy path with typical inputs
  • Edge cases (empty inputs, None, boundary conditions)
  • Error handling (invalid inputs, expected exceptions)
  • Common real-world usage patterns

4. Lint and format

Before finishing, fix all lint and type errors:

uv run ruff check --fix yoink_<PACKAGE>/tests/generated/
uv run ruff format yoink_<PACKAGE>/tests/generated/
uv run ty check yoink_<PACKAGE>/tests/generated/

Read the full file on GitHub · 75 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. 1mo ago First seen · 75 lines · 30 tokens per session scan A 65a7113573d2

Subscribe to this mod's changes

test-generator is an agent published in the GitHub repository theogbrand/yoink (38 stars, last pushed 6mo ago), licensed MIT. It adds 30 tokens to every session and 653 once invoked, about $0.0001 per session on Opus 5.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.