writing-tests

writing-tests is a skill for Claude Code, Codex from Cristhianzl/claude-skills-czl. It costs 103 tokens per session (3,255 once invoked), scanned A, original, MIT.

A testing guide for writing unit tests, integration tests, and end-to-end tests, which check code at different levels. It uses common test structure and naming rules and sets a branch-coverage target for each supported operating system.

In plain words
What is it for?
Use it to add a test suite, write tests for a feature, increase coverage, fix unreliable tests, or verify behavior across operating systems.
Why use it?
It gives tests a consistent structure and helps find bugs instead of merely repeating what the code already does. It also defines a coverage gate so untested code is easier to spot.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add a test suite, write tests for a feature, increase coverage, fix unreliable tests, or verify behavior across operating systems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cristhianzl/claude-skills-czl/writing-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 Cristhianzl/claude-skills-czl --skill writing-tests
Clone the repo
git clone --depth 1 https://github.com/Cristhianzl/claude-skills-czl

Made for: Claude Code, Codex.

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 writing-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/cristhianzl/claude-skills-czl/writing-tests/github.svg)](https://agentmods.dev/skills/cristhianzl/claude-skills-czl/writing-tests)
Your own site
<a href="https://agentmods.dev/skills/cristhianzl/claude-skills-czl/writing-tests"><img src="https://agentmods.dev/badge/skills/cristhianzl/claude-skills-czl/writing-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 writing-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/cristhianzl/claude-skills-czl/writing-tests"><img src="https://agentmods.dev/badge/skills/cristhianzl/claude-skills-czl/writing-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,255 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 28
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00103 $0.03255
Opus 5 $0.00051 $0.01628
Sonnet 5 $0.00021 $0.00651
Haiku 4.5 $0.00010 $0.00326

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

Security

Grade A, and why

writing-tests scanned grade A with 1 finding 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 12d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

Tests are implicitly Linux-only when they hardcode `/tmp`, depend on `\n`-only line endings, call `subprocess.run("ls")`, assume case-sensitive filesystems, or fork worker processes. Fix patterns in `references/multi-pla
configs/agnostic/skills/writing-tests/SKILL.md · 224 lines

How it starts

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

Writing Tests

Test code is production code. Same quality bar — naming, structure, immutability, file structure, security. The point of the test suite is to find bugs, not to confirm what the code already does.

Read first (always)

List learnings/ and read every file relevant to the current task. Project-specific test framework choices, fixture conventions, flaky-test hotspots, or coverage carve-outs live there and override the defaults in this SKILL.md. If a learning conflicts with this file, the learning wins — mention it to the user.

Tradeoff — when to apply, when to lighten up

Apply the full discipline (pyramid, AAA, coverage gate, multi-platform matrix) for production code. Lighten the formality for one-off scripts, exploration, or examples under 30 lines — but even then, at least one happy-path test and one adversarial test.

Pre-test analysis (mandatory)

Before writing a single test:

  1. Identify the test framework. Look for pytest.ini / jest.config.* / vitest.config.* / *_test.go / build.gradle test deps / *.Tests.csproj / Cargo.toml [dev-dependencies]. Use the framework already in the project. Do NOT introduce a new one.
  2. Identify the mocking library. unittest.mock / pytest-mock, jest.mock / vitest.mock / sinon / msw, Mockito, gomock / testify/mock, Moq / NSubstitute. Use what's already there.
  3. Identify existing test patterns. How are files named and organized? Are there factories, fixtures, helpers, conftest.py, __mocks__? Reuse them. Do NOT duplicate.
  4. Identify the linter, formatter, type checker used on test code. Run them in pre-commit (Step 5).

If you introduce a new pattern without checking existing ones, stop and refactor.

Workflow

  1. Plan coverage from the spec, not the code. List the behaviors the feature exhibits per the requirements. Categorize each as success, error, edge, or boundary. Map each to unit / integration / E2E using the pyramid below. → verify: every behavior from the spec maps to at least one planned test; pure infrastructure glue maps to ≤1.

Read the full file on GitHub · 224 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 224 lines · 103 tokens per session scan A 1ff3f91920d4

Subscribe to this mod's changes

writing-tests is a skill published in the GitHub repository Cristhianzl/claude-skills-czl (5 stars, last pushed yesterday), licensed MIT. It adds 103 tokens to every session and 3,255 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). 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

testing-strategies

Strategic guidance for choosing and implementing testing approaches across the test pyramid. Use when building comprehensive test suites that balance unit, integration, E2E, and contract testing for optimal speed and confidence. Covers multi-language patterns (TypeScript, Python, Go, Rust) and modern best practices…

ancoleman/ai-design-components · 76 tokens

tdd-workflow

Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.

affaan-m/ECC · 43 tokens

agent-browser

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

code-yeongyu/oh-my-openagent · 51 tokens

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

testing-patterns

Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage. Triggers: test, fixture, mock, stub, e2e, TDD, Playwright, Cypress, flaky, coverage, property-based.

softspark/ai-toolkit · 52 tokens

accessibility-testing

Skill "accessibility-testing" from vibeeval/vibecosystem, covering accessibility testing, axe-core setup, jest-axe (unit / component tests), playwright-axe (e2e) and cypress-axe.

vibeeval/vibecosystem · 31 tokens