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 JayRHa/AgentSkills --skill unit-test-authorgit clone --depth 1 https://github.com/JayRHa/AgentSkillsWrote 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/jayrha/agentskills/unit-test-author)<a href="https://agentmods.dev/skills/jayrha/agentskills/unit-test-author"><img src="https://agentmods.dev/badge/skills/jayrha/agentskills/unit-test-author/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/jayrha/agentskills/unit-test-author"><img src="https://agentmods.dev/badge/skills/jayrha/agentskills/unit-test-author.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.00141 | $0.01750 |
| Opus 5.5 | $0.00056 | $0.00700 |
| Sonnet 5.5 | $0.00028 | $0.00350 |
| Haiku 4.5 | $0.00014 | $0.00175 |
Grade A, and why
unit-test-author 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Unit Test Author
Overview
This skill produces unit tests that are correct, behavior-focused, exhaustive on edge cases, and resistant to brittleness. It applies across languages and frameworks and emphasizes testing observable behavior over implementation details.
Keywords: unit test, test coverage, edge cases, table-driven, parametrize, mock, stub, spy, fake, fixture, AAA arrange-act-assert, flaky test, property-based, snapshot, regression test, pytest, Jest, Vitest, Go test, JUnit, RSpec, xUnit, NUnit, Rust test.
Use this skill whenever the goal is to create or strengthen unit tests for a specific function, class, or module — not for end-to-end or load testing.
Core Principles
- Test behavior, not implementation. Assert on outputs, return values, raised errors, and observable side effects — never on private internals that can change without breaking the contract.
- One logical concept per test. A test may have several assertions, but they should all verify a single behavior. If a test name needs "and", split it.
- Deterministic always. No real clocks, randomness, network, filesystem, or ordering assumptions unless explicitly under test. Inject or freeze them.
- Arrange-Act-Assert (AAA). Visually separate setup, the single action, and verification. Keep the "act" to one call.
- Fail for one reason. When a test fails the message should point to the cause. Prefer precise assertions over
assertTrue(x == y). - Cover the contract, then the edges. Happy path first, then boundaries, then error/exception paths.
Workflow
Follow these steps in order. Do not skip step 1 — understanding the unit under test prevents tautological tests.
- Identify the unit and its contract. Read the function/class. List: inputs (types, ranges), outputs, raised errors, side effects, and dependencies (collaborators to mock).
- Detect the framework and conventions. Inspect the repo: test directory layout, existing test files, the runner (
package.jsonscripts,pytest.ini/pyproject.toml,go.mod,pom.xml,Cargo.toml), assertion library, and mocking library already in use. Match existing conventions. Seereferences/frameworks.md. - Enumerate test cases using the edge-case checklist in
references/edge-cases.md. Produce a short list before writing code (happy path, boundaries, empties, nulls, errors, concurrency if relevant). - Choose a structure. When many inputs map to one behavior, use table-driven / parametrized tests (see
references/table-driven.md). Otherwise, individual named tests. - Plan the test double strategy for each dependency (mock vs stub vs fake vs spy) using the decision guide in
references/mocking.md. Mock at architectural boundaries (network, DB, time, randomness), not internal pure functions. - Write the tests with descriptive names (
method_condition_expectedResult), AAA layout, and precise assertions. - Add error-path and edge tests explicitly — these are most often missing.
- Run the tests and ensure they pass. Then sanity-check quality with
scripts/check_tests.py(heuristic linter for missing assertions, skipped tests, sleep-based timing, etc.). - Verify they actually test something: mentally (or literally) mutate the implementation and confirm a test would fail. Tests that pass against a broken implementation are worthless.
What ships with it
7 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.
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.
- 3mo ago First seen · 99 lines · 141 tokens per session scan A bb15d49c61f9
unit-test-author is a skill published in the GitHub repository JayRHa/AgentSkills (12 stars, last pushed 4mo ago), licensed MIT. It adds 141 tokens to every session and 1,750 once invoked, about $0.0006 per session on Opus 5.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-03.
unit-test-author compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| unit-test-authorJayRHa/AgentSkills | Skill | 12 | 4mo ago | MIT | A | 141 | Claude Code, Codex |
| test-masterzacklecon/claude-skills | Skill | 3 | 1mo ago | MIT | A | 38 | Claude Code, Codex |
| cpp-testingaffaan-m/ECC | Skill | 316k | 2d ago | MIT | A | 34 | Claude Code, Kiro |
| rust-testingaffaan-m/ECC | Skill | 316k | 2d ago | MIT | A | 31 | Claude Code, Kiro |
| golang-testingaffaan-m/ECC | Skill | 316k | 2d ago | MIT | A | 37 | Claude Code, Kiro |
| swift-protocol-di-testingaffaan-m/ECC | Skill | 316k | 2d ago | MIT | A | 32 | Claude Code, Kiro |
| web3-testingwshobson/agents | Skill | 43k | yesterday | MIT | A | 46 | Claude Code |