agentleFS
eugnmueller-87eugnmueller-87/claude-blueprint/.claude/skills/test-writer/SKILL.md

test-writer

Skill1 starsChanged 5 months agoMITView on GitHub

Backfill real pytest coverage for an existing Python module — behavior not implementation, the edge cases that actually break, no assertion-free tests and no mock theater. Use to add tests to code that already works but is under-tested. Trigger phrases "write tests for X", "add tests", "cover this module".

29 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use changelog-writer, readme-generator and 4 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.
  • 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

  • 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

  • nimbalystSkill

    prd-writer

    Create structured Product Requirements Documents (PRDs) with prioritized requirements. Use when writing product specs, feature requirements, or project briefs.

    Also in 3 projects that use this

  • GoogleSkill

    code-reviewer

    Also in 4 projects that use this

  • ElasticSkill

    accessibility

    Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write tests that would actually catch a regression, not tests that just execute lines.

    line 12
  2. Distinctive:

    Enumerate cases: before writing any:

    line 23

“Common” is measured: kept by at least 6 in 10 of the 28 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

Trigger: "write tests for X" / "add tests" / "cover this module"

Standing rules: ../_conventions.md.

Write tests that would actually catch a regression, not tests that just execute lines. Test behavior and contracts, not internals. Never write assert True and never assert only that a mock was called without checking its arguments.

Steps

  1. Read the target and its contract. What are the public functions/classes? For each: inputs, outputs, side effects, and the documented or implied behavior. Note what's a real boundary (network, filesystem, clock, LLM API, DB) vs pure logic.
  2. Enumerate cases before writing any:
    • Happy path — the normal expected use.
    • Edge cases — empty input, None, zero, boundary values, empty collection, duplicates, unicode.
    • Error cases — invalid input raises the right exception; failure paths.
    • For AI code: a refusal/truncated response, malformed JSON from the model, a tool-call error.
  3. Write pytest tests. One assertion per test, Arrange-Act-Assert, names that describe behavior (test_returns_empty_list_when_no_suppliers_match). Use pytest.mark.parametrize for the same behavior across inputs. Use fixtures for shared setup.
  4. Mock only at boundaries. Real implementations everywhere possible. Mock the network/LLM/DB/clock/randomness only — and when you mock, assert on the arguments passed, not just call count. No mocking of the code under test.
  5. Run them. pytest path/to/test_x.py. All pass. Then deliberately break the source once to confirm a test actually fails (a test that can't fail is worthless) — then restore.
  6. Report (terse): cases covered · tests added · run result. Name any behavior you could NOT test and why (e.g. needs a live key) — honestly, don't fake it.

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.