test-generation

test-generation is a skill for Claude Code from shennawardana23/skillme. It costs 69 tokens per session (1,380 once invoked), scanned A, original, Apache-2.0.

A test-writing workflow that creates unit tests for normal cases, errors, empty inputs, boundary values, and mocked dependencies. Unit tests check small pieces of code in isolation, while table-driven tests run the same logic against many inputs.

In plain words
What is it for?
Use it to add coverage to a function or module, create regression tests for bugs, or strengthen incomplete existing tests.
Why use it?
It helps expose missing coverage and edge cases that a single happy-path test would miss. It is suited to Go and TypeScript code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit Use it to add coverage to a function or module, create regression tests for bugs, or strengthen incomplete existing tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shennawardana23/skillme/test-generation
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.

Any agent
npx skills add shennawardana23/skillme --skill test-generation
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/test-generation/github.svg)](https://agentmods.dev/skills/shennawardana23/skillme/test-generation)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/test-generation"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/test-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/shennawardana23/skillme/test-generation"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/test-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,380 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00069 $0.01380
Opus 5 $0.00034 $0.00690
Sonnet 5 $0.00014 $0.00276
Haiku 4.5 $0.00007 $0.00138

Measured 7d ago against content hash 078c4b0bd442, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

test-generation 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 7d 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-generation/SKILL.md · 102 lines

How it starts

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

Test Generation

For any given code, produce all of the following — not just the happy-path test that's easiest to write.

What to generate

1. Unit tests, per exported function/method:

  • Happy path — normal inputs produce expected outputs
  • Error paths — every error condition is triggered and its content verified (not just err != nil)
  • Nil/zero inputs — behavior with empty or zero values
  • Boundary values — min, max, empty slice, single element, max slice

2. Table-driven tests (Go) — for any function with multiple input variants:

func TestFoo(t *testing.T) {
    tests := []struct {
        name    string
        input   InputType
        want    OutputType
        wantErr bool
    }{
        {"happy path", validInput, expectedOutput, false},
        {"nil input", nil, zero, true},
        {"empty string", "", zero, true},
    }
    for _, tc := range tests {
        tc := tc // capture range variable (needed pre-Go 1.22; see Gotchas)
        t.Run(tc.name, func(t *testing.T) {
            t.Parallel()
            got, err := Foo(tc.input)
            if (err != nil) != tc.wantErr {
                t.Fatalf("err = %v, wantErr %v", err, tc.wantErr)
            }
            if !tc.wantErr && got != tc.want {
                t.Errorf("got %v, want %v", got, tc.want)
            }
        })
    }
}

3. Concurrency tests (Go) — for any function touching shared state, channels, or goroutines:

  • Design the test to run under go test -race, not just to pass without it.
  • Use sync.WaitGroup to synchronize multiple goroutines exercising the code concurrently.
  • Assert the invariant holds after concurrent access, not just that it doesn't panic — a race can corrupt data silently without crashing.

4. Mock patterns — for external dependencies (database, HTTP, filesystem):

  • Mock through an interface (hand-written or golang/mock/uber-go/mock), not by monkey-patching a concrete type.
  • Cover both the success and error return from the mock.
  • Verify the mock was called the expected number of times when call count is part of the contract (e.g., "retries exactly twice").

Read the full file on GitHub · 102 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 102 lines · 69 tokens per session scan A 078c4b0bd442

Subscribe to this mod's changes

test-generation is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 12d ago), licensed Apache-2.0. It adds 69 tokens to every session and 1,380 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-09-03.

Related

Other skills, from other repositories

test-provenance-guard

Detects tests that pass by construction — tests that define a private copy of the function under test instead of importing the production module — and self-heals by extracting the inline logic to an exported function, updating production callers, and rewriting the test to import the export. Two checks: (1) static …

mthines/agent-skills · 207 tokens

test-auto-fix

Diagnoses failing tests across any project, classifies each failure as a test-bug, prod-bug, or unsure, confidence-gates the fix (auto-apply at >=90%, 80-89 ask, <80 escalate), applies it, and re-runs until green. Surface-driven: reads per-project configuration from a surface file keyed by normalised git remote URL.…

mthines/agent-skills · 166 tokens

dart-generate-test-mocks

Define and generate mock objects for external dependencies using package:mockito and buildrunner. Use when unit testing classes that depend on complex external services like APIs or databases.

sutchan/Agent-Skills-Hub · 43 tokens

dart-add-unit-test

Write and organize unit tests for functions, methods, and classes using package:test. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free.

sutchan/Agent-Skills-Hub · 39 tokens

flutter-add-widget-test

Implement a component-level test using WidgetTester to verify UI rendering and user interactions (tapping, scrolling, entering text). Use when validating that a specific widget displays correct data and responds to events as expected.

sutchan/Agent-Skills-Hub · 48 tokens

diagnosing-bugs

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.

sutchan/Agent-Skills-Hub · 40 tokens