Agent skill

Unit Testing

by dzhalaevd in dzhalaevd/Donatello

Use as the lead skill when designing, writing, or reviewing focused unit tests for isolated Python behavior without real I/O or competing concurrent operations

Apache-2.0Auto-check passedTesting & QA

Install Unit Testing

skills CLI
$ npx skills add dzhalaevd/Donatello --skill unit-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dzhalaevd/Donatello unit-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dzhalaevd/Donatello.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/unit-testing .claude/skills/unit-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
unit-testing
GitHub stars
135
Token cost
~2.3k tokens
SKILL.md length
1,096 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
Apache-2.0

At a glance

Use as the lead skill when designing, writing, or reviewing focused unit tests for isolated Python behavior without real I/O or competing concurrent operations

  • Works in 6 steps: Identify the unit of behavior, not… → Identify the public interface used to… → Read input types, return types,… → …
  • Tasks that involve Unit testing
  • SKILL.md covers Purpose, Relationship to Other Testing…, Codebase Understanding and Framework-Agnostic First, plus 12 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Unit Testing is an agent skill from dzhalaevd/Donatello. Use as the lead skill when designing, writing, or reviewing focused unit tests for isolated Python behavior without real I/O or competing concurrent operations

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing. It works with Python. The repository describes itself as: Make Dating Great Again. An open source dating platform. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Unit testing

Example prompts

  • “/unit-testing”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Identify the unit of behavior, not merely the class or function name.
  2. Identify the public interface used to observe that behavior.
  3. Read input types, return types, exceptions, side effects, and invariants.
  4. Identify dependencies
  5. Identify ambiguous or missing information
  6. Decide whether ambiguity blocks correct test design.

What it can do on your machine

Read from SKILL.md and the folder at commit b57816e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Unit Testing loads about 2.3k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 1,096 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dzhalaevd/Donatello at commit b57816e, republished under its Apache-2.0 licence (© dzhalaevd). 1,096 words, ~2,292 tokens.

Download SKILL.mdSave it as .claude/skills/unit-testing/SKILL.md (or your agent's skills folder).
name
unit-testing
description
Use as the lead skill when designing, writing, or reviewing focused unit tests for isolated Python behavior without real I/O or competing concurrent operations

Python Unit Testing

Purpose

Act as a senior Python developer designing a comprehensive, maintainable unit test suite for a provided codebase.

The goal is not to maximize the number of tests. The goal is to verify small units of behavior with fast, isolated, readable tests that make regressions obvious.

Use this skill when the user asks to:

  • write unit tests for Python code;
  • review unit-test quality;
  • identify missing unit-test scenarios;
  • design tool-agnostic test cases;
  • isolate Python code from external dependencies during tests.

Relationship to Other Testing Skills

Use this skill as the lead skill for isolated behavior and pure or near-pure Python logic.

Use testing-test-strategy first when the user asks which test levels are needed.

Use testing-pytest as a supporting skill when the user wants runnable pytest implementation details.

Use integration-testing as the lead skill when real databases, repositories, API flows, transactions, or multiple components must be tested together.

Use concurrency_fuzzing_testing as the lead skill when the risk is a scheduler/interleaving bug: multiple tasks, threads, workers, queues, locks, shared mutable state, or read -> modify -> write behavior that can run concurrently. Plain async code is not enough to choose concurrency fuzzing. If an async function can be tested by awaiting it with controlled fakes and no competing operation, keep unit-testing as the lead skill.

Use test-driven-development when implementation should be driven by a failing test first.

Codebase Understanding

Before writing tests, analyze the Python code step by step:

  1. Identify the unit of behavior, not merely the class or function name.
  2. Identify the public interface used to observe that behavior.
  3. Read input types, return types, exceptions, side effects, and invariants.
  4. Identify dependencies:
    • internal controlled collaborators;
    • external uncontrolled dependencies;
    • time, randomness, environment, filesystem, network, or process state.
  5. Identify ambiguous or missing information:
    • constants;
    • type definitions;
    • valid ranges;
    • external API contracts;
    • error semantics;
    • concurrency or async expectations.
  6. Decide whether ambiguity blocks correct test design.

If ambiguity blocks correctness, ask concise clarification questions before inventing behavior. If it does not block progress, state assumptions and continue.

Framework-Agnostic First

When the user asks for abstract or conceptual unit tests, describe tests using framework-neutral structure instead of naming pytest, unittest, or another specific tool.

Use generic terms:

  • test;
  • assert;
  • fake;
  • stub;
  • mock;
  • setup;
  • teardown.

When the user asks for runnable tests in this repository, follow the project's actual framework and conventions while preserving these unit-testing principles.

What Counts as a Unit Test

A unit test verifies one small behavior quickly and in isolation.

Good unit-test targets:

  • pure functions;
  • validation logic;
  • value objects and domain rules;
  • branch-heavy business logic;
  • data transformation;
  • error mapping;
  • retry/backoff decision logic without real sleeping;
  • async control flow with dependencies replaced.

Poor unit-test targets:

  • database engine behavior;
  • framework internals;
  • third-party SDK behavior;
  • real network calls;
  • broad API flows;
  • multi-component persistence behavior.

Those usually belong in integration tests.

Small, Focused Tests

Each unit test should:

  • verify one behavior;
  • have one main Act;
  • be independent of every other test;
  • be deterministic;
  • use explicit inputs;
  • assert an observable result;
  • avoid real I/O;
  • avoid loops and conditionals inside the test.

If a test name contains "and", consider splitting it.

Arrange / Act / Assert

Use AAA in every test:

python
def test_normalizes_email_before_comparison() -> None:
    # Arrange
    user_email = "Ada@Example.COM "
    candidate_email = "ada@example.com"
    matcher = EmailMatcher()

    # Act
    result = matcher.matches(user_email, candidate_email)

    # Assert
    assert result is True

Keep Arrange readable. Do not hide meaningful business setup in a helper unless the helper name makes the setup obvious.

Naming

Test names should describe behavior in domain language.

Good:

python
def test_rejects_message_when_recipient_has_blocked_sender() -> None: ...


def test_returns_empty_recommendations_when_daily_limit_is_reached() -> None: ...


def test_keeps_original_score_when_explanation_data_is_missing() -> None: ...

Bad:

python
def test_case_1() -> None: ...


def test_validator_works() -> None: ...


def test_returns_false() -> None: ...

Dependencies and Test Doubles

Replace external uncontrolled dependencies with test doubles:

  • use a fake for simple in-memory behavior;
  • use a stub for fixed return values;
  • use a mock for verifying an interaction at a true boundary;
  • use a spy only when the interaction itself is part of the contract.

Prefer fakes and stubs over mocks when possible. They usually make tests less brittle.

Mock external boundaries such as:

  • HTTP clients;
  • SMTP/email sender;
  • third-party APIs;
  • filesystem access when not under test;
  • time providers;
  • random generators;
  • environment variables.

Do not mock private methods or internal implementation details. If a test requires many mocks, the unit may be too coupled or too large.

Show full SKILL.md (430 more words)Show less

Happy Paths, Failure Modes, and Boundaries

For each meaningful behavior, cover:

  • the happy path;
  • invalid input;
  • missing or empty values;
  • boundary values;
  • duplicate or conflicting data;
  • dependency failure;
  • permission or policy denial when relevant;
  • async cancellation or timeout when relevant.

Choose representative equivalence classes instead of every possible combination.

Python Types

Use Python's type system to improve tests:

  • keep test data consistent with type hints;
  • assert precise return types when they are part of the contract;
  • use typed fakes and fixtures where practical;
  • include None, empty collections, and invalid enum/literal values when the type contract allows or rejects them.

If type hints and runtime behavior disagree, call that out.

Async Code

For async Python code:

  • await the unit under test;
  • replace async dependencies with async fakes or stubs;
  • test success and failure paths;
  • test timeout, cancellation, or retry decisions when they are part of the behavior;
  • do not leave background tasks unobserved;
  • avoid real sleeping; inject a clock or sleeper instead.

Valid Python async example:

python
async def test_returns_fallback_when_profile_service_times_out() -> None:
    # Arrange
    profile_service = StubProfileService(timeout=True)
    recommender = Recommender(profile_service=profile_service)

    # Act
    result = await recommender.recommend_for(user_id)

    # Assert
    assert result == []

Avoid Logic in Tests

Tests should be simple examples, not alternative implementations.

Avoid:

  • if statements;
  • loops over many cases unless expressed as clear named scenarios;
  • computed expected values that duplicate production logic;
  • broad helper frameworks;
  • assertions that only check "no exception".

Expected values should usually be explicit.

Complete Test Cases

Do not provide skeletons when the user asks for tests.

A complete unit test includes:

  • concrete input data;
  • all required test doubles;
  • the action under test;
  • meaningful assertions;
  • failure-path assertions where applicable.

If repository context is missing, provide a complete framework-neutral test design and list the exact assumptions or questions needed to convert it into runnable code.

Review Checklist

  • The test verifies one behavior.
  • The test uses AAA.
  • The name explains the scenario.
  • The test is independent and deterministic.
  • There is no real network, database, or filesystem access unless that is the explicit unit.
  • External dependencies are replaced with appropriate doubles.
  • Mocks do not assert private implementation details.
  • Happy path and meaningful failure modes are covered.
  • Boundary cases are represented.
  • Async behavior is awaited and deterministic.
  • Types and runtime expectations agree.
  • The test is complete, not a placeholder.

Response Format

When writing unit tests:

  1. Summarize the unit of behavior being tested.
  2. State assumptions or blocking questions.
  3. Provide complete tests or framework-neutral test cases.
  4. Explain which dependencies are doubled and why.
  5. List missing edge cases or integration scenarios separately.

When reviewing unit tests:

  1. Lead with the highest-risk issues.
  2. Identify tests that are too broad, too mocked, or implementation-bound.
  3. Suggest focused replacements.
  4. Provide a corrected example when useful.

© dzhalaevd, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/unit-testing of dzhalaevd/Donatello.

Open the folder on GitHubat commit b57816e

Compare with similar skills

Unit Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Unit Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unit Testing this skilldzhalaevd/Donatello135—~2.3kAutomated safety check: PassApache-2.0
Adk Verify Snippetsgoogle/adk-python22k—~1.4kAutomated safety check: PassApache-2.0
Hermetic Python Unit TestsdimensionalOS/dimos4.6k—~1.4kAutomated safety check: PassCustom licence
ONNX Runtime Test Runnermicrosoft/onnxruntime22k—~1.8kAutomated safety check: PassMIT
Simple Modern Uvjlevy/simple-modern-uv301—~1.9kAutomated safety check: PassMIT
Test Coverage Reviewareed1192/finance-news-aggregator149—~2.6kAutomated safety check: PassMIT

Similar skills

  • Adk Verify Snippets

    google/adk-python

    Official

    Checks that every Python code block in a Markdown file actually compiles and runs, by extracting each block to a temporary file, executing it in an isolated subprocess, and writing a pass/fail…

    22k GitHub stars~1.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Hermetic Python Unit Tests

    dimensionalOS/dimos

    Rules for writing, fixing and reviewing pytest unit tests that are hermetic: behavior-focused, deterministic, isolated and cheap to run.

    4.6k GitHub stars~1.4k tokensUpdated today
    Testing & QAAuto-check passed
  • ONNX Runtime Test Runner

    microsoft/onnxruntime

    Official

    Runs and debugs ONNX Runtime tests: Google Test executables for C++ and unittest or pytest for Python, with filters and build-directory guidance.

    22k GitHub stars~1.8k tokensUpdated today
    Testing & QAAuto-check passed
  • Simple Modern Uv

    jlevy/simple-modern-uv

    Start, selectively modernize, fully migrate, or update Python projects using simple-modern-uv practices: uv, ruff, BasedPyright, pytest, GitHub Actions CI, and tag-driven PyPI publishing.

    301 GitHub stars~1.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Test Coverage Review

    areed1192/finance-news-aggregator

    Audit, plan, write, and verify unit tests for Python projects using pytest.

    149 GitHub stars~2.6k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Official

    Runs the ONNX Runtime transformers Python tests against a GPU wheel and proves the cuDNN flash attention path was used rather than a silent fallback.

    22k GitHub stars~2.9k tokensUpdated today
    Testing & QAAuto-check passed

More from dzhalaevd/Donatello

All 15 skills in this repo
  • API And Interface Design

    dzhalaevd/Donatello

    Guides stable API and interface design. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 9 repos~2.6k tokens
    Auto-check passed
  • Documentation And Adrs

    dzhalaevd/Donatello

    Records decisions and documentation. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 8 repos~2.4k tokens
    Auto-check: notes
  • CI CD And Automation

    dzhalaevd/Donatello

    Automates CI/CD pipeline setup. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 7 repos~2.7k tokens
    Auto-check: notes
  • Deprecation And Migration

    dzhalaevd/Donatello

    Manages deprecation and migration. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 7 repos~3.1k tokens
    Auto-check passed
  • Instruments code so production behavior is visible and diagnosable.

    135 GitHub starsUsed in 5 repos~2.7k tokens
    Auto-check passed
  • Shipping And Launch

    dzhalaevd/Donatello

    Prepares production launches. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 5 repos~2.5k tokens
    Auto-check passed

Works with

Categories

Questions about Unit Testing

What does Unit Testing do?

Use as the lead skill when designing, writing, or reviewing focused unit tests for isolated Python behavior without real I/O or competing concurrent operations. Unit Testing is an agent skill from dzhalaevd/Donatello.

When should I use Unit Testing?

Unit Testing fits situations like: tasks that involve Unit testing.

How do I install Unit Testing in Claude Code?

Run `npx skills add dzhalaevd/Donatello --skill unit-testing -a claude-code`. Or copy the skill folder (.agents/skills/unit-testing in dzhalaevd/Donatello) into .claude/skills/unit-testing in your project. Claude Code loads it when a task matches its description.

How do I install Unit Testing in Codex?

Run `npx skills add dzhalaevd/Donatello --skill unit-testing -a codex`. Or copy the skill folder (.agents/skills/unit-testing in dzhalaevd/Donatello) into .agents/skills/unit-testing in your project. Codex loads it when a task matches its description.

Can I use Unit Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dzhalaevd/Donatello --skill unit-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unit-testing, .gemini/skills/unit-testing, .github/skills/unit-testing and .opencode/skills/unit-testing in your project.

What does Unit Testing need to run?

SKILL.md names no scripts, command-line tools or credentials: Unit Testing is instructions for the agent only. Our summary lists: Python 3.

Does Unit Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Unit Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Unit Testing use?

Unit Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Unit Testing use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Unit Testing?

Skills that share tags, products or a category with Unit Testing: Adk Verify Snippets (google/adk-python, 22k stars), Hermetic Python Unit Tests (dimensionalOS/dimos, 4.6k stars), ONNX Runtime Test Runner (microsoft/onnxruntime, 22k stars) and Simple Modern Uv (jlevy/simple-modern-uv, 301 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unit Testing?

dzhalaevd (a GitHub user) maintains it in dzhalaevd/Donatello, which has 135 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 3, 2026.

Source: dzhalaevd/Donatello on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.