generate-tests

generate-tests is a skill for Claude Code from mavka-ai/unit-tests-skills. It costs 53 tokens per session (1,884 once invoked), scanned A, original, MIT.

A coding aid that examines Java code and creates unit tests, which check individual pieces of code in isolation. It first lists proposed test cases for review, then writes tests using Java testing tools such as JUnit 5.

In plain words
What is it for?
Use it when you need unit tests for Java classes or methods, including tests that use Mockito and AssertJ. It can also add missing tests to an existing test file after checking related code and project conventions.
Why use it?
It reduces the time spent understanding unfamiliar code and planning test scenarios. Reviewing the test list before code is written also makes missing or incorrect cases easier to spot.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the unit-tests-skills plugin — 2 skills shipped together

Good fit Use it when you need unit tests for Java classes or methods, including tests that use Mockito and AssertJ. It can also add missing tests to an existing test file after checking related code and project conventions.

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

Made for: Claude Code.

Or install unit-tests-skills, the plugin that ships this one along with the rest of its 2 skills.

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/mavka-ai/unit-tests-skills/generate-tests/github.svg)](https://agentmods.dev/skills/mavka-ai/unit-tests-skills/generate-tests)
Your own site
<a href="https://agentmods.dev/skills/mavka-ai/unit-tests-skills/generate-tests"><img src="https://agentmods.dev/badge/skills/mavka-ai/unit-tests-skills/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/mavka-ai/unit-tests-skills/generate-tests"><img src="https://agentmods.dev/badge/skills/mavka-ai/unit-tests-skills/generate-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,884 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00053 $0.01884
Opus 5 $0.00026 $0.00942
Sonnet 5 $0.00011 $0.00377
Haiku 4.5 $0.00005 $0.00188

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

How it starts

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

Generate Tests Skill

You will analyze code and generate high-quality unit tests for a given target.

Target to test: $ARGUMENTS

Quality Standards

  • Take your time to analyze the code thoroughly before generating test cases.
  • Quality is more important than speed — read all relevant source files and rules carefully.
  • Do not skip any step in the workflow below. Every step exists for a reason.
  • Do not take shortcuts with test data — read the actual classes to use correct constructors and fields.

Instructions

Step 1: Read Rules and Analyze Context

  1. Read the relevant rules from ./rules/tests/ based on code type (see Rules Reference below)
  2. Read the target source file/class/method
  3. Read dependencies: Follow imports to read DTOs, entities, enums, custom exceptions, and other types referenced by the target (as specified in code-context-analysis rule)
  4. Check for existing tests: Search for {ClassName}Test or {ClassName}Tests in the test directory (as specified in existing-test-awareness rule)
    • If found, read fully — you will add missing tests to it, not create a new file
    • If not found, scan 2-3 neighboring test classes to learn project conventions

Step 2: Generate Test Cases

  1. Analyze ALL code branches, including:
    • Success paths
    • Error/exception paths
    • Validation logic
    • Private/protected methods called by the target
    • Security annotations (if present)
  2. Apply the INCLUDE/EXCLUDE rules strictly
  3. Output the list of test cases in the format below — do NOT generate test code yet
Test Case Output Format
## Test Cases for {ClassName}.{methodName}

### 1. {testMethodName}
- **Given:** {preconditions/input state}
- **When:** {action being tested}
- **Then:** {expected outcome}
- **Code branch:** {which code path this covers}

### 2. {testMethodName}
...
Naming Convention

Test method name format: {testedMethod}_{givenState}_{expectedOutcome}

Examples:

  • calculateTotal_validProducts_returnsSum
  • calculateTotal_emptyList_throwsIllegalArgumentException
  • getUser_unauthorized_returns401

Read the full file on GitHub · 187 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. 12d ago First seen · 187 lines · 53 tokens per session scan A 76d9316b6297

Subscribe to this mod's changes

generate-tests is a skill published in the GitHub repository mavka-ai/unit-tests-skills (50 stars, last pushed 2d ago), licensed MIT. It adds 53 tokens to every session and 1,884 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

working-effectively-with-legacy-code

Apply Michael Feathers-inspired legacy-code rules when changing hard-to-test code safely with characterization tests, seams, sprout methods, or wrap methods.

ciembor/agent-rules-books · 37 tokens

refactoring-guru

Apply Refactoring.Guru-inspired rules when diagnosing code smells, choosing refactoring techniques, and stopping cleanup before uncontrolled redesign.

ciembor/agent-rules-books · 29 tokens

refactoring

Apply Martin Fowler-inspired refactoring rules when improving existing code structure while preserving observable behavior.

ciembor/agent-rules-books · 20 tokens

template-formal

Strongly-typed multiagent ant-robot colony exemplar — ADTs, session-typed protocols, affine-discipline resource handles, storage-as-functor framing, Active-Inference-flavored decision loop, mypy-as-oracle negative controls.

docxology/template · 53 tokens

template-test-creation

Create pytest suites under the no-mocks policy — real data, temp files, subprocess, pytest-httpserver. USE WHEN adding tests, raising coverage, testing new src/ module, or user forbids mocks.

docxology/template · 47 tokens

android-kotlin-testing

Android testing patterns — ViewModel unit tests with Turbine, Compose UI semantics, Hilt TestInstallIn fakes, coroutine test dispatchers, and release quality gates. Use when writing tests, setting up CI, mocking repositories, or asking "how to test ViewModel", "Compose UI test", "Turbine StateFlow".

haidrrrry/compose-kotlin-agent-skills · 72 tokens