Mock Stub Designer

Installation
SKILL.md

Mock Stub Designer

A test double exists to make a test fast, deterministic, and focused - never to mock everything in sight. Over-mocking yields tautological tests that pass against a broken system because they only verify the mocks. This skill decides, per dependency, the weakest double that still isolates the boundary, so the test exercises real behavior everywhere else.

Operating procedure

Step 1: Gather inputs

Collect before designing anything:

  1. The unit under test and the behavior being verified (one sentence).
  2. Every dependency the code touches, direct and transitive-at-the-boundary: HTTP/third-party APIs, payment/email/SMS SDKs, database, filesystem, clock, randomness, queues.
  3. Language and test stack (this picks the wire-interception tool: nock or msw for JS, WireMock for JVM, VCR-style cassettes for Ruby/Python, responses/respx for Python).
  4. Whether a sandbox environment exists for the critical integration backstop.

If the dependency list is unknown, trace the code first - guessing the boundary list is how internal collaborators end up mocked.

Step 2: Classify each dependency

For each dependency: external boundary you do not own (third-party HTTP, payment/email/SMS SDK, clock, randomness, filesystem, network) versus your own code (domain objects, pure functions, cheap deterministic collaborators). Double only the boundaries you do not own or cannot control. Use the real thing for your own domain objects - mocking them turns the test into a tautology.

Installs
–
GitHub Stars
19
First Seen
–