pstack-principle-test-behavior-not-implementation

pstack-principle-test-behavior-not-implementation is a skill for Claude Code from dmae97/omk. It costs 53 tokens per session (552 once invoked), scanned A, original, MIT.

A testing rule that checks what users or other systems can observe, rather than private implementation details.

In plain words
What is it for?
It helps write tests for returned values, errors, saved records, requests, messages, and other effects through the interface that users or services actually use.
Why use it?
Such tests continue to work when the code is reorganised, while still failing when visible behaviour breaks. Tests tied to internals otherwise create maintenance work without reliably finding bugs.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit It helps write tests for returned values, errors, saved records, requests, messages, and other effects through the interface that users or services actually use.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dmae97/omk/principle-test-behavior-not-implementation
View source ↗ dmae97/omk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dmae97/omk --skill principle-test-behavior-not-implementation
Clone the repo
git clone --depth 1 https://github.com/dmae97/omk

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pstack-principle-test-behavior-not-implementation

README.md
[![agentmods](https://agentmods.dev/badge/skills/dmae97/omk/principle-test-behavior-not-implementation/github.svg)](https://agentmods.dev/skills/dmae97/omk/principle-test-behavior-not-implementation)
Your own site
<a href="https://agentmods.dev/skills/dmae97/omk/principle-test-behavior-not-implementation"><img src="https://agentmods.dev/badge/skills/dmae97/omk/principle-test-behavior-not-implementation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pstack-principle-test-behavior-not-implementation

Your own site · 80×15
<a href="https://agentmods.dev/skills/dmae97/omk/principle-test-behavior-not-implementation"><img src="https://agentmods.dev/badge/skills/dmae97/omk/principle-test-behavior-not-implementation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 552 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.00552
Opus 5.5 $0.00021 $0.00221
Sonnet 5.5 $0.00011 $0.00110
Haiku 4.5 $0.00005 $0.00055

Measured 6d ago against content hash 394876f47acf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pstack-principle-test-behavior-not-implementation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

packages/coding-agent/resources/pstack/skills/principle-test-behavior-not-implementation/SKILL.md · 21 lines

What it actually says

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.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 21 lines · 53 tokens per session scan A 394876f47acf

Subscribe to this mod's changes

pstack-principle-test-behavior-not-implementation is a skill published in the GitHub repository dmae97/omk (152 stars, last pushed yesterday), licensed MIT. It adds 53 tokens to every session and 552 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-27.

Related

Other skills, from other repositories

ci-triage

Diagnose failing CI, build, release-gate, or test runs for Cool Workflow. Use when a GitHub Actions check, local npm test, npm run build, release gate, smoke test, or generated-manifest check fails and Codex must identify the first actionable failure with logs and verifier commands.

coo1white/cool-workflow · 66 tokens

deploy-check

Verify Cool Workflow release, publish, deploy, or package readiness. Use when Codex must check build/test gates, generated manifests, project index sync, dist/source contract, changelog/release notes, npm package contents, or pre-tag risk before shipping.

coo1white/cool-workflow · 54 tokens

design-qa

Evaluate Cool Workflow architecture, product design, operator UX, context-pack, workflow-app, MCP/CLI, or release-process proposals. Use when Codex must decide whether a design respects FreeBSD/POLA, mechanism-not-policy, stable JSON surfaces, evidence, and verifier boundaries before implementation.

coo1white/cool-workflow · 61 tokens

pr-review

Review Cool Workflow pull requests or branch diffs. Use when Codex must inspect code changes for bugs, regressions, FreeBSD/POLA violations, missing tests, generated artifact drift, release-contract risk, or CI implications, and return findings first with file/line citations.

coo1white/cool-workflow · 58 tokens

e2e-testing

Guide for running end-to-end tests of the Qwen Code CLI, including headless mode, MCP server testing, and API traffic inspection. Use this skill whenever you need to verify CLI behavior with real model calls, reproduce user-reported bugs end-to-end, test MCP tool integrations, or inspect raw API request/response…

QwenLM/qwen-code · 94 tokens

terminal-capture

Automates terminal UI screenshot testing for CLI commands. Applies when reviewing PRs that affect CLI output, testing slash commands (/about, /context, /auth, /export), generating visual documentation, or when 'terminal screenshot', 'CLI test', 'visual test', or 'terminal-capture' is mentioned.

QwenLM/qwen-code · 66 tokens