testing-unit

testing-unit is a skill for Claude Code from yonatangross/orchestkit. It costs 95 tokens per session (2,442 once invoked), scanned A, original, MIT.

A set of patterns for unit tests, which check one small piece of program logic in isolation. It covers test structure, repeated input cases, test fixtures, network mocking, and generated test data.

In plain words
What is it for?
Use it to write Arrange-Act-Assert tests, parameterised cases, scoped fixtures, network-level mocks with MSW or VCR.py, and factories for test data.
Why use it?
Tests become slow, repetitive, or unreliable when they share mutable data or contact real services. These patterns help keep each test focused and predictable.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: agent in frontmatter; mentions Claude Code.

Part of the ork plugin — 106 skills, 35 commands, 36 agents, 32 hooks shipped together

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.

agentmods
npx agentmods add skills/yonatangross/orchestkit/testing-unit
Any agent
npx skills add yonatangross/orchestkit --skill testing-unit
Clone the repo
git clone --depth 1 https://github.com/yonatangross/orchestkit

Made for: Claude Code.

Or install ork, the plugin that ships this one along with the rest of its 106 skills, 35 commands, 36 agents, 32 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/yonatangross/orchestkit/testing-unit.svg)](https://agentmods.dev/skills/yonatangross/orchestkit/testing-unit)
Your own site
<a href="https://agentmods.dev/skills/yonatangross/orchestkit/testing-unit"><img src="https://agentmods.dev/badge/skills/yonatangross/orchestkit/testing-unit.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,442 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00095 $0.02442
Opus 5 $0.00048 $0.01221
Sonnet 5 $0.00019 $0.00488
Haiku 4.5 $0.00010 $0.00244

Measured today against content hash 07dd65accf66, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

testing-unit 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 today.

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.

plugins/ork/skills/testing-unit/SKILL.md · 273 lines

How it starts

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

Unit Testing Patterns

Focused patterns for writing isolated, fast, maintainable unit tests. Covers test structure (AAA), parametrization, fixture management, HTTP mocking (MSW/VCR), and test data generation with factories.

Each category has individual rule files in rules/ loaded on-demand, plus reference material, checklists, and scaffolding scripts.

Core Principles (ALWAYS apply)

  1. AAA structure: Every test MUST follow Arrange-Act-Assert. Use // Arrange, // Act, // Assert comments for clarity.
  2. Parametrize, don't duplicate: Use test.each (TypeScript) or @pytest.mark.parametrize (Python) when testing multiple inputs. Never copy-paste the same test body with different values.
  3. Fixture scoping matters: Use scope="function" (default) for mutable data. Use scope="module" or scope="session" ONLY for expensive read-only resources (DB engines, ML models). Mutable data with shared scope causes flaky tests.
  4. Speed target: Each unit test should run under 100ms. If it's slower, you're likely hitting I/O — mock it.
  5. Mock at the network level: Use MSW (TypeScript) or VCR.py (Python) to intercept HTTP at the network layer. Never mock fetch/axios/requests directly.

Quick Reference

Category Rules Impact When to Use
Unit Test Structure 3 CRITICAL Writing any unit test
HTTP Mocking 2 HIGH Mocking API calls in frontend/backend tests
Test Data Management 3 MEDIUM Setting up test data, factories, fixtures

Total: 8 rules across 3 categories, 4 references, 3 checklists, 1 example set, 3 scripts

Unit Test Structure

Core patterns for structuring isolated unit tests with clear phases and efficient execution.

Rule File Key Pattern
AAA Pattern rules/unit-aaa-pattern.md Arrange-Act-Assert with isolation
Fixture Scoping rules/unit-fixture-scoping.md function/module/session scope selection
Parametrized Tests rules/unit-parametrized.md test.each / @pytest.mark.parametrize

Read the full file on GitHub · 273 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. today First seen · 273 lines · 95 tokens per session scan A 07dd65accf66

Subscribe to this mod's changes

testing-unit is a skill published in the GitHub repository yonatangross/orchestkit (228 stars, last pushed yesterday), licensed MIT. It adds 95 tokens to every session and 2,442 once invoked, about $0.0005 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-09-05.

Related

Other skills, from other repositories

vitest

Vitest unit testing — Vite-powered, Jest-compatible. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.

martineserios/thebrana · 33 tokens

pytest

Advanced Python unit testing framework for customer support tech enablement, covering FastAPI, SQLAlchemy, PostgreSQL, async operations, mocking, fixtures, parametrization, coverage, and comprehensive testing strategies for backend support systems.

manutej/luxor-claude-marketplace · 44 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

adk-verify-snippets

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 report with per-snippet coverage. Use when the user asks to verify, test, or validate the code samples in a README, a guide…

google/adk-python · 149 tokens

adk-setup

Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test run. Runs only when explicitly requested, never on its own. Use when asked to set up, bootstrap, or repair a development…

google/adk-python · 146 tokens

Jest Mocking Patterns

Teaches the agent the right way to mock in Jest — jest.fn, mockImplementation, mockResolvedValue, jest.mock factories, spyOn with restore, and isolating modules like axios.

PramodDutta/qaskills · 44 tokens