generate-tests

generate-tests is a skill for Claude Code, Codex from coco-research/coco. It costs 51 tokens per session (1,597 once invoked), scanned A, original, Apache-2.0.

A tool for generating tests for a file, component, or module using the project's existing testing setup. It covers normal cases, edge cases, failures, integration points, and mocks.

In plain words
What is it for?
Use it to create unit and integration tests, check error handling, cover edge cases, and add test doubles where needed.
Why use it?
It helps turn untested code paths into a broader test suite without assuming one particular testing framework.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it to create unit and integration tests, check error handling, cover edge cases, and add test doubles where needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/coco-research/coco/generate-tests
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 coco-research/coco --skill generate-tests
Clone the repo
git clone --depth 1 https://github.com/coco-research/coco

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 generate-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/coco-research/coco/generate-tests/github.svg)](https://agentmods.dev/skills/coco-research/coco/generate-tests)
Your own site
<a href="https://agentmods.dev/skills/coco-research/coco/generate-tests"><img src="https://agentmods.dev/badge/skills/coco-research/coco/generate-tests/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 generate-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/coco-research/coco/generate-tests"><img src="https://agentmods.dev/badge/skills/coco-research/coco/generate-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,597 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.00051 $0.01597
Opus 5.5 $0.00020 $0.00639
Sonnet 5.5 $0.00010 $0.00319
Haiku 4.5 $0.00005 $0.00160

Measured 2mo ago against content hash a8ea060969fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

generate-tests 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 2mo 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/generate-tests/SKILL.md · 175 lines

How it starts

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

Generate Tests — Comprehensive Test Suite Generator

Generate complete test coverage for any file, component, or module. Covers unit tests, integration tests, edge cases, error handling, and mocking — adapted to whatever testing framework the project uses.

Use when: you want tests generated for a file or component, need to improve test coverage, want edge case coverage, need mocks for external dependencies, or want to bootstrap a test suite for untested code.


When This Skill Is Activated

Follow every step below. Do NOT generate tests without first analyzing the project's testing setup and the target code.


Step 1: Detect the Testing Setup

Before writing any tests, discover the project's testing conventions:

  1. Find the test framework — Check package.json (dependencies/scripts), or config files:

    • jest.config.* / jest key in package.json → Jest
    • vitest.config.* → Vitest
    • cypress.config.* → Cypress
    • playwright.config.* → Playwright
    • pytest.ini / pyproject.toml [tool.pytest] → pytest
    • go.mod → Go testing
    • Cargo.toml → Rust (#[cfg(test)])
  2. Find existing test files — Search for *.test.*, *.spec.*, test_*.py, *_test.go to understand naming conventions and patterns already in use.

  3. Check for test utilities — Look for shared helpers, factories, custom matchers, or mock setups the project already provides (e.g., test/utils.ts, __mocks__/, conftest.py).

  4. Check the test script — Read the test script in package.json (or equivalent) to understand how tests are run, what flags are used, and what coverage tool is configured.

Match the project's existing conventions exactly. File naming, import style, assertion style, describe/it vs test, etc.


Step 2: Analyze the Target Code

Read the file or component the user wants tested. Identify:

  • All exported functions, classes, methods, and components
  • Input types and return types (or infer them)
  • External dependencies (API calls, database, file system, third-party libs)
  • Side effects (mutations, network calls, timers, DOM manipulation)
  • Error paths (throw statements, catch blocks, error returns)
  • Edge cases (null/undefined inputs, empty arrays, boundary values, large inputs)
  • Async behavior (promises, callbacks, streams)

Read the full file on GitHub · 175 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. 2mo ago Changed · +10 tokens per session a8ea060969fa
  2. 2mo ago First seen · 175 lines · 41 tokens per session scan A 2d5ff45f0bb6

Subscribe to this mod's changes

generate-tests is a skill published in the GitHub repository coco-research/coco (323 stars, last pushed yesterday), licensed Apache-2.0. It adds 51 tokens to every session and 1,597 once invoked, about $0.0002 per session on Opus 5.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

generate-tests compared with skills from other repositories

generate-tests next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
generate-testscoco-research/cocoSkill323yesterdayApache-2.0A51Claude Code, Codex
refactoring-guruciembor/agent-rules-booksSkill3.4k2mo agoMITA29Claude Code, Codex
refactoringciembor/agent-rules-booksSkill3.4k2mo agoMITA20Claude Code, Codex
working-effectively-with-legacy-codeciembor/agent-rules-booksSkill3.4k2mo agoMITA37Claude Code, Codex
template-formaldocxology/templateSkill25todayApache-2.0A53Claude Code, Codex
template-test-creationdocxology/templateSkill25todayApache-2.0A47Claude Code, Codex
generate-testsmavka-ai/unit-tests-skillsSkill762mo agoMITA63Claude Code