test-generator

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

Part of the yoink plugin — 4 skills, 4 agents, 3 hooks 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/theogbrand/yoink/test-generator
Clone the repo
git clone --depth 1 https://github.com/theogbrand/yoink

Or install yoink, the plugin that ships this one along with the rest of its 4 skills, 4 agents, 3 hooks.

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. 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.00030 $0.00653
Opus 5 $0.00015 $0.00327
Sonnet 5 $0.00006 $0.00131
Haiku 4.5 $0.00003 $0.00065

Measured 3d ago against content hash 65a7113573d2, 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 3d 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. 3d 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 (35 stars, last pushed 5mo ago), licensed MIT. It adds 30 tokens to every session and 653 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-08-30.

Related

Other agents, from other repositories

unittest-generator

Use this agent when you need to create unit tests for your code in unittest.TestCase format, organized in a tests folder with concept-based subfolders. Examples: Context: User has just written a new authentication module and needs comprehensive unit tests. user: 'I just finished writing my user authentication…

Upsonic/Upsonic · 0 tokens

python-test-engineer

Use this agent when you need to create new tests, fix failing tests, refactor test code, or improve test organization and maintainability. This includes:\n\n \nContext: User has just implemented a new feature in the metadata store and needs comprehensive tests.\nuser: "I've added a new fallback store chain feature.…

anam-org/metaxy · 358 tokens

test-engineer

Plans and writes pytest tests for the agent platform. Behavior-focused, mocks all external systems, adds negative/security tests. Never calls real external services.

extra-org/extra · 33 tokens

developer

Implement Idea and scoreidea in src/backlog.py, and verify them with tests/testbacklog.py. Use the formula impact 5 + strategicfit 3 - effort 2.

bonigarcia/context-engineering · 0 tokens

agentica-agent

Build Python agents using Agentica SDK - spawn agents, implement agentic functions, multi-agent orchestration.

parcadei/Continuous-Claude-v3 · 24 tokens

agentic-python-specialist

Use for isolated work in agenticai/, including multi-agent orchestration, MCP client changes, configuration flow, and Python deployment wrappers.

hoangsonww/AI-RAG-Assistant-Chatbot · 33 tokens