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 johnqtcg/awesome-skills --skill unit-testgit clone --depth 1 https://github.com/johnqtcg/awesome-skillsWrote 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.07767 |
| Opus 5.5 | $0.00040 | $0.03107 |
| Sonnet 5.5 | $0.00020 | $0.01553 |
| Haiku 4.5 | $0.00010 | $0.00777 |
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 1mo 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 — 505 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, name its critical assertion(s) and report
Kill: Verified— you injected the named defect throughgo test -overlay(never by editing the source), re-ran the test, observed the FAIL, and quote the failure line — orKill: Unverifiedplus why you could not run it. An unverified kill is a defect hypothesis, not a demonstrated result: never write it as one. - Do NOT claim an assertion is indispensable unless you checked that separately. Injecting the defect shows the case catches it; only deleting the named assertion while the defect is still injected and seeing the test PASS shows that assertion is what catches it. Redundant assertions are normal — report
Assertion necessityonly when that removal check was actually run, never as a blanket statement. → recipe:references/killer-case-patterns.md§ Verifying the Kill.
What ships with it
36 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 4.0 KB
- references/bug-finding-techniques.md 8.7 KB
- references/concurrency-testing.md 7.2 KB
- references/killer-case-patterns.md 11 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 36 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 9.4 KB
- scripts/tests/llm_eval/service_mapping/bad.md 4.1 KB
- scripts/tests/llm_eval/service_mapping/good.md 12 KB
- scripts/tests/llm_eval/service_mapping/meta.json 3.9 KB
- scripts/tests/llm_eval/service_mapping/sut.go 1.8 KB
- scripts/tests/llm_eval/slice_transform/bad.md 572 B
- scripts/tests/llm_eval/slice_transform/good.md 7.8 KB
- scripts/tests/llm_eval/slice_transform/meta.json 3.2 KB
- scripts/tests/llm_eval/slice_transform/sut.go 631 B
- scripts/tests/test_behavioral_killer.py 22 KB runs code
- scripts/tests/test_golden_scenarios.py 6.0 KB runs code
- scripts/tests/test_llm_skill_eval.py 59 KB runs code
- scripts/tests/test_skill_contract.py 65 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.
- 1mo ago Changed · +1 lines e10027b78838
- 1mo ago Changed · -2 lines 933acd5ca11c
- 1mo ago Changed · +12 lines 640ec39d5357
- 1mo 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 16d ago), licensed MIT. It adds 100 tokens to every session and 7,767 once invoked, about $0.0004 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.
Other skills, from other repositories
golang-testing
Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.
golang-testing-patterns
Modern Go testing patterns including table-driven tests, subtests, test organization, and best practices. Use when writing or refactoring tests, implementing test coverage, or when the user asks about Go testing approaches.
test-go
Write, review, and improve Go test code for this project. Use whenever generating, reviewing, or modifying Go tests - including when invoked by the Tester agent, the /test prompt, or any test-related request. Covers table-driven tests, subtests, t.Parallel(), test helpers with t.Helper(), error assertions via…
go-testing
Use when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff. Also use when a user asks to write a test for a Go function, even if they don't mention specific patterns like table-driven tests or subtests. Does…
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…
go-testing-with-testify
Write, review, or harden Go tests using stretchr/testify assert, require, mock, or suite. Use for assertion choice, test doubles, subtests, concurrency, and flake triage in an existing Go test setup. Use coding-guidance-go for production code or non-testify tests and tester-mindset for test strategy without concrete…