agentleFS
imMamdouhaboammarimMamdouhaboammar/anti-slop-engineering/skills/demock-guard/SKILL.md

demock-guard

Skill4 starsChanged 31 days agoMITView on GitHub

Detect and eliminate test doubles on production paths, silent dummy fallbacks (e.g. SQLite fallbacks in Supabase apps), fail-open authorization gates, and placeholder stubs.

The file

Files
SKILL.md

Demock & Silent-Fallback Guard

Eliminate phantom mocks on live paths, silent exception swallowing with dummy data, and fake persistence fallbacks.

Why This Skill Is Needed & Target State

AI code generators often insert silent fallbacks to make a broken system appear to work:

  1. Falling back to local SQLite or in-memory dictionaries when a database connection fails (hiding outages and creating data split-brain).
  2. Catch blocks that swallow exceptions and return dummy empty arrays or mock objects (catch { return [{ id: 1, name: "Sample" }]; }).
  3. Instantiating Mock* or Fake* doubles in non-test runtime modules.
  4. Security/auth checks that return true when credentials or tokens are missing.

The target state is fail-closed, honest engineering: production paths either execute their real dependencies or surface explicit, actionable failures with exact RFC 9457 error contracts.

Invariant Rules

  1. Fail-Closed by Default: External dependency outages must never be silently masked with dummy fallback objects. Fail closed or degrade gracefully with visible caller-facing status.
  2. Zero Test Doubles in Runtime: Mock*, MagicMock, Fake*, and test framework doubles are strictly banned in production files.
  3. No Auth Bypass: Missing credentials must return 401/403 or throw AuthenticationError, never return true.

CLI Usage

# Scan git diff against base commit
bunx anti-slop-engineering demock --base HEAD

# Scan specific files or directories with JSON output
bunx anti-slop-engineering demock src/ --json --strict

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.