Skip to main content
skill CX Codex

test-writer · sno-ai — Claude Code skill: tests and installation

test-writer — a skill for Claude Code writes and improves test code. It activates when Codex is asked to add or change tests.

Apache-2.0 ★ 869 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add sno-ai/sno-station-skills --skill test-writer -a claude-code
Open on GitHub

What test-writer does

test-writer reads the requested behavior, implementation boundary, nearby tests, and the repository’s usual test command before writing code. It picks a unit, integration, end-to-end, or eval boundary. Tests exercise real behavior where the project can run it, rather than mocking the system under test.

The skill edits tests, fixtures, test-only helpers, and the configuration those files need. It runs the narrow command for the changed test and fixes defects in test code; product failures go back to the calling agent. File read/write tools and shell access are required.

What it helps with

  • add a test for a requested behavior
  • reproduce a defect through a real code path
  • prepare fixtures for a test scenario
  • fix broken test code

Example prompts for the agent

  • Add tests for this behavior using the repository's existing test framework.
  • Reproduce this bug with a real integration test and run only the affected test.
  • Create fixtures for this case and report the test result.

How to install test-writer

1Skills CLI (Vercel)

npx skills add sno-ai/sno-station-skills --skill test-writer -a claude-code

2Manually: put the files in place

~/.claude/skills/test-writer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/test-writer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about test-writer

How do I install test-writer in Claude Code?

Run npx skills add sno-ai/sno-station-skills --skill test-writer -a claude-code. The skill file is at ~/.claude/skills/test-writer/SKILL.md.

What does test-writer do?

It creates and runs tests in the project’s existing harness, then fixes defects in test-owned code. It leaves production code unchanged.

What does test-writer need to run?

It requires file read/write tools and shell access.

Source text

SKILL.md · Apache-2.0
---
name: test-writer
description: "Write and improve test-owned code: tests, test scripts, fixtures, evals, and test-only helpers. Use whenever Codex is asked to create or change test code. Its only job is to produce the strongest practical tests in the repository's existing harness, run them, and fix defects in the test code."
requires:
  programs: []
  harness:
    - {slot: 4.shell, need: required}
    - {slot: 4.file-read-write, need: required}
---

# Test Writer

Write the best test code for the requested behavior. Start with the repository and the
behavior.

## Test scope

- Run tests only for the changed behavior and its directly affected callers or integrations.
- Do not run full evaluation, unit, integration, repository, site, or all-module suites unless the owner explicitly requests them.
- A skill, PRD, reviewer, repository document, or default package script does not grant that permission.
- After a failure, rerun the failing case first. Once it passes, run only directly affected cases; do not expand by default.
- Build artifacts required for a requested deployment are not permission to run unrelated tests.
- Every development task has a finite budget including setup, execution, and reporting; before each run, estimate duration from available timings and name the changed behavior it verifies, using a stated estimate when timings are unknown rather than building a timing system or running a preliminary suite.
- Remove checks and repeated runs that neither establish the requested main function nor expose its defects; select the smallest useful test that fits the remaining development budget, never spend it on reassurance.

## Single responsibility

Own only test code:

- tests and test scripts
- fixtures and test-only helpers
- eval and simulation code
- test harness configuration required by those files

The output of this skill is test-owned code and the result of running it. Return product
defects to the caller; do not edit production/runtime source.

## Core principles

1. **Everything should be real.** Exercise the real code path, real parser, real filesystem,
   real database, real API, or real service whenever the repository can provide it.
2. **We hate mocking.** A mock easily proves that the mock behaves like its setup while the
   product remains broken. Never mock the system under test. Use a substitute only when a
   truly external dependency cannot be run, and keep the substitute narrower than the
   behavior being proved.
3. **Assert observable results.** Check returned content, persisted state, emitted files,
   external effects, cleanup, and errors. Do not assert call counts when a real effect can be
   observed.
4. **A test must catch a real defect.** Every assertion must be able to fail when the product
   behavior is wrong. Do not add tests for quotas, coverage theater, or speculative cases.
5. **Use realistic data.** Match production formats, sizes, identifiers, timestamps, and
   sequences closely enough to expose real failures.
6. **Keep tests deterministic and isolated.** Use unique test identities, clean up created
   state, avoid shared-order assumptions, and make failures reproducible.

## Test ownership

Use this skill when changing test-owned files. Keep the test independent of the production
fix and report real failures. Do not enforce ownership through an edit-blocking hook or
require an edit lease before writing a test.

## Write the code

1. Read the requested behavior or acceptance criteria.
2. Read the implementation boundary, its immediate callers, nearby tests, test configuration,
   and the repository's normal test command.
3. Reuse the existing language, framework, fixtures, and directory layout. Ask only when a new
   framework, dependency, credential, or external environment is genuinely required.
4. Choose the smallest test boundary that proves the real behavior:
   - unit for pure deterministic logic;
   - integration for filesystem, database, API, cache, queue, or component interaction;
   - end-to-end for a complete user or service journey;
   - eval or simulation for non-deterministic model or agent behavior.
5. Write the test code. Prefer one strong journey over several weaker duplicates.
6. Run the narrowest command that executes the changed test. Fix syntax, fixtures, cleanup,
   flakiness, and other defects in test-owned code.
7. Report the changed test files, the command run, and the observed result. If the test exposes
   a product defect, name the failing behavior and evidence.

## Test quality

- Test public behavior rather than private implementation details.
- Verify positive behavior and the important failure that could silently corrupt or lose data.
- Check both the primary result and its meaningful side effect when both are part of the
  contract.
- For E2E work, exercise the changed primary flow through its ordinary entry to destination
  read-back. Reproduce the actual bug for a fix; do not plant extra defects in every new
  feature merely to complete a proof pattern. The harness may prepare
  inputs and environment and observe results; if it supplies a missing product step, return a
  product or contract defect.
- Keep setup shorter than the behavior it proves. If setup dominates, find a more direct real
  boundary or a reusable real fixture.
- Never weaken, skip, or delete an assertion just to make a failing test pass.
- Do not add a second proof layer unless it can catch a materially different defect.
- Use the task's agreed time limits for long calls; do not add an arbitrary timeout that kills useful work or hides its output.

## Optional code references

- For eval and simulation implementations, read `references/eval-sim-patterns.md`.

© sno-ai · Apache-2.0 · sno-ai/sno-station-skills

Similar skills

All skills for Testing and QA →

test-writer by other authors comes first.

test-writer leonardomso test-writer generates Vitest test suites for code examples in JavaScript concept documentation pages. Helps verify documentation snippets before publishing. CX Codex +1 358installs test-writer vstorm-co test-writer generates structured test suites for existing code matching your active testing framework. CX Codex +1 ★ 1,125repo stars test-data-generation aj-geddes test-data-generation generates realistic, consistent test datasets using factories, fixtures, and fake data libraries. Useful for database seeding and edge-case testing. CX Codex +1 505installs test-automation-framework aj-geddes Designs test automation frameworks with Page Object Model, fixtures, and reporting. It kicks in when a test suite grows past the point where ad-hoc scripts stay maintainable. CX Codex +1 507installs improving-test-suites b-mendoza improving-test-suites is a Claude Code skill that reviews test suites and focuses them on important behavior. It activates for requests to trim, rewrite, review, or strengthen tests. CX Codex +1 119installs test-value tt-a1i The test-value skill helps select tests by risk, spot duplicate coverage, and investigate flaky checks. Use it during implementation, audits, or review before a commit. CX Codex +1 ★ 98,599repo stars test-data-management kindlmann test-data-management is a Claude Code skill for building isolated test factories and deterministic seeds, and setting up PII anonymization with synthetic entities. CX Codex +1 1,700installs test-writer-fixer Community test-writer-fixer creates missing test suites, runs test runners after code changes, and updates failing checks. It keeps your test suite aligned with refactored logic. CX Codex ★ 2,003repo stars

From the same set40

The whole set →
catch-report The catch-report Claude Code skill compares findings from peer reviews with mistakes agents catch themselves. It runs when someone asks for review results or a weekly summary. CX Codex +1 ★ 869repo stars away-brief The away-brief Claude Code skill creates a short report on completed work, blockers, pending questions, and quota readings. It runs when someone asks what happened while they were away. CX Codex +1 ★ 869repo stars agentic-time-estimate agentic-time-estimate — a Claude Code skill that estimates an AI agent’s total runtime or remaining work from measured progress. It gets owner-facing clock times from sno report-time and never estimates human developer time. CX Codex +1 ★ 869repo stars ts-coder The ts-coder Claude Code skill guides TypeScript and TSX implementation and refactoring within an existing repository. It applies to work on types, APIs, and migrations. CX Codex +1 ★ 869repo stars shellscript-coder shellscript-coder — a Claude Code skill for writing and refactoring shell scripts and command-line tools. It applies to automation, Git helpers, and infrastructure tasks. CX Codex +1 ★ 869repo stars rust-coder The rust-coder Claude Code skill implements and refactors Rust code using the project’s own conventions. It activates for feature work, migrations, and substantial edits to .rs files or Cargo.toml. CX Codex +1 ★ 869repo stars python-coder The python-coder skill for Claude Code guides Python implementation and refactoring, including work with FastAPI and Pydantic. It applies to async code and migration tasks. CX Codex +1 ★ 869repo stars owner-intent-audit The owner-intent-audit Claude Code skill checks plans, tests, and code against the project owner’s intent. Run it before approving or merging agent work. CX Codex +1 ★ 869repo stars

Project sponsors

Companies that keep this analytics open