testing

A testing guide explains how to write or review automated checks for software behavior.

In plain words
What is it for?
It is for choosing a test runner, matching existing test conventions, deciding between real dependencies and test doubles, and adding regression tests after bug fixes.
Why use it?
It helps avoid tests that only mirror internal code and gives a consistent way to cover normal, unusual, and failing inputs.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/hautc-it/cil/testing
Any agent
npx skills add hautc-it/cil --skill testing
Clone the repo
git clone --depth 1 https://github.com/hautc-it/cil

Made for: Claude Code, Codex.

Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 721 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00055 $0.00721
Opus 5 $0.00028 $0.00360
Sonnet 5 $0.00011 $0.00144
Haiku 4.5 $0.00006 $0.00072

Measured yesterday against content hash 076d9cccf953, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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.

templates/skills/testing/SKILL.md · 69 lines

How it starts

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

Skill: Testing

Validate behavior, not implementation.

Project Context

Existing project

  1. Read CLAUDE.md — project rules take priority (mock policy, test scope, forbidden patterns).
  2. Identify the test runner — check the project manifest or config files to find what's already installed. Use it — never add a second test framework.
  3. Read existing tests — find 2–3 test files in the same module. Match their structure: file naming, test block nesting, assertion style, import paths, setup/teardown patterns.
  4. Check mock policy — does the project use real dependencies in tests, or mocks/stubs? Never introduce a strategy that contradicts what's already in use.
  5. Search memorymemory_search("testing [component] conventions") — retrieve prior decisions about test scope or mock strategy.
  6. Apply the protocol below within the project's conventions, not instead of them.

Greenfield project

No tests yet — you are establishing the conventions others will follow:

  1. Choose the test runner — use the standard one for the language/platform. Don't introduce a less-common alternative without a clear reason.
  2. Decide file layout upfront — co-located next to source files, or in a separate test directory. Pick one and document it. Changing later requires moving many files.
  3. Set the mock policy — prefer real dependencies where practical (catches integration bugs); mock only at expensive or unstable external boundaries. Document the policy in CLAUDE.md.
  4. Write the first test as the template — naming convention, assertion style, setup/teardown — this becomes the pattern every contributor follows.
  5. Store the decision:
    memory_store("decision", "testing: runner=[x], layout=[x], mock policy=[x]", ["testing", "conventions"])
    

Protocol

  1. Boundary first — Test the outermost contract (API, function signature, CLI output).
  2. Happy path — Core case works with valid input.
  3. Edge cases — Empty input, null, zero, max values, type boundaries.
  4. Error cases — Invalid input fails with the right error and message.
  5. Regression — Every bug fix gets a test that would have caught it.

Read the full file on GitHub · 69 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. yesterday First seen · 69 lines · 55 tokens per session scan A 076d9cccf953

Subscribe to this mod's changes

testing is a skill published in the GitHub repository hautc-it/cil (1 stars, last pushed 1mo ago), licensed MIT. It adds 55 tokens to every session and 721 once invoked, about $0.0003 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.