test

A test-generation command creates a starting test file for a function or source file.

In plain words
What is it for?
It is for generating boundary, normal-case, edge-case, and error-case tests; it does not run the tests.
Why use it?
It turns the testing plan into a runnable scaffold while following the project's existing test framework and style.

Command for Claude Code

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 commands/hautc-it/cil/test
Clone the repo
git clone --depth 1 https://github.com/hautc-it/cil

Made for: Claude Code.

Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 621 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.00034 $0.00621
Opus 5 $0.00017 $0.00311
Sonnet 5 $0.00007 $0.00124
Haiku 4.5 $0.00003 $0.00062

Measured yesterday against content hash cbb16ff1b4c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

.claude/commands/test.md · 82 lines

How it starts

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

/test

Target: $ARGUMENTS

TDD assist — applies the testing skill protocol to produce a runnable test scaffold.


Step 1 — Read the target

Open the target file (or find the function across the repo). Identify:

  • Public API of what's being tested (exports, function signatures, observable side effects).
  • Inputs: types, ranges, optional vs required.
  • Outputs: return value, thrown errors, side effects (DB writes, file writes, network).

If the target is a folder or unclear, ask which symbol to test.


Step 2 — Detect the test framework

Check package.json (devDependencies) and existing tests:

  • vitest → describe / it / expect from vitest
  • jest → describe / it / expect from jest
  • node --test → node:test runner
  • pytest (Python) → def test_* functions
  • go test → func Test*(t *testing.T)

Match the existing convention. Don't introduce a new framework.


Step 3 — Generate cases (testing skill protocol)

Group into 4 sections:

  1. Boundary — outermost contract: function signature, public API.
  2. Happy path — core valid case works.
  3. Edge cases — empty, null, zero, max, type boundaries, unusual but valid input.
  4. Error cases — invalid input fails with the correct error and message.

For each case: descriptive name (returns_404_when_user_not_found, not test_user), arrange-act-assert structure, one logical assertion per it.


Step 4 — Write the file

Co-locate with existing tests (mirror their location):

  • TS/JS: src/.../__tests__/<name>.test.ts
  • Python: tests/test_<name>.py

If a test file already exists, append new cases — don't overwrite.

Prefer real dependencies over mocks (testing skill rule). Mock only when crossing a network boundary.


Step 5 — Verify the scaffold runs

Run the test command (npm test, pytest, go test ./...). All new tests should fail with a meaningful error if the target doesn't exist yet, OR pass if the target is already correct.

If runner errors out (compile error, import failure), fix the test scaffold — never commit a non-running test file.

Read the full file on GitHub · 82 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 · 82 lines · 34 tokens per session scan A cbb16ff1b4c6

Subscribe to this mod's changes

test is a command published in the GitHub repository hautc-it/cil (1 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 621 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-08-31.