principle-test-behavior-not-implementation
Apply when you write, change, or keep a test.
Skill by backnotprop
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/backnotprop-principle-test-behavior-not-implementation
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/principle-test-behavior-not-implementation
What's inside
- Skill name
principle-test-behavior-not-implementation- Description
- 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.
- License
- MIT
- Instructions
- 16 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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. Keep a test that catches the first edit and survives the second. Rewrite or delete the rest. To write a test that does both, drive the code through its users' interface with a concrete input. Derive the expected value from the requirement, not from a run of the code. Assert what the contract promises, no less and no more. The contract decides, not the shape of the assertion. When "an empty cart never charges" is the promise, an assertion that the payment client got no call is behavior. Pair it with a case where the charge happens, so that the test shows it can see a call. The payload that a mocked external service receives is behavior, because that service observes it. A call to an internal helper is implementation, because no user can see it. An empty list is the exact answer when no record matches, and a hollow check when the test only needs some result. An exact error message pins wording that no caller reads. The error type that callers branch on is the contract. A test can pin an invariant instead of a call, such as a key that must exist in two tables or a compile-time type check. The invariant is the behavior.
From backnotprop/pstack, MIT.
More from backnotprop/pstack
- 0.769score
statechart
backnotprop
Draw how any system moves between states, such as a product flow, a protocol, or a service, as a Mermaid statechart from a TLA+ model.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.769score
show-me-your-work
backnotprop
Keep a reviewable decision trail for long-running or unattended work: a TSV log with one row per decision (what, why, evidence, result).
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.769score
reflect
backnotprop
Spawn three parallel review subagents over the active transcript, surface learnings, and route each to a concrete edit on an existing skill.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.769score
why
backnotprop
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.768score
typescript-best-practices
backnotprop
TypeScript best practices.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.766score
poteto-help
backnotprop
Guides users through pstack setup, /poteto-mode, and picking the skill, playbook, or principle for a task.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.764score
maintain-formal-verification-skill
backnotprop
Bring a project's formal verification back in line with the code after the code changes: find the commits that touched verified code, update the model…
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.761score
technical-writing
backnotprop
Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.761score
swarm
backnotprop
Fan out N parallel workers, drain them, and return one report.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.761score
setup-pstack
backnotprop
Configure which models pstack uses per role and at what reasoning budget.
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.760score
recall
backnotprop
Reconstruct your recent working context from your own chat history, live state, and the shared record (user reports, prior fixes, incidents), then hand back a…
SkillAFreshness: A★ 2.7KClaude Code +9 - 0.758score
principle-model-the-domain
backnotprop
Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.
SkillAFreshness: A★ 2.7KClaude Code +9
Signals
- Stars
- 2,694
- Forks
- 207
- Open issues
- 1
- Last commit (this folder)
- Oct 15, 2026 (13 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/backnotprop/pstack
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.396score
principle-test-behavior-not-implementation
dsebban
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 68Claude Code +9 - 0.382score
principle-test-behavior-not-implementation
jiangkoumo
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 27Claude Code +9 - 0.360score
principle-test-behavior-not-implementation
creedants
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 15Claude Code +9 - 0.351score
principle-test-behavior-not-implementation
edlng
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 2Claude Code +9 - 0.344score
principle-test-behavior-not-implementation
aayushbtw
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 1Claude Code +9 - 0.334score
principle-test-behavior-not-implementation
dotts-h
Apply when you write, change, or keep a test.
SkillAFreshness: AClaude Code +9 - 0.334score
principle-test-behavior-not-implementation
matthewyjiang
Apply when you write, change, or keep a test.
SkillAFreshness: AClaude Code +9
More from backnotprop
- 0.786score
plannotator-visual-explainer
backnotprop
Generate self-contained HTML visualizations with Plannotator theming.
SkillAFreshness: A★ 9.6KClaude Code +9 - 0.782score
release-plannotator
backnotprop
Prepare and execute a Plannotator release — draft release notes with full contributor credit, bump versions across all package files, build in dependency…
SkillAFreshness: A★ 9.6KClaude Code +9 - 0.781score
review-renovate
backnotprop
Review Renovate bot PRs that update GitHub Actions dependencies.
SkillAFreshness: A★ 9.6KClaude Code +9 - 0.781score
plannotator
backnotprop
Reference for using Plannotator (its `plannotator` tool when you have one, otherwise the CLI): plan review, code review, annotating files, URLs, folders, and…
SkillAFreshness: A★ 9.6KClaude Code +9 - 0.778score
plannotator-annotate
backnotprop
Open Plannotator's annotation UI for a markdown file, plain-text config file (.yaml, .json, .toml, .ini, .csv, .log, …), HTML file, URL, or folder and then…
SkillAFreshness: A★ 9.6KClaude Code +9 - 0.778score
update-deps
backnotprop
Audit and update npm/Bun dependencies with supply chain integrity checks — verifies maintainers, publish age, tarball diffs, and provenance before bumping.
SkillAFreshness: A★ 9.6KClaude Code +9
Cite this page
principle-test-behavior-not-implementation skill. Agent Mart. https://agentmart.dev/skills/backnotprop-principle-test-behavior-not-implementation (last updated 2026-10-24)