testing

testing is a skill for Claude Code, Codex from kid-sid/codex-spellbook. It costs 43 tokens per session (751 once invoked), scanned A, original, MIT.

General guidance for designing and maintaining automated tests, including test structure, naming, mocks, coverage, parameterized cases, and preventing flaky tests.

In plain words
What is it for?
Use it when adding or reviewing tests, repairing unreliable tests, deciding whether to use real dependencies, setting coverage goals, or applying TDD.
Why use it?
It helps teams find missing coverage and make test suites more reliable, readable, and useful when code changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding or reviewing tests, repairing unreliable tests, deciding whether to use real dependencies, setting coverage goals, or applying TDD.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kid-sid/codex-spellbook/testing
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 kid-sid/codex-spellbook --skill testing
Clone the repo
git clone --depth 1 https://github.com/kid-sid/codex-spellbook

Made for: Claude Code, Codex.

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 testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/kid-sid/codex-spellbook/testing/github.svg)](https://agentmods.dev/skills/kid-sid/codex-spellbook/testing)
Your own site
<a href="https://agentmods.dev/skills/kid-sid/codex-spellbook/testing"><img src="https://agentmods.dev/badge/skills/kid-sid/codex-spellbook/testing/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 testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/kid-sid/codex-spellbook/testing"><img src="https://agentmods.dev/badge/skills/kid-sid/codex-spellbook/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 751 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.
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.00043 $0.00751
Opus 5 $0.00022 $0.00376
Sonnet 5 $0.00009 $0.00150
Haiku 4.5 $0.00004 $0.00075

Measured 5d ago against content hash 8035f280fc33, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

testing 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 5d 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.

skills/testing/SKILL.md · 114 lines

How it starts

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

Testing

Write tests that isolate behavior, document intent, and fail for one reason at a time.

When to Activate

  • Add tests for new behavior
  • Refactor a flaky or slow test suite
  • Decide whether a collaborator should be mocked
  • Raise or enforce coverage expectations
  • Convert duplicated tests into parameterized cases
  • Review a PR for missing test coverage
  • Drive a change with TDD

Test Structure

Phase Purpose Rule
Arrange Build inputs and collaborators Keep setup minimal and explicit
Act Execute one behavior One action per test
Assert Verify outcome Assert observable effects, not internals

Naming and Coverage

Style Example
Python test_create_user_rejects_duplicate_email
TypeScript it("rejects duplicate email on createUser")
Go func TestCreateUser_RejectsDuplicateEmail(t *testing.T)
Codebase Type Target
Shared library >= 90% line coverage
Backend service >= 80% line coverage with integration coverage on critical flows
Frontend app >= 70% on logic-heavy modules, plus E2E coverage on core journeys

Mock vs Real

Dependency Default Reason
Database adapter in unit tests Mock or in-memory fake Keep units fast
Pure domain services Real No need to mock deterministic logic
HTTP clients Mock at network boundary Avoid external flake
Serialization and validation Real Contract drift matters

TDD and Parameterization

Step Goal
Red Prove the behavior is missing
Green Implement the smallest passing change
Refactor Improve structure without changing behavior

Python

@pytest.mark.parametrize(("input", "expected"), [("A", "a"), ("B", "b")])
def test_normalize_code(input: str, expected: str) -> None:
    assert normalize_code(input) == expected

TypeScript

it.each([
  ["A", "a"],
  ["B", "b"],
])("normalizes %s", (input, expected) => {
  expect(normalizeCode(input)).toBe(expected);
});

Read the full file on GitHub · 114 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. 5d ago First seen · 114 lines · 43 tokens per session scan A 8035f280fc33

Subscribe to this mod's changes

testing is a skill published in the GitHub repository kid-sid/codex-spellbook (21 stars, last pushed 4mo ago), licensed MIT. It adds 43 tokens to every session and 751 once invoked, about $0.0002 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.