test-writer

test-writer is a skill for Claude Code from Ozzeron/prompt-pack. It costs 95 tokens per session (2,435 once invoked), scanned A, original, MIT.

A guide for adding tests to existing code, focused on observable behavior rather than internal implementation. It covers unit tests, integration tests, regression tests, fixtures, factories, and boundary-level mocks.

In plain words
What is it for?
Use it to cover untested functions or components, add a test for a fixed bug, test an API or data boundary, or prepare an existing feature for launch.
Why use it?
It helps catch bugs without making tests so dependent on code structure that normal refactoring breaks them. It is for testing existing code, not setting up browser-test infrastructure.

Skill for Claude Code

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

Part of the nextjs plugin — 10 skills shipped together , and of backend, supabase, fullstack, all-skills

Good fit Use it to cover untested functions or components, add a test for a fixed bug, test an API or data boundary, or prepare an existing feature for launch.

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

Made for: Claude Code.

Or install nextjs, the plugin that ships this one along with the rest of its 10 skills.

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/ozzeron/prompt-pack/test-writer/github.svg)](https://agentmods.dev/skills/ozzeron/prompt-pack/test-writer)
Your own site
<a href="https://agentmods.dev/skills/ozzeron/prompt-pack/test-writer"><img src="https://agentmods.dev/badge/skills/ozzeron/prompt-pack/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/ozzeron/prompt-pack/test-writer"><img src="https://agentmods.dev/badge/skills/ozzeron/prompt-pack/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,435 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00095 $0.02435
Opus 5 $0.00048 $0.01218
Sonnet 5 $0.00019 $0.00487
Haiku 4.5 $0.00010 $0.00244

Measured 2d ago against content hash 8fa5c67ac9ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 2d 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.

prompts/delivery/test-writer/SKILL.md · 241 lines

How it starts

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

Test Writer

You write tests for existing code. Tests document behaviour and catch regressions; they are not a coverage-percentage box to tick. You test what the code is supposed to do, not how it's currently structured. Implementation-coupled tests rot the moment refactors happen and become a tax on every change.

When to use

  • Adding tests to existing untested code
  • Filling a coverage gap on a specific function / component / endpoint
  • Writing tests that should have caught a bug just fixed (regression tests)
  • Pre-launch test pass for a feature

Do not invoke for:

  • Writing code with tests included — that's part of architecture/frontend-feature, architecture/backend-api, or whichever skill is doing the work
  • E2E test infrastructure setup — flag as separate work
  • Snapshot-only changes (regenerating snapshots without thinking is not testing)

Scope

In scope:

  • Unit tests for pure logic (functions, hooks, utilities, components)
  • Integration tests at module / API / data-layer boundary
  • Regression tests for fixed bugs
  • Test fixtures and factories
  • Mocking at the right boundary

Out of scope:

  • E2E / browser / Playwright / Cypress test infrastructure (delegate or flag)
  • Performance / load / chaos tests
  • Test framework selection — match what the project uses

Inherits

  • meta/engineering-principles — naming, file size, single responsibility apply to tests too.
  • meta/reuse-before-create — before writing a new fixture, factory, mock, or test helper, search for an existing one in the test tree; tests duplicate setup more than any other code.
  • meta/token-discipline — read the unit under test and 1–2 sibling tests for style; not the whole test suite.

Token discipline (specific)

  • Read the unit under test and its direct dependencies. Don't recursively read the whole module graph.
  • Read 1–2 existing tests in the same project to learn conventions:
    • Test file location (colocated vs __tests__/ vs mirrored structure)
    • Naming style (describe('X') vs test('does Y'))
    • Setup / teardown patterns
    • Fixture / factory helpers in use
  • Read the test framework config (vitest.config.*, jest.config.*, pytest.ini, etc.) once, only if needed.
  • Do NOT read tests of unrelated features.

Read the full file on GitHub · 241 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. 2d ago Changed · +2 lines · +69 tokens per session 8fa5c67ac9ef
  2. 9d ago First seen · 239 lines · 26 tokens per session scan A c0b2727e1ac6

Subscribe to this mod's changes

test-writer is a skill published in the GitHub repository Ozzeron/prompt-pack (8 stars, last pushed 3d ago), licensed MIT. It adds 95 tokens to every session and 2,435 once invoked, about $0.0005 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.