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.
npx skills add williamzujkowski/standards --skill unit-testinggit clone --depth 1 https://github.com/williamzujkowski/standardsWrote 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.
[](https://agentmods.dev/skills/williamzujkowski/standards/unit-testing)<a href="https://agentmods.dev/skills/williamzujkowski/standards/unit-testing"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/unit-testing/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.
<a href="https://agentmods.dev/skills/williamzujkowski/standards/unit-testing"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/unit-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.04203 |
| Opus 5.5 | $0.00015 | $0.01681 |
| Sonnet 5.5 | $0.00007 | $0.00841 |
| Haiku 4.5 | $0.00004 | $0.00420 |
Grade A, and why
unit-testing scanned grade A with 1 finding 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 yesterday.
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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
@patch('requests.get') How it starts
The opening of the file, as written. The whole thing — 631 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Unit Testing Standards
Quick Navigation: Level 1: Quick Start (5 min) → Level 2: Implementation (30 min) → Level 3: Mastery (Extended)
Level 1: Quick Start (<2,000 tokens, 5 minutes)
Core Principles
- Test-Driven Development (TDD): Write tests before implementation (Red-Green-Refactor)
- Test Pyramid: 70% unit tests, 20% integration, 10% E2E
- Fast and Isolated: Tests run in milliseconds, no external dependencies
- Comprehensive Coverage: Aim for 80-90% code coverage minimum
- Clear and Maintainable: Tests serve as living documentation
Essential Checklist
- TDD workflow: Write failing test → Implement → Refactor
- Coverage targets: 80%+ overall, 95%+ for critical paths
- Naming convention:
test_<function>_<scenario>_<expected_result> - AAA pattern: Arrange, Act, Assert structure in every test
- Mocking: Mock external dependencies (database, APIs, filesystem)
- Fixtures: Reusable test data and setup/teardown
- Parametrized tests: Test multiple inputs efficiently
- CI integration: Tests run automatically on every commit
Quick Example
# pytest unit testing example
import pytest
from datetime import datetime
def calculate_discount(user_age: int, purchase_amount: float) -> float:
"""Calculate discount based on age and purchase amount."""
if user_age < 18:
return 0.0
elif user_age >= 65:
return purchase_amount * 0.15
elif purchase_amount >= 100:
return purchase_amount * 0.10
return 0.0
# Unit tests following TDD
def test_calculate_discount_no_discount_for_minors():
"""Test that users under 18 receive no discount."""
# Arrange
user_age = 16
purchase_amount = 100.0
# Act
discount = calculate_discount(user_age, purchase_amount)
# Assert
assert discount == 0.0
def test_calculate_discount_senior_discount():
"""Test that seniors (65+) receive 15% discount."""
assert calculate_discount(65, 100.0) == 15.0
assert calculate_discount(70, 200.0) == 30.0
def test_calculate_discount_large_purchase():
"""Test that purchases >= $100 receive 10% discount."""
assert calculate_discount(30, 100.0) == 10.0
assert calculate_discount(30, 150.0) == 15.0
@pytest.mark.parametrize("age,amount,expected", [
(16, 100, 0.0), # Minor
(30, 50, 0.0), # No discount
(30, 100, 10.0), # Large purchase
(65, 50, 7.5), # Senior
(70, 200, 30.0), # Senior large purchase
])
def test_calculate_discount_parametrized(age, amount, expected):
"""Test multiple discount scenarios."""
assert calculate_discount(age, amount) == expected
What ships with it
15 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.
- config/jest.config.js 7.0 KB runs code
- config/pytest.ini 6.3 KB
- resources/configs/jest.config.js 1.2 KB runs code
- resources/configs/pytest.ini 1.1 KB
- resources/coverage-configs/.coveragerc 587 B
- resources/README.md 29 B
- resources/test-pyramid-diagram.md 7.0 KB
- scripts/README.md 27 B
- templates/example_test.go 11 KB
- templates/example.test.js 11 KB runs code
- templates/README.md 29 B
- templates/test_example.py 9.8 KB runs code
- templates/test-template-go.go 1.6 KB
- templates/test-template-jest.js 2.9 KB runs code
- templates/test-template-pytest.py 2.9 KB runs code
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.
- yesterday First seen · 631 lines · 37 tokens per session scan A 070b7896964e
unit-testing is a skill published in the GitHub repository williamzujkowski/standards (18 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 4,203 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-29.
Other skills, from other repositories
rust-testing
Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.
cpp-testing
Use only when writing/updating/fixing C++ tests, configuring GoogleTest/CTest, diagnosing failing or flaky tests, or adding coverage/sanitizers.
write-vibe-tests
Write or refactor Mistral Vibe tests with proper decoupling. Use when adding behavior coverage, testing ports/adapters, replacing brittle mocks, creating fakes, adding characterization tests before refactors, or changing tests under tests/ for vibe/core, vibe/cli, vibe/acp, tools, config, sessions, skills, hooks, MCP…
composing-matchers
Build compound Gomega assertions by combining matchers — And/SatisfyAll (all pass), Or/SatisfyAny (any pass), Not (negate), WithTransform to map the actual before matching, Satisfy for an ad-hoc predicate, HaveValue to dereference pointers/interfaces, HaveField for struct fields and method results, HaveEach for every…
nw-test-organization-conventions
Test directory structure patterns by architecture style, language conventions, naming rules, and fixture placement. Decision tree for selecting test organization strategy.
spec-driven-tests
Rebuild a package's unit test suite around a behavior specification (SPEC.md) derived from the implementation, with every test citing a numbered rule ID. Use when asked to do a spec-driven test rebuild, write a SPEC.md for a package, repeat the state or store spec process (PRs.