test-generator

A tool that creates type-safe tests for TypeScript code. It detects testing tools such as Jest, Vitest, Playwright, or Cypress and generates unit, integration, component, end-to-end, or type tests as appropriate.

In plain words
What is it for?
Use it when adding features, changing or refactoring code, testing APIs or user flows, checking UI components, or testing TypeScript type definitions.
Why use it?
It reduces the effort of adding tests to new or changed code and helps address areas with low test coverage.

Skill for Claude CodeCodex

Part of the typescript-pro plugin — 5 skills, 10 commands, 8 agents 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/andronics/claude-plugin-typescript-pro/test-generator
Any agent
npx skills add andronics/claude-plugin-typescript-pro --skill test-generator
Clone the repo
git clone --depth 1 https://github.com/andronics/claude-plugin-typescript-pro

Made for: Claude Code, Codex.

Or install typescript-pro, the plugin that ships this one along with the rest of its 5 skills, 10 commands, 8 agents.

Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,810 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.00064 $0.02810
Opus 5 $0.00032 $0.01405
Sonnet 5 $0.00013 $0.00562
Haiku 4.5 $0.00006 $0.00281

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

Security

Grade A, and why

test-generator 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 3d 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-generator/SKILL.md · 407 lines

How it starts

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

You are a TypeScript Test Generation Specialist that creates comprehensive, type-safe tests across all testing frameworks.

When to Activate

Automatically activate when detecting:

  • New code without tests
  • Modified code needing test updates
  • Low test coverage areas
  • Complex functions requiring thorough testing
  • API endpoints needing integration tests
  • UI components needing component tests
  • User flows requiring E2E tests
  • Type definitions needing type tests
  • Refactored code needing regression tests

Framework Detection

Automatically detect and use the appropriate framework:

Check package.json dependencies:

  • vitest → Vitest
  • jest, @jest/globals → Jest
  • @playwright/test → Playwright
  • cypress → Cypress
  • @testing-library/react → React Testing Library
  • @testing-library/vue → Vue Testing Library

Check for config files:

  • vitest.config.ts → Vitest
  • jest.config.ts/js → Jest
  • playwright.config.ts → Playwright
  • cypress.config.ts → Cypress

Unit Test Generation

Vitest/Jest Tests

For Pure Functions:

// Source: src/utils/math.ts
export function add(a: number, b: number): number {
  return a + b;
}

export function divide(a: number, b: number): number {
  if (b === 0) {
    throw new Error('Division by zero');
  }
  return a / b;
}

Generated Test:

// Test: src/utils/math.test.ts
import { describe, it, expect } from 'vitest';
import { add, divide } from './math';

describe('math utilities', () => {
  describe('add', () => {
    it('adds two positive numbers', () => {
      expect(add(2, 3)).toBe(5);
    });

    it('adds negative numbers', () => {
      expect(add(-2, -3)).toBe(-5);
    });

    it('adds zero', () => {
      expect(add(5, 0)).toBe(5);
    });

    it('has correct type inference', () => {
      const result: number = add(1, 2);
      expect(result).toBe(3);
    });
  });

  describe('divide', () => {
    it('divides two positive numbers', () => {
      expect(divide(10, 2)).toBe(5);
    });

    it('handles decimal results', () => {
      expect(divide(5, 2)).toBe(2.5);
    });

    it('throws on division by zero', () => {
      expect(() => divide(10, 0)).toThrow('Division by zero');
    });

    it('handles negative numbers', () => {
      expect(divide(-10, 2)).toBe(-5);
      expect(divide(10, -2)).toBe(-5);
    });
  });
});

Read the full file on GitHub · 407 lines

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. 3d ago First seen · 407 lines · 64 tokens per session scan A caf391f2a523

Subscribe to this mod's changes

test-generator is a skill published in the GitHub repository andronics/claude-plugin-typescript-pro (4 stars, last pushed 10mo ago), licensed MIT. It adds 64 tokens to every session and 2,810 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.