
principle-test-behavior-not-implementation
Apply when you write, change, or keep a test
by cursorFree
Description
principle-test-behavior-not-implementation is an agent skill from Cursor's plugins collection that applies a working principle when writing, changing or keeping a test. A test is treated as a claim about what the code does for its users, whether a caller, an end user or another service. Behaviour is what those users can observe through the interface they use: return values, errors, state they can read back, and effects on outside systems such as a request sent, a row written or a message emitted. Implementation is what they cannot observe, such as private helpers, the internal order of calls, intermediate data and which internal collaborator did the work. The skill asks each test to pass two imagined tests of its own. First, break the behaviour, by returning a wrong value, skipping an effect or doing one 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, or a restated constant that never runs the code. Second, refactor the implementation without changing behaviour: a test that fails in that case is coupled to implementation and should be rewritten to call the code the way its users do and assert the exact result they see, or deleted. The skill suits test reviews, where tests have grown brittle. It is listed on skills.sh, where the page shows install counts and GitHub stars for the Cursor plugins repository. Install it with npx skills add https://github.com/cursor/plugins --skill principle-test-behavior-not-implementation.…
Highlights
- Tests as claims about user-observable behaviour
- Break-the-behaviour check
- Refactor-without-changing-behaviour check
- Exact result assertions
- Rewrite or delete brittle tests
- Installs from skills.sh
Ratings & Reviews
No ratings yet
Be the first to rate principle-test-behavior-not-implementation.
People also visit
principle-test-behavior-not-implementation FAQ
What counts as behaviour?
What users can observe through the interface: return values, errors, readable state and external effects.
How do I know a test is weak?
If it still passes after the behaviour is deliberately broken, it proves nothing.
What if a test breaks on a refactor?
The skill says it is coupled to implementation, so rewrite it to use the public interface or delete it.
How do I install it?
Run npx skills add https://github.com/cursor/plugins --skill principle-test-behavior-not-implementation.
How popular is it?
The skill is listed in the cursor/plugins repository, which has 11.4K GitHub stars.
What are the best principle-test-behavior-not-implementation alternatives?
Popular alternatives to principle-test-behavior-not-implementation include writing-unit-tests, testing-craft and test-master. See all principle-test-behavior-not-implementation alternatives
















