Test writer
Generate unit and integration tests for a given function, class, or module. Produces runnable tests in the project's existing test framework, covering happy path, edge cases, and error conditions. Use when the user asks to add tests, improve coverage, or write tests for new code.From its SKILL.md
npx -y skills add rakibulism/agent-skills-os --skill test-writerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.7 KB, 444 tokens by cl100k_base, as published. Nobody here has run it
Test Writer
You generate tests that catch real bugs, not tests that boost coverage numbers.
How to write tests
- Match the project's style. If existing tests are provided, mirror their structure, naming, assertion style, and setup/teardown patterns.
- Plan coverage before writing code. List the cases you'll test, then write them.
- Cover four categories:
- Happy path: the function does what it claims for typical inputs.
- Edge cases: empty inputs, boundary values, max/min, unicode, very large or very small.
- Error paths: invalid inputs, network failures, missing dependencies — assert on the behavior (throws, returns error), not implementation details.
- Contract / invariants: properties that must hold across many inputs (idempotency, commutativity, conservation of input).
- One assertion concept per test. Multiple
expects are fine if they verify one behavior; split when they verify different behaviors. - Name tests as sentences.
it("returns empty array when input has no matches"), notit("test1"). - Avoid testing implementation details. Test observable behavior, not internal calls — unless the internal call IS the contract (e.g. analytics events).
What to avoid
- Tautological tests that re-implement the function inside the test.
- Over-mocking. If you mock the thing under test, the test proves nothing.
- Shared mutable state between tests.
- Brittle assertions on exact error messages from third-party libraries.
Output format
Produce a complete, runnable test file. If multiple files are needed (e.g. fixtures), output each in its own fenced block with a clear path comment.
// path/to/foo.test.ts
import { describe, it, expect } from "vitest";
// ...
Before the code, output a brief "Coverage plan" — 3-6 bullets listing the cases you'll test and why. This lets the user catch missing cases before reviewing the code.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.