test-generator

test-generator is a skill for Claude Code from bestdeejay-design/agent-skills. It costs 0 tokens per session (1,020 once invoked), scanned A, original, MIT.

A generator that reads Python functions and creates pytest test-file skeletons with parameterized example inputs. Pytest is a Python testing tool, and TDD means writing tests as part of the implementation process.

In plain words
What is it for?
Use it to inspect a Python module, create cases for public synchronous and asynchronous functions, and generate placeholder assertions.
Why use it?
It gives you a starting test file when a module has little or no test coverage, while leaving the expected results for you to define.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Good fit Use it to inspect a Python module, create cases for public synchronous and asynchronous functions, and generate placeholder assertions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bestdeejay-design/agent-skills/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.

Any agent
npx skills add bestdeejay-design/agent-skills --skill test-generator
Clone the repo
git clone --depth 1 https://github.com/bestdeejay-design/agent-skills

Made for: Claude Code.

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/skills/bestdeejay-design/agent-skills/test-generator/github.svg)](https://agentmods.dev/skills/bestdeejay-design/agent-skills/test-generator)
Your own site
<a href="https://agentmods.dev/skills/bestdeejay-design/agent-skills/test-generator"><img src="https://agentmods.dev/badge/skills/bestdeejay-design/agent-skills/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/skills/bestdeejay-design/agent-skills/test-generator"><img src="https://agentmods.dev/badge/skills/bestdeejay-design/agent-skills/test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,020 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.00000 $0.01020
Opus 5 $0.00000 $0.00510
Sonnet 5 $0.00000 $0.00204
Haiku 4.5 $0.00000 $0.00102

Measured 5d ago against content hash 7accb750c22c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/test_gen.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/test-generator/SKILL.md · 74 lines

What it actually says

Test Generator

Генерация pytest-скелетов из сигнатур функций: AST-парсинг + эвристика значений, готовый параметризованный тест-файл в stdout или файл.

Загружай этот скилл когда нужно создать стартовый pytest-набор для существующих функций или модуля. Скилл читает исходник, извлекает сигнатуры и генерирует @pytest.mark.parametrize-скелеты с разумными тестовыми значениями — остаётся лишь дописать assert-ожидания.

🎯 When to use

Use this skill when:

  • Нужны тесты для нового модуля, где покрытие начинается с пустого файла
  • Просят «сгенерируй тесты», «test skeleton», «покрой функциям»
  • Нужна быстрая заготовка parametrize-кейсов с типичными значениями
  • Хочешь перейти к TDD: сгенерируй красные скелеты и реализуй

Do NOT use when:

  • Нужны осмысленные ассерты под конкретную логику — скрипт даёт заглушки, логику пишешь сам
  • Тесты уже покрывают функции — файл-генератор всё перезапишет
  • Нужны моки/фикстуры вне модуля — это уровень pytest напрямую

📦 Files

  • SKILL.md — этот файл
  • scripts/test_gen.py — генератор из AST (Python 3 stdlib)
  • references/ — примеры и референс TS/Go (в будущих версиях)

🧰 Usage

# В stdout:
python3 skills/test-generator/scripts/test_gen.py --file path/to/module.py

# В файл (рядом с модулем):
python3 skills/test-generator/scripts/test_gen.py \
    --file path/to/module.py --out tests/test_module.py

⚙️ Эвристика значений аргументов

Аннотация Значения
bool True, False
int 0, -1, 1
float 0.0, -1.5
str / text "sample", ""
list[...] []
tuple[...] ()
dict[...] {}
Optional[...] None
иное значение не подставляется → None-заглушка

Правила:

  • Функции, начинающиеся с _, пропускаются.
  • async def оборачивается в asyncio.run(...).
  • В генерируемом коде assert-заглушка: assert result is not None — допиши реальные ожидания.

✅ Definition of Done

  • Скрипт отработал: валидный pytest-файл в stdout или --out.
  • Сгенерированный код проходит python3 -c "import ast" (синтаксис корректный).
  • Значения аргументов соответствуют эвристикам (таблица выше).
Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 74 lines · 0 tokens per session scan A 7accb750c22c

Subscribe to this mod's changes

test-generator is a skill published in the GitHub repository bestdeejay-design/agent-skills (5 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,020 tokens. 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-03.