Skip to main content
skill CX Codex

demock — Claude Code skill: find mocks and install

demock — a Claude Code skill that finds mocks and hidden failures on live code paths. It runs when reviewing changes, integrations, or error handling.

MIT 125 installs ★ 1,470 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add LilMGenius/paperthin --skill demock -a claude-code
Open on GitHub

What demock does

The skill looks for test doubles, placeholders, and swallowed errors that make a live code path report success without doing the real work. Its search stays within the files, directories, diff, or change named by the human.

A bundled script, node scripts/scan.mjs, gathers candidates for review. The agent checks each one and can add findings from linter rules already used by the repository. It reports the location, evidence of the live path, a classification, and a proposal: use the real dependency or surface an honest failure. Running the script requires Node.js.

Nothing changes without approval. For each approved item, the agent writes a test that fails on the double before fixing it, then reruns the repository checks. Candidates that cannot be traced to a live path are marked unverified.

What it helps with

  • spot a test double wired into a live code path
  • catch an error handler that turns failure into success
  • find a missing-key check that lets a request through
  • flag an unfinished implementation reachable from an entry point
  • replace a fake with the real dependency or an explicit failure

Example prompts for the agent

  • Check this diff for test doubles and swallowed failures on live paths.
  • Find handlers in src/api that return an empty result after an error.
  • Review error handling and integrations in src/worker before calling the change done.

How to install demock

1Skills CLI (Vercel)

npx skills add LilMGenius/paperthin --skill demock -a claude-code

2Manually: put the files in place

~/.claude/skills/demock/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/demock/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about demock

How do I install demock in Claude Code?

Run npx skills add LilMGenius/paperthin --skill demock -a claude-code. The skill is installed at ~/.claude/skills/demock/SKILL.md.

What does demock do?

It finds test doubles, misleading success results, and unfinished implementations on live code paths. For each finding, it proposes using the real dependency or surfacing the failure.

How does demock tell whether code is on a live path?

It traces calls from entry points through imports, dependency injection, and registries. A candidate whose path cannot be confirmed is marked unverified.

Source text

SKILL.md · MIT
---
name: demock
description: "Find the mocks, stubs, fakes, hidden fallbacks and placeholder implementations standing on a real code path outside the tests, where nothing real runs and a success report is false, and propose the real dependency or an honest failure for each. Use when a change or a named file, directory or diff may ship a test double or a swallowed error into production, when a catch or except returns an empty list, None, a default or true, when a guard lets a request through because its key, config or input is missing, when a function raises NotImplementedError or returns a TODO value on a live path, when a feature reports success but nothing seems to happen, or before calling work done that touched error handling, integrations or service clients."
---

Find candidates for a test double, a swallowed failure or a placeholder on the real code path with the bundled script, read each one, and propose the real dependency or an honest failure before anything is fixed.

## Goal

A real code path runs what it claims to run: a success means the work happened, and a failure surfaces with its cause. The scope is what the human named: files, directories, a diff, or the change just made. The run never picks its own target.

The run reports each finding with its location, the evidence that it is reached from the real path, its class and its proposal; then, for each item the human approved, the test that failed first and the fix. A run whose scope holds no finding changes nothing and says so.

## Workflow

1. **Split real paths from test paths first.** Read the repository's test convention from its test directories, file naming rules and test configuration. A real path is code reached from an entry point (build output, an export, a handler, a CLI): trace it through imports and calls, including what dependency injection or a registry wires in. Code nothing reaches is dead, not a finding here; report it for a cleanup pass.
2. **List candidates.** From this skill's folder run `node scripts/scan.mjs <paths...> [--test-glob <glob>]... [--json]` over the scope, adding a `--test-glob` for each test path the repository's convention names beyond the defaults. It prints each candidate outside the test paths with its file, line, kind and evidence text; `--json` prints one JSON object. Exit codes: 0 no candidate, 3 candidates, 2 a usage error. An exit of 2 is a broken run: fix the command and run again. A name match is a lead, never a verdict.
3. **Add the repository's own linter rules.** When the repository already uses a linter carrying swallowed-failure rules (ruff BLE, S110 and S112, ESLint no-empty, Go errcheck), run those rules through the repository's own scripts or locally installed binaries at the version it declares, and add their hits to the candidates. Install no new tool.
4. **Read and classify each candidate.** Class (a) is a test double on the real path. Class (b) is a false success: a catch that turns a failure into a success, logged or not, a fallback whose caller cannot tell it from the real result, or a gate on access, spending, deletion or a counted signal that lets the request through when the secret, dependency or input it checks is missing. Class (c) is a placeholder: an unfinished implementation the real path reaches. Class (d) is intended: a seam where the real implementation is chosen at runtime, a degradation the caller can see (a typed empty result, a flag, a documented status) and is designed to handle, an offline mode documented and off by default on the real path, or code a production build excludes. Keep (d) with its evidence. When reaching the real path cannot be confirmed, give the candidate its class and proposal and mark it unverified.
5. **Propose a fix for each (a), (b) and (c)**: the real dependency that should run, or an honest failure that surfaces the cause; for a gate that lets requests through, the honest failure is a denial. Never propose swapping one fake for another.
6. **Stop and report.** Report the findings and their proposals, including any pattern the script missed, and end the run. The human approves by naming the items to fix; nothing else changes.
7. **Fix one approved item at a time.** First write a test that fails on the fake, proving the real path runs or the failure surfaces; then fix the item and rerun the repository's checks.

## Rules

- The scope is what the human named. Never widen it or choose a target on your own.
- The script owns the candidate patterns and the default test conventions; a pattern it missed is proposed as a script change with a test, under the same approval as a fix.
- Test doubles inside tests are left alone.
- A log followed by a rethrow at a boundary is an honest failure and stays.
- A fix replaces a fake with the real dependency or an honest failure, never with another fake.
- Nothing is fixed without the human's approval, and each fix has a test that failed first.
- A run with no finding changes nothing.
- Vocabulary for the doubles follows Gerard Meszaros's test double taxonomy (dummy, stub, spy, mock, fake) and Martin Fowler's "Mocks Aren't Stubs".

## Verification

Before finishing, confirm:

1. Every finding has its location, the evidence that it reaches the real path or its unverified mark, its class and its proposal.
2. No file was changed without the human's approval.
3. Every applied fix has a test that failed first.

© LilMGenius · MIT · LilMGenius/paperthin

Similar skills

All skills for Code review and refactoring →

From the same set48

The whole set →
re0-watch re0-watch — a skill for Claude Code that watches long-running agent jobs for stalls and generates recovery proposals for human approval. CX Codex +1 129installs ssotize-local The ssotize-local Claude Code skill consolidates duplicate files or directories under one canonical path using filesystem links. It runs for disk deduplication when multiple paths must resolve to the same data. CX Codex +1 129installs elon The elon skill audits requirements and commitments in Claude Code using Musk's five-step algorithm. It runs when reviewing backlogs or specs. CX Codex +1 129installs re0-readme re0-readme is a Claude Code skill that audits and aligns a repository's README, AGENTS.md, and manifests. It runs when updating or reviewing documentation. CX Codex +1 126installs whychk whychk — a skill for Claude Code and Codex that challenges freshly made choices. An isolated sub-session identifies unstated assumptions, demanding explanations one gap at a time. CX Codex +1 123installs re0-decide re0-decide — a skill for Claude Code that turns proposal materials into a traceable decision instrument without recommending outcomes. CX Codex +1 123installs re0-squash The re0-squash Claude Code skill condenses a GitHub repository into one signed commit, then recreates its remote. It runs on an explicit request to replace a repository’s history. CX Codex +1 123installs scopechk scopechk is a Claude Code skill that checks whether an item falls within a target repository scope. Run it before adding or moving a module into a repository. CX Codex +1 123installs

Project sponsors

Companies that keep this analytics open