mock-detection

mock-detection is a skill for Claude Code from ashaykubal/essential-agents-skills. It costs 13 tokens per session (4,129 once invoked), scanned A, a copy of mock-detection, MIT.

An internal analysis prompt for checking whether test mocks are appropriate. A mock is a fake dependency used in a test instead of the real component.

In plain words
What is it for?
Use it inside a test-audit process to examine flagged test files and report mock-related violations for a later summary.
Why use it?
It helps find tests that appear to pass because they replace too much real behavior with fakes, including issues traced through the code's call paths.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions subagents.

Good fit Use it inside a test-audit process to examine flagged test files and report mock-related violations for a later summary.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashaykubal/essential-agents-skills/mock-detection
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ashaykubal/essential-agents-skills --skill mock-detection
Clone the repo
git clone --depth 1 https://github.com/ashaykubal/essential-agents-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mock-detection

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashaykubal/essential-agents-skills/mock-detection/github.svg)](https://agentmods.dev/skills/ashaykubal/essential-agents-skills/mock-detection)
Your own site
<a href="https://agentmods.dev/skills/ashaykubal/essential-agents-skills/mock-detection"><img src="https://agentmods.dev/badge/skills/ashaykubal/essential-agents-skills/mock-detection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mock-detection

Your own site · 80×15
<a href="https://agentmods.dev/skills/ashaykubal/essential-agents-skills/mock-detection"><img src="https://agentmods.dev/badge/skills/ashaykubal/essential-agents-skills/mock-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,129 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 88% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.04129
Opus 5 $0.00006 $0.02065
Sonnet 5 $0.00003 $0.00826
Haiku 4.5 $0.00001 $0.00413

Measured 11d ago against content hash 94406ff89eb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

mock-detection scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

const mockSpawn = jest.spyOn(child_process, 'spawn')
Origin

This is a copy

88% identical to mock-detection — 1,044 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/mock-detection/SKILL.md · 512 lines

How it starts

The opening of the file, as written. The whole thing — 512 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mock Detection

Prompt template for deep mock appropriateness analysis using call graph tracing. Designed for a Sonnet sub-agent to detect T1-T4 violations and track violation scope.


When to Use This Skill

This is an internal skill loaded by the orchestrator during Test Audit pipeline.

Context Action
/test-audit invoked Orchestrator loads this skill for Stage 2
Test Audit pipeline triggered by hook Orchestrator loads this skill for Stage 2
Need deep mock analysis Load directly as prompt template for Sonnet
Files flagged by test-classification Analyze only needs_deep_analysis: true files

DO NOT use for:

  • Direct user invocation (not user-invocable)
  • Surface-level classification (use test-classification skill)
  • Full audit synthesis (use test-audit skill)

Role in Test Audit Pipeline

This skill provides the second stage prompt template:

test-audit (P0.8) orchestrates:
  Stage 1: test-classification (Haiku) → classification YAML
  Stage 2: mock-detection (Sonnet) → violations YAML    ← THIS SKILL
  Stage 3: synthesis (Sonnet) → audit report

The orchestrator loads this skill and constructs a 4-part prompt for a general-purpose Sonnet sub-agent.


4-Part Prompt Template

GOAL

Analyze flagged test files for T1-T4 violations using mock appropriateness rubric and call graph analysis. Track the full scope of each violation for test effectiveness calculation.

CONSTRAINTS

  • Do NOT modify any files
  • Only analyze files with needs_deep_analysis: true from classification
  • Use call graph analysis to detect broken integration chains
  • Track violation scope (all affected lines, not just violation line)
  • Provide full context for each violation (line, snippet, reason, fix)
  • Complete within 50 tool calls

CONTEXT

Classification output: {classification_yaml_path}

Files to analyze: List of files with needs_deep_analysis: true

Read the full file on GitHub · 512 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 512 lines · 13 tokens per session scan A 94406ff89eb5

Subscribe to this mod's changes

mock-detection is a skill published in the GitHub repository ashaykubal/essential-agents-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 13 tokens to every session and 4,129 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). It is 88% identical to mock-detection, differing in 1,044 lines, and is treated as a copy.