principle-test-behavior-not-implementation
Apply when you write, change, or keep a test.
Skill by dotts-h
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/dotts-h-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: not checked yet.
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 user may be a caller, an end user, or another service. Behavior is what those users can observe through the interface they use. Observable results include return values, errors, and state a user can read back. Observable results also include effects on systems outside the code, such as a request sent, a row written, or a message emitted. Implementation is what users cannot observe. That means 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. These are the usual causes. An assertion is looser than the contract. An expected value is computed by the code under test. A restated constant or prompt string never runs the code that reads it. An assertion checks 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 that assertion with a case where the charge happens, so 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. An empty list is 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. A key that must exist in two tables is one invariant. A compile-time type check is another. The invariant is the behavior.
From dotts-h/qstack, MIT.
More from dotts-h/qstack
- 0.567score
triage-defect
dotts-h
Triage bug reports with bounded cause tracing, duplicate detection, bug-versus-feature classification, and self-contained defect report formatting.
SkillAFreshness: AClaude Code +9 - 0.567score
qstack-mode
dotts-h
Run structured QA workflows in Cursor: test chartering, real-surface reproduction with recorded runs, defect triage, baseline-versus-patch fix verification…
SkillAFreshness: AClaude Code +9 - 0.567score
reproduce-issue
dotts-h
Reproduce reported defects through the target app's real UI or CLI on at least two recorded runs, verify existing fixes against baseline and patched builds…
SkillAFreshness: AClaude Code +9 - 0.565score
setup-qstack
dotts-h
Configure which models the qstack how and why skills give their subagents and at what reasoning budget.
SkillAFreshness: AClaude Code +9 - 0.561score
regression-pin
dotts-h
Pin a reproduced bug or regression signal with a focused executable check that fails before the fix and passes after it, or select the closest live…
SkillAFreshness: AClaude Code +9 - 0.561score
principle-build-the-lever
dotts-h
Apply to any non-trivial work, including edits, migrations, analyses, and checks.
SkillAFreshness: AClaude Code +9 - 0.556score
principle-sequence-verifiable-units
dotts-h
Apply to multi-step work such as sweeps, migrations, and runs of similar edits, and to how you stack commits and PRs.
SkillAFreshness: AClaude Code +9 - 0.556score
in-your-own-words
dotts-h
Restate the testing goal, target surface, and risk hypothesis in your own words before test execution.
SkillAFreshness: AClaude Code +9 - 0.556score
principle-explain-the-number
dotts-h
Apply before you trust, report, or act on a number you measured.
SkillAFreshness: AClaude Code +9 - 0.556score
principle-never-block-on-the-human
dotts-h
Apply when tempted to ask 'should I do X?' on reversible work.
SkillAFreshness: AClaude Code +9 - 0.541score
how
dotts-h
Use for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which…
SkillAFreshness: AClaude Code +9 - 0.536score
blast-radius
dotts-h
Find what a change could break somewhere else before it ships, beyond the diff, and prove the one fact it's safe because of by running real code instead of…
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 19, 2026 (9 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/dotts-h/qstack
- 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.756score
principle-test-behavior-not-implementation
backnotprop
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 2.7KClaude Code +9 - 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
matthewyjiang
Apply when you write, change, or keep a test.
SkillAFreshness: AClaude Code +9
More from dotts-h
- 0.567score
reproduce-issue
dotts-h
Reproduce reported defects through the target app's real UI or CLI on at least two recorded runs, verify existing fixes against baseline and patched builds…
SkillAFreshness: AClaude Code +9 - 0.567score
triage-defect
dotts-h
Triage bug reports with bounded cause tracing, duplicate detection, bug-versus-feature classification, and self-contained defect report formatting.
SkillAFreshness: AClaude Code +9 - 0.567score
qstack-mode
dotts-h
Run structured QA workflows in Cursor: test chartering, real-surface reproduction with recorded runs, defect triage, baseline-versus-patch fix verification…
SkillAFreshness: AClaude Code +9 - 0.565score
setup-qstack
dotts-h
Configure which models the qstack how and why skills give their subagents and at what reasoning budget.
SkillAFreshness: AClaude Code +9 - 0.561score
regression-pin
dotts-h
Pin a reproduced bug or regression signal with a focused executable check that fails before the fix and passes after it, or select the closest live…
SkillAFreshness: AClaude Code +9 - 0.561score
principle-build-the-lever
dotts-h
Apply to any non-trivial work, including edits, migrations, analyses, and checks.
SkillAFreshness: AClaude Code +9
Cite this page
principle-test-behavior-not-implementation skill. Agent Mart. https://agentmart.dev/skills/dotts-h-principle-test-behavior-not-implementation (last updated 2026-10-24)