write-tests

write-tests is a skill for Claude Code from nirecom/agents. It costs 24 tokens per session (2,342 once invoked), scanned A, original, MIT.

A workflow for planning and writing software tests, including checks of how code connects to the rest of the system.

In plain words
What is it for?
Designing test cases, covering error paths, and writing or updating automated tests.
Why use it?
It helps expose failures at both individual code boundaries and larger integration paths.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter; mentions CLAUDE.md; mentions subagents.

Good fit Designing test cases, covering error paths, and writing or updating automated tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nirecom/agents/write-tests
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 nirecom/agents --skill write-tests
Clone the repo
git clone --depth 1 https://github.com/nirecom/agents

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 write-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirecom/agents/write-tests/github.svg)](https://agentmods.dev/skills/nirecom/agents/write-tests)
Your own site
<a href="https://agentmods.dev/skills/nirecom/agents/write-tests"><img src="https://agentmods.dev/badge/skills/nirecom/agents/write-tests/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 write-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/nirecom/agents/write-tests"><img src="https://agentmods.dev/badge/skills/nirecom/agents/write-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,342 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.00024 $0.02342
Opus 5.5 $0.00010 $0.00937
Sonnet 5.5 $0.00005 $0.00468
Haiku 4.5 $0.00002 $0.00234

Measured 4d ago against content hash b974d99d64b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

write-tests 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 4d 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/write-tests/SKILL.md · 98 lines

How it starts

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

Write or update tests for the current task.

Procedure

WT-0. Read the session facts once, before the pre-launch steps that consume them: node "$AGENTS_MAIN_ROOT/bin/workflow/read-session-facts" --session "$SESSION_ID"

  • PLANS_DIR= — substitute this absolute path for every <PLANS_DIR> below.
  • GATE_CONFIRM_TESTS= — the WT-5 pre-action gate (ON / OFF / ERROR).
  • COMPLEXITY_LEVEL_write_tests=, COMPLEXITY_MODEL_write_tests= and COMPLEXITY_SIGNALS= — the WT-6 level, model and signals.
  • If the command exits non-zero, or PLANS_DIR=NONE, stop — do not proceed with any step that uses <PLANS_DIR>; report via /supervisor-report; never construct a path like NONE/<session-id>-....

WT-1. Read:

  • rules/core-principles.md
  • skills/_shared/test-design.md
  • rules/test.md — on-demand-only; never auto-injected, so this Read is mandatory For parser / regex / allowlist targets, apply the Table-Driven Tests pattern from test-design/parser-regex-tests.md. WT-2. Identify which source file(s) need tests. WT-3. Enumerate call paths: For each source file from WT-2, trace all integration paths it participates in — what calls it, what it calls, and what format/contract each boundary expects. For each boundary, list potential failure modes (wrong format, missing field, wrong type, unexpected value). These become integration-path error cases in WT-4. WT-4. List all planned test cases by category (include call-path error cases from WT-3). WT-5. Decide the destination of each planned case — append to an existing test file, or create a new one.
  • For each planned case, state its complete source set S (the # Tests: tokens the case protects).
  • Run bash "$AGENTS_MAIN_ROOT/bin/find-tests-for-source.sh" --with-language --sources <comma-joined S> with every distinct S in one call, repeating --sources (Bash, standalone command with timeout 600000; split rule and language columns in skills/_shared/test-design/append-vs-new.md; rows come back in query order; read-only, so hooks/block-tests-direct.js does not apply). On exit 4 or a tool timeout, HALT and surface the stderr.
  • Record each row's verdict/reason/target as the case group's destination. append is mandatory; the sole permitted new file when a target exists is the size-hard-limit case, per skills/_shared/test-design/append-vs-new.md — do not decide by eye.
  • If GATE_CONFIRM_TESTS is ON or ERROR, present the planned cases together with their destinations and wait for user confirmation before WT-6. WT-6. Determine the subagent's model:
  • If COMPLEXITY_LEVEL_write_tests from WT-0 is not NONE, use COMPLEXITY_MODEL_write_tests as the model and COMPLEXITY_SIGNALS directly; skip the fallback below.
  • If NONE (fail-open for sessions without persisted evaluation): follow skills/_shared/jev-two-stage-judge.md with point=complexity-judge stage=write-tests; use its model= and SIGNALS_CSV — never judge the level inline.
  • Emit in Claude text output (NOT Bash echo):

    Model selected: (signals: [comma-separated triggered signal IDs, or "none"])

WT-7. Launch a subagent (Agent tool, mode: "default", model: <model alias from WT-6>) to autonomously: WT-7a. Write the test file(s). WT-7b. Run tests with timeout. WT-7c. Fix failures and re-run until green. WT-7d. Review test coverage against skills/_shared/test-design.md categories — fix gaps. WT-7e. Re-run tests until green. The subagent prompt MUST include these structured fields so verbose output stays in the subagent context:

  • task_complexity_signals: the signals= line from WT-6 verbatim (comma-separated IDs, or "none")
  • source_files: list of source file paths from WT-2
  • planned_cases: list of planned test cases from WT-4 — each entry states the source set it protects
  • test_destinations: one entry per case group, keyed by that group's complete source set — append <path> or new. Each source set's new verdict generates its own independent new file — one new file per source set. A new test file's path MUST be tests/<category>/<file> (category = first path segment of the source it protects; valid categories: hooks bin skills agents install tests) — never a flat tests/<file>; the commit gate rejects a newly-added flat test (#1834, #2392). Name a new file by a supported entry's patterns in hooks/lib/test-language-registry.json. Follow the language column of the WT-5 output: a new test file MUST load that registry entry's helperLibrary — bin/check-test-frontmatter.sh rejects new files without it. If the Tests: header lists 2 or more paths, every case MUST carry a case marker written per that entry's notationDoc; bin/check-case-markers.sh flags multi-path files without markers as HIGH. On append: never rewrite the target's # Tests: line; # Tags: may only be added to. append is mandatory when the verdict is append; skills/_shared/test-design/append-vs-new.md is the SSOT for when a new file is warranted instead. The subagent prompt MUST instruct: edit only test files, never modify source code. The subagent prompt MUST instruct: Read rules/shell-commands.md before the first Bash command, or before writing a file — general-purpose dispatch does not inherit auto-injected rules. The subagent prompt MUST include the canonical line of the rules/shell-commands.md Subagent Dispatch Prompts section, verbatim as a standalone line, with <AGENTS_MAIN_ROOT> replaced by the literal absolute path. The subagent prompt MUST instruct: Read rules/user-escalation.md before any system-state-changing command — general-purpose dispatch does not inherit auto-injected rules. The subagent prompt MUST instruct: Read rules/coding.md (the hub — on-demand-only, so it does not reach you otherwise) and rules/coding/<lang>.md for each language present, before the first Edit. The subagent prompt MUST instruct: for Bash, PowerShell, JSON, or YAML test files (no rules/coding/<lang>.md B-layer exists for these), apply the A-layer language essence from skills/write-code/SKILL.md's "A-layer language essence" section before the first Edit. The subagent prompt MUST instruct: Read rules/test.md before writing or running tests — on-demand-only, so it does not reach you otherwise; general-purpose dispatch does not inherit auto-injected rules. Note: the Stop-guard silence during dispatch is automatic (PostToolUse marks the step in_progress). Do not emit NEXT_STEP_PAUSE. The subagent prompt MUST also include: "NEVER present diffs for approval. NEVER wait for user confirmation. Edit and run autonomously until tests pass."
  • (Optional) Follow agents/lib/nfr-severity-calibration.md to obtain the PROJECT NFR block and use it as a test constraint when relevant.

Read the full file on GitHub · 98 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. 4d ago Changed · +1 lines b974d99d64b8
  2. 6d ago Changed 493dc294bd6f
  3. 7d ago Changed · -4 lines d30e4f00a97f
  4. 9d ago Changed · +1 lines 3e7899cbc26d
  5. 11d ago Changed bd38f0ff1c73
  6. 17d ago Changed · +1 lines eb1e97ed8586
  7. 18d ago Changed 2e41f5f4d106
  8. 21d ago Changed f170770cfcb0
  9. 24d ago Changed · +2 lines 7c390e0a8e4b
  10. 25d ago First seen · 97 lines · 24 tokens per session scan A c13aa0be8b79

Subscribe to this mod's changes

write-tests is a skill published in the GitHub repository nirecom/agents (3 stars, last pushed today), licensed MIT. It adds 24 tokens to every session and 2,342 once invoked, about $0.0001 per session on Opus 5.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

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

eval-dataset-design

A guide to creating reliable test sets for AI agents. Each evaluation task includes the request, the simulated user's behaviour, a reset starting state, and a success check that can be independently verified.

bojieli/ai-agent-book · 138 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens

cua-driver

Use Cua Driver for desktop or browser tasks that are awkward or unavailable through Bash/APIs, or when the user explicitly wants GUI interaction: app testing, visual bug reproduction, form filling, calendar entry, screenshots, and demo recording. Also covers Cua setup; not OpenAI Codex Computer Use or web research.

davidondrej/skills · 68 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

atmos-validation

Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.

cloudposse/atmos · 31 tokens