test-writer

test-writer is a skill for Claude Code from hex/claude-council. It costs 30 tokens per session (988 once invoked), scanned A, original, MIT.

A test-writing guide for adding tests that protect behaviour users or other code can observe.

In plain words
What is it for?
Use it to test return values, files, HTTP responses, errors, state changes, and other documented contracts.
Why use it?
It prevents tests that merely repeat the implementation, cannot fail for a real bug, or depend on expected values produced by the code being tested.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: built for openclaw.

Part of the claude-council plugin — 10 skills, 4 commands, 1 agent, 1 hook shipped together

Good fit Use it to test return values, files, HTTP responses, errors, state changes, and other documented contracts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hex/claude-council/test-writer
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 hex/claude-council --skill test-writer
Clone the repo
git clone --depth 1 https://github.com/hex/claude-council

Made for: Claude Code.

Or install claude-council, the plugin that ships this one along with the rest of its 10 skills, 4 commands, 1 agent, 1 hook.

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 test-writer

README.md
[![agentmods](https://agentmods.dev/badge/skills/hex/claude-council/test-writer/github.svg)](https://agentmods.dev/skills/hex/claude-council/test-writer)
Your own site
<a href="https://agentmods.dev/skills/hex/claude-council/test-writer"><img src="https://agentmods.dev/badge/skills/hex/claude-council/test-writer/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 test-writer

Your own site · 80×15
<a href="https://agentmods.dev/skills/hex/claude-council/test-writer"><img src="https://agentmods.dev/badge/skills/hex/claude-council/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 988 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.00030 $0.00988
Opus 5.5 $0.00012 $0.00395
Sonnet 5.5 $0.00006 $0.00198
Haiku 4.5 $0.00003 $0.00099

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

Security

Grade A, and why

test-writer 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 22d 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.

mods/council-pane/specialists/test-writer/SKILL.md · 104 lines

How it starts

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

Test Writer

Add tests that protect behaviour a user or caller relies on. Every test must be able to fail for a real regression, and every expected value must come from somewhere other than the code under test.

Authoring gate

Before writing any test, answer these four questions in your notes. If one has no answer, do not write that test; list it in the report instead.

  1. What observable behaviour, invariant or contract does it protect? Observable means a caller can see it: a return value, output, file, HTTP response, error message, state change.
  2. What credible regression would make it fail? Name the plausible bug.
  3. Why does existing coverage not catch that already? Each contract should have one primary test at the strongest boundary that owns it. Another layer needs a distinct risk that the owner cannot reach. Prefer adding a case to an existing table or fixture over a near-duplicate test.
  4. Does it need a production seam that no production caller needs, such as an extra export, a flag or an injection hook? If yes, test at the real boundary instead.

Where expected values come from

In order of preference:

  • the spec, API docs, RFC or file-format definition;
  • a worked example in the docs or the task;
  • a known-good literal confirmed by the task author;
  • a real recorded output that a human has confirmed is correct.

Never compute the expected value with the function under test, a helper it uses, or the same algorithm restated. expect(add(a, b)).toBe(a + b) proves nothing. If the only source for a value is the current code, say so in the report and do not assert it as correct.

Reject these patterns

  • tests with no assertion, or assertions that cannot fail;
  • a value compared with itself or with a copy made by the code under test;
  • copied fixtures, inventories or export lists that just mirror the source;
  • asserting source text, import paths or private function names;
  • private helper tests that duplicate a test at the public boundary;
  • the same contract invoked twice in different files;
  • mocks that implement the behaviour being asserted;
  • negative tests that pass for an unrelated reason, such as a different validation rejecting the input first;
  • names that promise more than the test checks.

Read the full file on GitHub · 104 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. 22d ago First seen · 104 lines · 30 tokens per session scan A 1c7bfef9bb49

Subscribe to this mod's changes

test-writer is a skill published in the GitHub repository hex/claude-council (884 stars, last pushed 4d ago), licensed MIT. It adds 30 tokens to every session and 988 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-26.

Related

Other skills, from other repositories

linked-intent-dev

Guide for linked-intent development (LID). Consult for ALL code changes. Walks changes through a mode-aware six-phase workflow (HLD → LLD → EARS → intent-narrowing edge audit → tests-first → code) with mandatory stops between each phase. Bugs walk the arrow like any other change — no short-circuit. Enforces cascade…

jszmajda/lid · 87 tokens

qa-expert

Expert-level quality assurance, testing strategies, automation, and QA processes. Use when the user mentions testing, test automation, quality assurance, or Selenium, or when the task involves Testing Types, QA Processes, Test Strategy, or Defect Management.

personamanagmentlayer/pcl · 53 tokens

bidirectional-differential

Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then classifies the drift between them. Use when the user invokes /differential-audit, asks to audit EARS-to-code drift for a feature…

jszmajda/lid · 172 tokens

acceptance

A skill for writing, running, and repairing human-written acceptance checks stored in an `acceptance/ACCEPTANCE.md` file. Acceptance checks are executable tests of whether the finished result matches the requested outcome.

cryndoc/polisade-orchestrator · 129 tokens

maintainer-preflight

Use before claiming work is done, before committing, and before opening a PR in this repo — runs the mcp-server test/typecheck/build gates and the committed-bundle rule. Trigger on "done", "ready to commit", "open a PR", or any completion claim.

xzawed/claude-grok-build-plugin · 61 tokens

test-loop

Run tests, fix failures, re-run until all tests pass.

swDomass/AI_orchestrator · 15 tokens