writing-acceptance-tests
Skill7 starsChanged 5 months agoMITView on GitHub
Use when independent tests must be derived from a specification, public interface, or acceptance criteria before implementation, without writing or relying on production code.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- cli/clitheir own version, first seen Oct 8, 2026
- PostHog/sdk-specstheir own version, first seen Aug 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- cli/cli★ 47ksame name
- PostHog/sdk-specs★ 4same 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 repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- compactSkill
- assistant-notebookSkill
- brainstormingSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- mem0-memorySkill
- next-level-agentSkill
- planning-parallel-workSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
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 18
Test observable behavior through public APIs, public methods, message contracts, CLI commands, or documented state assertions.
- Distinctive: line 19
Do not assert private fields, private methods, incidental call order, internal storage layout, or implementation-specific algorithms unless …
- Distinctive: line 20
Write only tests and test-owned fixtures, stubs, mocks, harnesses, and data.
- Distinctive: line 21
Do not change production code, production configuration, migrations, or public contracts.
- Distinctive: line 44
Run the narrowest relevant test command and confirm each new test:
- Distinctive: line 49
does not fail because of syntax errors, broken fixtures, missing imports, accidental environment dependencies, or an unhandled setup …
- Distinctive: line 77
Stop and report rather than modifying production code when the public interface is missing, the specification is contradictory, the …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing Acceptance Tests
Produce executable tests and test-only fixtures from the contract. Do not implement, repair, or refactor production code.
Authoritative Inputs
Base tests only on supplied requirements, user stories, issue descriptions, acceptance criteria, and public interfaces such as APIs, CLI commands, protocols, schemas, headers, or documented state transitions. If expected behavior is ambiguous, report the ambiguity; do not infer private implementation details.
Existing source may be read only to discover public entry points, repository test conventions, build commands, and test boundaries. It must not redefine the requested behavior.
Behavioral Boundary
- Test observable behavior through public APIs, public methods, message contracts, CLI commands, or documented state assertions.
- Do not assert private fields, private methods, incidental call order, internal storage layout, or implementation-specific algorithms unless the specification explicitly makes them contractual.
- Write only tests and test-owned fixtures, stubs, mocks, harnesses, and data.
- Do not change production code, production configuration, migrations, or public contracts.
- Mock external systems at their documented boundary. Prefer real behavior inside the system under test over mocks of internal collaborators.
Coverage
Cover only behavior justified by the contract, including where applicable:
- the principal successful path;
- boundary values such as empty inputs, zero values, nullability, and documented limits;
- invalid input and specified error behavior;
- timeout, cancellation, retry, or failure behavior when it is part of the contract;
- persistence, idempotency, concurrency, or restart behavior when required by acceptance criteria.
Map every test to one or more acceptance criteria. Identify uncovered criteria instead of inventing expected behavior.
Isolation and Readability
Tests must be deterministic and independent of execution order. Isolate network services, databases, clocks, randomness, and external processes with explicit test fixtures or boundary doubles. Do not use unexplained sleeps when an observable readiness condition is available.
Name tests as behavioral specifications. Use Arrange-Act-Assert or Given-When-Then consistently with repository conventions.
RED Validation
Run the narrowest relevant test command and confirm each new test:
- compiles or loads successfully;
- reaches its behavioral assertion;
- fails because the requested behavior is absent or incorrect;
- does not fail because of syntax errors, broken fixtures, missing imports, accidental environment dependencies, or an unhandled setup exception.
If a test passes immediately, determine whether the behavior already exists or the assertion is ineffective. Do not weaken or distort the contract merely to force RED. If RED cannot be demonstrated safely because required infrastructure or authorization is unavailable, report NOT_RUN with the exact prerequisite rather than claiming a valid failing test.
Output Contract
Return:
{
"test_files": [],
"fixture_files": [],
"criteria_coverage": [
{ "criterion": "string", "tests": [] }
],
"commands_run": [],
"red_evidence": [
{ "test": "string", "status": "RED | NOT_RUN", "reason": "string" }
],
"uncovered_criteria": [],
"implementation_handoff": []
}Include concise human-readable notes when needed. The handoff may describe observable behavior the Implementer must satisfy, but it must not prescribe or contain production implementation.
Stop Conditions
Stop and report rather than modifying production code when the public interface is missing, the specification is contradictory, the permitted test paths are unknown, or valid RED evidence would require an unauthorized external or destructive action.
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.

