principle-test-behavior-not-implementation
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.
Install / Use
npx skills add backnotprop/pstack --skill principle-test-behavior-not-implementationInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of principle-test-behavior-not-implementation
principle-test-behavior-not-implementation scores 83/100 on our quality scale, 3133rd of 4,604 Development & Engineering skills we index.
Its SKILL.md is 2.5 KB long, lightly structured (1 heading) and no code examples: a solid amount of guidance for an agent.
It has 434 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 22 days ago, so principle-test-behavior-not-implementation is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
principle-test-behavior-not-implementation compared with similar skills
All 4 of these similar skills score higher than principle-test-behavior-not-implementation; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| principle-test-behavior-not-implementation (this skill)by backnotprop | 83 | 434 | 22d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 45.1k | 1d ago | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.8k | 6d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
Frequently asked questions
- How do I install principle-test-behavior-not-implementation?
- Run
npx skills add backnotprop/pstack --skill principle-test-behavior-not-implementation. The install tabs above show the steps for each supported agent. - Which AI agents does principle-test-behavior-not-implementation work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is principle-test-behavior-not-implementation safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is principle-test-behavior-not-implementation still maintained?
- The repository was last updated 22 days ago, so principle-test-behavior-not-implementation is actively maintained.
Skill content
View source on GitHubname: 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." disable-model-invocation: true
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 onlytoBeDefined,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.
Related Skills
ai-job-search
45.1kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.8kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
