agentleFS
PedroMosqueraPedroMosquera/squadai/.agents/skills/testing/SKILL.md

testing

Skill10 starsChanged 20 days agoMITView on GitHub

Test writing protocol with structured coverage analysis

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 171 edited versions we read keep these.

  • 11

    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:

    Write tests for the specified code following a structured protocol.

    line 8
  2. Distinctive:

    Table-driven tests: When testing the same function with multiple inputs.

    line 20
  3. Distinctive:

    Name tests descriptively: Test names should explain the scenario.

    line 24
  4. Distinctive:

    Use temp directories for filesystem tests.

    line 30
  5. Distinctive:

    Create minimal fixtures: only what the test needs.

    line 31
  6. Distinctive:

    Write assertions: Verify behavior clearly.

    line 34
  7. Distinctive:

    Check both positive cases (correct output) and negative cases (expected errors).

    line 36
  8. Distinctive:

    Verify side effects (file created, state changed) when relevant.

    line 37
  9. Distinctive:

    Mock boundaries, not internals: Keep tests focused.

    line 39
  10. Distinctive:

    Do not mock internal functions or private methods.

    line 41
  11. Distinctive:

    Use interfaces at boundaries to enable test substitution.

    line 42

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

Testing Skill

Write tests for the specified code following a structured protocol. Produce thorough, maintainable tests that cover the important behavior.

Steps

  1. Identify what to test: Analyze the code to determine test targets.
    • Public API functions and methods
    • Edge cases: empty inputs, nil/null values, boundary conditions
    • Error paths: invalid input, missing dependencies, timeout conditions
    • State transitions: before/after side effects
  2. Choose test structure: Select the appropriate pattern.
    • Table-driven tests: When testing the same function with multiple inputs.
    • Arrange-Act-Assert (AAA): For single-scenario tests.
    • Given-When-Then: For behavior-focused tests.
  3. Name tests descriptively: Test names should explain the scenario.
    • Format: TestFunctionName_Scenario_ExpectedResult
    • Example: TestValidate_EmptyInput_ReturnsError
    • Failed test names should make the failure obvious without reading the test body.
  4. Set up test fixtures: Prepare the test environment.
    • Use temp directories for filesystem tests.
    • Create minimal fixtures: only what the test needs.
    • Clean up after tests (use deferred cleanup or framework helpers).
  5. Write assertions: Verify behavior clearly.
    • Assert on specific values, not just "no error."
    • Check both positive cases (correct output) and negative cases (expected errors).
    • Verify side effects (file created, state changed) when relevant.
  6. Mock boundaries, not internals: Keep tests focused.
    • Mock external dependencies: HTTP, databases, filesystems, clocks.
    • Do not mock internal functions or private methods.
    • Use interfaces at boundaries to enable test substitution.
  7. Check coverage gaps: Review what is not yet tested.
    • Concurrent access (if applicable).
    • Large inputs or performance-sensitive paths.
    • Integration between components (consider integration tests).

Output Format

Produce test code that:

  • Follows the project's existing test conventions.
  • Includes a brief comment explaining each test's purpose.
  • Groups related tests together.
  • Is runnable without modification.

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.