unit-testing-test-generate

unit-testing-test-generate is a skill for Claude Code from KunanonJ/ai-skills-hub. It costs 23 tokens per session (2,482 once invoked), scanned A, a copy of unit-testing-test-generate, MIT.

A tool for generating unit tests, which check small pieces of code in isolation. It analyses code to create maintainable tests with mocks, fixtures, assertions, and checks for unusual inputs.

In plain words
What is it for?
Use it when existing code needs automated unit tests across supported languages and frameworks. It helps identify untested code and generate tests for normal, boundary, and error scenarios.
Why use it?
It reduces the time needed to build a consistent test suite for existing code. It also helps reveal untested paths and edge cases before changes cause regressions.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when existing code needs automated unit tests across supported languages and frameworks. It helps identify untested code and generate tests for normal, boundary, and error scenarios.

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

Made for: Claude Code.

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/kunanonj/ai-skills-hub/unit-testing-test-generate/github.svg)](https://agentmods.dev/skills/kunanonj/ai-skills-hub/unit-testing-test-generate)
Your own site
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/unit-testing-test-generate"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/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/kunanonj/ai-skills-hub/unit-testing-test-generate"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/unit-testing-test-generate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,482 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 88% 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.00023 $0.02482
Opus 5 $0.00012 $0.01241
Sonnet 5 $0.00005 $0.00496
Haiku 4.5 $0.00002 $0.00248

Measured 6d ago against content hash 3fdc338d79aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 6d 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

88% identical to unit-testing-test-generate — 6 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.

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

How it starts

The opening of the file, as written. The whole thing — 328 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 · 328 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. 6d ago First seen · 328 lines · 23 tokens per session scan A 3fdc338d79aa

Subscribe to this mod's changes

unit-testing-test-generate is a skill published in the GitHub repository KunanonJ/ai-skills-hub (5 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 2,482 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). It is 88% identical to unit-testing-test-generate, differing in 6 lines, and is treated as a copy.