unit-test-generator

unit-test-generator is a skill for Claude Code from glincker/claude-code-marketplace. It costs 16 tokens per session (1,755 once invoked), scanned A, original, Apache-2.0.

A unit-test generator that reads functions or classes and creates tests for normal inputs, edge cases, and errors. Unit tests are small automated checks for individual pieces of code.

In plain words
What is it for?
It is for generating tests in languages and frameworks such as Python with pytest or unittest, JavaScript and TypeScript with Jest, Mocha, or Vitest, Go, Rust, and Java with JUnit.
Why use it?
It reduces the manual work of deciding which code paths to test and writing matching test files.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit It is for generating tests in languages and frameworks such as Python with pytest or unittest, JavaScript and TypeScript with Jest, Mocha, or Vitest, Go, Rust, and Java with JUnit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/glincker/claude-code-marketplace/unit-test-generator
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 glincker/claude-code-marketplace --skill unit-test-generator
Clone the repo
git clone --depth 1 https://github.com/glincker/claude-code-marketplace

Made for: Claude Code.

Its marketplace also offers this one on its own, as the plugin unit-test-generator/plugin install unit-test-generator 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-test-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/glincker/claude-code-marketplace/unit-test-generator.svg)](https://agentmods.dev/skills/glincker/claude-code-marketplace/unit-test-generator)
Your own site
<a href="https://agentmods.dev/skills/glincker/claude-code-marketplace/unit-test-generator"><img src="https://agentmods.dev/badge/skills/glincker/claude-code-marketplace/unit-test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,755 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.00016 $0.01755
Opus 5 $0.00008 $0.00877
Sonnet 5 $0.00003 $0.00351
Haiku 4.5 $0.00002 $0.00176

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

Security

Grade A, and why

unit-test-generator 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/testing/unit-test-generator/SKILL.md · 280 lines

How it starts

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

Unit Test Generator

Automatically generates comprehensive unit tests for your code, supporting multiple programming languages and testing frameworks.

What This Skill Does

This skill creates high-quality unit tests by:

  • Analyzing function/method signatures and logic
  • Generating test cases for happy paths
  • Creating edge case tests
  • Adding error condition tests
  • Following language-specific best practices
  • Using appropriate testing frameworks
  • Including setup/teardown when needed

Instructions

1. Code Analysis

When asked to generate tests:

  1. Identify target code:

    • Use Read to examine the source file
    • Parse function/class signatures
    • Understand parameters, return types, and dependencies
  2. Detect language and framework:

    • Python: pytest, unittest
    • JavaScript/TypeScript: Jest, Mocha, Vitest
    • Go: testing package
    • Rust: built-in test framework
    • Java: JUnit
  3. Analyze logic:

    • Identify all code paths
    • Find conditionals and branches
    • Locate error handling
    • Determine edge cases

2. Test Generation Strategy

Create tests covering:

Happy Path Tests:

  • Normal input → expected output
  • Valid use cases
  • Common scenarios

Edge Cases:

  • Empty inputs
  • Boundary values (min, max)
  • Special characters
  • Large datasets
  • Zero/null values

Error Conditions:

  • Invalid inputs
  • Type mismatches
  • Missing required parameters
  • Exception scenarios

Integration Points:

  • Mock external dependencies
  • Stub API calls
  • Fake database interactions

3. Test Structure

Follow framework-specific conventions:

Python (pytest):

import pytest
from module import function_to_test

class TestFunctionName:
    def test_happy_path(self):
        # Arrange
        input_data = "valid input"

        # Act
        result = function_to_test(input_data)

        # Assert
        assert result == expected_value

    def test_edge_case_empty_input(self):
        with pytest.raises(ValueError):
            function_to_test("")

Read the full file on GitHub · 280 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 · 280 lines · 16 tokens per session scan A 603df1e4d236

Subscribe to this mod's changes

unit-test-generator is a skill published in the GitHub repository glincker/claude-code-marketplace (36 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 16 tokens to every session and 1,755 once invoked, about $0.0001 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.