Agent skill · Security

exp-mock-usage-analysis

Audits .NET test mock usage by tracing each mock setup through the production code's execution path to find dead, unreachable, redundant, or replaceable mocks. Use when the user asks to audit mock usage, find unused or unnecessary mock setups, check if mocks are needed, reduce mock duplication or over-mocking, simplify test setup, or review whether mock configurations like ILogger/IOptions should use real implementations instead. Supports Moq, NSubstitute, and FakeItEasy.

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill exp-mock-usage-analysis --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 6 KB
Bundled scripts: none
Path: plugins/dotnet-experimental/skills/exp-mock-usage-analysis/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Mock Usage Analysis Trace each mock setup through the production code's execution path to determine which setups are actually exercised at runtime and which are dead, unreachable, redundant, or replaceable with real implementations. ## When to Use - User asks to audit, review, or analyze mock usage in .NET tests - User wants to find unused, unnecessary, or redundant mock setups - User wants to simplify test setup or reduce over-mocking - User asks whether mocks of ILogger, IOptions, or similar types are needed ## When Not to Use - User wants to write new mocks or tests (general testing guidance) - User wants to detect non-mock test anti-patterns (use `test-anti-patterns`) - User wants to migrate between mock frameworks (out of scope) ## Inputs | Input | Required | Description | |-------|----------|-------------| | Test code | Yes | Test files to analyze | | Production code | Yes | Code under test — essential for tracing execution paths | ## Workflow ### Step 1: Read all provided code Read the test files and **always** read the production code. You cannot determine whether a mock setup is necessary without understanding the production method's control flow. Identify the mock frame

What's inside
Steps it walks through
  1. When to Use
  2. When Not to Use
  3. Inputs
  4. Workflow
  5. Step 1: Read all provided code
  6. Step 2: Trace each mock setup through the production code
  7. Step 3: Check for replaceable mocks
  8. Step 4: Report findings
  9. Validation
  10. Common Pitfalls
More from skills
All skills →
About this skill
What does the exp-mock-usage-analysis skill do?

Audits .NET test mock usage by tracing each mock setup through the production code's execution path to find dead, unreachable, redundant, or replaceable mocks. Use when the user asks to audit mock usage, find unused or unnecessary mock setups, check if mocks are needed, reduce mock duplication or over-mocking, simplify test setup, or review whether mock configurations like ILogger/IOptions should use real implementations instead. Supports Moq, NSubstitute, and FakeItEasy.

How do I install it?

Run `npx skills add dotnet/skills --skill exp-mock-usage-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going