Agent skill

Test Gen

by SethGammon in SethGammon/Citadel

Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns

MITAuto-check passedTesting & QA

Install Test Gen

skills CLI
$ npx skills add SethGammon/Citadel --skill test-gen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SethGammon/Citadel test-gen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SethGammon/Citadel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/test-gen .claude/skills/test-gen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-gen
GitHub stars
922
Token cost
~1.5k tokens
SKILL.md length
764 words
Files
3
Skills in repo
48
Repo updated
First seen
Licence
MIT

At a glance

Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns

  • Works in 6 steps: Detect test framework → Analyze the target → Generate tests → …
  • Tasks that involve Test generation
  • SKILL.md covers Orientation, Protocol, Step 1 — Detect test framework and Step 2 — Analyze the target, plus 7 more sections
  • Calls node

What it does

Test Gen is an agent skill from SethGammon/Citadel. Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `__benchmarks__/no-source.md` and `__benchmarks__/specific-file.md`).

It sits in Testing & QA, covering Test generation. The repository describes itself as: The operating layer for Claude Code + OpenAI Codex: persistent project memory, intent routing, safety hooks, cost telemetry, and parallel agent fleets. The licence is MIT.

When your agent uses it

  • Tasks that involve Test generation

Example prompts

  • “/test-gen”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Detect test framework
  2. Analyze the target
  3. Generate tests
  4. Write the test file
  5. Run and verify
  6. Coverage check

What it can do on your machine

Read from SKILL.md and the folder at commit e41ff1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Gen loads about 1.5k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 764 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SethGammon/Citadel at commit e41ff1d, republished under its MIT licence (© SethGammon). 764 words, ~1,523 tokens.

Download SKILL.mdSave it as .claude/skills/test-gen/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
test-gen
description
Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns
license
MIT
user-invocable
true
trigger_keywords
/test-gen, generate tests, write tests, add tests, test

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.

Step 3 — Generate tests

Write the test file following the project's exact patterns. Organize into three sections per function:

Happy Path
  • Primary use case with typical, valid input; multiple input shapes if behavior differs
  • Verify return value AND expected side effects
Edge Cases
  • Boundary values: 0, 1, -1, empty string/array/object, MAX_SAFE_INTEGER, very long strings
  • Null/undefined for every parameter that could receive them (only if reachable given the type system)
  • Collection: empty, single element, duplicates, very large
  • String: whitespace-only, unicode, special characters
  • Concurrent access if function manages shared state
Error Paths
  • Invalid input (at untyped boundaries), out-of-range values, malformed data
  • Dependency failures: throws, returns null, times out, unexpected data
  • State precondition violations: wrong method order, closed/disposed resources
  • Verify error type/message, not just that it throws
Mocking rules
  • Mock: HTTP clients, DB connections, file system, timers, random number generators
  • Do NOT mock: internal utilities, data transformations, pure functions, the module under test
  • Prefer fakes over mocks when available. Reset mocks in beforeEach/afterEach. Type mocks to match the real interface.
Show full SKILL.md (297 more words)Show less

Step 4 — Write the test file

One file per source file. Group with describe blocks per function/class. Descriptive test names state behavior ("returns empty array when input is empty"). Shared fixtures in beforeEach. Each test independent. Extract helpers for setups over 15 lines.

Step 5 — Run and verify

Run only the generated file. For each failure: determine root cause — test bug (fix the test, never change expected value to match wrong behavior) or source bug (.skip with // SKIP: source bug — {description}). Up to 3 iterations. After 3 failed attempts: .skip with // SKIP: could not resolve after 3 attempts — {last error}.

Step 6 — Coverage check

If a coverage tool is configured, run it for the target file. Add tests for meaningful uncovered branches. Skip if no coverage tool exists — do not install one.

Contextual Gates

Disclosure: "Generating tests for [target]. Creates new test files; no existing files modified." Reversibility: green — creates new test files only; delete the generated test files to undo Trust gates:

  • Any: generate tests for any target file or directory

Quality Gates

  1. All tests pass — final run with node scripts/run-with-timeout.js 300 <test-cmd>. Skips must have documented reasons.
  2. No snapshot-only tests — every test asserts specific behavior.
  3. No implementation coupling — tests don't break on internal refactors. Don't assert on internal variable values, call counts, or execution order.
  4. No test interdependence — each test runnable in isolation.
  5. Mocks are minimal — only external boundaries. Internal functions: remove the mock and test through real code.
  6. Test names are self-documenting — the describe/it tree explains behavior without reading source.

Exit Protocol

Deliver:

## Tests Generated: {target}

**Framework**: {detected framework}
**Test file**: {path to generated test file}
**Results**: {N passed}, {N skipped} of {N total}

### Coverage
- {function/method name}: {branches covered} / {total branches}
- ...

### Skipped Tests
- {test name}: {reason}
- ...
(or "None — all tests pass.")

If any tests were skipped due to source bugs, call them out clearly — these are findings, not failures of test generation:

### Source Issues Found
- **{file}:{line}**: {description of the bug the test exposed}

Do not offer to fix source bugs unless asked. The tests are the deliverable.

© SethGammon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/test-gen of SethGammon/Citadel.

  • SKILL.md
  • __benchmarks__/no-source.md
  • __benchmarks__/specific-file.md

Open the folder on GitHubat commit e41ff1d

Compare with similar skills

Test Gen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Gen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Gen this skillSethGammon/Citadel922—~1.5kAutomated safety check: PassMIT
Emcaklofas/kicad-happy1.3k1 repos~2.8kAutomated safety check: PassMIT
Swig Testswig/swig6.3k—~2.3kAutomated safety check: PassCustom licence
Generate Test Cases342164796/generate-test-cases1191 repos~2.9kAutomated safety check: PassNone
Verify Cc Safety Netkenryu42/cc-safety-net1.6k—~2kAutomated safety check: PassMIT
Wioworkersio/skills180—~5.8kAutomated safety check: PassMIT

Similar skills

  • Emc

    aklofas/kicad-happy

    EMC pre-compliance risk analysis for KiCad PCB designs — 18 check categories, 44 rule IDs covering ground planes, decoupling, I/O filtering, switching harmonics, clock routing, differential pair…

    1.3k GitHub starsUsed in 1 repo~2.8k tokens
    Testing & QAAuto-check passed
  • Swig Test

    swig/swig

    Run SWIG test suite for specific languages. An agent skill from swig/swig.

    6.3k GitHub stars~2.3k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Generate Test Cases

    342164796/generate-test-cases

    自主学习型测试文档生成器。从需求文档(Markdown)生成测试用例 XMind 文件,支持持久化记忆和持续学习。当用户提到"生成测试用例"、"根据需求生成测试"时触发。

    119 GitHub starsUsed in 1 repo~2.9k tokens
    Testing & QAAuto-check passed
  • Verify Cc Safety Net

    kenryu42/cc-safety-net

    Launch and drive the real cc-safety-net CLI — the hook decision path, explain, status/doctor, logs, and the local policy GUI — against an isolated home, capturing evidence.

    1.6k GitHub stars~2k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Wio

    workersio/skills

    Testing workflow skill for finding high-value test candidates, writing focused tests, generating realistic workloads, reviewing test value, and diagnosing test-suite health.

    180 GitHub stars~5.8k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • File Server

    microsoft/WindowsProtocolTestSuites

    Official

    ALWAYS LOAD THIS SKILL when working with FileServer, SMB, SMB2, SMB3, CIFS, file sharing, MS-SMB2, MS-FSCC, MS-FSA, MS-DFSC, MS-FSRVP, MS-RSVD, MS-SQOS, or any file server protocol test…

    567 GitHub stars~4.1k tokensUpdated 22 days ago
    Testing & QAAuto-check passed

More from SethGammon/Citadel

All 48 skills in this repo
  • Create Skill

    SethGammon/Citadel

    Creates new skills from the user's repeating patterns. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.9k tokensUpdated 6 days ago
    Auto-check passed
  • Houseclean

    SethGammon/Citadel

    Cross-drive storage audit and cleanup. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.2k tokensUpdated 6 days ago
    Auto-check passed
  • Loop

    SethGammon/Citadel

    Bounded foreground repetition for the current session. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.4k tokensUpdated 6 days ago
    Auto-check passed
  • Triage

    SethGammon/Citadel

    GitHub issue and PR investigator. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.7k tokensUpdated 6 days ago
    Auto-check passed
  • Watch

    SethGammon/Citadel

    File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

    922 GitHub stars~2.9k tokensUpdated 6 days ago
    Auto-check passed
  • Archon

    SethGammon/Citadel

    Autonomous multi-session campaign agent. An agent skill from SethGammon/Citadel.

    922 GitHub stars~5.4k tokensUpdated 6 days ago
    Auto-check passed

Categories

Questions about Test Gen

What does Test Gen do?

Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns. Test Gen is an agent skill from SethGammon/Citadel.

When should I use Test Gen?

Test Gen fits situations like: tasks that involve Test generation.

How do I install Test Gen in Claude Code?

Run `npx skills add SethGammon/Citadel --skill test-gen -a claude-code`. Or copy the skill folder (skills/test-gen in SethGammon/Citadel) into .claude/skills/test-gen in your project. Claude Code loads it when a task matches its description.

How do I install Test Gen in Codex?

Run `npx skills add SethGammon/Citadel --skill test-gen -a codex`. Or copy the skill folder (skills/test-gen in SethGammon/Citadel) into .agents/skills/test-gen in your project. Codex loads it when a task matches its description.

Can I use Test Gen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SethGammon/Citadel --skill test-gen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-gen, .gemini/skills/test-gen, .github/skills/test-gen and .opencode/skills/test-gen in your project.

What does Test Gen need to run?

Going by SKILL.md and its folder, Test Gen needs the command-line tools its instructions call (node).

Does Test Gen access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Gen safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test Gen use?

Test Gen is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Gen use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Gen?

Skills that share tags, products or a category with Test Gen: Emc (aklofas/kicad-happy, 1.3k stars), Swig Test (swig/swig, 6.3k stars), Generate Test Cases (342164796/generate-test-cases, 119 stars) and Verify Cc Safety Net (kenryu42/cc-safety-net, 1.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Gen?

SethGammon (a GitHub user) maintains it in SethGammon/Citadel, which has 922 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 1, 2026.

Source: SethGammon/Citadel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.