test-design
Skill0 starsChanged 3 days agoMITView on GitHub
Language-agnostic test design: one behavior per test, naming, assertions with diagnostics, isolation, test data, coverage, and anti-patterns. Use when writing, reviewing, or refactoring unit, integration, or end-to-end tests. Not for test runner or CI setup.
26 other projects use a version of this.
Adopted by
Most recently taken up by
- endqwerty/endstacktheir own version, first seen Nov 29, 2026
- swadhinbiswas/SKILLStheir own version, first seen Nov 22, 2026
- Hakkadaikon/hymmetheir own version, first seen Nov 21, 2026
- jame-hv/brse-toolkittheir own version, first seen Nov 16, 2026
- LeanMeanCleanApps/CleanLambdaFunctiontheir own version, first seen Nov 15, 2026
- LeanMeanCleanApps/CleanWebApitheir own version, first seen Nov 15, 2026
Used with
Projects with it also use add-a-use-case, branches-and-pull-requests 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.
LeanMeanCleanAppsSkilladd-a-use-case
How to add a command or query to the Application layer as a vertical slice (request, handler, validator, tests) using source-generated Mediator. Use when adding a new feature, a new query, or a new write operation.
Also in 5 projects that use this
LeanMeanCleanAppsSkillbranches-and-pull-requests
Branch naming (feature/, fix/, chore/), how labels and release notes follow from the branch, the pull request template, and how changes get merged in the template repository. Use when creating a branch, writing a commit or opening a pull request.
Also in 5 projects that use this
- +10 more from LeanMeanCleanApps
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- Agenta-AI/agenta★ 4.9ksame name
- LeanMeanCleanApps/CleanMinimalApi★ 401same name
- adamentwistle/fable-skills★ 98same name
- nahid-sparktales/agent-dispatcher★ 59same name
- LeanMeanCleanApps/CleanGraphQLApi★ 13same name
- shabaraba/vibing.nvim★ 13same name
- tlzmw001/aitest-kit★ 13same name
- yasunori0418/skills★ 10same name
- umararshad4/honey-stack★ 6same name
- LeanMeanCleanApps/CleanWebApi★ 4same name
16 more not listed
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 repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-contextSkill
- agent-pluginsSkill
- architecture-decisionsSkill
- brand-identitySkill
- browser-controlSkill
- cross-harnessSkill
- efficient-tool-callsSkill
- git-historySkill
- github-actionsSkill
- gitignore-standardsSkill
- html-reportSkill
- java-developmentSkill
- mermaid-diagramsSkill
- meta-workspaceSkill
- product-designSkill
- project-backlogSkill
- project-setupSkill
- project-upgradeSkill
- python-developmentSkill
- refinement-tribunalSkill
- session-handoffSkill
- shell-scriptsSkill
- software-architectureSkill
- technical-documentationSkill
- typescript-developmentSkill
- web-auth-bridgeSkill
- worktree-isolationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 14 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 20 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Write tests that each prove one behavior and, on failure, say exactly what broke.
- Distinctive: line 17
Measure a baseline: when coverage tooling exists, and list the gaps (coverage.md).
- Distinctive: line 30
Every test calls production code and has an assertion that can fail.
- Distinctive: line 32
Never compute expected values with the production algorithm.
- Distinctive: line 33
No environment-specific values (absolute paths, hostnames, ports) in tests.
- Distinctive: line 34
Never catch and swallow exceptions to make a test pass.
- Distinctive: line 35
Do not test the language, the framework, or a mock's configured return value.
- Distinctive: line 44
Use the most specific assertion: exact values over truthiness, specific error types over "it failed".
- Distinctive: line 51
Prefer per-test setup to shared mutable fixtures.
- Distinctive: line 52
Keep integration tests separable from unit tests by directory or naming, and document their external dependencies.
- Distinctive: line 57
Use builder or factory functions with valid defaults and keyword overrides for any complex object used by three or more tests.
- Distinctive: line 58
Use synthetic data for unit tests.
- Distinctive: line 62
Every public interface gets a success test and one test per documented error.
- Distinctive: line 63
Test boundaries explicitly: zero, one, min, max, empty, null, and off-by-one.
- Very specific: line 78
Put helpers and builders at the top of the file or in a shared module (conftest.py, testutils).
“Common” is measured: kept by at least 6 in 10 of the 20 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
Test design
Write tests that each prove one behavior and, on failure, say exactly what broke. Frameworks and commands come from whatever language standards the user has. This skill supplies the design rules.
Workflow
- Read the production code first. Record the exact signatures, field names, nested keys, and constructor arguments. A test that fails with
unexpected keyword argumentis a defect in the test. - Measure a baseline when coverage tooling exists, and list the gaps (coverage.md).
- List equivalence classes per input: typical valid, boundary, and invalid. Plan one test per class per code path.
- Write each test as Arrange, Act, Assert, with exactly one action under test.
- Check the test can fail: picture a wrong implementation and confirm the assertion catches it.
- Run the suite, in isolation and in random order when the runner supports it. Re-measure coverage.
- Scan for anti-patterns (anti-patterns.md) and fix or delete matches.
Rules
Design
- One logical behavior per test. Several assertions are fine only when they check facets of one outcome, such as the status and body of one response.
- Tests are independent and deterministic. Inject clocks, seed randomness, and fake external services.
- Every test calls production code and has an assertion that can fail.
- Clean up everything a test creates: files, handles, globals, and environment variables.
- Never compute expected values with the production algorithm. Derive them from requirements.
- No environment-specific values (absolute paths, hostnames, ports) in tests.
- Never catch and swallow exceptions to make a test pass.
- Do not test the language, the framework, or a mock's configured return value.
Naming
- The name states the unit, the scenario, and the expected result:
withdraw_oneAboveBalance_returnsInsufficientFunds, or the runner's natural-language form. Nevertest1orhappyPath. - Suites are named after the unit under test.
Assertions
- Use the most specific assertion: exact values over truthiness, specific error types over "it failed".
- Give each assertion a message with what was tested, the expected value, and the actual value, so the failure is clear without opening the test.
- Assert on observable behavior, not internals such as private state or call counts on non-critical collaborators.
Isolation
- Unit tests replace databases, networks, file systems, and clocks with stubs, fakes, or in-memory versions.
- Prefer per-test setup to shared mutable fixtures.
- Keep integration tests separable from unit tests by directory or naming, and document their external dependencies.
- For code that imports a framework that is not installed, read isolation.md.
Test data
- Use builder or factory functions with valid defaults and keyword overrides for any complex object used by three or more tests. Tests override only the fields they care about.
- Use synthetic data for unit tests. Use real sample files only for end-to-end parsing tests, as a complement.
Coverage
- Every public interface gets a success test and one test per documented error.
- Test boundaries explicitly: zero, one, min, max, empty, null, and off-by-one.
- Negative tests assert the documented error, not just "no crash".
- Targets: 90%+ lines for core logic, 70%+ for CLI or UI orchestration. A number alone is not a pass; shallow assertions at 95% are worse than rigorous ones at 80%.
Suites
- Choose suites by risk and keep each runnable alone (suites.md). Performance budgets and mutation runs stay off the fast path.
Regressions
- For each fixed bug, add a test that reproduces the original failure, named for the behavior, asserting the specific wrong result. Keep it unless the behavior is removed on purpose.
Organization
- One test file per module, named by the language's convention (
test_<module>.py,<module>.test.ts). - Put helpers and builders at the top of the file or in a shared module (
conftest.py,testutils).
References
- anti-patterns.md: read when reviewing tests or before declaring new tests done.
- coverage.md: read when measuring coverage or analyzing gaps across a codebase.
- isolation.md: read when the code under test imports a framework missing from the test environment.
- suites.md: read when choosing which suites a project needs (unit, property, integration, end to end, contract, performance, UX, mutation) or documenting them.
- examples.md: read for worked examples of builders, boundary sets, and regression tests.
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.

