{"slug":"demock","title":"demock","summary":"Find mocks, stubs, fakes, fallbacks and placeholders on a real path when a change, file, diff or deployment may ship a test double or swallowed error. It reads code, hosted settings and deployed files outside the tests, where a success report is false, and proposes the real depen","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-12-04T19:25:14.058142Z","repo":{"url":"https://github.com/LilMGenius/paperthin","stars":1490,"forks":125,"license":"MIT","updatedAt":"2026-12-04T18:12:19Z"},"bodyHtml":"<hr>\n<h2>name: demock\ndescription: \"Find mocks, stubs, fakes, fallbacks and placeholders on a real path when a change, file, diff or deployment may ship a test double or swallowed error. It reads code, hosted settings and deployed files outside the tests, where a success report is false, and proposes the real dependency or an honest failure for each. Also use when a catch returns an empty value, None or true, when a guard lets a request through or a setting falls back to localhost or a sample secret because its key is missing, when a sign-in return address, allow list, mail template or deployed bundle may keep localhost or a vendor's development value, when a function raises NotImplementedError or returns a TODO, when a feature reports success but nothing happens, or before calling error handling or integrations done.\"</h2>\n<p>Read the named scope (code, the settings a hosted service it depends on keeps, or the files its deployment serves) for a test double, a swallowed failure, a development default or a placeholder on the real path, starting from the bundled script's candidates, and propose the real dependency or an honest failure before anything is fixed.</p>\n<h2>Goal</h2>\n<p>A real code path runs what it claims to run: a success means the work happened, and a failure surfaces with its cause. The path runs with more than its source: the settings a hosted service it depends on keeps, and the files its deployment serves. The scope is what the human named: files, directories, a diff, a deployment, or the change just made. The run never picks its own target. When no scope is named and no change was just made, the run asks for the scope before doing anything else.</p>\n<p>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.</p>\n<h2>Workflow</h2>\n<ol>\n<li><strong>Split real paths from test paths first.</strong> 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; note it separately as dead code.</li>\n<li><strong>Sweep the settings the real path runs with.</strong> Read the configuration a real environment loads (settings modules, environment files, deploy and container manifests, the release job) and list the variables each one sets. A default the code supplies for a variable reaches the real path in every environment whose configuration leaves that variable unset; when the repository holds no real environment's configuration, the default's reach is unverified. A default whose variable every real environment's configuration sets is not reached and is no finding: report it as not reached, citing the configuration line that sets it, and offer at most a startup failure for when the variable goes missing.</li>\n<li><strong>Probe the hosted settings a named deployment runs with.</strong> When the scope names a deployment (its address, or the hosting project that serves it), read what it runs with outside the repository as it answers now, never from its docs, a copy of its settings taken earlier or the source that built it; a scope of code alone skips this step and the next. The hosted services to probe are the ones whose addresses and keys steps 1 and 2 found on the real path. Such a service (an auth provider, a mail sender, a storage bucket) keeps its own settings: return addresses, message templates, allow lists. A value its vendor ships there for development (a local address, the vendor's sample sender or template) is a development default like any the code supplies, and lives in no file. Read those settings from what the service answers a request without credentials (a public settings or discovery document), and send an input that forces a fallback (a sign-in callback with a wrong state, a return address the allow list should refuse) to read where the answer sends you. The run sends no credentials, even ones it holds, so it never reads a dashboard or any other signed-in page itself: a value only a signed-in read shows (a template behind a sign-in, an allow list the service does not publish) is listed as not measured, with the read it would take, for the human to make. Every request only reads or is built to be refused, and its refusal comes from an input check the service runs before it acts (a malformed address, a password too short to accept, a state that matches nothing), never from a rule it applies once it has acted: none creates an account, sends a message or changes a setting. A request that does create, send or change something ends the probing: send no further request, report exactly what it made, and leave undoing it to the service's owner.</li>\n<li><strong>Save what the named deployment serves.</strong> Save the pages the scope names, the bundles and public files they load, and the response headers of those pages and of step 3's requests to a scratch folder outside the repository, since a build can inline a host its source reads from a variable and a redirect carries its return address in a header.</li>\n<li><strong>List candidates.</strong> With the repository root as the working directory, run the bundled script by its path, <code>node &lt;this skill's folder&gt;/scripts/scan.mjs &lt;paths...&gt; [--test-glob &lt;glob&gt;]... [--json]</code>, over the scope, adding a <code>--test-glob</code> for each test path the repository's convention names beyond the defaults; a glob with a slash names a path from the repository root. It prints each candidate outside the test paths with its file, line, kind and evidence text; <code>--json</code> prints one JSON object. That run reads source files only, chosen by extension, and skips <code>node_modules</code>, <code>dist</code> and <code>build</code>, so it never reads a page, public file or build output. Run <code>node &lt;this skill's folder&gt;/scripts/scan.mjs &lt;folders...&gt; --deployed [--json]</code> over each folder of served files: the scratch folder step 4 saved, and any folder in the scope that the real path ships as served files (a public folder, a build output already in the scope; the run never builds one). It reads every text file there, whatever its name or folder, and lists each local, private-network, development-labelled or documentation host (example.com and the other reserved names) it names with the text around it. Exit codes: 0 no candidate, 3 candidates, 4 nothing was scanned because every file read as a test path (or, with <code>--deployed</code>, no text file was found), 2 a usage error or an unreadable file. An exit of 2 or 4 is a broken run: fix the command, its working directory, a <code>--test-glob</code> or what step 4 saved, and run again. A name match is a lead, never a verdict.</li>\n<li><strong>Add the repository's own linter rules.</strong> When the repository already uses a linter carrying swallowed-failure or insecure-default rules (ruff BLE, S110, S112, S105, S201 and S501, ESLint no-empty, Go errcheck and gosec G402), 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.</li>\n<li><strong>Read everything in the scope and classify what you find.</strong> Read each handler, catch or except, guard and settings lookup, and each value step 3 or a <code>--deployed</code> scan brought back, using the candidates as a starting list; a stand-in neither the script nor a linter listed is classified like any other. A host in a served file reaches the real path when a page the real path serves loads that file, by a tag or a script's request, and the code around the host sends a request there or hands it to the browser. A library's built-in default (a client's fallback to a local address) that a setting the deployment passes the library replaces is not reached, even though the code around it would send a request there: it is no finding, and is reported as not reached, citing the served text or hosted setting that replaces it, as step 2 cites a configuration line. 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, a development default the real path runs with (a local address or a sample secret standing in for an unset variable, debug mode on, a certificate check off), 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. A (d) item is no finding: report it apart from the findings, with its evidence. When reaching the real path cannot be confirmed, give the candidate its class and proposal and mark it unverified.</li>\n<li><strong>Propose a fix for each (a), (b) and (c)</strong>: 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. A development default gives way to the value the real environment sets, read with no fallback so that startup fails and names the variable when it is unset. A hosted service's development default gives way to the value the deployment needs, set in that service by whoever owns it. Never propose swapping one fake for another.</li>\n<li><strong>Stop and report.</strong> Report the findings and their proposals, marking as missed by the script each finding in a file it scanned that it did not list, and end the run. The human approves by naming the items to fix; nothing else changes.</li>\n<li><strong>Fix one approved item at a time.</strong> 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. For a value step 3 or a <code>--deployed</code> scan brought back, the request or scan that showed the wrong value is the test that fails first, and the run repeats it once the change is deployed. A value traced to this repository's source, or to a build variable its configuration sets, is fixed here like any code item, at the line that sets it. A value set outside the repository, in a hosted service or the hosting platform's own settings, is changed by whoever owns them. A fix changes only what its item needs; a related change to docs, configuration or another item is proposed, not made.</li>\n</ol>\n<h2>Rules</h2>\n<ul>\n<li>The scope is what the human named. Never widen it or choose a target on your own; an entry point or an environment's configuration outside it is read as evidence of reach, and findings come only from the scope.</li>\n<li>A stand-in seen outside the scope while tracing reach gets at most one line, under its own heading after the findings, that names its file and offers a separate run; it is never a finding, a class, a proposal or an edit.</li>\n<li>A table that copies by hand facts another system owns (a redirect map, a route list) is duplication, which <code>ssotize</code> owns, so the run never goes looking for stale entries. An entry holding a development default is classified like any other. An entry that the run's own reading already shows gone stale (a step 3 request, or the owning system's source or credential-free answer read while tracing reach) is named in one line under a heading \"Stale copies\" after the findings, with the system that owns its facts.</li>\n<li>The script owns the candidate patterns and the default test conventions. A finding it missed is marked so in the report, for whoever maintains this skill; the run never edits the script.</li>\n<li>Test doubles inside tests are left alone.</li>\n<li>A log followed by a rethrow at a boundary is an honest failure and stays.</li>\n<li>A fix replaces a fake with the real dependency or an honest failure, never with another fake.</li>\n<li>Nothing is fixed without the human's approval, and each fix has a test that failed first.</li>\n<li>A run with no finding changes nothing.</li>\n<li>Vocabulary for the doubles follows Gerard Meszaros's test double taxonomy (dummy, stub, spy, mock, fake) and Martin Fowler's \"Mocks Aren't Stubs\".</li>\n</ul>\n<h2>Verification</h2>\n<p>Before finishing, confirm:</p>\n<ol>\n<li>Every (a), (b) and (c) finding has its location, the evidence that it reaches the real path or its unverified mark, its class and its proposal; every (d) item has its evidence.</li>\n<li>Every deployment value step 3 could not read is listed as not measured, with what reading it would take.</li>\n<li>No file was changed without the human's approval.</li>\n<li>No request to a deployment or a hosted service it depends on created, sent or changed anything; one that did is reported with exactly what it made, and no request followed it.</li>\n<li>Every applied fix has a test that failed first.</li>\n</ol>\n","files":[{"path":"agents/openai.yaml","sizeBytes":217,"isText":true},{"path":"scripts/scan.mjs","sizeBytes":23753,"isText":false},{"path":"scripts/scan.test.mjs","sizeBytes":16460,"isText":false},{"path":"SKILL.md","sizeBytes":12979,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-12-04T19:25:57.291501Z","sha256":"39195ABCA2B95E855E18A7504984D5AD5E7A77C030A61F8D9CAB0501467D0311","sizeBytes":19019},"review":null,"source":{"repositoryUrl":"https://github.com/LilMGenius/paperthin","path":"skills/depth/demock","license":"MIT","commit":"dd00a4a9377cf5409f75ca16c15a90c33ac225d1","subtreeSha":"E1670B0D3AFFB274FDBB50E16A6A6825F902B6E6D0FFCBA672CC9BC8B24A92CD","lastSyncedAt":"2026-12-04T19:25:06.052327Z"},"reviewedAt":"2026-12-04T19:26:55.682999Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/LilMGenius/paperthin/tree/main/skills/depth/demock"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install lilmgenius-paperthin@llmmart"},{"target":"git","command":"git clone https://github.com/LilMGenius/paperthin.git"}]}