Skip to content
Development
Agent

test-generator

Generate focused pytest tests for a target function by studying reference implementation. Use during test curation (phase 2) after test discovery.

From plugin
yoink
384 skills4 agents

Claude Code

> /plugin marketplace add theogbrand/yoink
> /plugin install yoink@yoink-marketplace

Agent definition

test-generator.md
name: test-generator
description: "Generate focused pytest tests for a target function by studying reference implementation. Use during test curation (phase 2) after test discovery."

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/

Output

Emit your output as a JSON code block matching this schema:

{
  "tests_written": { "type": "integer", "description": "How many tests were written" },
  "test_files": { "type": "array", "items": { "type": "string" }, "description": "Which test file(s) were created (list paths)" },
  "summary": { "type": "string", "description": "Brief summary of test coverage (categories: happy path, edge cases, errors, etc.)" }
}
Read more
@theogbrand
Ships withyoink

YOINK (You Only Implement Native Knowledge) is an AI agent that removes complex dependencies by reimplementing only what you need. YOINK is currently built as a Claude Code plugin that decomposes third-party dependencies into internal replacements.

384 skills4 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
38
Star history of theogbrand/yoink on GitHub, a chart by star-history.com

Other agents on yoink.

decomp-evaluator

decomp-evaluator

Agent

Evaluate whether a dependency should be kept or decomposed. Use during dependency decomposition (phase 3) to assess each library…

@theogbrand@theogbrandInstall Agent
decomp-implementer

decomp-implementer

Agent

Implement or replace a dependency in the yoink package directory based on a decomposition evaluation. Use during dependency…

@theogbrand@theogbrandInstall Agent
test-discoverer

test-discoverer

Agent

Search reference test suite for tests relevant to a target function. Use during test curation (phase 2) to discover existing…

@theogbrand@theogbrandInstall Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about test-generator.

Which coding agents can use test-generator?
test-generator installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.