test-authoring

test-authoring is a skill for Claude Code from avmnu-sng/sutra. It costs 31 tokens per session (2,067 once invoked), scanned A, original, MIT.

A method for writing tests from the actual code, schemas, database writes, and output formats they check.

In plain words
What is it for?
It is for creating, improving, and debugging tests with assertions that fail when a real defect is introduced.
Why use it?
It reduces failures caused by guessing field names or data shapes and prevents tests from being weakened just to pass.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the sutra plugin — 19 skills, 4 agents, 2 hooks shipped together

Good fit It is for creating, improving, and debugging tests with assertions that fail when a real defect is introduced.

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

Made for: Claude Code.

Or install sutra, the plugin that ships this one along with the rest of its 19 skills, 4 agents, 2 hooks.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/avmnu-sng/sutra/test-authoring"><img src="https://agentmods.dev/badge/skills/avmnu-sng/sutra/test-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,067 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.00031 $0.02067
Opus 5 $0.00015 $0.01033
Sonnet 5 $0.00006 $0.00413
Haiku 4.5 $0.00003 $0.00207

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

Security

Grade A, and why

test-authoring 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 9d 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.

plugins/sutra/skills/test-authoring/SKILL.md · 210 lines

How it starts

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

Test authoring

Write tests that catch regressions, not tests that report false safety. A test earns its place only if a real defect would make it fail. Follow the steps below in order; skipping step 1 is the number-one cause of integration-test churn.

1. Read the source of truth before asserting anything

Never guess the name, type, or shape of a value you assert on. Open the artifact that actually produces it and read it:

  • The schema or type definition for a structured payload.
  • The handler, controller, or function that builds the response.
  • The serializer or formatter that renders the wire/output form.
  • The database write (column names, nullability, defaults) behind a persisted value.

Guessing field names and shapes is the dominant integration-test failure mode. Before writing assertions, build a short mapping and keep it next to the test:

output surface            -> source artifact
------------------------------------------------------------
response.user.display_name -> serializers/user.*  (field: display_name)
row.status                 -> schema migration    (enum: pending|done)
event.emitted_at           -> handler build step  (unix millis, not ISO)

If you cannot find the source artifact, stop and find it. Do not assert against a value you have only inferred from a variable name.

2. Enumerate the case list before writing tests

For a substantial new suite, enumerate the cases (input -> expected) from the source of truth and confirm them before writing bodies -- especially where a wrong expectation is expensive. For routine additions, enumerate but don't block. Enumerate every case as an explicit input -> expected pair -- happy path, boundaries, and known failure modes -- derived from the source of truth (step 1), not from whatever the code currently emits.

  • One row per case: input/precondition -> expected outcome.
  • Include the cases you deliberately leave out, and why, so a reviewer can catch a missing branch before any code exists.
  • If review changes a case, update the list first; do not silently drift the expected values to match the implementation.

Read the full file on GitHub · 210 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. 9d ago First seen · 210 lines · 31 tokens per session scan A cebb3056516f

Subscribe to this mod's changes

test-authoring is a skill published in the GitHub repository avmnu-sng/sutra (2 stars, last pushed 1mo ago), licensed MIT. It adds 31 tokens to every session and 2,067 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.

Related

Other skills, from other repositories

memstack-development-test-writer

Use this skill when the user says 'write tests', 'add tests', 'test coverage', 'unit tests', 'integration tests', 'component tests', 'mocking', 'edge cases', or needs to generate tests with proper mocking and edge case coverage. Do NOT use for refactoring plans or database migrations.

cwinvestments/memstack · 70 tokens

verify

Runs this project's check chain through scripts/verify.py and reads the receipt it writes. Fires when tracked changes are finished, when the user asks whether work passes, before a commit, and before reporting a task done. Stays dormant in repositories with no detectable check chain, during read-only audits, and for…

cwinvestments/memstack · 71 tokens

memstack-development-webapp-testing

Use when the user says 'write browser tests', 'test this page', 'playwright test', 'e2e test', 'end to end test', 'browser test', 'test the UI', or needs Playwright-based browser testing for a web application. Do NOT use for unit tests, API tests, or non-browser testing.

cwinvestments/memstack · 75 tokens

plan-pipeline-execute

Execute a validated plan: worktree isolation, TDD scaffolding, level-based parallel agents, quality gate with smoke test, PR creation and merge. Handles everything through to merged PR.

FlorianBruniaux/claude-code-ultimate-guide · 43 tokens

qa

Systematic QA testing of a web application: diff-aware, tiered, with fix-and-verify loop.

FlorianBruniaux/claude-code-ultimate-guide · 23 tokens

plan-pipeline-eng-review

Engineering architecture gate: lock architecture, diagrams, edge cases, and test matrix before writing implementation code.

FlorianBruniaux/claude-code-ultimate-guide · 25 tokens