Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Test Behavior, Not Implementation
A test is a claim about what the code does for its users: a caller, an end user, or another service. Behavior is what those users can observe through the interface they use. That includes return values, errors, state they can read back, and effects on systems outside the code, such as a request sent, a row written, or a message emitted. Implementation is what they cannot observe: private helpers, internal call order, intermediate data, and which internal collaborator did the work.
Judge each test against two imagined edits:
- **Break the behavior.** Make the code return a wrong value, skip an effect, or do the effect twice. If the test still passes, it proves nothing. The usual causes are an assertion looser than the contract, an expected value computed by the code under test, a restated constant or prompt string that never runs the code that reads it, and an assertion on data that the test built itself.
- **Change the internals.** Keep every observable result the same and restructure the code underneath. If the test now fails, it is pinned to the implementation. It will need a rewrite on every refactor and still catches no bug.
…
The line at the top of this page pins the label git:20261015.e5136d8, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_e5eepdleveq47dtq
GET https://markdownregistry.com/api/v1/resolve?ref=cursor/plugins/principle-test-behavior-not-implementation
GET https://markdownregistry.com/api/v1/blob/f7223698623b6a26fea49c751e466b38e6691b1f32ce841d3983e7ffbe2b74a6
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
cursor/plugins · advisor/skills/advisor/SKILL.md · Advisor mode. Consult a stronger (or different) model at key checkpoints: before major decisions, when stuck on an…
cursor/plugins · agent-compatibility/skills/check-agent-compatibility/SKILL.md · Run the full repository compatibility pass: scanner score, startup path, validation loop, and docs reliability.
cursor/plugins · cli-for-agent/skills/cli-for-agents/SKILL.md · Designs or reviews CLIs so coding agents can run them reliably: non-interactive flags, layered --help with examples…
cursor/plugins · create-plugin/skills/create-plugin-scaffold/SKILL.md · Create a new Cursor plugin scaffold with a valid manifest, component directories, and marketplace wiring. Use when…
cursor/plugins · create-plugin/skills/review-plugin-submission/SKILL.md · Audit a Cursor plugin for marketplace readiness. Use when validating manifests, component metadata, discovery paths…
cursor/plugins · cursor-sdk/skills/cursor-sdk/SKILL.md · Guide users building apps, scripts, CI pipelines, or automations on top of the Cursor TypeScript SDK (`@cursor/sdk`)…
cursor/plugins · cursor-team-kit/skills/control-cli/SKILL.md · Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services. Use…
cursor/plugins · cursor-team-kit/skills/control-ui/SKILL.md · Build or adapt a local browser/CDP harness to drive and inspect a web, IDE, or Electron UI. Use for local UI…
cursor/plugins · harness/pstack/claude-code/skills/principle-test-behavior-not-implementation/SKILL.md · Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when…
nightly-labs/openbot · marketplace/production-catalog/bundles/pstack/skills/principle-test-behavior-not-implementation/SKILL.md · Apply when you write, change, or keep a test. Call the code as its users do and assert the exact result they see…
michael-denyer/pstack-claude · plugins/pstack/skills/principle-test-behavior-not-implementation/SKILL.md · Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when…
backnotprop/pstack · skills/principle-test-behavior-not-implementation/SKILL.md · Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when…
iap/pstack-hermes · skills/principle-test-behavior-not-implementation/SKILL.md · Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe…
barbieri/local-openfinance · .agents/skills/principle-test-behavior-not-implementation/SKILL.md · Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe…
theonlyfusioncube/potetos-for-everyone · skills/principle-test-behavior-not-implementation/SKILL.md · Call the system the way its consumer does and assert meaningful observable output; avoid mocks or assertions that only…
creedants/pstack-t3 · skills/principle-test-behavior-not-implementation/SKILL.md · Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when…