test-generation

test-generation is a skill for Claude Code, Codex from int2t05/engineering-skills. It costs 52 tokens per session (1,362 once invoked), scanned A, original, MIT.

A workflow for creating tests for existing code or from a specification, using the project's language and test framework. It reads the requirements and source code, then produces test files without changing the application.

In plain words
What is it for?
Use it when turning acceptance criteria, API contracts, product requirements, or existing source code into unit or other framework-appropriate tests.
Why use it?
It adds coverage systematically without confusing test creation with the test-first development process or running the tests itself.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the engineering-skills plugin — 48 skills, 1 agent, 1 hook 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 skills/int2t05/engineering-skills/test-generation
Any agent
npx skills add int2t05/engineering-skills --skill test-generation
Clone the repo
git clone --depth 1 https://github.com/int2t05/engineering-skills

Made for: Claude Code, Codex.

Or install engineering-skills, the plugin that ships this one along with the rest of its 48 skills, 1 agent, 1 hook.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/int2t05/engineering-skills/test-generation.svg)](https://agentmods.dev/skills/int2t05/engineering-skills/test-generation)
Your own site
<a href="https://agentmods.dev/skills/int2t05/engineering-skills/test-generation"><img src="https://agentmods.dev/badge/skills/int2t05/engineering-skills/test-generation.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,362 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.00052 $0.01362
Opus 5 $0.00026 $0.00681
Sonnet 5 $0.00010 $0.00272
Haiku 4.5 $0.00005 $0.00136

Measured 5d ago against content hash a798e6f599d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-generation 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.

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/06-test/test-generation/SKILL.md · 141 lines

How it starts

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

Test Generation (Language-Agnostic)

Generate anti-pattern-free test code from PRD acceptance criteria and source code. Read inputs, produce test files. No execution, no reports, no source modifications.

Input: PRD acceptance criteria + architecture docs + source code

When to use

  • Generating tests for a feature or bugfix
  • Creating tests from a PRD, API contract, or existing source
  • Triggers on "generate tests", "write tests for", "生成测试", "生成测试代码", "补测试"

Not for: the TDD red-green-refactor loop (use tdd); API contract testing (use api-testing); browser E2E flows (use e2e-testing).

Steps

1. Detect language & framework

Scan the project before generating. Detection priority: existing test files (naming conventions) → dependency manifests → test config files. If nothing found, ask which framework to use.

  • Load references/language-patterns.md for the per-language detection table (manifests and test-file patterns to scan for) and the Test Framework | Assertion Style | Mock Library mapping (testify/gomock, pytest/unittest.mock, jest/jest.fn, etc.)

2. Read inputs

Ask for or discover: PRD path (default docs/PRD.md or docs/vX.Y/prd.md), architecture docs (default docs/TECH.md or docs/vX.Y/tech.md), source code to test (default src/), and the auto-detected language/framework. Ask only critical questions before proceeding.

3. Extract testable conditions

  • Per acceptance criterion → one or more test cases
  • Per API endpoint / function signature → contract tests
  • Per defined error state → error path test
  • Per security-sensitive input → injection test (SQL, command, path traversal, XSS)
PRD: "US-001: User login"
AC: "Valid credentials return an authenticated session"
AC: "Invalid credentials return an error"
AC: "Empty fields show validation errors"

→ Test cases:
  1. valid credentials → success + session established
  2. wrong password → error response + message present
  3. empty email → validation error for email field
  4. empty password → validation error for password field

Read the full file on GitHub · 141 lines

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 · 141 lines · 52 tokens per session scan A a798e6f599d4

Subscribe to this mod's changes

test-generation is a skill published in the GitHub repository int2t05/engineering-skills (3 stars, last pushed 4d ago), licensed MIT. It adds 52 tokens to every session and 1,362 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

auto-loop

TDD-based autonomous development loop with checkpoint recovery and observability changelog.

claude-world/director-mode-lite · 17 tokens

workflow

Run the complete 5-step development workflow: focus problem → prevent over-development → test-first (TDD) → document → smart commit. Use when starting a new feature, or when the user runs /workflow or asks for the full development flow.

claude-world/director-mode-lite · 52 tokens

plan-create

Create structured implementation plans for autonomous TDD development. Use for new features, multi-file changes, or anything requiring multiple steps or tests. Triggers on aspirational openers ("let's build", "let's start building", "I want to make", "I want an app that", "help me build"), capability lists ("users…

markshust/hcf · 171 tokens

test-first

Drive one feature through a strict TDD Red-Green-Refactor cycle with checklists for each phase. Use when implementing new functionality test-first, or when the user runs /test-first.

claude-world/director-mode-lite · 42 tokens

specify-incremental

Decompose a single-feature specification into a linear, phase-by-phase implementation plan. Use this for medium-complexity work — single feature, one or two components — where transparent human-in-the-loop phase review is preferred over factory automation.

rsmdt/the-startup · 53 tokens

building

Implementation skill for writing production code with TDD. Covers the RED-GREEN-REFACTOR cycle, false-RED detection, vertical slicing, scope escalation, test process discipline, and code generation patterns. Loaded by component-builder and bug-investigator.

romiluz13/cc10x · 53 tokens