awesome-test-writing

awesome-test-writing is a skill for Claude Code from khasky/awesome-agent-skills. It costs 122 tokens per session (2,132 once invoked), scanned A, original, MIT.

A test-writing guide for adding checks that detect when software behavior breaks. It covers unit, integration, and end-to-end tests, plus tests for older code, parsers, and known bugs.

In plain words
What is it for?
Use it to write tests for a module, add coverage, protect a bug fix, prepare legacy code for refactoring, or test parsers with varied and unexpected inputs.
Why use it?
It helps avoid tests that only increase coverage without detecting real regressions. It also helps new tests fit the project's existing test tools and conventions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the awesome-agent-skills plugin — 42 skills shipped together

Good fit Use it to write tests for a module, add coverage, protect a bug fix, prepare legacy code for refactoring, or test parsers with varied and unexpected inputs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khasky/awesome-agent-skills/awesome-test-writing
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 khasky/awesome-agent-skills --skill awesome-test-writing
Clone the repo
git clone --depth 1 https://github.com/khasky/awesome-agent-skills

Made for: Claude Code.

Or install awesome-agent-skills, the plugin that ships this one along with the rest of its 42 skills.

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 awesome-test-writing

README.md
[![agentmods](https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-test-writing/github.svg)](https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-test-writing)
Your own site
<a href="https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-test-writing"><img src="https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-test-writing/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 awesome-test-writing

Your own site · 80×15
<a href="https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-test-writing"><img src="https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-test-writing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,132 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 41
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
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.00122 $0.02132
Opus 5 $0.00061 $0.01066
Sonnet 5 $0.00024 $0.00426
Haiku 4.5 $0.00012 $0.00213

Measured today against content hash 42c6e3eed912, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

awesome-test-writing 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 today.

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.

skills/awesome-test-writing/SKILL.md · 72 lines

How it starts

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

Test Writing

Write tests that fail when the behavior breaks and stay green through refactors. The deliverable is not coverage — it is a tripwire: for every realistic way the code under test could regress, at least one test goes red. A test that cannot fail against broken code is documentation wearing a test's costume.

When to Activate

  • "Write tests for X", "add coverage", "this module has no tests".
  • A bug fix needs its regression test (awesome-bug-fix hands off here).
  • A review or audit finding says "needs a test" (awesome-code-review, awesome-security-audit, awesome-dependency-audit).
  • Legacy code needs a safety net before a refactor (characterization tests).

Do not activate to review test quality in a diff (awesome-code-review Phase 4 owns that) or to find the root cause of a failure (awesome-bug-fix).

Work Process

  1. Discover the incumbent setup first — runner, assertion style, fixture/factory conventions, file placement, naming pattern. New tests match the repo's existing shape; never introduce a second test framework or a parallel convention. No runner at all → propose the ecosystem default and wait for approval (it is a new dependency).
  2. Read the code under test end to end — public seams, inputs, outputs, side effects, error paths. The seam you test through must be one a caller actually uses; needing to export a private function to test it is a design signal to report, not to work around.
  3. Choose placement by the lowest level that can catch the defect — pure logic gets unit tests; wiring, queries, and contracts get integration tests; only critical user flows get E2E. A bug that a unit test can catch, caught only by an E2E suite, costs 100× per run forever.
  4. Agree the seams before writing a line of test code — write down which seams the tests will run against (the public entry points, the boundaries you will observe through) and put that list to the user. Nothing gets tested at an unconfirmed seam. You cannot test everything, and agreeing the seams up front is what puts the effort on the critical paths and the complex logic instead of spreading it evenly over every edge case; it also surfaces the disagreement while it is still cheap, rather than after twenty tests exist at the wrong level. Where the shape of the interface is itself the question (how deep the module is, where the seam belongs), the vocabulary is in awesome-architecture-audit's references/design-vocabulary.md.
  5. Design the case list before writing code — happy path, boundaries (empty, one, many, max), error paths (invalid input, dependency failure, timeout), and the bug class this code invites (off-by-one in pagination, timezone in date math, race in check-then-act). Write the list down; each case becomes one test with one behavioral focus.
  6. Write behavior-first — assert observable outcomes through the public seam (return value, state change, emitted event, recorded call), never internals (private fields, call order of helpers). Test name states scenario and expectation ("rejects expired token with 401", not "test token 2").
  7. Prove every test can fail — run the new test against intentionally broken code (revert the fix, flip the branch, break the constant) and watch it go red, then restore and watch it go green. A regression test is proven both ways: fails without the fix, passes with it. A test that has never failed has proven nothing.
  8. Run the suite and report — full relevant scope, exit code read, flaky behavior reported (a test passing only on re-run is a defect, not a pass — quarantine and report, never silently retry to green).

Read the full file on GitHub · 72 lines

Files

What ships with it

1 file 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.

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. today Changed 42c6e3eed912
  2. 5d ago Changed · +2 lines · -12 tokens per session 737432ae457d
  3. 11d ago First seen · 70 lines · 134 tokens per session scan A 7d31d06557ef

Subscribe to this mod's changes

awesome-test-writing is a skill published in the GitHub repository khasky/awesome-agent-skills (8 stars, last pushed today), licensed MIT. It adds 122 tokens to every session and 2,132 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

nestjs-testing-expert

NestJS testing mechanics with Jest — building testing modules, mocking providers and repositories, writing service and controller specs, and driving HTTP end-to-end tests through the real application. Use for any test touching a NestJS service, controller, guard, module, or API endpoint, including test-module setup…

shipshitdev/skills · 77 tokens

browser-testing-with-devtools

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be…

addyosmani/agent-skills · 68 tokens

testing-setup

Analyze and create a testing strategy for native Android apps - install testing libraries, set up test infrastructure, create harnesses for unit tests, UI tests, screenshot tests, and end-to-end tests.

android/skills · 43 tokens

designing-tests

Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.

CloudAI-X/claude-workflow-v2 · 48 tokens

backend/testing-guide

A guide for writing backend tests: small unit tests, tests that check connected parts such as an API and database, and end-to-end tests that follow a complete user flow.

echoVic/boss-skill · 30 tokens

qa/test-strategy

A testing strategy based on the testing pyramid: many small unit tests, fewer integration tests, and a smaller set of end-to-end tests that follow real user journeys. It also defines checks for security, boundaries, permissions, and business consistency.

echoVic/boss-skill · 33 tokens