Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/johnqtcg/awesome-skillsnpx agentmods add skills/johnqtcg/awesome-skills/unit-testWrote 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/johnqtcg/awesome-skills/unit-test)<a href="https://agentmods.dev/skills/johnqtcg/awesome-skills/unit-test"><img src="https://agentmods.dev/badge/skills/johnqtcg/awesome-skills/unit-test/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/johnqtcg/awesome-skills/unit-test"><img src="https://agentmods.dev/badge/skills/johnqtcg/awesome-skills/unit-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00100 | $0.06897 |
| Opus 5 | $0.00050 | $0.03449 |
| Sonnet 5 | $0.00020 | $0.01379 |
| Haiku 4.5 | $0.00010 | $0.00690 |
Grade A, and why
unit-test 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 6d 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 — 494 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Unit Test
Create and refine Go tests for this repository with table-driven cases and explicit bug-hunting rules.
Quick Reference
| When you need to… | Jump to |
|---|---|
| Quick tests for simple functions | Light mode — §Execution Modes |
| Normal feature development | Standard mode (default) — §Execution Modes |
| High-risk / release / concurrent code | Strict mode — §Execution Modes |
| Fix or triage failing tests | §Test Execution Hardening |
| Supplement coverage on existing code | §Coverage Gate Policy |
| Know if a Killer Case is required | Standard + Strict modes: always required — §Killer Case |
| Check Go version compatibility | §Go Version Gate |
| Write a Killer Case | §Killer Case — Definition + load references/killer-case-patterns.md |
Hard Rules
- Name test files as
<target_file>_test.go, co-located with source. - Assertion strategy (adapt to project):
- If project uses testify:
requirefor fatal preconditions,assertfor value checks. - If project uses standard library only: use
t.Fatalffor fatal preconditions,t.Errorffor value checks. Include got/want in messages:t.Errorf("Name = %q, want %q", got, want). - If project uses go-cmp: use
cmp.Difffor deep struct comparison. Prefer over field-by-field assertion for complex output. - Detection: Check existing
_test.gofiles for"github.com/stretchr/testify"imports. Follow project convention.
- If project uses testify:
- Keep tests deterministic; isolate time, randomness, environment, and network.
- Prefer
t.Setenvfor env changes; avoid leaking global state between tests. Note:t.Setenvpanics undert.Parallel()(see Go Version Gate) — for a parallel subtest that needs env isolation, inject config explicitly instead of mutating the process environment.
- Prefer
- Prefer stable fakes/stubs over heavy mock chains.
- Unit tests SHOULD NOT require real external services (DB/Redis/HTTP) unless explicitly requested; that belongs to integration tests.
- Do NOT test constructors (
NewXxx) or private helpers unless explicitly requested OR they contain non-trivial logic (validation/defaulting/option-merging) that can break runtime invariants. - For service-layer code with interfaces, focus on methods declared in the interface. For pure functions/handlers, focus on exported functions/endpoints.
- Run with the race detector (
go test -race). Scope is the tested package set, not always./...: PR mode narrows it to changed packages, and a Light pure-function target with nogo/chan/syncmay run-raceon just that package rather than the whole repo. Precedence when the rules below disagree:race.requiredconfig > PR scope > mode default.race.required: falsedisables-raceentirely (state it in the report); otherwise-raceis required on every tested package. - Killer Case hard constraint (Standard + Strict): each test target (interface method / exported function / handler endpoint) must include at least 1 "killer case" (fault-injection or boundary-kill case) that is expected to fail on a known bad mutation/path.
- In the report, for each killer case, explicitly state: "if this assertion is removed, the known bug can escape detection."
What ships with it
32 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.
- references/boundary-scorecard.md 3.4 KB
- references/bug-finding-techniques.md 7.4 KB
- references/concurrency-testing.md 7.2 KB
- references/killer-case-patterns.md 6.1 KB
- references/property-based-testing.md 5.4 KB
- references/unit-test-config.example.yaml 759 B
- scripts/run_regression.sh 601 B runs code
- scripts/tests/COVERAGE.md 14 KB
- scripts/tests/golden/001_pure_function_boundary.json 742 B
- scripts/tests/golden/002_service_dependency_error.json 815 B
- scripts/tests/golden/003_concurrent_shared_state.json 678 B
- scripts/tests/golden/004_generated_code_exclusion.json 428 B
- scripts/tests/golden/005_trivial_getter_antiexample.json 408 B
- scripts/tests/golden/006_collection_transform.json 776 B
- scripts/tests/golden/007_http_handler.json 817 B
- scripts/tests/golden/008_cli_command.json 739 B
- scripts/tests/golden/009_middleware.json 746 B
- scripts/tests/golden/010_simple_pure_function_light.json 464 B
- scripts/tests/golden/011_roundtrip_property_standard.json 545 B
- scripts/tests/golden/012_concurrent_map_access.json 896 B
- scripts/tests/golden/013_scorecard_tier_validation.json 814 B
- scripts/tests/golden/014_strict_property_required.json 846 B
- scripts/tests/golden/015_strict_state_machine.json 920 B
- scripts/tests/llm_eval/README.md 1.6 KB
- scripts/tests/llm_eval/slice_transform/bad.md 572 B
- scripts/tests/llm_eval/slice_transform/good.md 1.4 KB
- scripts/tests/llm_eval/slice_transform/meta.json 456 B
- scripts/tests/llm_eval/slice_transform/sut.go 367 B
- scripts/tests/test_behavioral_killer.py 11 KB runs code
- scripts/tests/test_golden_scenarios.py 6.0 KB runs code
- scripts/tests/test_llm_skill_eval.py 11 KB runs code
- scripts/tests/test_skill_contract.py 26 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.
- 6d ago First seen · 494 lines · 100 tokens per session scan A 24bb095b6389
unit-test is a skill published in the GitHub repository johnqtcg/awesome-skills (30 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 6,897 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-03.
Other skills, from other repositories
golang-testing
Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…
golang-stretchr-testify
Comprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, creating mocks, setting up test suites, or choosing between assert and require. Covers testify assertions, mock expectations, argument matchers, call verification…
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.
verify-implementation
A workflow that runs a project’s verification skills to produce a report on coding patterns, architecture rules, and project conventions. It is intended for work after implementation, before a pull request, or during code review.
verification-engine
Use when verifying build/test/lint before commit, PR, or completion claims. Runs verification pipeline in fresh subagent context with auto-repair. Triggers on /handoff-verify, pre-commit check, build verification, test validation.
ci-tests
Run the test suite for the current repo, auto-detecting Python (pytest/uv), Node (vitest/pnpm), or Rust (cargo test).