test-generation

test-generation is a skill for Claude Code, Codex from richardcb/oh-my-gemini. It costs 41 tokens per session (1,305 once invoked), scanned A, original, MIT.

A tool for creating unit tests, integration tests, and tests for unusual or failing cases, using the project's existing testing setup. Unit tests check small pieces of code, while integration tests check how pieces work together.

In plain words
What is it for?
Use it after adding a feature, during code review, or when you need tests for normal behavior, edge cases, and errors.
Why use it?
It helps find what code needs testing and avoids writing tests that conflict with the project's framework or conventions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it after adding a feature, during code review, or when you need tests for normal behavior, edge cases, and errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/richardcb/oh-my-gemini/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 richardcb/oh-my-gemini --skill test-generation
Clone the repo
git clone --depth 1 https://github.com/richardcb/oh-my-gemini

Made for: Claude Code, Codex.

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/richardcb/oh-my-gemini/test-generation/github.svg)](https://agentmods.dev/skills/richardcb/oh-my-gemini/test-generation)
Your own site
<a href="https://agentmods.dev/skills/richardcb/oh-my-gemini/test-generation"><img src="https://agentmods.dev/badge/skills/richardcb/oh-my-gemini/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/richardcb/oh-my-gemini/test-generation"><img src="https://agentmods.dev/badge/skills/richardcb/oh-my-gemini/test-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,305 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.00041 $0.01305
Opus 5 $0.00020 $0.00652
Sonnet 5 $0.00008 $0.00261
Haiku 4.5 $0.00004 $0.00130

Measured 9d ago against content hash ccc81fc1b7ee, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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 · 240 lines

How it starts

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

Test Generation Skill

Goal

Generate comprehensive, maintainable tests that provide confidence in code correctness. Tests should cover happy paths, edge cases, and error conditions.

Activation Triggers

  • User asks to "write tests", "add tests", or "test this"
  • After implementing new features
  • When code coverage is mentioned
  • Part of code review process

Process

1. Detect Testing Environment

# Check for test frameworks
cat package.json 2>/dev/null | grep -E "(jest|vitest|mocha|pytest|go test)" || echo "NO_TEST_FRAMEWORK"

# Find existing tests
find . -name "*.test.*" -o -name "*.spec.*" -o -name "*_test.*" 2>/dev/null | head -10

# Check test configuration
ls jest.config.* vitest.config.* pytest.ini 2>/dev/null || echo "NO_TEST_CONFIG"

2. Analyze Existing Test Patterns

# Look at existing test structure
cat $(find . -name "*.test.ts" | head -1) 2>/dev/null | head -50

Key patterns to match:

  • Import style (ES modules vs CommonJS)
  • Test organization (describe/it vs test)
  • Assertion library (expect, assert, chai)
  • Mock patterns (jest.mock, vi.mock)
  • Setup/teardown patterns

3. Analyze Code to Test

For the target file, identify:

Functions/Methods
  • Input parameters and types
  • Return values and types
  • Side effects
  • Error conditions
Classes
  • Constructor parameters
  • Public methods
  • State management
  • Dependencies to mock
Components (React/Vue/etc)
  • Props and their types
  • User interactions
  • Rendered output
  • State changes

4. Generate Test Cases

Test Categories

Happy Path Tests

  • Normal expected inputs
  • Successful operations
  • Expected outputs

Edge Cases

  • Empty inputs (null, undefined, [], "")
  • Boundary values (0, -1, MAX_INT)
  • Single element collections
  • Maximum size inputs

Error Cases

  • Invalid inputs
  • Network failures
  • Timeout conditions
  • Permission errors

Integration Points

  • Database operations
  • API calls
  • File system access
  • External services

Read the full file on GitHub · 240 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. 9d ago First seen · 240 lines · 41 tokens per session scan A ccc81fc1b7ee

Subscribe to this mod's changes

test-generation is a skill published in the GitHub repository richardcb/oh-my-gemini (16 stars, last pushed 5mo ago), licensed MIT. It adds 41 tokens to every session and 1,305 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-30.