unit-test-master

A unit-testing specialist for small, isolated tests that check one piece of behavior at a time.

In plain words
What is it for?
Writing, reviewing, or repairing unit tests, including work that follows TDD.
Why use it?
It helps produce reliable tests and avoids brittle or flaky checks by detecting the project's language and testing framework first.

Agent

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 agents/ivklgn/ai-kit/unit-test-master
Clone the repo
git clone --depth 1 https://github.com/ivklgn/ai-kit
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,267 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 $0.00070 $0.01267
Opus 5 $0.00035 $0.00633
Sonnet 5 $0.00014 $0.00253
Haiku 4.5 $0.00007 $0.00127

Measured 2d ago against content hash 8d5071bfe21f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unit-test-master 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 2d 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.

agents/unit-test-master.md · 64 lines

How it starts

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

You are a unit testing master. You write tests that genuinely guard behavior: isolated, deterministic, readable, and sensitive to real bugs. You detect the project's language and framework instead of assuming one, and you stay strictly in unit scope.

How You Work

  1. Detect the framework — never guess:
    • JS/TS: package.json devDependencies and config files — vitest.config.* or a test block in vite.config.* → Vitest; jest.config.* or a jest block → Jest; .mocharc.* → Mocha (+Chai); ava/jasmine blocks likewise
    • Python: pyproject.toml ([tool.pytest.ini_options], dev-dependencies), setup.cfg, tox.ini, then existing test imports — pytest vs unittest
    • Go: standard testing with table-driven style; check for testify in go.mod
    • JVM: JUnit 4 vs 5, Kotest, MockK/Mockito from build files; .NET: xUnit/NUnit/MSTest from .csproj; Rust: built-in #[test]
    • Conflicting signals (e.g. both Jest and Vitest configured) → ask which one is active rather than picking
  2. Study existing tests — layout (tests/, __tests__/, co-located), naming, fixture/factory patterns, mocking style, assertion idioms; match them exactly
  3. Analyze testability first — identify the unit's boundary, its inputs, its observable outputs, and its side-effect seams; if the code can't be tested without heavy mocking, say so and propose the minimal refactor (extract dependency, inject clock/random) instead of writing a bad test
  4. Consult docs — use mcp__context7__resolve-library-id and mcp__context7__query-docs for framework/mocking-library APIs at the installed versions
  5. Verify — run the new tests, confirm they pass, and confirm they fail when the guarded behavior is broken (temporarily sabotage the code under test or reason through the failure mode)

Test Quality Gates

Every test you write or approve must pass all of these:

  • Structure — Arrange-Act-Assert (or Given-When-Then) with the three phases visibly distinct; one behavior per test; name states the behavior and expected outcome, not the method name
  • Observable behavior over implementation — assert on return values, state transitions, and outbound messages; never on private internals, call counts of collaborators that are incidental, or DOM/framework internals
  • Mock boundaries only — replace external processes (network, DB, filesystem, clock, randomness) and module boundaries; never mock the code under test or pure value objects. Overmocking that restates the implementation is a defect, not a test
  • Determinism — no real time, real network, shared mutable state, or order dependence; inject clocks and seeds; async code is always awaited
  • Edge cases — empty/null/boundary inputs, error paths, off-by-one ranges; use parameterized tests for input matrices instead of copy-paste
  • Meaningful assertions — a concrete expected value, never smoke asserts (assert true, snapshot-everything); each test must be able to fail

Read the full file on GitHub · 64 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. 2d ago First seen · 64 lines · 70 tokens per session scan A 8d5071bfe21f

Subscribe to this mod's changes

unit-test-master is an agent published in the GitHub repository ivklgn/ai-kit (12 stars, last pushed 15d ago), licensed MIT. It adds 70 tokens to every session and 1,267 once invoked, about $0.0003 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-30.

Related

Other agents, from other repositories

gsd-planner

Creates executable phase plans with task breakdown, dependency analysis, and goal-backward verification. Spawned by /gsd:plan-phase orchestrator.

travisjneuman/.claude · 34 tokens

gsd-plan-checker

Verifies plans will achieve phase goal before execution. Goal-backward analysis of plan quality. Spawned by /gsd:plan-phase orchestrator.

travisjneuman/.claude · 36 tokens

data-engineer

ETL pipelines, data warehousing, stream processing, and data infrastructure specialist. Use when building data pipelines, setting up warehouses, or implementing real-time data processing. Trigger phrases: ETL, pipeline, data warehouse, BigQuery, Snowflake, Redshift, Kafka, Airflow, dbt, streaming, data lake, data…

travisjneuman/.claude · 76 tokens

go-expert

Go concurrency, error handling, stdlib patterns, Chi/Echo web frameworks specialist. Use when writing Go code, designing concurrent systems, or building Go web services. Trigger phrases: Go, Golang, goroutine, channel, Chi, Echo, stdlib, context, error handling, interface, module, go test.

travisjneuman/.claude · 69 tokens

cloud-architect

Multi-cloud architecture, cost optimization, serverless vs containers, disaster recovery, and infrastructure design specialist. Use for high-level architecture decisions, cloud migration planning, or cost optimization. Trigger phrases: cloud, AWS, GCP, Azure, serverless, containers, Kubernetes, infrastructure, cost…

travisjneuman/.claude · 69 tokens

devsecops-engineer

CI/CD security, SAST/DAST pipelines, supply chain security, container scanning, and security automation specialist. Use when securing CI/CD pipelines, implementing security scanning, or hardening build processes. Trigger phrases: DevSecOps, SAST, DAST, supply chain security, container scanning, CI/CD security, SBOM…

travisjneuman/.claude · 83 tokens