unit-testing

unit-testing is a skill for Claude Code, Codex from tottinge/otter-skills. It costs 106 tokens per session (5,137 once invoked), scanned A, original, Apache-2.0.

A test-first software development workflow based on writing a failing test, making it pass, and then improving the code. TDD means test-driven development, where tests guide implementation.

In plain words
What is it for?
Use it for new behavior, test-first bug fixes, small refactors during a working test cycle, and diagnosing unit-test quality or flakiness.
Why use it?
It helps developers add behavior or fix bugs with focused tests and identify slow, flaky, or poorly structured tests.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the otter-skills plugin — 7 skills shipped together

Good fit Use it for new behavior, test-first bug fixes, small refactors during a working test cycle, and diagnosing unit-test quality or flakiness.

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

Made for: Claude Code, Codex.

Or install otter-skills, the plugin that ships this one along with the rest of its 7 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 unit-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/tottinge/otter-skills/unit-testing.svg)](https://agentmods.dev/skills/tottinge/otter-skills/unit-testing)
Your own site
<a href="https://agentmods.dev/skills/tottinge/otter-skills/unit-testing"><img src="https://agentmods.dev/badge/skills/tottinge/otter-skills/unit-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,137 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.00106 $0.05137
Opus 5 $0.00053 $0.02568
Sonnet 5 $0.00021 $0.01027
Haiku 4.5 $0.00011 $0.00514

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

Security

Grade A, and why

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

plugins/otter-skills/skills/unit-testing/SKILL.md · 412 lines

How it starts

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

Unit Testing (TDD · Microtests · ZOMBIES · Tidy First? · Eight Virtues)

When to use this skill

Use unit-testing when:

  • Implementing new behavior or extending existing behavior with production code
  • Bug fixes that require new logic (characterize with a failing test first)
  • Choosing the next test to write (ZOMBIES ordering)
  • Deciding whether to tidy before writing the next test (Tidy First?)
  • Refactoring production or test code toward the Eight Code Virtues within an active TDD cycle
  • Diagnosing flaky, slow, or poorly-structured tests using FIRST
  • Any session where you would otherwise "code then sprinkle tests"

Do NOT use unit-testing for:

  • Establishing initial test access or characterizing poorly understood existing behavior → use legacy-code-safety, then return here
  • Choosing which delivery slice to build next → use story-splitting-for-delivery
  • Formatting an already-split story as user-visible outcomes → use user-pov-sliced-stories
  • Reviewing code broadly for representation or virtue violations without an active TDD cycle → use representation-refactor-review
  • Performing a focused identifier diagnosis or rename plan → use code-object-naming
  • Trunk-landing strategies, feature toggles, or branch-by-abstraction (out of scope for this package)

Purpose and scope

TDD is programming hygiene. Its job is not "prove the whole system" or "raise coverage." Its job is to keep code orderly and safe to change in tiny steps so you can refactor, integrate, and deliver without fear.

  • Timely, not Thorough: test-first keeps code testable and orderly; component, contract, E2E, and human testing are still required and not replaced by microtests.
  • Test-after is not TDD: writing tests after a production pile recreates legacy conditions — hard-to-test shapes, fear of breaking "what already works," and joyless test-after work.
  • Review is not a substitute for tests: representation-refactor-review catches representation drift and virtue violations but does not replace the microtest hygiene loop this skill owns.

Read the full file on GitHub · 412 lines

Files

What ships with it

3 files 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 · 412 lines · 106 tokens per session scan A 2c7870dfb3d3

Subscribe to this mod's changes

unit-testing is a skill published in the GitHub repository tottinge/otter-skills (3 stars, last pushed yesterday), licensed Apache-2.0. It adds 106 tokens to every session and 5,137 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-08-31.