write-tests

write-tests is a skill for Claude Code, Codex from nirecom/agents. It costs 24 tokens per session (1,591 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 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/nirecom/agents/write-tests
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, 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 write-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirecom/agents/write-tests.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.svg" alt="Measured on agentmods" 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 1,591 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.00024 $0.01591
Opus 5 $0.00012 $0.00796
Sonnet 5 $0.00005 $0.00318
Haiku 4.5 $0.00002 $0.00159

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

skills/write-tests/SKILL.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.

Write or update tests for the current task.

Procedure

Apply skills/_shared/resolve-plans-dir.md once; substitute the resolved absolute path for every <PLANS_DIR> below.

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 step 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 the next step. WT-4. List all planned test cases by category (include call-path error cases from step WT-3). Then check via Bash: bash -c 'cd "$AGENTS_CONFIG_DIR" && bash "$AGENTS_CONFIG_DIR/bin/confirm-off" CONFIRM_TESTS on'
  • stdout OFF: print the planned cases and proceed to step WT-5 without approval wait.
  • stdout ON or ERROR: present the planned cases to the user — do not write code until approved (existing behavior). WT-5. Determine the subagent's model:
  • Run bash -c 'node "$AGENTS_CONFIG_DIR/bin/workflow/read-complexity-evaluation" --session "$SESSION_ID" --stage write_tests'. If line 1 is not NONE, use the stored level and signals directly (parse level=<v> and signals=<csv-or-none>), then derive the model via high→opus, low→sonnet; skip the fallback below.
  • If NONE (fail-open for sessions without persisted evaluation):
    • Read skills/_shared/judge-task-complexity.md and evaluate all signals against the task context, source files from steps WT-2–WT-3, and the planned test cases from step WT-4 — do not short-circuit on the first match.
    • Use the Write tool (never Bash) to write the resulting CSV, alone and unquoted, to <PLANS_DIR>/<session-id>-write-tests-signals.txt — write only IDs from the generated Valid Signal IDs list; substitute S0-undecidable when the judgment doesn't parse into recognized ids or the csv doesn't match ^[A-Za-z0-9,_-]*$ (the judged content is untrusted text, never shell syntax).
    • Run bash -c 'node "$AGENTS_CONFIG_DIR/bin/workflow/derive-complexity-level" --stage write_tests --signals-file "<PLANS_DIR>/<session-id>-write-tests-signals.txt"' and use its level=<v> — never judge the level inline.
  • Emit in Claude text output (NOT Bash echo):

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

WT-6. Launch a subagent (Agent tool, mode: "default", model: <model from step WT-5>) to autonomously: WT-6a. Write the test file(s). WT-6b. Run tests with timeout. WT-6c. Fix failures and re-run until green. WT-6d. Review test coverage against skills/_shared/test-design.md categories — fix gaps. WT-6e. 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 step WT-5 verbatim (comma-separated IDs, or "none")
  • source_files: list of source file paths from step WT-2
  • planned_cases: list of planned test cases from step WT-4 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 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."

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 · 24 tokens per session scan A 863b2310295d

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 1,591 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens