principle-test-behavior-not-implementation
Apply when you write, change, or keep a test.
Skill by minghinmatthewlam
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/minghinmatthewlam-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 and code. 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. Call the code as its users do and assert the exact result they see. Rewrite or delete a test that would pass if every imported function returned undefined.
- License
- MIT
- Instructions
- 17 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- openai.yaml · agents/
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 minghinmatthewlam/agent-guards, MIT.
More from minghinmatthewlam/agent-guards
- 0.650score
ketchup
minghinmatthewlam
Catch the user up on everything in this chat since their last message, in plain words.
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
architect
minghinmatthewlam
Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in.
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
create-verification-skill
minghinmatthewlam
Generate a project-local verification skill that drives your app the way a user does — any language, framework, or platform.
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
how
minghinmatthewlam
Use for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which…
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
interrogate
minghinmatthewlam
Use for "interrogate", "adversarial review", "multi-model review", "challenge this", "stress test this code", "find blind spots", or "tear this apart".
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
poteto-mode
minghinmatthewlam
poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work.
SkillAFreshness: A★ 46Claude Code +9 - 0.633score
correct
minghinmatthewlam
Find the mistakes agents keep repeating in this repo and make each one impossible.
SkillAFreshness: A★ 46Claude Code +9 - 0.633score
benchmark-checklist
minghinmatthewlam
Vet a perf measurement (limiter, tuning, limits, errors, repeatability, relevance, and whether the work happened) before you report or act on it.
SkillAFreshness: A★ 46Claude Code +9 - 0.630score
principle-encode-lessons-in-structure
minghinmatthewlam
Apply when you catch yourself writing the same instruction a second time, or notice a recurring correction.
SkillAFreshness: A★ 46Claude Code +9 - 0.630score
automate-me
minghinmatthewlam
Use for "automate me", "create/update/refresh my -mode skill", "turn/capture my preferences or working style into a skill", or wanting agents to follow how…
SkillAFreshness: A★ 46Claude Code +9 - 0.630score
maintain-verification-skill
minghinmatthewlam
Periodic pass that keeps a project's verification skill and feature map honest: parallel source readers per feature, one live session driving every feature…
SkillAFreshness: A★ 46Claude Code +9 - 0.630score
principle-boundary-discipline
minghinmatthewlam
Apply when wiring validation, error handling, or framework adapters.
SkillAFreshness: A★ 46Claude Code +9
Signals
- Stars
- 46
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- Oct 13, 2026 (15 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from minghinmatthewlam
- 0.650score
ketchup
minghinmatthewlam
Catch the user up on everything in this chat since their last message, in plain words.
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
architect
minghinmatthewlam
Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in.
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
create-verification-skill
minghinmatthewlam
Generate a project-local verification skill that drives your app the way a user does — any language, framework, or platform.
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
how
minghinmatthewlam
Use for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which…
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
interrogate
minghinmatthewlam
Use for "interrogate", "adversarial review", "multi-model review", "challenge this", "stress test this code", "find blind spots", or "tear this apart".
SkillAFreshness: A★ 46Claude Code +9 - 0.635score
poteto-mode
minghinmatthewlam
poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work.
SkillAFreshness: A★ 46Claude Code +9
Cite this page
principle-test-behavior-not-implementation skill. Agent Mart. https://agentmart.dev/skills/minghinmatthewlam-principle-test-behavior-not-implementation (last updated 2026-10-24)