agentleFS
divik-09divik-09/claude-skills-collection/skills/test-writer/SKILL.md

test-writer

Skill1 starsChanged 9 days agoMITView on GitHub

Design and write automated tests (unit, integration, property-based) for code the user provides. Use whenever the user asks for tests, test cases, better coverage, a regression test for a bug, or asks 'how should I test this', even if they do not name a framework.

37 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use debug-fix, changelog-writer and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zebbernSkill

    debug-fix

    Find and fix a bug or issue — from any source (GitHub issue, error message, user report, or observed behavior)

    Also in 4 projects that use this

  • zbruhnkeSkill

    changelog-writer

    Maintain CHANGELOG.md with properly categorized entries. Use after implementing features, fixing bugs, or making any notable changes. Follows Keep a Changelog format.

    Also in 5 projects that use this

  • chmouelSkill

    commit-helper

    Generate conventional commit from staged changes

    Also in 3 projects that use this

  • glinckerSkill

    readme-generator

    Generates comprehensive README.md files for software projects by analyzing codebase structure

    Also in 4 projects that use this

  • JohnJBorenSkill

    debugger

    Systematic debugging workflows, root cause analysis, and troubleshooting patterns

    Also in 3 projects that use this

  • get-proofpilotSkill

    context-budget

    Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 34 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Build a case table: before writing code:

    line 12
  2. Distinctive:

    Prefer real objects and small fakes over heavy mocking.

    line 29
  3. Distinctive:

    Use parametrization/table tests for many similar cases.

    line 30
  4. Distinctive:

    Never assert on implementation details that would break under a harmless refactor.

    line 31
  5. Distinctive:

    No sleeps. Inject clocks and seeds.

    line 32

“Common” is measured: kept by at least 6 in 10 of the 34 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test Writer

Approach

  1. Identify the behavior, not the lines. List what the code promises: inputs, outputs, side effects, errors.
  2. Pick the framework the project already uses (pytest, unittest, Jest, Vitest, JUnit, Go testing, RSpec...). If unknown, default to pytest for Python and Vitest/Jest for JS/TS and say so.
  3. Build a case table before writing code:
CategoryExamples
Happy pathtypical valid input
Boundaries0, 1, max, empty, single element, exact limit
Invalid inputwrong type, None/null, malformed, too large
Error pathsdependency fails, timeout, partial failure
State/orderingrepeated calls, idempotency, concurrency
Regressionthe exact input that triggered a past bug
  1. Write tests that are independent, deterministic, and fast.

Style rules

  • Arrange / Act / Assert, with one logical assertion focus per test.
  • Name tests as sentences: test_rejects_negative_amount, it('retries twice before failing').
  • Prefer real objects and small fakes over heavy mocking. Mock only at system boundaries (network, clock, filesystem, randomness).
  • Use parametrization/table tests for many similar cases.
  • Never assert on implementation details that would break under a harmless refactor.
  • No sleeps. Inject clocks and seeds.
  • For pure functions with wide input domains, add a property-based test (Hypothesis, fast-check) and state the invariant.

Output

Deliver the test file ready to run, then a short list: what is covered, what is deliberately not covered, and any code smell that made testing hard (with a suggested seam). If you could not run the tests, say so.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.