test-generator

test-generator is a skill for Claude Code, Codex from Dokkabei97/forged-claude-code. It costs 40 tokens per session (1,017 once invoked), scanned A, original, MIT.

A test-writing tool that examines existing code and creates unit tests for individual pieces and integration tests for connected parts.

In plain words
What is it for?
Use it with Jest or Vitest for JavaScript and TypeScript, pytest for Python, or Kotest for Kotlin.
Why use it?
It reduces the manual work of finding untested code and checking normal inputs, unusual cases, and failures. TDD, or test-driven development, is a way of writing tests before code; this tool instead starts from existing code.

Skill for Claude CodeCodex

Part of the forged-claude-code plugin — 29 skills, 14 commands, 9 agents, 2 hooks 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/dokkabei97/forged-claude-code/test-generator
Any agent
npx skills add Dokkabei97/forged-claude-code --skill test-generator
Clone the repo
git clone --depth 1 https://github.com/Dokkabei97/forged-claude-code

Made for: Claude Code, Codex.

Or install forged-claude-code, the plugin that ships this one along with the rest of its 29 skills, 14 commands, 9 agents, 2 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/dokkabei97/forged-claude-code/test-generator.svg)](https://agentmods.dev/skills/dokkabei97/forged-claude-code/test-generator)
Your own site
<a href="https://agentmods.dev/skills/dokkabei97/forged-claude-code/test-generator"><img src="https://agentmods.dev/badge/skills/dokkabei97/forged-claude-code/test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,017 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.1 $0.00040 $0.01017
Opus 5 $0.00020 $0.00508
Sonnet 5 $0.00008 $0.00203
Haiku 4.5 $0.00004 $0.00102

Measured 5d ago against content hash 4950a01a6caf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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/cto/test-generator/SKILL.md · 155 lines

How it starts

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

Test Generator - Automated Test Generation

Overview

Reads existing code and generates comprehensive test suites. Covers the boring-but-critical test writing so developers can focus on business logic.


1. When to Apply

Trigger Behavior
"generate tests for [file]" Analyze file, generate test suite
"add tests" Scan for untested code, generate tests
"test coverage" Identify coverage gaps, generate missing tests

2. Test Generation Workflow

Step 1: Code Analysis

1. Read target file(s)
2. Identify exported functions/classes/methods
3. Analyze parameter types and return types
4. Detect dependencies (imports, injections)
5. Identify side effects (API calls, DB, file system)

Step 2: Test Case Planning

For each function, generate test cases:

Category Examples
Happy path Valid inputs → expected output
Boundary values 0, 1, MAX, empty string, empty array
Invalid inputs null, undefined, wrong type, negative
Error handling Network failure, timeout, invalid response
Edge cases Concurrent calls, unicode, special chars

Step 3: Test Generation

TypeScript (Jest/Vitest):

import { describe, it, expect, vi } from 'vitest'
import { calculatePrice } from './pricing'

describe('calculatePrice', () => {
  it('calculates base price correctly', () => {
    expect(calculatePrice({ quantity: 1, unitPrice: 100 })).toBe(100)
  })

  it('applies discount for bulk orders', () => {
    expect(calculatePrice({ quantity: 100, unitPrice: 10 })).toBe(900)
  })

  it('throws for negative quantity', () => {
    expect(() => calculatePrice({ quantity: -1, unitPrice: 10 }))
      .toThrow('Quantity must be positive')
  })

  it('returns 0 for zero quantity', () => {
    expect(calculatePrice({ quantity: 0, unitPrice: 100 })).toBe(0)
  })
})

Python (pytest):

import pytest
from pricing import calculate_price

def test_base_price():
    assert calculate_price(quantity=1, unit_price=100) == 100

def test_bulk_discount():
    assert calculate_price(quantity=100, unit_price=10) == 900

def test_negative_quantity_raises():
    with pytest.raises(ValueError, match="positive"):
        calculate_price(quantity=-1, unit_price=10)

def test_zero_quantity():
    assert calculate_price(quantity=0, unit_price=100) == 0

Read the full file on GitHub · 155 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. 5d ago First seen · 155 lines · 40 tokens per session scan A 4950a01a6caf

Subscribe to this mod's changes

test-generator is a skill published in the GitHub repository Dokkabei97/forged-claude-code (2 stars, last pushed 6mo ago), licensed MIT. It adds 40 tokens to every session and 1,017 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

run-helix-tests

Submit and monitor .NET MAUI unit tests on Helix infrastructure. Supports running XAML, Resizetizer, Core, Essentials, and other unit test projects on distributed Helix queues.

dotnet/maui · 45 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

dotnet/skills · 149 tokens

nunit-testing

Use when writing or modifying tests in NUnit's own test projects, or when making a behavioral change to production code that needs test coverage. Covers test structure, attribute choice, helper visibility, platform guards, and which test projects are real.

nunit/nunit · 51 tokens

detect-flaky-tests

Detects flaky Go tests by analyzing GitHub Actions workflow runs across the last 7 days and all PRs — covering both the run-tests job (unit/integration) and the e2e-test job (gVisor and microVM lanes). For each newly-detected flaky test or infra issue, opens a GitHub issue with full evidence and a draft fix PR. Does…

agent-substrate/substrate · 102 tokens

go-testing

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

Gentleman-Programming/gentle-ai · 26 tokens

add-go-test

Write or extend Go unit tests in this repo. Use when the user asks to add or update Go tests.

authgear/authgear-server · 26 tokens