principle-test-behavior-not-implementation
Apply when you write, change, or keep a test.
Skill by n3m6
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/n3m6-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, agent-building
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. Call the code the way its users do and assert the result they observe against a literal expected value. If the test would still pass when every imported function returns undefined, rewrite the assertion or delete the test.
- License
- GPL-3.0
- Metadata
- opencode/autoinvoke: false
- Instructions
- 21 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Test Behavior, Not Implementation
A test calls the code the way its users do and asserts the result they observe against a literal expected value. A test that asserts which calls the code made, or restates a constant the code contains, does neither.
The check: before you keep a test, ask whether it would still pass if every function it imports returned `undefined`. If yes, it observes no behavior and cannot fail for a defect. Rewrite the assertion or delete the test.
**Why:** A test that cannot fail for a defect costs CI time and review attention and catches nothing. A constant pin also fails when someone edits the constant or the prompt it restates, so it prevents that edit.
**Five shapes that still pass when every imported function returns `undefined`:**
- **Weak or no assertion.** No `expect`, or only `toBeDefined`, `toBeTruthy`, `not.toThrow`, `toBeInstanceOf`, `toBeGreaterThan(0)`.
- **Mock or absence only.** Only `toHaveBeenCalled`, `not.toHaveBeenCalled`, `toBeUndefined`, `toEqual([])`, `toHaveLength(0)`, `not.toBe(wrongValue)`.
- **Self-referential.** The expected value comes from the code under test: `expect(f(a)).toBe(f(a))`, `expect(parsed.url).toBe(buildUrl(...))`.
- **Constant pin.** The assertion restates a hand-maintained constant, config default, table row, or prompt string: `expect(LIMITS.maxTools).toBe(8)`, `expect(PROMPT).toContain("You are")`.
- **Fixture asserts fixture.** The assertion reads data the test built or a value computed in `beforeEach`, and the subject never runs inside the body.
**The fix:** call the subject inside the test body with one concrete input and assert the literal output or the observable effect, `expect(slugify("Hello, World!")).toBe("hello-world")`. For an absence, assert the presence on the other input in the same test. For a constant, test the mechanism that reads it with one input instead of restating the value. For a mock, assert the payload it received or the state after the call, not that it was called. When no such assertion exists, delete the test.
**Keep** a test of a relation across a table's rows (a key present in two tables, a parent that exists), and a compile-time check in a `*.test-d.ts` file.From n3m6/opencode-config, GPL-3.0.
More from n3m6/opencode-config
- 0.640score
unslop
n3m6
Edit prose to remove AI writing patterns while preserving meaning, intended tone, and the requested format.
SkillAFreshness: A★ 19Claude Code +9 - 0.635score
no-comments
n3m6
Review comments and workaround explanations in a scoped diff, preserve necessary contracts, and fix accepted findings.
SkillAFreshness: A★ 19Claude Code +9 - 0.635score
setup-pstack
n3m6
Configure which models pstack uses per role and at what reasoning budget.
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
architect
n3m6
Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in.
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
create-verification-skill
n3m6
Generate a project-local verification skill that drives your app the way a user does — any language, framework, or platform.
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
how
n3m6
Use for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which…
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
interrogate
n3m6
Use for "interrogate", "adversarial review", "multi-model review", "challenge this", "stress test this code", "find blind spots", or "tear this apart".
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
poteto-mode
n3m6
poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work.
SkillAFreshness: A★ 19Claude Code +9 - 0.618score
figure-it-out
n3m6
Design an auditable playbook when no narrower one fits: a large migration, an ambitious multi-part change, or work a human reviews after stepping away.
SkillAFreshness: A★ 19Claude Code +9 - 0.618score
benchmark-checklist
n3m6
Vet a perf measurement (limiter, tuning, limits, errors, repeatability, relevance, and whether the work happened) before you report or act on it.
SkillAFreshness: A★ 19Claude Code +9 - 0.618score
correct
n3m6
Find the mistakes agents keep repeating in this repo and make each one impossible.
SkillAFreshness: A★ 19Claude Code +9 - 0.615score
maintain-verification-skill
n3m6
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★ 19Claude Code +9
Signals
- Stars
- 19
- Forks
- 2
- Open issues
- 1
- Last commit (this folder)
- Oct 6, 2026 (22 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- GPL-3.0
- Repository
- github.com/n3m6/opencode-config
- 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.778score
principle-test-behavior-not-implementation
uzairansaruzi
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 155Claude Code +9 - 0.384score
principle-test-behavior-not-implementation
iap
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 27Claude Code +9 - 0.378score
principle-test-behavior-not-implementation
enitrat
Apply when you write, change, or keep a test.
SkillAFreshness: A★ 15Claude Code +9
More from n3m6
- 0.640score
unslop
n3m6
Edit prose to remove AI writing patterns while preserving meaning, intended tone, and the requested format.
SkillAFreshness: A★ 19Claude Code +9 - 0.635score
setup-pstack
n3m6
Configure which models pstack uses per role and at what reasoning budget.
SkillAFreshness: A★ 19Claude Code +9 - 0.635score
no-comments
n3m6
Review comments and workaround explanations in a scoped diff, preserve necessary contracts, and fix accepted findings.
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
interrogate
n3m6
Use for "interrogate", "adversarial review", "multi-model review", "challenge this", "stress test this code", "find blind spots", or "tear this apart".
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
create-verification-skill
n3m6
Generate a project-local verification skill that drives your app the way a user does — any language, framework, or platform.
SkillAFreshness: A★ 19Claude Code +9 - 0.620score
how
n3m6
Use for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which…
SkillAFreshness: A★ 19Claude Code +9
Cite this page
principle-test-behavior-not-implementation skill. Agent Mart. https://agentmart.dev/skills/n3m6-principle-test-behavior-not-implementation (last updated 2026-10-24)