agentleFS
pickleshellpickleshell/next-level-agent/skills/writing-acceptance-tests/SKILL.md

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

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
  1. Distinctive:

    Test observable behavior through public APIs, public methods, message contracts, CLI commands, or documented state assertions.

    line 18
  2. Distinctive:

    Do not assert private fields, private methods, incidental call order, internal storage layout, or implementation-specific algorithms unless …

    line 19
  3. Distinctive:

    Write only tests and test-owned fixtures, stubs, mocks, harnesses, and data.

    line 20
  4. Distinctive:

    Do not change production code, production configuration, migrations, or public contracts.

    line 21
  5. Distinctive:

    Run the narrowest relevant test command and confirm each new test:

    line 44
  6. Distinctive:

    does not fail because of syntax errors, broken fixtures, missing imports, accidental environment dependencies, or an unhandled setup …

    line 49
  7. Distinctive:

    Stop and report rather than modifying production code when the public interface is missing, the specification is contradictory, the …

    line 77

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. compiles or loads successfully;
  2. reaches its behavioral assertion;
  3. fails because the requested behavior is absent or incorrect;
  4. 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.

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.