write-skill-test

write-skill-test is a command for Claude Code from axiomantic/spellbook. It costs 29 tokens per session (1,607 once invoked), scanned A, original, MIT.

A test-first workflow for creating and editing coding-agent skills. It first observes how an agent fails under pressure, then uses that evidence to write and improve the skill.

In plain words
What is it for?
It helps design, test, and refine instructions for coding agents, using a failing test before each skill change.
Why use it?
It prevents skills from being written based only on assumptions. Testing combined pressures exposes loopholes that simple checks may miss.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: mentions subagents; names the TodoWrite tool.

Good fit It helps design, test, and refine instructions for coding agents, using a failing test before each skill change.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/axiomantic/spellbook/write-skill-test.svg)](https://agentmods.dev/commands/axiomantic/spellbook/write-skill-test)
Your own site
<a href="https://agentmods.dev/commands/axiomantic/spellbook/write-skill-test"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/write-skill-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,607 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.1 $0.00029 $0.01607
Opus 5 $0.00015 $0.00804
Sonnet 5 $0.00006 $0.00321
Haiku 4.5 $0.00003 $0.00161

Measured 3d ago against content hash 7b6de1994216, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

write-skill-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 3d 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.

commands/write-skill-test.md · 161 lines

How it starts

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

RED-GREEN-REFACTOR Skill Testing

Invariant Principles

  1. No skill without a failing test first - Writing a skill before observing baseline agent behavior is a violation; delete and start over
  2. Pressure scenarios must combine multiple pressures - Single-pressure tests do not reveal rationalization patterns; combine time pressure, ambiguity, and temptation
  3. Verbatim evidence, not summaries - Document exact agent quotes and choices during baseline testing; paraphrasing obscures the failure modes the skill must address

Iron Law

NO SKILL WITHOUT FAILING TEST FIRST

Applies to NEW skills AND EDITS. Write skill before testing? Delete it. Start over. Edit skill without testing? Same violation.

The Iron Law is NOT a ceremony component

There is no waiver, and deliberately no exemption for "pure reference churn" or "docs-only" skill edits. Such an exemption would be self-assessed by the agent making the edit, and "this edit changes no behavior" is precisely the claim a baseline test exists to check — a skill edit that looks inert is the case most likely to be wrong, because skills ARE their text. A test-first rule that can be switched off is not a rule; it is a default.

If the Iron Law is genuinely too heavy for a given change, the correct response is to make a SMALLER change, not to run a lighter ceremony. Record the Iron Law in develop_gate_ledger.ceremony.core, never in selected and never in declined.

Read the full file on GitHub · 161 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. 3d ago First seen · 161 lines · 29 tokens per session scan A 7b6de1994216

Subscribe to this mod's changes

write-skill-test is a command published in the GitHub repository axiomantic/spellbook (10 stars, last pushed 2d ago), licensed MIT. It adds 29 tokens to every session and 1,607 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.