write-tests

write-tests is a skill for Claude Code from AcKeskin/contexture. It costs 57 tokens per session (2,711 once invoked), scanned A, original, MIT.

A skill that writes tests for code that already exists, while matching the project's testing conventions. It confirms a test plan before writing and flags suspicious current behavior for review.

In plain words
What is it for?
Use it to create tests for a function, class, module, file, or directory.
Why use it?
It helps fill gaps in test coverage without confusing tests for existing code with test-driven development, a workflow where tests guide new code.

Skill for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable.

Good fit Use it to create tests for a function, class, module, file, or directory.

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

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/ackeskin/contexture/write-tests/github.svg)](https://agentmods.dev/skills/ackeskin/contexture/write-tests)
Your own site
<a href="https://agentmods.dev/skills/ackeskin/contexture/write-tests"><img src="https://agentmods.dev/badge/skills/ackeskin/contexture/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/ackeskin/contexture/write-tests"><img src="https://agentmods.dev/badge/skills/ackeskin/contexture/write-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,711 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.00057 $0.02711
Opus 5 $0.00028 $0.01355
Sonnet 5 $0.00011 $0.00542
Haiku 4.5 $0.00006 $0.00271

Measured 5d ago against content hash 4674a8ffce35, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 5d 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 · 138 lines

How it starts

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

write-tests

The test-authoring organ. Fills the hole between test-driven-development (the test-first workflow for new code) and the testability design rule (the code-side rule for making code testable): pointed at existing code, it authors a quality suite to a standard. It writes to universal/test-quality.md — the standard /review also audits against.

When to run

  • User types /write-tests <target> (or no arg → prompt for a target).
  • Natural language: "write tests for this", "add tests for Invoice", "I need a test suite for the billing module".
  • Do not auto-fire. Mode A, user-invoked. Authoring tests is a deliberate act. No hook, no session trigger. (Distinct from test-driven-development, which is the workflow you follow while writing new code — that one is invoked when you're about to build a feature; this one is pointed at code that already exists.)

Inputs

  • Target — a function, class, module, file, or directory. With no arg, prompt:

    What should I write tests for? A function, class, file, or module.

  • Working directory$CLAUDE_PROJECT_DIR or cwd. Anchors framework detection, the extracted test-convention lookup, and where tests are written.

  • Per-plan and per-flag confirmations — collected at the plan gate (§4) and on flagged-as-suspicious behaviors (§5). Collaborator principle — never author blind, never enshrine a suspected bug silently.

Procedure

1. Resolve the target

Resolve the target argument to concrete code: a file, a symbol within a file (grep for the declaration), a directory (each file), or a module. If ambiguous, list candidates and ask. If the target has no testable surface (a pure constant file, generated code), say so and stop rather than authoring vacuous tests.

2. Detect framework + conventions

Determine how this project tests, in this precedence:

  1. Extracted test conventions — if <project>/.claude/rules/<lang>/conventions.md exists and has a test-conventions section, use it. It is the project's own observed style; conform to it.
  2. Existing tests — read the project's existing test files. Detect the framework (xUnit / NUnit / MSTest, Jest / vitest / mocha, pytest / unittest, cargo test, GoogleTest, …), the layout (where tests live, file naming), and the conventions (test naming pattern, fixture/setup style, assertion library).
  3. Inference + confirm — when neither is present, infer the most idiomatic framework + conventions for the language and surface them explicitly:

Read the full file on GitHub · 138 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. 5d ago First seen · 138 lines · 57 tokens per session scan A 4674a8ffce35

Subscribe to this mod's changes

write-tests is a skill published in the GitHub repository AcKeskin/contexture (2 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 2,711 once invoked, about $0.0003 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.