agentleFS
boadijboadij/pi-herdsman/.agents/skills/testing/SKILL.md

testing

Skill121 starsChanged 2 months agoApache-2.0View on GitHub

Write and review tests that protect meaningful Herdsman behavior without creating redundant, brittle, or low-value coverage. Use whenever adding, changing, reviewing, or removing tests.

123 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use oss-pr, pr-automation and 10 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.
  • CES-LtdSkill

    oss-pr

    Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.

    Also in 3 projects that use this

  • CES-LtdSkill

    pr-automation

    PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    cicd

    Continuous integration and delivery pipelines

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    networking

    Practical application and coding skills for Networking

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 9 projects that use this

  • Cogni-AI-OUSkill

    dotfiles

    Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.

    Also in 3 projects that use this

  • +2 more from CES-Ltd
  • +1 more from ffsshhttiikk

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 105 edited versions we read keep these.

  • 15

    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:

    Read the changed behavior and nearby tests first.

    line 12
  2. Distinctive:

    Add a test only when it protects at least one of:

    line 14
  3. Distinctive:

    If an existing test already proves the behavior, do not add another one.

    line 22
  4. Distinctive:

    Test behavior at its lowest authoritative layer.

    line 35
  5. Distinctive:

    Use live smoke only when behavior crosses the real Pi/Herdr runtime boundary.

    line 39
  6. Distinctive:

    Prefer real local objects, temporary directories, files, and processes.

    line 41
  7. Distinctive:

    Use the repository's existing Node test stack.

    line 43
  8. Distinctive:

    If no plausible defect makes the test fail, delete the test.

    line 51
  9. Distinctive:

    Prefer exact behavioral assertions over existence, truthiness, call counts, or snapshots unless those are themselves the contract.

    line 55
  10. Distinctive:

    When relevant, exercise the actual failure boundary: I/O failure, stale state, interrupted process, failed persistence, timeout, cleanup, …

    line 63
  11. Distinctive:

    Test only behavior the contract actually promises.

    line 65
  12. Distinctive:

    Avoid sleeps as synchronization.

    line 67
  13. Distinctive:

    Delete tests made redundant by stronger tests or structural enforcement.

    line 73
  14. Distinctive:

    Do not introduce factories, builders, custom matchers, fixtures, helpers, property testing, fuzzing, mutation tooling, or another framework …

    line 75
  15. Distinctive:

    Follow the repository's existing focused-test and validation contract instead of duplicating it here.

    line 77

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

Tests exist to catch plausible defects, not to increase test count or coverage.

Before adding a test

Read the changed behavior and nearby tests first.

Add a test only when it protects at least one of:

  • observable behavior or an authoritative internal invariant;
  • a regression that could plausibly recur;
  • a meaningful boundary or state transition;
  • a realistic failure, recovery, concurrency, or cleanup path;
  • wiring across layers that cannot be established at a lower layer.

If an existing test already proves the behavior, do not add another one.

Do not test:

  • trivial getters, assignments, forwarding, or wiring with no independent behavior;
  • Node.js, TypeScript, Pi, Herdr, or another dependency's own behavior;
  • implementation details when the same contract can be tested directly;
  • states already made impossible structurally unless testing the enforcing boundary;
  • the same invariant again at every layer;
  • mocks rather than the behavior they stand in for.

Choose the smallest honest layer

Test behavior at its lowest authoritative layer.

Integration tests prove wiring and layer crossings. They do not repeat complete lower-layer behavior matrices.

Use live smoke only when behavior crosses the real Pi/Herdr runtime boundary.

Prefer real local objects, temporary directories, files, and processes. Mock only the boundary that must be controlled to reach otherwise inaccessible behavior or failure.

Use the repository's existing Node test stack. Add no testing dependency unless the existing platform cannot economically establish the required property.

Make every test discriminate

For a bug fix, the regression test must fail for the defective behavior and pass for the correction.

For new behavior, ask what plausible wrong implementation the test would reject.

If no plausible defect makes the test fail, delete the test.

Expected values must be independent of the production calculation being tested.

Prefer exact behavioral assertions over existence, truthiness, call counts, or snapshots unless those are themselves the contract.

Table-drive variants of one invariant instead of copying tests.

Failure and lifecycle behavior

Invalid input is not sufficient failure coverage when the meaningful risk is a dependency or lifecycle failure.

When relevant, exercise the actual failure boundary: I/O failure, stale state, interrupted process, failed persistence, timeout, cleanup, recovery, ownership, or state transition.

Test only behavior the contract actually promises. Do not invent retries, fallbacks, errors, or recovery semantics merely to test them.

Avoid sleeps as synchronization. Wait on observable conditions or use deterministic native test facilities where practical.

Keep the suite smaller

A new test should increase confidence more than maintenance cost.

Delete tests made redundant by stronger tests or structural enforcement.

Do not introduce factories, builders, custom matchers, fixtures, helpers, property testing, fuzzing, mutation tooling, or another framework until repeated concrete need makes the simpler alternative worse.

Follow the repository's existing focused-test and validation contract instead of duplicating it here.

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.