test-gen

test-gen is a skill for Claude Code, Codex from SethGammon/Citadel. It costs 24 tokens per session (1,377 once invoked), scanned A, original, MIT.

A test generator that creates automated checks for a function, file, or directory, including normal cases, unusual inputs, and expected errors.

In plain words
What is it for?
Use it to create and run tests for exported functions or classes in a selected file, directory, or specific function.
Why use it?
It reduces the work of starting test coverage while matching the project's existing testing style and checking that the tests pass.

Skill for Claude CodeCodex

Part of the citadel plugin — 49 skills, 7 agents, 2 MCP servers 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/sethgammon/citadel/test-gen
Any agent
npx skills add SethGammon/Citadel --skill test-gen
Clone the repo
git clone --depth 1 https://github.com/SethGammon/Citadel

Made for: Claude Code, Codex.

Or install citadel, the plugin that ships this one along with the rest of its 49 skills, 7 agents, 2 MCP servers.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/sethgammon/citadel/test-gen.svg)](https://agentmods.dev/skills/sethgammon/citadel/test-gen)
Your own site
<a href="https://agentmods.dev/skills/sethgammon/citadel/test-gen"><img src="https://agentmods.dev/badge/skills/sethgammon/citadel/test-gen.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,377 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.00024 $0.01377
Opus 5 $0.00012 $0.00688
Sonnet 5 $0.00005 $0.00275
Haiku 4.5 $0.00002 $0.00138

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

Security

Grade A, and why

test-gen 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 4d 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/test-gen/SKILL.md · 130 lines

How it starts

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

Identity

You write tests that run on the first try. Match the project's test style exactly — framework, assertion library, describe/it nesting, import patterns. Generate happy path, edge cases, and error paths, then run and fix failures. Never ship a red suite. Mock only external services, I/O, and time.

Orientation

Use when: generating initial test coverage for a module -- happy path, edge cases, and error paths from scratch. Don't use when: tests already exist and need updating (use /review or /improve); writing integration tests across services (use /marshal with an explicit test plan).

Orientation

Input: A test target — one of:

  • A file path (/test-gen src/auth/session.ts)
  • A specific function (/test-gen src/auth/session.ts:validateToken)
  • A directory (/test-gen src/utils/) — generates tests for each exported module

Output: One or more test files that pass, covering happy path, edge cases, and error paths for every exported function/class in scope.

Constraints:

  • Tests must run and pass before delivery — no "these should work" handoffs
  • Maximum 3 fix iterations per test file. If a test still fails after 3 attempts, mark it as .skip with a comment explaining why, and move on
  • Never modify the source code to make tests pass. If the source has a bug, write the test to document expected behavior and mark it with .todo or .skip plus a note

Protocol

Step 1 — Detect test framework

Check config files (jest.config.*, vitest.config.*, pytest.ini, etc.), package.json devDependencies, and the nearest existing test file. Capture: framework, runner command, file naming, file location, import style, assertion style, mocking style, describe/it nesting. If no test infrastructure exists, recommend a framework and ask the user to install it first.

Step 2 — Analyze the target

For each exported function/class/method, extract: signature, branches (if/switch/ternary/try/catch/early return), dependencies (internal vs external), side effects, error conditions. Map every branch to at least one test case before writing code.

Read the full file on GitHub · 130 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. 4d ago First seen · 130 lines · 24 tokens per session scan A 30112b33591b

Subscribe to this mod's changes

test-gen is a skill published in the GitHub repository SethGammon/Citadel (916 stars, last pushed today), licensed MIT. It adds 24 tokens to every session and 1,377 once invoked, about $0.0001 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 skills, from other repositories

compose-org

Run a task as an evolved multi-agent ORG using the installed liquid-org framework — where YOU (the running Claude) embody the org: you ask liquid-org which proven team topology + specialist personas to use (retrieved from its evolved pool, or assembled fresh), then dispatch ONE SUBAGENT PER TALENT to play each role…

U0001F3A2/liquid-org · 226 tokens

liquid-rank

Rank the available skills by RELEVANCE to the current task, on demand, using liquid-org's read-only hermes skill ranker. This is an EXPLICIT, OPT-IN selector you invoke WHEN you want help choosing the most relevant skill for what you're doing — it is NOT default, automatic skill selection, and it does NOT decide for…

U0001F3A2/liquid-org · 198 tokens

present-gate

First-officer gate-presentation rendering — the captain-facing gate-review template and assembly rules, including workflow-owned finding labels. Invoke at the gate point after the FO has decided a stage must be presented.

spacedock-dev/spacedock · 44 tokens

agent-workflow-playbook

AI Agent Workflow & Skill Architecture Guide — turn expert work into measurable, reusable agent systems. Covers workflow discovery, skill decomposition, harness design, evaluation, human escalation, observability, cost control, and multi-agent orchestration. Includes a measured marketing-delivery case: 15 people × 3–4…

Gingiris-1031/gingiris-skills · 83 tokens

audit-project

Run an iterative multi-agent code audit until critical and high findings are resolved. Use when the user says "audit my code", "find all the bugs", "deep code audit", "iterative review", or "review until clean".

OutlineDriven/odin-claude-plugin · 50 tokens

ast-grep

Use when asked to run AST-based structural search, lint, or rewrite of code when regex is too fragile. Pattern is validated, blast radius reviewed, and rewrite landed at the correct scope. Don't use for remote, credential, publish, deploy, or irreversible changes.

OutlineDriven/odin-claude-plugin · 57 tokens