principle-test-behavior-not-implementation
/principle-test-behavior-not-implementation
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.
- Author
- koolamusic ↗
- Repository
- claudefiles ↗
- Licence
- MIT
- Last repository change
- 14.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 14.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
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.
Original author 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.
How it works
SKILL.md has no level-two headings · 17 lines, 169 words
SKILL.md preview
--- 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." disable-model-invocation: true --- # Test Behavior, Not Implementation A test calls the code as its users do and asserts the exact result they see. Rewrite or delete any test that would still pass if every imported function returned `undefined` or a wrong value. These shapes fail that check: - Loose or no assertion: `toBeDefined`, `toBeTruthy`, `not.toThrow`, `toBeGreaterThan(0)`. - Call or absence only: `toHaveBeenCalled`, `not.toHaveBeenCalled`, `toBeUndefined`, `toEqual([])`. - Expected value computed by the code under test: `expect(f(a)).toBe(f(a))`. - Restated constant, config default, table row, or prompt string. - Assertions on data the test built, with no call to the subject. Fix: call the subject in the test body with one concrete input and assert the literal output or effect. For a mock, assert the payload it received. For an absence, also assert the presence on another input. For a constant, test the mechanism that reads it with one input instead of restating the value. Keep relation checks across table rows (a key in two tables, a parent that exists) and `*.test-d.ts` type checks.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · koolamusic/claudefiles | 96 | MIT |
| alexanderop/pstack | 96 | MIT |
| requie/endostack | 90 | MIT |
| chmonitor/chmonitor | 86 | GPL-3.0 |
| tommy-ca/pstack | 86 | MIT |
| arjitj2/open-pstack | 81 | MIT |
| michael-denyer/pstack-claude | 81 | MIT |
| xinhi6716/axiom-atropos | 81 | MIT |
| workerstack/clients | 81 | MIT |
Database snapshot: 13.11.2026 · package version 245509867058 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 2 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100principle-test-behavior
Use when writing or reviewing tests: a test asserts the behaviour a requirement asks for, through the code's public surface, and would fail on a real defect. - 100test-driven-development
Use when implementing any feature, bug fix, refactor or behavior change, before writing implementation code. Write the failing test first, watch it fail, then write the minimal code to pass. - 90write-tests
Write tests that pin real behavior instead of implementation details, config values, or lucky samples. Use when adding tests for new behavior, writing a regression test, fixing a brittle or flaky test, reviewing a test diff, or when a test breaks after a refactor or config… - 100loom-test-after-implementation
Implement features first, then write behavior-verification tests against the real public API. Code-first/test-after cycle: implement → refactor → write behavior tests → run tests. Use when: implementing behavior where tests verify outcomes after production code is written. - 100write-tests
Write tests that pin real behavior instead of implementation details, config values, or lucky samples. Use when adding tests for new behavior, writing a regression test, fixing a brittle or flaky test, reviewing a test diff, or when a test breaks after a refactor or config… - 100write-tests
Write tests that pin real behavior instead of implementation details, config values, or lucky samples. Use when adding tests for new behavior, writing a regression test, fixing a brittle or flaky test, reviewing a test diff, or when a test breaks after a refactor or config…