---
title: Principle Test Behavior Not Implementation Skill
canonical: https://skillselion.com/skills/cursor/plugins/principle-test-behavior-not-implementation
content_type: text/markdown
description: "principle-test-behavior-not-implementation by cursor - principle-test-behavior-not-implementation applies whenever the agent writes, changes or keeps a test."
---

# Principle Test Behavior Not Implementation Skill

> principle-test-behavior-not-implementation by cursor - principle-test-behavior-not-implementation applies whenever the agent writes, changes or keeps a test.

Canonical: https://skillselion.com/skills/cursor/plugins/principle-test-behavior-not-implementation

principle-test-behavior-not-implementation applies whenever the agent writes, changes or keeps a test. It asserts what the code users can observe, so the test fails when that behavior breaks and keeps passing when only internals change. Use it to stop brittle tests that lock in implementation details. Part of pstack, the poteto skill pack in the cursor/plugins repo, run as a slash command in Cursor or Claude Code.

## Key facts

- Installs: 3,701
- GitHub stars: 19,807
- Author: cursor
- Repository: cursor/plugins
- Install command: `npx skills add https://github.com/cursor/plugins --skill principle-test-behavior-not-implementation`
- Last updated: November 26, 2026

## What Principle Test Behavior Not Implementation does

Principle: tests assert observable behavior so they fail on real breakage and survive refactors.

- Asserts user-observable behavior
- Tests survive internal refactors
- Part of the pstack skill pack by poteto

## SKILL.md

## Test Behavior, Not Implementation

A test is a claim about what the code does for its users: a caller, an end user, or another service. Behavior is what those users can observe through the interface they use. That includes return values, errors, state they can read back, and effects on systems outside the code, such as a request sent, a row written, or a message emitted. Implementation is what they cannot observe: private helpers, internal call order, intermediate data, and which internal collaborator did the work.

Judge each test against two imagined edits:

- **Break the behavior.** Make the code return a wrong value, skip an effect, or do the effect 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, a restated constant or prompt string that never runs the code that reads it, and an assertion on data that the test built itself.
- **Change the internals.** Keep every observable result the same and restructure the code underneath. If the test now fails, it is pinned to the implementation. It will need a rewrite on every refactor and still catches no bug.

Keep a test that catches the first edit and survives the second. Rewrite or delete the rest. To write a test that does both, drive the code through its users' interface with a concrete input. Derive the expected value from the requirement, not from a run of the code. Assert what the contract promises, no less and no more.

The contract decides, not the shape of the assertion. When "an empty cart never charges" is the promise, an assertion that the payment client got no call is behavior. Pair it with a case where the charge happens, so that the test shows it can see a call. The payload that a mocked external service receives is behavior, because that service observes it. A call to an internal helper is implementation, because no user can see it. An empty list is the exact answer when no record matches, and a hollow check when the test only needs some result. An exact error message pins wording that no caller reads. The error type that callers branch on is the contract.

A test can pin an invariant instead of a call, such as a key that must exist in two tables or a compile-time type check. The invariant is the behavior.

## Principle Test Behavior Not Implementation FAQ

### Is Principle Test Behavior Not Implementation safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

## Machine access

- [Sitemap](https://skillselion.com/sitemap.xml)
- [llms.txt](https://skillselion.com/llms.txt)
- [llms-full.txt](https://skillselion.com/llms-full.txt)
- [Developer resources](https://skillselion.com/developers)
- [OpenAPI spec](https://skillselion.com/openapi.json)
- [MCP handshake](https://skillselion.com/.well-known/mcp)
- [API catalog](https://skillselion.com/.well-known/api-catalog)
- [AI catalog](https://skillselion.com/.well-known/ai-catalog.json)
- [Pricing](https://skillselion.com/pricing.md)
- [Auth](https://skillselion.com/auth.md)
- [AGENTS.md](https://skillselion.com/AGENTS.md)
- [Contact](https://skillselion.com/contact)
- [Home](https://skillselion.com/)
