test-discipline
Skill0 starsChanged 57 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 or run order.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- microsoft/fsi-banking-payments-dispute-resolution-acceleratortheir own version, first seen Aug 14, 2026
- thrillmade/agent-skillstheir own version, first seen Jun 29, 2026
- microsoft/wazatheir own version, first seen Jun 15, 2026
- github/gh-awtheir own version, first seen May 27, 2026
- jasoncrawford/claude-skillstheir own version, first seen Apr 25, 2026
- microsoft/Generative-AI-for-beginners-dotnettheir own version, first seen Mar 16, 2026
Used with
Projects with it also use {skill-name}.
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.
MicrosoftSkill{skill-name}
{what this skill teaches agents}
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- github/gh-aw★ 5.3ksame name
- microsoft/Generative-AI-for-beginners-dotnet★ 3.1ksame name
- microsoft/waza★ 1.4ksame name
- Azure/fleet★ 226same name
- thrillmade/agent-skills★ 2same name
- jasoncrawford/claude-skills★ 1same name
- microsoft/fsi-banking-payments-dispute-resolution-accelerator★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository52 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- best-practices-auditSkill
- catalog-authoringSkill
- cli-toolsSkill
- conventional-commitsSkill
- decompose-planSkill
- falsify-firstSkill
- find-skillsSkill
- harness-clientSkill
- harness-loopSkill
- interface-factsSkill
- no-commentsSkill
- nodeSkill
- plain-englishSkill
- pythonSkill
- release-processSkill
- repair-in-placeSkill
- retention-probeSkill
- root-causeSkill
- session-finishSkill
- skill-creatorSkill
- tier-injectionSkill
- validate-as-consumerSkill
- work-trackerSkill
- worktree-isolationSkill
- best-practices-auditSkill
- catalog-authoringSkill
- cli-toolsSkill
- conventional-commitsSkill
- decompose-planSkill
- falsify-firstSkill
- find-skillsSkill
- harness-clientSkill
- harness-loopSkill
- interface-factsSkill
- no-commentsSkill
- nodeSkill
- plain-englishSkill
- pythonSkill
- release-processSkill
- repair-in-placeSkill
- retention-probeSkill
- root-causeSkill
- session-finishSkill
- skill-creatorSkill
- test-disciplineSkill
- tier-injectionSkill
- validate-as-consumerSkill
- work-trackerSkill
- worktree-isolationSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
6
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
- Distinctive: line 9
Keep a test suite true as it grows.
- Distinctive: line 31
When the code loads its own configuration or environment, put the values where the code reads them: the file, the directory, the …
- Distinctive: line 37
When you write a test after its fix, delete the fix and watch the test fail for the stated reason.
- Distinctive: line 42
Delete the fix. A test must fail.
- Distinctive: line 64
Before you move repeated access behind one shared helper, look at what the tests patch.
- Distinctive: line 67
If the change is still correct, move the patch points in the same commit.
“Common” is measured: kept by at least 6 in 10 of the 7 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.
Files
<!-- 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.
Set up the condition that the code reads
- When the code loads its own configuration or environment, put the values where the code reads them: the file, the directory, the environment variable. A configuration object that the test gives to a helper never reaches a function that calls its own loader.
- Prove that the condition is live. Assert that your input changes the value that the code branches on. A threshold at its default or a window too small to trigger stages a case that the code never sees.
- When you write a test after its fix, delete the fix and watch the test fail for the stated reason.
Mutate the fix in both directions
- Delete the fix. A test must fail. This proves that the tests see the fix.
- Make the check fire on every input: always warn, always refuse, always the same verdict. A control must fail. If none fails, the suite proves only that the check reacts, not that it discriminates. This direction finds the missing control.
- Record which direction found what, so that the next reader can tell a verified check from an exercised one.
Restore from a copy, never with git checkout -- <file>. The working tree usually
holds the change under test, and git checkout restores from the index and discards it.
Copy the file aside first and copy it back.
An absence needs a positive control
- A search, scan or query that finds nothing proves nothing alone. Run the same method on a case that you know is present. When that control also finds nothing, the method is wrong.
- An assertion that something is absent also passes when the locator is wrong. Pin the locator with a case that must match before you trust the case that must not.
A seam is not duplication
- A module-level alias or thin wrapper around a dependency (a CLI, a clock, an HTTP client) is usually a test seam. Tests replace it.
- Before you move repeated access behind one shared helper, look at what the tests patch. A new module bypasses each patch of the old alias, and many tests fail for a reason that is not the refactor.
- If the change is still correct, move the patch points in the same commit. Keep one seam per module, not one for the whole codebase.
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
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.

