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.zip

Installs 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%).
311 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

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

You give it
feature list or task packet, coverage target
You get back
traceability matrix, layer plan, coverage gate status, test artifacts

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-driver or post-impl-generator
  • source: feature-list or task-packet
  • payload: inline text, packet text, or payload file path
  • coverage_target: integer percent (default 90)
  • preferred_cli: auto, gemini, copilot, claude
  • use_pal_testgen: auto, on, off

Pipeline

Run these phases in order and fail closed on ambiguity.

  1. Intake and normalization.
  2. Requirement decomposition and risk modeling (thinkdeep when available).
  3. Deterministic sequencing (planner when available).
  4. Edge-case and failure challenge pass (consensus when available).
  5. Specialist authoring pass:
    • Primary: subagent (clink) when available.
    • Fallback: built-in test-specialist persona.
    • Optional augmentation: PAL testgen when enabled and available.
  6. Layered generation:
    • Unit tests are mandatory.
    • Smoke/integration/e2e/regression are generated when applicable.
    • Non-applicable layers require explicit N/A with evidence.
  7. 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 status first, then git 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:

  1. traceability_matrix
  2. layer_plan (unit/smoke/integration/e2e/regression)
  3. coverage_gate (target, measured, status)
  4. na_layers with rationale and evidence

Optional sections (when available):

  • test_artifacts list 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.py
  • scripts/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.

SkillInstallsUpdatedSafetyDifficulty
testgen (this skill)01moReviewAdvanced
vitest416moNo flagsIntermediate
svelte-expert119moNo flagsIntermediate
implementing-cards72moReviewAdvanced

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.

41183

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.

11107

implementing-cards

bcollazo

Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.

790

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.

1260

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.

953

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.

545

Search skills

Search the agent skills registry