test-writer

test-writer is a skill for Claude Code, Codex from Jignesh-Ponamwar/skills-mcp. It costs 72 tokens per session (1,549 once invoked), scanned A, original, Apache-2.0.

A guide to writing tests for individual units of code, connected parts of an application, and complete user flows. It covers pytest, Jest, Go testing, and JUnit, plus test-driven development, where tests are written before or alongside the code.

In plain words
What is it for?
Use it to add test suites for functions, classes, web endpoints, and database operations, including normal cases, boundary values, missing data, failures, and mocked external services.
Why use it?
It helps find incorrect behavior, edge cases, and error handling problems while keeping tests dependable during refactoring. It also avoids flaky tests caused by shared state, time, randomness, or network access.

Skill for Claude CodeCodex

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

Good fit Use it to add test suites for functions, classes, web endpoints, and database operations, including normal cases, boundary values, missing data, failures, and mocked external services.

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

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 test-writer

README.md
[![agentmods](https://agentmods.dev/badge/skills/jignesh-ponamwar/skills-mcp/test-writer/github.svg)](https://agentmods.dev/skills/jignesh-ponamwar/skills-mcp/test-writer)
Your own site
<a href="https://agentmods.dev/skills/jignesh-ponamwar/skills-mcp/test-writer"><img src="https://agentmods.dev/badge/skills/jignesh-ponamwar/skills-mcp/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/jignesh-ponamwar/skills-mcp/test-writer"><img src="https://agentmods.dev/badge/skills/jignesh-ponamwar/skills-mcp/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,549 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.00072 $0.01549
Opus 5 $0.00036 $0.00775
Sonnet 5 $0.00014 $0.00310
Haiku 4.5 $0.00007 $0.00155

Measured 12d ago against content hash 51ddf7abe801, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (assets/test-template.py, scripts/coverage_check.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skill_mcp/skills_data/test-writer/SKILL.md · 192 lines

How it starts

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

Test Writer Skill

Overview

Generate comprehensive, maintainable test suites. Focuses on correctness, isolation, and readability - tests that catch real bugs and survive refactoring.

Principles

  1. One assertion concept per test - each test validates one specific behavior
  2. Descriptive names - test_<unit>_<scenario>_<expected> format
  3. Isolation - no shared mutable state between tests; mock external dependencies
  4. Determinism - no flakiness from time, randomness, or network
  5. Coverage - happy path + edge cases + error paths

Step-by-Step Process

Step 1: Analyse the Code Under Test

Identify:

  • Inputs: parameters, types, valid ranges, optional vs required
  • Outputs: return values, side effects (file writes, DB calls, HTTP requests)
  • Dependencies: external systems to mock (DB, HTTP, clock, filesystem)
  • Behaviors: branching logic, loops, error handling paths

Step 2: Define Test Cases

For each function/method, write test cases for:

Category Examples
Happy path Valid inputs → expected output
Boundary values 0, -1, max int, empty string, empty list
None / null Missing optional fields, None arguments
Type errors Wrong types where applicable
Domain errors Negative price, future birth date, invalid email
External failure DB down, HTTP 500, file not found

Step 3: Python / pytest

import pytest
from myapp.billing import calculate_discount

class TestCalculateDiscount:
    def test_gold_tier_applies_20_percent(self):
        assert calculate_discount(price=100.0, tier="gold") == 80.0

    def test_standard_tier_applies_no_discount(self):
        assert calculate_discount(price=100.0, tier="standard") == 100.0

    def test_zero_price_returns_zero(self):
        assert calculate_discount(price=0.0, tier="gold") == 0.0

    def test_negative_price_raises_value_error(self):
        with pytest.raises(ValueError, match="Price must be non-negative"):
            calculate_discount(price=-10.0, tier="gold")

    def test_unknown_tier_raises_value_error(self):
        with pytest.raises(ValueError, match="Unknown tier"):
            calculate_discount(price=100.0, tier="diamond")

    @pytest.mark.parametrize("tier,expected", [
        ("gold", 80.0),
        ("silver", 90.0),
        ("bronze", 95.0),
    ])
    def test_tier_discounts_parametrized(self, tier, expected):
        assert calculate_discount(price=100.0, tier=tier) == expected

Read the full file on GitHub · 192 lines

Files

What ships with it

3 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 · 192 lines · 72 tokens per session scan A 51ddf7abe801

Subscribe to this mod's changes

test-writer is a skill published in the GitHub repository Jignesh-Ponamwar/skills-mcp (8 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 72 tokens to every session and 1,549 once invoked, about $0.0004 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

javascript-testing-patterns

Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.

rmyndharis/antigravity-skills · 63 tokens

test-pyramid

Decide what type of test to write, structure the suite, measure health, and apply test doubles correctly.

sawrus/agent-guides · 26 tokens

test-orchestrator

QA & testing orchestrator managing unit tests, E2E user scenarios, load testing, and performance benchmarks. / TR: Kapsamlı test stratejileri, birim testleri (unit), uçtan uca testler (E2E), performans ve yük testlerini yöneten ana orkestratör.

GktuOktay/ai-skills · 71 tokens

testing-master

Automated test strategies, unit testing, and E2E testing guidelines. / TR: Test stratejileri, birim testleri (unit test) ve e2e testler yazmak için yetenek.

GktuOktay/ai-skills · 46 tokens

android-testing

Android testing for AI agents. Use this skill whenever writing unit tests, integration tests, UI tests, ViewModel tests, Repository tests, DAO tests, Compose UI tests, Hilt testing, @HiltAndroidTest, TestCoroutineDispatcher, runTest, turbine Flow testing, MockK, Mockito, FakeRepository, Robolectric, Espresso, Compose…

piyushverma0/android-agent-skills · 120 tokens

javascript-testing-patterns

Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.

FluxonLab/Skillry · 63 tokens