writing-unit-tests-quick

writing-unit-tests-quick is a skill for Claude Code from jaktestowac/awesome-copilot-for-testers. It costs 87 tokens per session (1,378 once invoked), scanned A, original, MIT.

A short set of rules for writing everyday unit tests for a function, class, or small module. Unit tests check one isolated part of a program through its public behavior.

In plain words
What is it for?
It helps cover a bug fix, a small code branch, or a quick set of tests someone has just written.
Why use it?
It helps keep routine tests deterministic, readable, and honest without requiring a large testing process.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit It helps cover a bug fix, a small code branch, or a quick set of tests someone has just written.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jaktestowac/awesome-copilot-for-testers/writing-unit-tests-quick
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.

Any agent
npx skills add jaktestowac/awesome-copilot-for-testers --skill writing-unit-tests-quick
Clone the repo
git clone --depth 1 https://github.com/jaktestowac/awesome-copilot-for-testers

Made for: Claude Code.

Wrote 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.

agentmods badge for writing-unit-tests-quick

README.md
[![agentmods](https://agentmods.dev/badge/skills/jaktestowac/awesome-copilot-for-testers/writing-unit-tests-quick/github.svg)](https://agentmods.dev/skills/jaktestowac/awesome-copilot-for-testers/writing-unit-tests-quick)
Your own site
<a href="https://agentmods.dev/skills/jaktestowac/awesome-copilot-for-testers/writing-unit-tests-quick"><img src="https://agentmods.dev/badge/skills/jaktestowac/awesome-copilot-for-testers/writing-unit-tests-quick/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.

agentmods 80×15 button for writing-unit-tests-quick

Your own site · 80×15
<a href="https://agentmods.dev/skills/jaktestowac/awesome-copilot-for-testers/writing-unit-tests-quick"><img src="https://agentmods.dev/badge/skills/jaktestowac/awesome-copilot-for-testers/writing-unit-tests-quick.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,378 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00087 $0.01378
Opus 5 $0.00044 $0.00689
Sonnet 5 $0.00017 $0.00276
Haiku 4.5 $0.00009 $0.00138

Measured 7d ago against content hash f513f6c0bbdb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

writing-unit-tests-quick 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 7d 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.

plugins/writing-unit-tests/skills/writing-unit-tests-quick/SKILL.md · 93 lines

How it starts

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

Quick Unit Tests

A compact standard for everyday unit testing: enough to keep tests honest, short enough to read in one pass.

Framework-agnostic - match whatever runner, assertion style, and file layout the project already uses. If none exists, ask which runner to target before writing anything.

When to Use

  1. Add tests for one function, class, or small module.
  2. Sanity-check a handful of tests someone just wrote.
  3. Cover a bug fix or a small new branch.

Escalate to writing-unit-tests when the job is a legacy backfill, a flaky or slow suite, a full-suite review, or heavy test-double design. Use test-driven-development when the tests should come before the code.

The Rules

  1. Test behavior, not implementation. Assert what the public interface returns, throws, or emits. Never touch private state.
  2. One reason to fail. If the test name needs "and", split it.
  3. Name the behavior and the condition. returns zero when the cart is empty - the CI log alone should say what broke.
  4. Arrange - Act - Assert, visibly separated, with exactly one call to the unit under test.
  5. Expected values are independent literals. Never recompute them the way the code does, and never import the implementation's own constant - that test can only agree with the code.
  6. Assert specific values. Not truthy, not defined. For errors, assert the type and the meaningful part of the message.
  7. No logic in the test. No loops or conditionals - use the runner's parameterized/table-driven API so each case reports separately.
  8. Control nondeterminism. Inject or freeze time, randomness, and IDs; use fake timers instead of real delays; await every promise and assert rejections directly.
  9. Mock only what you do not own. Network, storage, clock. Never stub your own modules - that freezes the design and breaks on every refactor.
  10. No real I/O. If proving the behavior needs a database, HTTP call, or browser, say so and route it to integration coverage instead of mocking around it.
  11. Synthetic test data only. No credentials, tokens, or real personal data - a fixture committed once stays in history forever.
  12. Leave nothing skipped silently. A skip or only carries an issue link and an owner, or it does not land.
  13. Do not reshape the code to suit the test. Hard-to-test code is a design finding to raise, not something to restructure inside a test-adding change.

Read the full file on GitHub · 93 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. 7d ago First seen · 93 lines · 87 tokens per session scan A f513f6c0bbdb

Subscribe to this mod's changes

writing-unit-tests-quick is a skill published in the GitHub repository jaktestowac/awesome-copilot-for-testers (113 stars, last pushed 15d ago), licensed MIT. It adds 87 tokens to every session and 1,378 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

go-testing

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

Gentleman-Programming/gentle-ai · 26 tokens

unit-test-generator

Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.

JackyST0/awesome-agent-skills · 20 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

managedcode/dotnet-skills · 149 tokens

nunit

Write, run, or repair .NET tests that use NUnit. Use when a repo uses NUnit, [Test], [TestCase], [TestFixture], or NUnit3TestAdapter for VSTest or Microsoft.Testing.Platform execution. USE FOR: writing or reviewing NUnit tests; using [Test], [TestCase], [TestFixture], [SetUp], [TearDown] attributes; configuring…

managedcode/dotnet-skills · 146 tokens

crap-score

Calculates CRAP (Change Risk Anti-Patterns) for a named .NET method, class, or file. USE FOR: explicit CRAP calculation or coverage-and-complexity risk within that named target, including which tests to prioritize. DO NOT USE FOR: project-wide coverage/CRAP, plateaus, or project-wide blockers/priorities…

managedcode/dotnet-skills · 99 tokens

deepeval

Use when discussing or working with DeepEval (the python AI evaluation framework).

sammcj/agentic-coding · 19 tokens