[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKJS5ZSF6H6HHTDNGYVSRS":3,"skill-same:01M7EKJS5ZSF6H6HHTDNGYVSRS":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":14,"repositoryHtmlUrl":35,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M7EKJS5ZSF6H6HHTDNGYVSRS","exp-mock-usage-analysis",null,"'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","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fcloud\u002Fexp-mock-usage-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: exp-mock-usage-analysis\ndescription: \"'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\"\ncategory: cloud\nversion: 1.0.0\ndisable-model-invocation: false\nrisk: low\nsource:\n  repository: \"microsoft\u002Fskills\"\n  commit: \"8f3b1a2c\"\n  path: \"plugins\u002Fdotnet-experimental\u002Fskills\u002Fexp-mock-usage-analysis\u002FSKILL.md\"\n  license: \"MIT\"\n  imported_at: \"2026-09-20\"\n---\n# Mock Usage Analysis\n\nTrace 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.\n\n## When to Use\n\n- User asks to audit, review, or analyze mock usage in .NET tests\n- User wants to find unused, unnecessary, or redundant mock setups\n- User wants to simplify test setup or reduce over-mocking\n- User asks whether mocks of ILogger, IOptions, or similar types are needed\n\n## When Not to Use\n\n- User wants to write new mocks or tests (general testing guidance)\n- User wants to detect non-mock test anti-patterns (use `test-anti-patterns`)\n- User wants to migrate between mock frameworks (out of scope)\n\n## Inputs\n\n| Input | Required | Description |\n|-------|----------|-------------|\n| Test code | Yes | Test files to analyze |\n| Production code | Yes | Code under test — essential for tracing execution paths |\n\n## Workflow\n\n### Step 1: Read all provided code\n\nRead 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.\n\nIdentify the mock framework by scanning for its patterns:\n- **Moq**: `new Mock\u003CT>()`, `.Setup(...)`, `.Verify(...)`\n- **NSubstitute**: `Substitute.For\u003CT>()`, `.Returns(...)`, `.Received(...)`\n- **FakeItEasy**: `A.Fake\u003CT>()`, `A.CallTo(...)`, `.MustHaveHappened()`\n\nUse the correct framework's terminology throughout your analysis.\n\n### Step 2: Trace each mock setup through the production code\n\nFor **each test method**, do the following:\n\n1. Identify every mock setup line (`.Setup`, `.Returns`, `A.CallTo`, etc.)\n2. Read the production method being tested and trace its execution path for the specific inputs used in that test\n3. Determine which mock setups are actually reached during execution\n4. Classify each setup:\n\n| Classification | Meaning | Example |\n|---------------|---------|---------|\n| **Used** | The production code calls this mock during the test's execution path | `GetStock` setup when `Reserve` is called and stock is sufficient |\n| **Unreachable** | The production code returns early, throws, or branches away before reaching this mock call | `UpdateStock` setup when the test expects the method to throw `ArgumentOutOfRangeException` on the first line |\n| **Unused** | The mock method is never called by the production method under test at all, regardless of inputs | `GetLowStockProducts` setup when testing `Reserve`, which never calls that method |\n| **Redundant** | Identical mock configurations are duplicated across multiple tests instead of being shared | Five tests each creating `new Mock\u003CIPaymentGateway>()` with the same default setup |\n\nPay special attention to:\n- **Early returns and guard clauses** — setups for mocks called after a guard clause are unreachable when the guard triggers\n- **Exception throws** — if the method throws before using dependencies, all setups for those dependencies are unnecessary\n- **Branch-specific logic** — if a method dispatches by channel\u002Ftype, setups for other channels are unused\n- **Verify-only tests** — tests that only call `.Verify`\u002F`.Received`\u002F`.MustHaveHappened` without asserting on the method's return value\n\n### Step 3: Check for replaceable mocks\n\nFlag mocks of stable framework types that should use real implementations:\n- `Mock\u003CILogger\u003CT>>` → `NullLogger\u003CT>.Instance` (unless log output is asserted)\n- `Mock\u003CIOptions\u003CT>>` → `Options.Create(new T { ... })`\n- Mocks of DTOs, records, or value objects → use `new T { ... }` directly\n\nExplicitly confirm which mocks are **correctly placed** — external boundaries (databases, HTTP clients, message queues, third-party APIs) and security-sensitive types should remain mocked.\n\n### Step 4: Report findings\n\nFor each finding, state:\n1. The specific test method and mock setup line\n2. Why the setup is unnecessary (trace the production code path to explain)\n3. A concrete fix — which lines to remove, what to replace them with, or how to extract shared setup\n\nWhen multiple tests duplicate mock configurations, provide a before\u002Fafter example showing how to extract shared setup into a fixture or helper method.\n\n## Validation\n\n- [ ] Production code was read and execution paths were traced (not just test code reviewed)\n- [ ] Every finding references a specific test method and setup line\n- [ ] Unreachable setups include an explanation of which production code path makes them unreachable\n- [ ] Correctly-placed mocks (external boundaries) are explicitly noted as appropriate\n- [ ] Correct framework terminology is used throughout (not mixing Moq\u002FNSubstitute\u002FFakeItEasy terms)\n\n## Common Pitfalls\n\n| Pitfall | Solution |\n|---------|----------|\n| Analyzing test code without reading production code | Always read the production method to trace which mocks are actually called |\n| Flagging mocks for external boundaries (HTTP, DB) | These are valid isolation boundaries — keep them mocked |\n| Flagging `ILogger` mock when log output is asserted | Only flag when the mock is set up but log output is never verified |\n| Using wrong framework terminology | Match the framework in the code: Moq (`Setup`\u002F`Verify`), NSubstitute (`Returns`\u002F`Received`), FakeItEasy (`A.CallTo`\u002F`MustHaveHappened`) |\n","# Mock Usage Analysis\n\nTrace 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.\n\n## When to Use\n\n- User asks to audit, review, or analyze mock usage in .NET tests\n- User wants to find unused, unnecessary, or redundant mock setups\n- User wants to simplify test setup or reduce over-mocking\n- User asks whether mocks of ILogger, IOptions, or similar types are needed\n\n## When Not to Use\n\n- User wants to write new mocks or tests (general testing guidance)\n- User wants to detect non-mock test anti-patterns (use `test-anti-patterns`)\n- User wants to migrate between mock frameworks (out of scope)\n\n## Inputs\n\n| Input | Required | Description |\n|-------|----------|-------------|\n| Test code | Yes | Test files to analyze |\n| Production code | Yes | Code under test — essential for tracing execution paths |\n\n## Workflow\n\n### Step 1: Read all provided code\n\nRead 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.\n\nIdentify the mock framework by scanning for its patterns:\n- **Moq**: `new Mock\u003CT>()`, `.Setup(...)`, `.Verify(...)`\n- **NSubstitute**: `Substitute.For\u003CT>()`, `.Returns(...)`, `.Received(...)`\n- **FakeItEasy**: `A.Fake\u003CT>()`, `A.CallTo(...)`, `.MustHaveHappened()`\n\nUse the correct framework's terminology throughout your analysis.\n\n### Step 2: Trace each mock setup through the production code\n\nFor **each test method**, do the following:\n\n1. Identify every mock setup line (`.Setup`, `.Returns`, `A.CallTo`, etc.)\n2. Read the production method being tested and trace its execution path for the specific inputs used in that test\n3. Determine which mock setups are actually reached during execution\n4. Classify each setup:\n\n| Classification | Meaning | Example |\n|---------------|---------|---------|\n| **Used** | The production code calls this mock during the test's execution path | `GetStock` setup when `Reserve` is called and stock is sufficient |\n| **Unreachable** | The production code returns early, throws, or branches away before reaching this mock call | `UpdateStock` setup when the test expects the method to throw `ArgumentOutOfRangeException` on the first line |\n| **Unused** | The mock method is never called by the production method under test at all, regardless of inputs | `GetLowStockProducts` setup when testing `Reserve`, which never calls that method |\n| **Redundant** | Identical mock configurations are duplicated across multiple tests instead of being shared | Five tests each creating `new Mock\u003CIPaymentGateway>()` with the same default setup |\n\nPay special attention to:\n- **Early returns and guard clauses** — setups for mocks called after a guard clause are unreachable when the guard triggers\n- **Exception throws** — if the method throws before using dependencies, all setups for those dependencies are unnecessary\n- **Branch-specific logic** — if a method dispatches by channel\u002Ftype, setups for other channels are unused\n- **Verify-only tests** — tests that only call `.Verify`\u002F`.Received`\u002F`.MustHaveHappened` without asserting on the method's return value\n\n### Step 3: Check for replaceable mocks\n\nFlag mocks of stable framework types that should use real implementations:\n- `Mock\u003CILogger\u003CT>>` → `NullLogger\u003CT>.Instance` (unless log output is asserted)\n- `Mock\u003CIOptions\u003CT>>` → `Options.Create(new T { ... })`\n- Mocks of DTOs, records, or value objects → use `new T { ... }` directly\n\nExplicitly confirm which mocks are **correctly placed** — external boundaries (databases, HTTP clients, message queues, third-party APIs) and security-sensitive types should remain mocked.\n\n### Step 4: Report findings\n\nFor each finding, state:\n1. The specific test method and mock setup line\n2. Why the setup is unnecessary (trace the production code path to explain)\n3. A concrete fix — which lines to remove, what to replace them with, or how to extract shared setup\n\nWhen multiple tests duplicate mock configurations, provide a before\u002Fafter example showing how to extract shared setup into a fixture or helper method.\n\n## Validation\n\n- [ ] Production code was read and execution paths were traced (not just test code reviewed)\n- [ ] Every finding references a specific test method and setup line\n- [ ] Unreachable setups include an explanation of which production code path makes them unreachable\n- [ ] Correctly-placed mocks (external boundaries) are explicitly noted as appropriate\n- [ ] Correct framework terminology is used throughout (not mixing Moq\u002FNSubstitute\u002FFakeItEasy terms)\n\n## Common Pitfalls\n\n| Pitfall | Solution |\n|---------|----------|\n| Analyzing test code without reading production code | Always read the production method to trace which mocks are actually called |\n| Flagging mocks for external boundaries (HTTP, DB) | These are valid isolation boundaries — keep them mocked |\n| Flagging `ILogger` mock when log output is asserted | Only flag when the mock is set up but log output is never verified |\n| Using wrong framework terminology | Match the framework in the code: Moq (`Setup`\u002F`Verify`), NSubstitute (`Returns`\u002F`Received`), FakeItEasy (`A.CallTo`\u002F`MustHaveHappened`) |\n",{"name":5,"risk":24,"source":25,"version":30,"category":31,"description":7,"disable-model-invocation":20},"low",{"path":26,"commit":27,"license":15,"repository":28,"imported_at":29},"plugins\u002Fdotnet-experimental\u002Fskills\u002Fexp-mock-usage-analysis\u002FSKILL.md","8f3b1a2c","microsoft\u002Fskills","2026-09-20","1.0.0","cloud","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fcloud\u002Fexp-mock-usage-analysis","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill exp-mock-usage-analysis",{"tool":44,"command":45},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill exp-mock-usage-analysis",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill exp-mock-usage-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fcloud\u002Fexp-mock-usage-analysis\u002FSKILL.md",true,[],[53,61,68,75,82,89],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":60},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":60},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":60},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":60},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":60},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":60},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]