unit-testing-test-generate

unit-testing-test-generate is a skill for Claude Code from bcastelino/agent-skills-kit. It costs 33 tokens per session (2,413 once invoked), scanned A, a copy of unit-testing-test-generate, MIT.

A unit-test generator that examines existing code and creates tests for its behavior. Unit tests check small pieces of code separately from the rest of an application.

In plain words
What is it for?
Generating tests, mocks, fixtures, assertions, and edge-case checks across programming languages and testing frameworks.
Why use it?
It helps find untested paths and likely edge cases, reducing the manual work needed to build a consistent test suite.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Generating tests, mocks, fixtures, assertions, and edge-case checks across programming languages and testing frameworks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bcastelino/agent-skills-kit/unit-testing-test-generate
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 bcastelino/agent-skills-kit --skill unit-testing-test-generate
Clone the repo
git clone --depth 1 https://github.com/bcastelino/agent-skills-kit

Made for: Claude Code.

Its marketplace also offers this one on its own, as the plugin unit-testing-test-generate/plugin install unit-testing-test-generate after adding the marketplace above.

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 unit-testing-test-generate

README.md
[![agentmods](https://agentmods.dev/badge/skills/bcastelino/agent-skills-kit/unit-testing-test-generate/github.svg)](https://agentmods.dev/skills/bcastelino/agent-skills-kit/unit-testing-test-generate)
Your own site
<a href="https://agentmods.dev/skills/bcastelino/agent-skills-kit/unit-testing-test-generate"><img src="https://agentmods.dev/badge/skills/bcastelino/agent-skills-kit/unit-testing-test-generate/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 unit-testing-test-generate

Your own site · 80×15
<a href="https://agentmods.dev/skills/bcastelino/agent-skills-kit/unit-testing-test-generate"><img src="https://agentmods.dev/badge/skills/bcastelino/agent-skills-kit/unit-testing-test-generate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,413 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 95% copy Near-identical to another mod 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.00033 $0.02413
Opus 5 $0.00016 $0.01207
Sonnet 5 $0.00007 $0.00483
Haiku 4.5 $0.00003 $0.00241

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

Security

Grade A, and why

unit-testing-test-generate scanned grade A with 1 finding 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 8d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
Origin

This is a copy

95% identical to unit-testing-test-generate — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/unit-testing-test-generate/SKILL.md · 320 lines

How it starts

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

Automated Unit Test Generation

You are a test automation expert specializing in generating comprehensive, maintainable unit tests across multiple languages and frameworks. Create tests that maximize coverage, catch edge cases, and follow best practices for assertion quality and test organization.

Use this skill when

  • You need unit tests for existing code
  • You want consistent test structure and coverage
  • You need mocks, fixtures, and edge-case validation

Do not use this skill when

  • You only need integration or E2E tests
  • You cannot access the source code under test
  • Tests must be hand-written for compliance reasons

Context

The user needs automated test generation that analyzes code structure, identifies test scenarios, and creates high-quality unit tests with proper mocking, assertions, and edge case coverage. Focus on framework-specific patterns and maintainable test suites.

Requirements

$ARGUMENTS

Instructions

1. Analyze Code for Test Generation

Scan codebase to identify untested code and generate comprehensive test suites:

import ast
from pathlib import Path
from typing import Dict, List, Any

class TestGenerator:
    def __init__(self, language: str):
        self.language = language
        self.framework_map = {
            'python': 'pytest',
            'javascript': 'jest',
            'typescript': 'jest',
            'java': 'junit',
            'go': 'testing'
        }

    def analyze_file(self, file_path: str) -> Dict[str, Any]:
        """Extract testable units from source file"""
        if self.language == 'python':
            return self._analyze_python(file_path)
        elif self.language in ['javascript', 'typescript']:
            return self._analyze_javascript(file_path)

    def _analyze_python(self, file_path: str) -> Dict:
        with open(file_path) as f:
            tree = ast.parse(f.read())

        functions = []
        classes = []

        for node in ast.walk(tree):
            if isinstance(node, ast.FunctionDef):
                functions.append({
                    'name': node.name,
                    'args': [arg.arg for arg in node.args.args],
                    'returns': ast.unparse(node.returns) if node.returns else None,
                    'decorators': [ast.unparse(d) for d in node.decorator_list],
                    'docstring': ast.get_docstring(node),
                    'complexity': self._calculate_complexity(node)
                })
            elif isinstance(node, ast.ClassDef):
                methods = [n.name for n in node.body if isinstance(n, ast.FunctionDef)]
                classes.append({
                    'name': node.name,
                    'methods': methods,
                    'bases': [ast.unparse(base) for base in node.bases]
                })

        return {'functions': functions, 'classes': classes, 'file': file_path}

Read the full file on GitHub · 320 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. 8d ago First seen · 320 lines · 33 tokens per session scan A ade3a7728491

Subscribe to this mod's changes

unit-testing-test-generate is a skill published in the GitHub repository bcastelino/agent-skills-kit (2 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 2,413 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). It is 95% identical to unit-testing-test-generate, differing in 4 lines, and is treated as a copy.

Related

Other skills, from other repositories

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens

golang-stretchr-testify

Comprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, creating mocks, setting up test suites, or choosing between assert and require. Covers testify assertions, mock expectations, argument matchers, call verification…

samber/cc-skills-golang · 97 tokens

test-gen

Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns.

SethGammon/Citadel · 24 tokens

check-and-test

Run lint checks (ruff for Python, Biome for TS/JS), type checks (pyright for Python, tsc for TS/JS), and the standard pytest tiers (unit + e2e + tests skipped during pre-commit). Investigates failures to determine if they are application bugs or test issues, and fixes application bugs rather than weakening tests. Does…

ReflexioAI/claude-smart · 97 tokens

brooks-test

Test quality review drawing on twelve classic engineering books — with primary focus on xUnit Test Patterns, The Art of Unit Testing, How Google Tests Software, and Working Effectively with Legacy Code — that diagnoses structural problems in an existing test suite: brittleness, mock abuse, coverage illusions, slow…

hyhmrright/brooks-lint · 161 tokens

bun-test-lifecycle

Use for test lifecycle hooks: beforeAll, afterAll, beforeEach, afterEach, fixtures, preload.

secondsky/claude-skills · 27 tokens