principle-test-behavior-not-implementation
Test behaviour, not implementation. Apply when writing, changing or keeping a test.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- principle-test-behavior-not-implementation
- license
- MIT
- metadata
- { "source": "pstack principle-test-behavior-not-implementation, MIT, Copyright (c) 2026 Lauren Tan, github.com/cursor/plugins, adapted; checked against pstack 0.15.36 at commit 0bb6f37" }
- description
- Test behaviour, not implementation. Apply when writing, changing or keeping a test.
03 SKILL.md 正文
<!-- Generated by scripts/build.mjs from the sources; edit the source, then run npm run build. -->
Test behaviour, not implementation
A test checks what the code's users observe: return values, errors, readable state, and outside effects such as a sent request or a written row. Internal helpers and call order are not behaviour.
Two imagined edits:
- Break the behaviour: return a wrong value, skip an effect or do it twice. If the test still passes, it proves nothing.
- Change the internals and keep every observable result. If the test fails, it is pinned to the implementation.
Keep a test that catches the first edit and survives the second; rewrite or delete others.
Usual causes: an assertion looser than the contract, an expected value from the code under test, a restated constant or prompt string, a fixture asserting itself, an exact message, not the error type that callers branch on.
The fix. Drive the code through its users' interface with a concrete input. Derive the expected value from the requirement; assert exactly what the contract promises. Pair an absence (no call, an empty list) with a case that shows the presence. A payload sent to an external service is behaviour; an internal helper call is not.
Keep invariant tests: a key in two tables, or a compile-time type check.
04 同仓库更多 Skills
writing-standard
Write at 80% of Simplified Technical English. Apply to any text an agent writes for a person: messages, reports, specs, findings, reviews, plans.
sage
The state tool of sage mode: records tasks, routes, agent runs, findings, verdicts by head SHA and the user's gates in ~/.claude/sage/<project>/. Use in sage mode for every change of a task's state, and before any merge. Claude Code only.
sage-help
Help with sage: how to set it up, switch sage mode and autopilot, read the board, answer the chief's questions, pick a skill or a principle, fix a run that went wrong, and find where sage keeps its files. The user types /sage:sage-help (or /sage-help) with a question. Load it only when the user types it; do not load it on your own. Claude Code only.
report
The report that every sage agent ends with: STATUS, RESULT, EVIDENCE, FINDINGS, QUESTIONS, NOT VERIFIED, BRANCH. Use at the end of any task that the sage chief of staff gave you. Claude Code only.
remote-control
Set up Remote Control, so that the user can follow, steer and start Claude Code sessions from the Claude app on a phone. It turns Remote Control on for every new session, and it can run a server in a folder (such as ~/workspace) that starts at each login. Use when the user asks to reach sessions or start new ones from a phone, or to set up, check or undo Remote Control. Claude Code only.
readme-guide
Write a project README. Apply when you write, change or review a README of any project, in any language.