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.
npx agentmods add skills/chandrudp29/skillhub/test-writernpx skills add chandrudp29/skillhub --skill test-writergit clone --depth 1 https://github.com/chandrudp29/skillhubWrote 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.
[](https://agentmods.dev/skills/chandrudp29/skillhub/test-writer)<a href="https://agentmods.dev/skills/chandrudp29/skillhub/test-writer"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/test-writer.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00040 | $0.00887 |
| Opus 5 | $0.00020 | $0.00443 |
| Sonnet 5 | $0.00008 | $0.00177 |
| Haiku 4.5 | $0.00004 | $0.00089 |
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 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.
How it starts
The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test Writer
Writes tests that actually catch bugs — not tests that just run green.
When to Use
- "Write tests for this function"
- "Add tests before I refactor this"
- "What should I test here?"
- "My coverage is low — where do I start?"
What Makes a Test Valuable
A test is valuable if it would fail when the code is wrong and pass when the code is correct. A test that always passes regardless of the implementation has negative value — it creates false confidence.
Before writing any test, ask: "If I deleted the function body and replaced it with return null, would this test fail?" If no, the test is measuring nothing.
Test Categories (write in this order)
1. Happy Path
The expected behavior with valid inputs. Should be the first test, simplest to write.
2. Edge Cases
The boundaries where behavior changes:
- Empty inputs (empty string, empty array, null, undefined)
- Zero and negative numbers
- Single-element collections
- Maximum/minimum values
- Boundary conditions (n=0, n=1, n=N, n=N+1)
3. Error Cases
What happens when things go wrong:
- Invalid input types
- Missing required fields
- Values out of range
- External service failures (mocked)
- Concurrent access
4. Integration Points
Where this code meets other systems:
- Database reads/writes produce expected results
- External API calls are made with correct parameters
- Events are emitted in the right order
- State is cleaned up after use
Test Structure
Every test follows Arrange → Act → Assert:
def test_descriptive_name_of_what_is_being_verified():
# Arrange — set up the exact state needed
user = User(id=1, email="[email protected]", role="admin")
# Act — run exactly one thing
result = can_delete_post(user, post_id=42)
# Assert — verify the specific outcome
assert result is True
One assertion per test is a guideline, not a rule. Multiple assertions are fine when they verify a single behavior. Multiple behaviors in one test = split into multiple tests.
What ships with it
1 file 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.
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.
- 5d ago First seen · 130 lines · 40 tokens per session scan A c6cd6872bc23
test-writer is a skill published in the GitHub repository chandrudp29/skillhub (13 stars, last pushed 2mo ago), licensed MIT. It adds 40 tokens to every session and 887 once invoked, about $0.0002 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-30.
Other skills, from other repositories
cover
Generate tests that do not exist yet. Analyzes coverage gaps, then writes and runs new test files across three tiers (unit, integration via testcontainers, Playwright E2E), one test-generator agent per tier, healing failures for up to 3 iterations. Use when code has no tests or when raising coverage after…
test-generator
Generate comprehensive unit, integration, and end-to-end tests. Use when adding test coverage, writing tests for new features, or improving existing test suites.
Test Engineer
Creates or completes a medium-coverage test suite: unit, component, and critical e2e flows.
JUnit 5 Testing
Production-grade Java unit and integration testing with JUnit 5 covering assertions, parameterized tests, lifecycle hooks, Mockito mocking, nested tests, and extensions.
Karma Testing
Comprehensive Karma test runner skill for browser-based JavaScript unit testing with Jasmine, Mocha, or QUnit frameworks, real browser execution, coverage reporting, and CI/CD pipeline integration.
Code Coverage Analysis
Measure and enforce test coverage with Istanbul/nyc, c8, Jest, and Vitest. Covers branch versus line coverage, per-directory thresholds, CI gates, and correctly excluding generated code from reports.