agentleFS
matthullmatthull/my-skills/skills/technical/testing/SKILL.md

testing

Skill0 starsChanged 55 days agoMITView on GitHub

Test scenarios, coverage analysis, test quality standards, and the mandatory test failure stop protocol. Load this skill for any task requiring test coverage.

We split this skill into the rules it gives an agent

17 rules. 0 are common, 14 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 172 edited versions we read keep these.

  • 14

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    IF output contains ANY failure indicators: IMMEDIATELY output "STOP: Test failures detected"

    line 13
  2. Distinctive:

    DO NOT analyze, explain, or categorize failures

    line 14
  3. Distinctive:

    DO NOT dismiss as "pre-existing" or "unrelated"

    line 15
  4. Distinctive:

    ONLY if ZERO failures: Proceed to next step

    line 18
  5. Very specific:

    Use describe and context blocks to organize within the file

    line 26
  6. Distinctive:

    No execution order dependencies (tests pass in random order)

    line 30
  7. Distinctive:

    All tests pass consistently (run 3x to verify if flaky suspected)

    line 32
  8. Distinctive:

    No test pollution (tests pass in isolation and in suite)

    line 33
  9. Distinctive:

    No over-mocking (test real behavior when possible)

    line 38
  10. Distinctive:

    When planning test coverage, identify:

    line 46
  11. Distinctive:

    Create multiple spec files for individual methods (ONE per class)

    line 58
  12. Very specific:

    Add boilerplate comments (# Arrange, # Act, # Assert, # Setup, # Given/When/Then)

    line 59
  13. Very specific:

    Use sleep to fix timing issues (find root cause)

    line 61
  14. Distinctive:

    Test private methods directly (test through public interface)

    line 63
  15. Distinctive:

    Leave failing tests commented out

    line 64
  16. Distinctive:

    Write one spec per response attribute (use comprehensive specs)

    line 65
  17. Distinctive:

    Test behavior, not implementation

    line 68

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

MANDATORY: Test Failure Stop Protocol

This is an ABSOLUTE constraint with NO exceptions:

When running tests:

  • IF output contains ANY failure indicators: IMMEDIATELY output "STOP: Test failures detected"
  • DO NOT analyze, explain, or categorize failures
  • DO NOT dismiss as "pre-existing" or "unrelated"
  • EXECUTE: STOP and Ask protocol
  • AWAIT: User decision
  • ONLY if ZERO failures: Proceed to next step

Test Quality Standards

Organization

  • ONE spec file per class (no method-specific spec files)
  • Use describe and context blocks to organize within the file
  • Tests written BEFORE implementation (TDD red-green-refactor)

Reliability

  • No execution order dependencies (tests pass in random order)
  • No .only or .skip in committed code
  • All tests pass consistently (run 3x to verify if flaky suspected)
  • No test pollution (tests pass in isolation and in suite)
  • No flaky tests

Quality

  • Clear test descriptions (readable as documentation)
  • No over-mocking (test real behavior when possible)
  • Fast tests (< 30 seconds for full suite if possible)
  • Tests verify behavior, not implementation details

Test Scenario Planning

When planning test coverage, identify:

  • Happy path: Primary success scenario
  • Edge cases: Boundary conditions, empty inputs, large inputs
  • Error handling: Invalid input, missing data, service failures

Reference existing test patterns in the codebase for structure.


Anti-patterns

You MUST NEVER:

  • Create multiple spec files for individual methods (ONE per class)
  • Add boilerplate comments (# Arrange, # Act, # Assert, # Setup, # Given/When/Then)
  • Skip tests to "make it work first"
  • Use sleep to fix timing issues (find root cause)
  • Stub methods on the object under test
  • Test private methods directly (test through public interface)
  • Leave failing tests commented out
  • Write one spec per response attribute (use comprehensive specs)

Prefer:

  • Test behavior, not implementation
  • Comprehensive response specs (one spec per scenario, checking all attributes)
  • Descriptive test names that explain "why" not "what"
  • Test-first development (red-green-refactor)
  • Integration tests for critical user flows
  • Fast, focused unit tests for edge cases
  • Comments ONLY for non-obvious business logic (rare)

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.