Generates robust, traceable tests for TDD or post-implementation validation with coverage tracking.
Install
mkdir -p .claude/skills/testgen && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15145" && unzip -o skill.zip -d .claude/skills/testgen && rm skill.zipInstalls to .claude/skills/testgen
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Comprehensive test generation skill for TDD-driving and post-implementation validation from feature lists or task packets. Use when you need deterministic, traceable unit/smoke/integration/e2e/regression tests with explicit edge-case analysis and a fail-closed touched-code coverage gate (default at least 90%).Key capabilities
- →Generate unit tests for correctness
- →Generate smoke, integration, e2e, and regression tests
- →Decompose requirements and model risk
- →Perform edge-case and failure challenge analysis
- →Verify touched code coverage against a target
- →Return a traceability matrix from requirements to tests
How it works
The skill processes requirements, decomposes them, models risk, and then generates various types of tests, ensuring deterministic sequencing and verifying code coverage against a specified target.
Inputs & outputs
When to use testgen
- →Generate unit tests for new module
- →Validate feature requirements
- →Run integration test suite
About this skill
Testgen
Use this skill to design and generate tests that prove implementation correctness against explicit requirements.
Inputs
Provide one normalized request:
mode:tdd-driverorpost-impl-generatorsource:feature-listortask-packetpayload: inline text, packet text, or payload file pathcoverage_target: integer percent (default90)preferred_cli:auto,gemini,copilot,claudeuse_pal_testgen:auto,on,off
Pipeline
Run these phases in order and fail closed on ambiguity.
- Intake and normalization.
- Requirement decomposition and risk modeling (
thinkdeepwhen available). - Deterministic sequencing (
plannerwhen available). - Edge-case and failure challenge pass (
consensuswhen available). - Specialist authoring pass:
- Primary: subagent (
clink) when available. - Fallback: built-in test-specialist persona.
- Optional augmentation: PAL
testgenwhen enabled and available.
- Primary: subagent (
- Layered generation:
- Unit tests are mandatory.
- Smoke/integration/e2e/regression are generated when applicable.
- Non-applicable layers require explicit
N/Awith evidence.
- Verification gate on touched code coverage (default
>=90).
Deterministic Rules
- If an explicit touched-file list is provided, treat it as the source of truth.
- Otherwise, resolve touched scope from VCS in this order:
git statusfirst, thengit diff. - If VCS-based resolution yields no trustworthy scope, fall back to requirement/feature-to-file mapping.
- If none of these sources are trustworthy, stop and request explicit scope before proceeding.
- Coverage is pass/fail for touched code; missing coverage evidence fails closed.
- Always return a traceability matrix from requirement IDs to test IDs.
Output Contract
Return these core sections:
traceability_matrixlayer_plan(unit/smoke/integration/e2e/regression)coverage_gate(target, measured, status)na_layerswith rationale and evidence
Optional sections (when available):
-
test_artifactslist by file and layer Detailed output and heuristics are defined in: -
references/output_contract.md -
references/layer_policy.md
Python and JS/TS v1 Focus
Prioritize first-class support for:
- Python (
pytest) - JS/TS (
jest,vitest)
For other stacks, keep behavior conservative and explicit about unsupported assumptions.
Local Utility Scripts
Use bundled scripts for deterministic preprocessing and gate evaluation:
scripts/testgen_workflow.pyscripts/testgen_cli.py
Example:
python scripts/testgen_cli.py \
--mode tdd-driver \
--source feature-list \
--payload-file /abs/path/features.txt \
--coverage-target 90 \
--preferred-cli auto \
--use-pal-testgen auto
When not to use it
- →The task does not require deterministic or traceable tests
- →The task involves generating tests for unsupported stacks without explicit instructions
Limitations
- →Coverage is pass/fail for touched code
- →Missing coverage evidence fails closed
- →If VCS-based resolution yields no trustworthy scope, it stops and requests explicit scope
How it compares
This skill provides a complete, pipeline-driven approach to test generation with explicit coverage gates and traceability, which is more structured than ad-hoc test writing.
Compared to similar skills
testgen side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| testgen (this skill) | 0 | 1mo | Review | Advanced |
| vitest | 41 | 6mo | No flags | Intermediate |
| svelte-expert | 11 | 9mo | No flags | Intermediate |
| implementing-cards | 7 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
vitest
antfu
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
svelte-expert
Raudbjorn
Expert Svelte/SvelteKit development assistant for building components, utilities, and applications. Use when creating Svelte components, SvelteKit applications, implementing reactive patterns, handling state management, working with stores, transitions, animations, or any Svelte/SvelteKit development task. Includes comprehensive documentation access, code validation with svelte-autofixer, and playground link generation.
implementing-cards
bcollazo
Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.
zod-4
prowler-cloud
Zod 4 schema validation patterns. Trigger: When creating or updating Zod v4 schemas for validation/parsing (forms, request payloads, adapters), including v3 -> v4 migration patterns.
csharp-pro
sickn33
Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.
write-unit-tests
tldraw
Writing unit and integration tests for the tldraw SDK. Use when creating new tests, adding test coverage, or fixing failing tests in packages/editor or packages/tldraw. Covers Vitest patterns, TestEditor usage, and test file organization.