agentleFS
niksavisniksavis/basicly/.agents/skills/test-discipline/SKILL.md

test-discipline

Skill2 starsChanged 6 days agoMITView on GitHub

Writes isolated, order-independent tests that assert what the caller sees, not private helpers. Use for tests with shared fixtures, leaked state, run order or platform differences.

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use squad-commands, architectural-proposals 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.
  • Microsoft AzureSkill

    squad-commands

    Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.

    Also in 4 projects that use this

  • Microsoft AzureSkill

    architectural-proposals

    How to write comprehensive architectural proposals that drive alignment before code is written

    Also in 3 projects that use this

  • +10 more from Azure

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 1

    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:

    Keep a test suite true as it grows.

    line 9

“Common” is measured: kept by at least 6 in 10 of the 12 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
<!-- Generated by `basicly skills-build` from skill.yaml. Do not edit; edit the source. -->

Test Discipline

Keep a test suite true as it grows. These rules catch a test that passes today and lies, which no formatter, type checker or test runner can see.

Rules

  • A test owns its inputs. Build each fixture it needs and remove it after. A test that reads state it did not make is broken, even when it passes.
  • A test passes alone, in any order and in parallel. Share no mutable state, and do not depend on a sibling test that runs first.
  • Assert on behavior, not internals. Assert on return values, output and visible side effects. A test that breaks on a pure refactor tests the implementation.
  • Remove nondeterminism at the source. Pin the clock, seed randomness, and stub the network and the filesystem. Fix or quarantine a flaky test. Never hide it with a retry.
  • Wait for a condition, not a duration. Measure time with a monotonic clock. Poll the predicate with a generous timeout, so that the assertion says that the event happened.
  • Set a wall-clock limit to twice the time on the slowest runner in the CI matrix. A limit set from a local run fails on a slower runner.
  • Watch a regression test fail before the fix. Then you know that it exercises the defect.

Read when needed

For fixture inputs, regression mutations, absence controls, test seams or platform differences, read test controls before editing the test.

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.