本文へ移動
cccskills
無料GitHub で公開

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md1.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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. Keep an absence-only test when the contract requires the absence and making the subject produce it fails the test: a denied operation must send no email, so temporarily make the denied path send one and watch the test fail. Keep a constant pin when the value is a promise to users, such as a documented default, and name that promise.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

architect

無料

Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for /architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape.

日本語の概要は準備中です。原文の説明を表示しています。

michael-denyer/pstack-claude1,8982026年10月13日 更新

arena

無料

Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape.

日本語の概要は準備中です。原文の説明を表示しています。

michael-denyer/pstack-claude1,8982026年10月13日 更新

Use for "automate me", "create/update/refresh my -mode skill", "turn/capture my preferences or working style into a skill", or wanting agents to follow how the user works. Drafts or revises a personal -mode skill via plugin-dev:skill-development + unslop, optionally pulling fresh evidence from recent transcripts.

日本語の概要は準備中です。原文の説明を表示しています。

michael-denyer/pstack-claude1,8982026年10月13日 更新

babysit

無料

Watch an open PR — fix failing CI, handle the straightforward review comments, and drive it to a mergeable state. Claude Code analog of Cursor's built-in /babysit. Use after opening a PR when the user wants the agent to shepherd it without re-prompting.

日本語の概要は準備中です。原文の説明を表示しています。

michael-denyer/pstack-claude1,8982026年10月13日 更新

Vet a perf measurement (limiter, tuning, limits, errors, repeatability, relevance, and whether the work happened) before you report or act on it. Use when you run a benchmark or report a speedup or regression you measured.

日本語の概要は準備中です。原文の説明を表示しています。

michael-denyer/pstack-claude1,8982026年10月13日 更新

Find what a change could break somewhere else before it ships, beyond the diff, and prove the one fact it's safe because of by running real code instead of writing it up. Use for 'blast radius of X', 'what could this break', reviewing a small diff you don't trust, or a brief that asserts something about existing code ('make X public', 'X already handles Y') before you design against that assertion.

日本語の概要は準備中です。原文の説明を表示しています。

michael-denyer/pstack-claude1,8982026年10月13日 更新

michael-denyer のスキルをすべて見る

このスキルの問題を報告する