agentleFS
DongDuong2001DongDuong2001/pudo-code-system/skills/test/unit-test/SKILL.md

unit-test

Skill5 starsChanged 5 months agoMITView on GitHub

Unit testing techniques, mocking, and assertions

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 4

    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. Distinctive:

    When writing tests for utility functions, algorithms, or standalone classes.

    line 11
  2. Distinctive:

    When using tools like Jest, pytest, JUnit, or xUnit.

    line 12
  3. Distinctive:

    When needing to mock out dependencies (databases, APIs, file systems).

    line 13
  4. Very specific:

    Naming: Use clear, descriptive names (e.g., calculateTotal_withValidInput_returnsCorrectSum).

    line 17
  5. Distinctive:

    Structure: Use the Arrange-Act-Assert (AAA) pattern.

    line 18

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

Unit Test Skill

This skill focuses on writing fast, isolated tests for individual units of code (functions, methods, classes).

When to use this skill

  • When writing tests for utility functions, algorithms, or standalone classes.
  • When using tools like Jest, pytest, JUnit, or xUnit.
  • When needing to mock out dependencies (databases, APIs, file systems).

Guidelines

  • Isolation: A unit test should not rely on an external database or network. Use mocks or stubs instead.
  • Naming: Use clear, descriptive names (e.g., calculateTotal_withValidInput_returnsCorrectSum).
  • Structure: Use the Arrange-Act-Assert (AAA) pattern.
  • Speed: Unit tests must be fast so developers can run them frequently.

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.

Reviews can't be read right now.

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.