agentleFS
ahfarhan001-dotahfarhan001-dot/dev-ai-tools/skills/test-writer/SKILL.md

test-writer

Skill0 starsChanged 5 days agoMITView on GitHub

Write focused unit tests for a function or file — naming, edge cases, and what not to test. Use when the user asks for tests, or before refactoring code that has no test coverage.

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 8 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

  • tekumaraSkill

    api-design-review

    Reviews REST API design by inventorying routes, finding overlapping functionality, comparing payloads and pagination, and checking resource naming, URL structure, identifiers, errors, idempotency, and timestamps. Use when asked to review API routes, compare endpoints, find redundant or superseding operations, assess contract consistency, or run a REST API design review.

    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

  • nimbalystSkill

    prd-writer

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

    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

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 34 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write small, focused unit tests that catch real bugs.

    line 8
  2. Very specific:

    Don't test the language or the library (for example, that sorted() sorts).

    line 22
  3. Distinctive:

    Don't test a private helper through the public function twice — test it once, directly.

    line 23
  4. Distinctive:

    Don't write tests for code that is about to be deleted.

    line 24
  5. Very specific:

    Use the project's existing test style.

    line 28
  6. Distinctive:

    Keep setup tiny — build test data inside the test, not in a shared fixture, unless three or more tests need the same data.

    line 30
  7. Distinctive:

    Never change the code under test to make a test pass.

    line 34
  8. Distinctive:

    Every test must be able to fail.

    line 35
  9. Distinctive:

    Keep tests fast. No network, no real files outside a temp folder, no sleeping.

    line 36

“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

Write small, focused unit tests that catch real bugs. Tests should be easy to read and quick to run.

How to work

  1. Read the code first. Understand what the function does, what it takes in, and what it returns. If the code is unclear, say so before writing tests.
  2. Pick the cases that matter:
    • The happy path — the normal input the function is written for.
    • Edge cases — empty input, zero, the biggest or smallest allowed value, a missing file.
    • Error cases — bad input, wrong types, things that should raise an error or return one.
  3. One behaviour per test. A test that checks three things at once hides which one broke.
  4. Name tests after the behaviour, not the function: test_returns_empty_list_when_no_notes_found beats test_find_notes_3.

What NOT to test

  • Don't test the language or the library (for example, that sorted() sorts).
  • Don't test a private helper through the public function twice — test it once, directly.
  • Don't write tests for code that is about to be deleted.

Output format

  • Use the project's existing test style. If there is no test file yet, use plain assert statements in a file named test_<module>.py.
  • Group tests by the function they cover, with a short comment above each group.
  • Keep setup tiny — build test data inside the test, not in a shared fixture, unless three or more tests need the same data.

Rules

  • Never change the code under test to make a test pass. If the code is wrong, say so.
  • Every test must be able to fail. A test that always passes is not a test — read it once more after writing it and check.
  • Keep tests fast. No network, no real files outside a temp folder, no sleeping.

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.