[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-dotnet-exp-mock-usage-analysis":3,"mdc--245gud-key":37,"related-repo-dotnet-exp-mock-usage-analysis":918,"related-org-dotnet-exp-mock-usage-analysis":1023},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":32,"sourceUrl":35,"mdContent":36},"exp-mock-usage-analysis","audit .NET test mock usage","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\u002FIOptions should use real implementations instead. Supports Moq, NSubstitute, and FakeItEasy.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"dotnet",".NET (Microsoft)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fdotnet.png",[12,16,19,22],{"name":13,"slug":14,"type":15},".NET","net","tag",{"name":17,"slug":18,"type":15},"Code Analysis","code-analysis",{"name":20,"slug":21,"type":15},"Testing","testing",{"name":23,"slug":24,"type":15},"Debugging","debugging",4576,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills","2026-07-15T06:03:40.567264","MIT",332,[31],"agent-skills",{"repoUrl":26,"stars":25,"forks":29,"topics":33,"description":34},[31],"Repository for skills to assist AI coding agents with .NET and C#","https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fdotnet-experimental\u002Fskills\u002Fexp-mock-usage-analysis","---\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 are needed, reduce mock duplication or over-mocking, simplify test setup, or review whether mock configurations like ILogger\u002FIOptions should use real implementations instead. Supports Moq, NSubstitute, and FakeItEasy.\"\nlicense: MIT\n---\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",{"data":38,"body":39},{"name":4,"description":6,"license":28},{"type":40,"children":41},"root",[42,51,57,64,89,95,122,128,196,202,209,222,227,319,324,330,342,388,548,553,619,625,630,681,693,699,704,722,727,733,787,793],{"type":43,"tag":44,"props":45,"children":47},"element","h1",{"id":46},"mock-usage-analysis",[48],{"type":49,"value":50},"text","Mock Usage Analysis",{"type":43,"tag":52,"props":53,"children":54},"p",{},[55],{"type":49,"value":56},"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.",{"type":43,"tag":58,"props":59,"children":61},"h2",{"id":60},"when-to-use",[62],{"type":49,"value":63},"When to Use",{"type":43,"tag":65,"props":66,"children":67},"ul",{},[68,74,79,84],{"type":43,"tag":69,"props":70,"children":71},"li",{},[72],{"type":49,"value":73},"User asks to audit, review, or analyze mock usage in .NET tests",{"type":43,"tag":69,"props":75,"children":76},{},[77],{"type":49,"value":78},"User wants to find unused, unnecessary, or redundant mock setups",{"type":43,"tag":69,"props":80,"children":81},{},[82],{"type":49,"value":83},"User wants to simplify test setup or reduce over-mocking",{"type":43,"tag":69,"props":85,"children":86},{},[87],{"type":49,"value":88},"User asks whether mocks of ILogger, IOptions, or similar types are needed",{"type":43,"tag":58,"props":90,"children":92},{"id":91},"when-not-to-use",[93],{"type":49,"value":94},"When Not to Use",{"type":43,"tag":65,"props":96,"children":97},{},[98,103,117],{"type":43,"tag":69,"props":99,"children":100},{},[101],{"type":49,"value":102},"User wants to write new mocks or tests (general testing guidance)",{"type":43,"tag":69,"props":104,"children":105},{},[106,108,115],{"type":49,"value":107},"User wants to detect non-mock test anti-patterns (use ",{"type":43,"tag":109,"props":110,"children":112},"code",{"className":111},[],[113],{"type":49,"value":114},"test-anti-patterns",{"type":49,"value":116},")",{"type":43,"tag":69,"props":118,"children":119},{},[120],{"type":49,"value":121},"User wants to migrate between mock frameworks (out of scope)",{"type":43,"tag":58,"props":123,"children":125},{"id":124},"inputs",[126],{"type":49,"value":127},"Inputs",{"type":43,"tag":129,"props":130,"children":131},"table",{},[132,156],{"type":43,"tag":133,"props":134,"children":135},"thead",{},[136],{"type":43,"tag":137,"props":138,"children":139},"tr",{},[140,146,151],{"type":43,"tag":141,"props":142,"children":143},"th",{},[144],{"type":49,"value":145},"Input",{"type":43,"tag":141,"props":147,"children":148},{},[149],{"type":49,"value":150},"Required",{"type":43,"tag":141,"props":152,"children":153},{},[154],{"type":49,"value":155},"Description",{"type":43,"tag":157,"props":158,"children":159},"tbody",{},[160,179],{"type":43,"tag":137,"props":161,"children":162},{},[163,169,174],{"type":43,"tag":164,"props":165,"children":166},"td",{},[167],{"type":49,"value":168},"Test code",{"type":43,"tag":164,"props":170,"children":171},{},[172],{"type":49,"value":173},"Yes",{"type":43,"tag":164,"props":175,"children":176},{},[177],{"type":49,"value":178},"Test files to analyze",{"type":43,"tag":137,"props":180,"children":181},{},[182,187,191],{"type":43,"tag":164,"props":183,"children":184},{},[185],{"type":49,"value":186},"Production code",{"type":43,"tag":164,"props":188,"children":189},{},[190],{"type":49,"value":173},{"type":43,"tag":164,"props":192,"children":193},{},[194],{"type":49,"value":195},"Code under test — essential for tracing execution paths",{"type":43,"tag":58,"props":197,"children":199},{"id":198},"workflow",[200],{"type":49,"value":201},"Workflow",{"type":43,"tag":203,"props":204,"children":206},"h3",{"id":205},"step-1-read-all-provided-code",[207],{"type":49,"value":208},"Step 1: Read all provided code",{"type":43,"tag":52,"props":210,"children":211},{},[212,214,220],{"type":49,"value":213},"Read the test files and ",{"type":43,"tag":215,"props":216,"children":217},"strong",{},[218],{"type":49,"value":219},"always",{"type":49,"value":221}," read the production code. You cannot determine whether a mock setup is necessary without understanding the production method's control flow.",{"type":43,"tag":52,"props":223,"children":224},{},[225],{"type":49,"value":226},"Identify the mock framework by scanning for its patterns:",{"type":43,"tag":65,"props":228,"children":229},{},[230,261,290],{"type":43,"tag":69,"props":231,"children":232},{},[233,238,240,246,248,254,255],{"type":43,"tag":215,"props":234,"children":235},{},[236],{"type":49,"value":237},"Moq",{"type":49,"value":239},": ",{"type":43,"tag":109,"props":241,"children":243},{"className":242},[],[244],{"type":49,"value":245},"new Mock\u003CT>()",{"type":49,"value":247},", ",{"type":43,"tag":109,"props":249,"children":251},{"className":250},[],[252],{"type":49,"value":253},".Setup(...)",{"type":49,"value":247},{"type":43,"tag":109,"props":256,"children":258},{"className":257},[],[259],{"type":49,"value":260},".Verify(...)",{"type":43,"tag":69,"props":262,"children":263},{},[264,269,270,276,277,283,284],{"type":43,"tag":215,"props":265,"children":266},{},[267],{"type":49,"value":268},"NSubstitute",{"type":49,"value":239},{"type":43,"tag":109,"props":271,"children":273},{"className":272},[],[274],{"type":49,"value":275},"Substitute.For\u003CT>()",{"type":49,"value":247},{"type":43,"tag":109,"props":278,"children":280},{"className":279},[],[281],{"type":49,"value":282},".Returns(...)",{"type":49,"value":247},{"type":43,"tag":109,"props":285,"children":287},{"className":286},[],[288],{"type":49,"value":289},".Received(...)",{"type":43,"tag":69,"props":291,"children":292},{},[293,298,299,305,306,312,313],{"type":43,"tag":215,"props":294,"children":295},{},[296],{"type":49,"value":297},"FakeItEasy",{"type":49,"value":239},{"type":43,"tag":109,"props":300,"children":302},{"className":301},[],[303],{"type":49,"value":304},"A.Fake\u003CT>()",{"type":49,"value":247},{"type":43,"tag":109,"props":307,"children":309},{"className":308},[],[310],{"type":49,"value":311},"A.CallTo(...)",{"type":49,"value":247},{"type":43,"tag":109,"props":314,"children":316},{"className":315},[],[317],{"type":49,"value":318},".MustHaveHappened()",{"type":43,"tag":52,"props":320,"children":321},{},[322],{"type":49,"value":323},"Use the correct framework's terminology throughout your analysis.",{"type":43,"tag":203,"props":325,"children":327},{"id":326},"step-2-trace-each-mock-setup-through-the-production-code",[328],{"type":49,"value":329},"Step 2: Trace each mock setup through the production code",{"type":43,"tag":52,"props":331,"children":332},{},[333,335,340],{"type":49,"value":334},"For ",{"type":43,"tag":215,"props":336,"children":337},{},[338],{"type":49,"value":339},"each test method",{"type":49,"value":341},", do the following:",{"type":43,"tag":343,"props":344,"children":345},"ol",{},[346,373,378,383],{"type":43,"tag":69,"props":347,"children":348},{},[349,351,357,358,364,365,371],{"type":49,"value":350},"Identify every mock setup line (",{"type":43,"tag":109,"props":352,"children":354},{"className":353},[],[355],{"type":49,"value":356},".Setup",{"type":49,"value":247},{"type":43,"tag":109,"props":359,"children":361},{"className":360},[],[362],{"type":49,"value":363},".Returns",{"type":49,"value":247},{"type":43,"tag":109,"props":366,"children":368},{"className":367},[],[369],{"type":49,"value":370},"A.CallTo",{"type":49,"value":372},", etc.)",{"type":43,"tag":69,"props":374,"children":375},{},[376],{"type":49,"value":377},"Read the production method being tested and trace its execution path for the specific inputs used in that test",{"type":43,"tag":69,"props":379,"children":380},{},[381],{"type":49,"value":382},"Determine which mock setups are actually reached during execution",{"type":43,"tag":69,"props":384,"children":385},{},[386],{"type":49,"value":387},"Classify each setup:",{"type":43,"tag":129,"props":389,"children":390},{},[391,412],{"type":43,"tag":133,"props":392,"children":393},{},[394],{"type":43,"tag":137,"props":395,"children":396},{},[397,402,407],{"type":43,"tag":141,"props":398,"children":399},{},[400],{"type":49,"value":401},"Classification",{"type":43,"tag":141,"props":403,"children":404},{},[405],{"type":49,"value":406},"Meaning",{"type":43,"tag":141,"props":408,"children":409},{},[410],{"type":49,"value":411},"Example",{"type":43,"tag":157,"props":413,"children":414},{},[415,450,485,519],{"type":43,"tag":137,"props":416,"children":417},{},[418,426,431],{"type":43,"tag":164,"props":419,"children":420},{},[421],{"type":43,"tag":215,"props":422,"children":423},{},[424],{"type":49,"value":425},"Used",{"type":43,"tag":164,"props":427,"children":428},{},[429],{"type":49,"value":430},"The production code calls this mock during the test's execution path",{"type":43,"tag":164,"props":432,"children":433},{},[434,440,442,448],{"type":43,"tag":109,"props":435,"children":437},{"className":436},[],[438],{"type":49,"value":439},"GetStock",{"type":49,"value":441}," setup when ",{"type":43,"tag":109,"props":443,"children":445},{"className":444},[],[446],{"type":49,"value":447},"Reserve",{"type":49,"value":449}," is called and stock is sufficient",{"type":43,"tag":137,"props":451,"children":452},{},[453,461,466],{"type":43,"tag":164,"props":454,"children":455},{},[456],{"type":43,"tag":215,"props":457,"children":458},{},[459],{"type":49,"value":460},"Unreachable",{"type":43,"tag":164,"props":462,"children":463},{},[464],{"type":49,"value":465},"The production code returns early, throws, or branches away before reaching this mock call",{"type":43,"tag":164,"props":467,"children":468},{},[469,475,477,483],{"type":43,"tag":109,"props":470,"children":472},{"className":471},[],[473],{"type":49,"value":474},"UpdateStock",{"type":49,"value":476}," setup when the test expects the method to throw ",{"type":43,"tag":109,"props":478,"children":480},{"className":479},[],[481],{"type":49,"value":482},"ArgumentOutOfRangeException",{"type":49,"value":484}," on the first line",{"type":43,"tag":137,"props":486,"children":487},{},[488,496,501],{"type":43,"tag":164,"props":489,"children":490},{},[491],{"type":43,"tag":215,"props":492,"children":493},{},[494],{"type":49,"value":495},"Unused",{"type":43,"tag":164,"props":497,"children":498},{},[499],{"type":49,"value":500},"The mock method is never called by the production method under test at all, regardless of inputs",{"type":43,"tag":164,"props":502,"children":503},{},[504,510,512,517],{"type":43,"tag":109,"props":505,"children":507},{"className":506},[],[508],{"type":49,"value":509},"GetLowStockProducts",{"type":49,"value":511}," setup when testing ",{"type":43,"tag":109,"props":513,"children":515},{"className":514},[],[516],{"type":49,"value":447},{"type":49,"value":518},", which never calls that method",{"type":43,"tag":137,"props":520,"children":521},{},[522,530,535],{"type":43,"tag":164,"props":523,"children":524},{},[525],{"type":43,"tag":215,"props":526,"children":527},{},[528],{"type":49,"value":529},"Redundant",{"type":43,"tag":164,"props":531,"children":532},{},[533],{"type":49,"value":534},"Identical mock configurations are duplicated across multiple tests instead of being shared",{"type":43,"tag":164,"props":536,"children":537},{},[538,540,546],{"type":49,"value":539},"Five tests each creating ",{"type":43,"tag":109,"props":541,"children":543},{"className":542},[],[544],{"type":49,"value":545},"new Mock\u003CIPaymentGateway>()",{"type":49,"value":547}," with the same default setup",{"type":43,"tag":52,"props":549,"children":550},{},[551],{"type":49,"value":552},"Pay special attention to:",{"type":43,"tag":65,"props":554,"children":555},{},[556,566,576,586],{"type":43,"tag":69,"props":557,"children":558},{},[559,564],{"type":43,"tag":215,"props":560,"children":561},{},[562],{"type":49,"value":563},"Early returns and guard clauses",{"type":49,"value":565}," — setups for mocks called after a guard clause are unreachable when the guard triggers",{"type":43,"tag":69,"props":567,"children":568},{},[569,574],{"type":43,"tag":215,"props":570,"children":571},{},[572],{"type":49,"value":573},"Exception throws",{"type":49,"value":575}," — if the method throws before using dependencies, all setups for those dependencies are unnecessary",{"type":43,"tag":69,"props":577,"children":578},{},[579,584],{"type":43,"tag":215,"props":580,"children":581},{},[582],{"type":49,"value":583},"Branch-specific logic",{"type":49,"value":585}," — if a method dispatches by channel\u002Ftype, setups for other channels are unused",{"type":43,"tag":69,"props":587,"children":588},{},[589,594,596,602,604,610,611,617],{"type":43,"tag":215,"props":590,"children":591},{},[592],{"type":49,"value":593},"Verify-only tests",{"type":49,"value":595}," — tests that only call ",{"type":43,"tag":109,"props":597,"children":599},{"className":598},[],[600],{"type":49,"value":601},".Verify",{"type":49,"value":603},"\u002F",{"type":43,"tag":109,"props":605,"children":607},{"className":606},[],[608],{"type":49,"value":609},".Received",{"type":49,"value":603},{"type":43,"tag":109,"props":612,"children":614},{"className":613},[],[615],{"type":49,"value":616},".MustHaveHappened",{"type":49,"value":618}," without asserting on the method's return value",{"type":43,"tag":203,"props":620,"children":622},{"id":621},"step-3-check-for-replaceable-mocks",[623],{"type":49,"value":624},"Step 3: Check for replaceable mocks",{"type":43,"tag":52,"props":626,"children":627},{},[628],{"type":49,"value":629},"Flag mocks of stable framework types that should use real implementations:",{"type":43,"tag":65,"props":631,"children":632},{},[633,652,668],{"type":43,"tag":69,"props":634,"children":635},{},[636,642,644,650],{"type":43,"tag":109,"props":637,"children":639},{"className":638},[],[640],{"type":49,"value":641},"Mock\u003CILogger\u003CT>>",{"type":49,"value":643}," → ",{"type":43,"tag":109,"props":645,"children":647},{"className":646},[],[648],{"type":49,"value":649},"NullLogger\u003CT>.Instance",{"type":49,"value":651}," (unless log output is asserted)",{"type":43,"tag":69,"props":653,"children":654},{},[655,661,662],{"type":43,"tag":109,"props":656,"children":658},{"className":657},[],[659],{"type":49,"value":660},"Mock\u003CIOptions\u003CT>>",{"type":49,"value":643},{"type":43,"tag":109,"props":663,"children":665},{"className":664},[],[666],{"type":49,"value":667},"Options.Create(new T { ... })",{"type":43,"tag":69,"props":669,"children":670},{},[671,673,679],{"type":49,"value":672},"Mocks of DTOs, records, or value objects → use ",{"type":43,"tag":109,"props":674,"children":676},{"className":675},[],[677],{"type":49,"value":678},"new T { ... }",{"type":49,"value":680}," directly",{"type":43,"tag":52,"props":682,"children":683},{},[684,686,691],{"type":49,"value":685},"Explicitly confirm which mocks are ",{"type":43,"tag":215,"props":687,"children":688},{},[689],{"type":49,"value":690},"correctly placed",{"type":49,"value":692}," — external boundaries (databases, HTTP clients, message queues, third-party APIs) and security-sensitive types should remain mocked.",{"type":43,"tag":203,"props":694,"children":696},{"id":695},"step-4-report-findings",[697],{"type":49,"value":698},"Step 4: Report findings",{"type":43,"tag":52,"props":700,"children":701},{},[702],{"type":49,"value":703},"For each finding, state:",{"type":43,"tag":343,"props":705,"children":706},{},[707,712,717],{"type":43,"tag":69,"props":708,"children":709},{},[710],{"type":49,"value":711},"The specific test method and mock setup line",{"type":43,"tag":69,"props":713,"children":714},{},[715],{"type":49,"value":716},"Why the setup is unnecessary (trace the production code path to explain)",{"type":43,"tag":69,"props":718,"children":719},{},[720],{"type":49,"value":721},"A concrete fix — which lines to remove, what to replace them with, or how to extract shared setup",{"type":43,"tag":52,"props":723,"children":724},{},[725],{"type":49,"value":726},"When multiple tests duplicate mock configurations, provide a before\u002Fafter example showing how to extract shared setup into a fixture or helper method.",{"type":43,"tag":58,"props":728,"children":730},{"id":729},"validation",[731],{"type":49,"value":732},"Validation",{"type":43,"tag":65,"props":734,"children":737},{"className":735},[736],"contains-task-list",[738,751,760,769,778],{"type":43,"tag":69,"props":739,"children":742},{"className":740},[741],"task-list-item",[743,749],{"type":43,"tag":744,"props":745,"children":748},"input",{"disabled":746,"type":747},true,"checkbox",[],{"type":49,"value":750}," Production code was read and execution paths were traced (not just test code reviewed)",{"type":43,"tag":69,"props":752,"children":754},{"className":753},[741],[755,758],{"type":43,"tag":744,"props":756,"children":757},{"disabled":746,"type":747},[],{"type":49,"value":759}," Every finding references a specific test method and setup line",{"type":43,"tag":69,"props":761,"children":763},{"className":762},[741],[764,767],{"type":43,"tag":744,"props":765,"children":766},{"disabled":746,"type":747},[],{"type":49,"value":768}," Unreachable setups include an explanation of which production code path makes them unreachable",{"type":43,"tag":69,"props":770,"children":772},{"className":771},[741],[773,776],{"type":43,"tag":744,"props":774,"children":775},{"disabled":746,"type":747},[],{"type":49,"value":777}," Correctly-placed mocks (external boundaries) are explicitly noted as appropriate",{"type":43,"tag":69,"props":779,"children":781},{"className":780},[741],[782,785],{"type":43,"tag":744,"props":783,"children":784},{"disabled":746,"type":747},[],{"type":49,"value":786}," Correct framework terminology is used throughout (not mixing Moq\u002FNSubstitute\u002FFakeItEasy terms)",{"type":43,"tag":58,"props":788,"children":790},{"id":789},"common-pitfalls",[791],{"type":49,"value":792},"Common Pitfalls",{"type":43,"tag":129,"props":794,"children":795},{},[796,812],{"type":43,"tag":133,"props":797,"children":798},{},[799],{"type":43,"tag":137,"props":800,"children":801},{},[802,807],{"type":43,"tag":141,"props":803,"children":804},{},[805],{"type":49,"value":806},"Pitfall",{"type":43,"tag":141,"props":808,"children":809},{},[810],{"type":49,"value":811},"Solution",{"type":43,"tag":157,"props":813,"children":814},{},[815,828,841,862],{"type":43,"tag":137,"props":816,"children":817},{},[818,823],{"type":43,"tag":164,"props":819,"children":820},{},[821],{"type":49,"value":822},"Analyzing test code without reading production code",{"type":43,"tag":164,"props":824,"children":825},{},[826],{"type":49,"value":827},"Always read the production method to trace which mocks are actually called",{"type":43,"tag":137,"props":829,"children":830},{},[831,836],{"type":43,"tag":164,"props":832,"children":833},{},[834],{"type":49,"value":835},"Flagging mocks for external boundaries (HTTP, DB)",{"type":43,"tag":164,"props":837,"children":838},{},[839],{"type":49,"value":840},"These are valid isolation boundaries — keep them mocked",{"type":43,"tag":137,"props":842,"children":843},{},[844,857],{"type":43,"tag":164,"props":845,"children":846},{},[847,849,855],{"type":49,"value":848},"Flagging ",{"type":43,"tag":109,"props":850,"children":852},{"className":851},[],[853],{"type":49,"value":854},"ILogger",{"type":49,"value":856}," mock when log output is asserted",{"type":43,"tag":164,"props":858,"children":859},{},[860],{"type":49,"value":861},"Only flag when the mock is set up but log output is never verified",{"type":43,"tag":137,"props":863,"children":864},{},[865,870],{"type":43,"tag":164,"props":866,"children":867},{},[868],{"type":49,"value":869},"Using wrong framework terminology",{"type":43,"tag":164,"props":871,"children":872},{},[873,875,881,882,888,890,896,897,903,905,910,911,917],{"type":49,"value":874},"Match the framework in the code: Moq (",{"type":43,"tag":109,"props":876,"children":878},{"className":877},[],[879],{"type":49,"value":880},"Setup",{"type":49,"value":603},{"type":43,"tag":109,"props":883,"children":885},{"className":884},[],[886],{"type":49,"value":887},"Verify",{"type":49,"value":889},"), NSubstitute (",{"type":43,"tag":109,"props":891,"children":893},{"className":892},[],[894],{"type":49,"value":895},"Returns",{"type":49,"value":603},{"type":43,"tag":109,"props":898,"children":900},{"className":899},[],[901],{"type":49,"value":902},"Received",{"type":49,"value":904},"), FakeItEasy (",{"type":43,"tag":109,"props":906,"children":908},{"className":907},[],[909],{"type":49,"value":370},{"type":49,"value":603},{"type":43,"tag":109,"props":912,"children":914},{"className":913},[],[915],{"type":49,"value":916},"MustHaveHappened",{"type":49,"value":116},{"items":919,"total":1022},[920,933,948,966,978,998,1008],{"slug":921,"name":921,"fn":922,"description":923,"org":924,"tags":925,"stars":25,"repoUrl":26,"updatedAt":932},"analyzing-dotnet-performance","analyze .NET code for performance anti-patterns","Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I\u002FO with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[926,927,928,929],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":930,"slug":931,"type":15},"Performance","performance","2026-07-12T08:23:25.400375",{"slug":934,"name":934,"fn":935,"description":936,"org":937,"tags":938,"stars":25,"repoUrl":26,"updatedAt":947},"android-tombstone-symbolication","symbolicate .NET runtime frames in Android tombstones","Symbolicate the .NET runtime frames in an Android tombstone file. Extracts BuildIds and PC offsets from the native backtrace, downloads debug symbols from the Microsoft symbol server, and runs llvm-symbolizer to produce function names with source file and line numbers. USE FOR triaging a .NET MAUI or Mono Android app crash from a tombstone, resolving native backtrace frames in libmonosgen-2.0.so or libcoreclr.so to .NET runtime source code, or investigating SIGABRT, SIGSEGV, or other native signals originating from the .NET runtime on Android. DO NOT USE FOR pure Java\u002FKotlin crashes, managed .NET exceptions that are already captured in logcat, or iOS crash logs. INVOKES Symbolicate-Tombstone.ps1 script, llvm-symbolizer, Microsoft symbol server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[939,940,943,944],{"name":13,"slug":14,"type":15},{"name":941,"slug":942,"type":15},"Android","android",{"name":23,"slug":24,"type":15},{"name":945,"slug":946,"type":15},"Microsoft","microsoft","2026-07-12T08:23:21.595572",{"slug":949,"name":949,"fn":950,"description":951,"org":952,"tags":953,"stars":25,"repoUrl":26,"updatedAt":965},"apple-crash-symbolication","symbolicate .NET runtime frames in crash logs","Symbolicate .NET runtime frames in Apple platform .ips crash logs (iOS, tvOS, Mac Catalyst, macOS). Extracts UUIDs and addresses from the native backtrace, locates dSYM debug symbols, and runs atos to produce function names with source file and line numbers. Automatically downloads .dwarf symbols from the Microsoft symbol server using Mach-O UUIDs. USE FOR triaging a .NET MAUI or Mono app crash from an .ips file on any Apple platform, resolving native backtrace frames in libcoreclr or libmonosgen-2.0 to .NET runtime source code, retrieving .ips crash logs from a connected iOS device or iPhone, or investigating EXC_CRASH, EXC_BAD_ACCESS, SIGABRT, or SIGSEGV originating from the .NET runtime. DO NOT USE FOR pure Swift\u002FObjective-C crashes with no .NET components, or Android tombstone files. INVOKES Symbolicate-Crash.ps1 script, atos, dwarfdump, idevicecrashreport.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[954,955,956,959,962],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":957,"slug":958,"type":15},"iOS","ios",{"name":960,"slug":961,"type":15},"macOS","macos",{"name":963,"slug":964,"type":15},"Observability","observability","2026-07-12T08:23:20.369986",{"slug":967,"name":967,"fn":968,"description":969,"org":970,"tags":971,"stars":25,"repoUrl":26,"updatedAt":977},"assertion-quality","evaluate assertion quality in test suites","Analyzes the variety and depth of assertions across test suites in any language. Use when the user asks to evaluate assertion quality, find shallow tests, identify assertion-free tests (no assertions or only trivial ones like Assert.IsNotNull \u002F toBeTruthy()), flag self-referential or tautological assertions, measure assertion diversity, or audit whether tests verify different facets of behavior. Polyglot: .NET, Python, TS\u002FJS, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, C++. DO NOT USE FOR: writing new tests (use code-testing-agent \u002F writing-mstest-tests), mutation reasoning about whether tests would catch a bug (use test-gap-analysis), or a general severity-ranked anti-pattern audit (use test-anti-patterns), fixing or rewriting assertions, or writing, fixing, or modernizing MSTest tests, assertions, or attributes (use writing-mstest-tests).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[972,973,976],{"name":17,"slug":18,"type":15},{"name":974,"slug":975,"type":15},"QA","qa",{"name":20,"slug":21,"type":15},"2026-07-12T08:23:51.277743",{"slug":979,"name":979,"fn":980,"description":981,"org":982,"tags":983,"stars":25,"repoUrl":26,"updatedAt":997},"author-component","create and review Blazor components","Create or review Blazor components (.razor files) with correct architecture. USE FOR: writing new Blazor components that do NOT involve JavaScript interop, implementing parameters and EventCallback, RenderFragment slots, component lifecycle (OnInitializedAsync, OnParametersSet), async patterns, IAsyncDisposable, CancellationToken, CSS isolation, code-behind. DO NOT USE FOR: creating new projects (use create-blazor-project), JavaScript interop or calling browser APIs from Blazor (use use-js-interop), forms and validation (use collect-user-input), prerendering issues (use support-prerendering), HTTP data fetching patterns (use fetch-and-send-data), coordinating state between unrelated components (use coordinate-components).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[984,985,988,991,994],{"name":13,"slug":14,"type":15},{"name":986,"slug":987,"type":15},"Blazor","blazor",{"name":989,"slug":990,"type":15},"C#","csharp",{"name":992,"slug":993,"type":15},"UI Components","ui-components",{"name":995,"slug":996,"type":15},"Web Development","web-development","2026-07-15T06:03:29.216359",{"slug":999,"name":999,"fn":1000,"description":1001,"org":1002,"tags":1003,"stars":25,"repoUrl":26,"updatedAt":1007},"binlog-failure-analysis","analyze MSBuild binary logs","Analyze MSBuild binary logs to diagnose build failures. USE FOR: build errors that are unclear from console output, diagnosing cascading failures across multi-project builds, tracing MSBuild target execution order, and generally any MSBuild build issues. Requires an existing .binlog file. DO NOT USE FOR: generating binlogs (use binlog-generation), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1004,1005,1006],{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":945,"slug":946,"type":15},"2026-07-12T08:21:34.637923",{"slug":1009,"name":1009,"fn":1010,"description":1011,"org":1012,"tags":1013,"stars":25,"repoUrl":26,"updatedAt":1021},"binlog-generation","generate MSBuild binary logs for diagnostics","Generate MSBuild binary logs (binlogs) for build diagnostics and analysis. USE FOR: adding \u002Fbl:{} to any dotnet build, test, pack, publish, or restore command to capture a full build execution trace, prerequisite for binlog-failure-analysis and build-perf-diagnostics skills, enabling post-build investigation of errors or performance. Requires MSBuild 17.8+ \u002F .NET 8 SDK+ for {} placeholder; PowerShell needs -bl:{{}}. DO NOT USE FOR: non-MSBuild build systems (npm, Maven, CMake), analyzing an existing binlog (use binlog-failure-analysis instead).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1014,1017,1018],{"name":1015,"slug":1016,"type":15},"Build","build",{"name":23,"slug":24,"type":15},{"name":1019,"slug":1020,"type":15},"Engineering","engineering","2026-07-19T05:38:19.340791",96,{"items":1024,"total":1129},[1025,1037,1044,1051,1059,1065,1073,1079,1085,1095,1108,1119],{"slug":1026,"name":1026,"fn":1027,"description":1028,"org":1029,"tags":1030,"stars":1034,"repoUrl":1035,"updatedAt":1036},"multithreaded-task-migration","migrate MSBuild tasks to multithreaded mode","Guide for migrating MSBuild tasks to multithreaded mode support, including compatibility red-team review. Use this when converting tasks to thread-safe versions, implementing IMultiThreadableTask, adding TaskEnvironment support, or auditing migrations for behavioral compatibility.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1031,1032,1033],{"name":13,"slug":14,"type":15},{"name":1019,"slug":1020,"type":15},{"name":930,"slug":931,"type":15},5535,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmsbuild","2026-07-22T05:37:33.965588",{"slug":921,"name":921,"fn":922,"description":923,"org":1038,"tags":1039,"stars":25,"repoUrl":26,"updatedAt":932},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1040,1041,1042,1043],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":930,"slug":931,"type":15},{"slug":934,"name":934,"fn":935,"description":936,"org":1045,"tags":1046,"stars":25,"repoUrl":26,"updatedAt":947},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1047,1048,1049,1050],{"name":13,"slug":14,"type":15},{"name":941,"slug":942,"type":15},{"name":23,"slug":24,"type":15},{"name":945,"slug":946,"type":15},{"slug":949,"name":949,"fn":950,"description":951,"org":1052,"tags":1053,"stars":25,"repoUrl":26,"updatedAt":965},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1054,1055,1056,1057,1058],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":957,"slug":958,"type":15},{"name":960,"slug":961,"type":15},{"name":963,"slug":964,"type":15},{"slug":967,"name":967,"fn":968,"description":969,"org":1060,"tags":1061,"stars":25,"repoUrl":26,"updatedAt":977},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1062,1063,1064],{"name":17,"slug":18,"type":15},{"name":974,"slug":975,"type":15},{"name":20,"slug":21,"type":15},{"slug":979,"name":979,"fn":980,"description":981,"org":1066,"tags":1067,"stars":25,"repoUrl":26,"updatedAt":997},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1068,1069,1070,1071,1072],{"name":13,"slug":14,"type":15},{"name":986,"slug":987,"type":15},{"name":989,"slug":990,"type":15},{"name":992,"slug":993,"type":15},{"name":995,"slug":996,"type":15},{"slug":999,"name":999,"fn":1000,"description":1001,"org":1074,"tags":1075,"stars":25,"repoUrl":26,"updatedAt":1007},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1076,1077,1078],{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":945,"slug":946,"type":15},{"slug":1009,"name":1009,"fn":1010,"description":1011,"org":1080,"tags":1081,"stars":25,"repoUrl":26,"updatedAt":1021},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1082,1083,1084],{"name":1015,"slug":1016,"type":15},{"name":23,"slug":24,"type":15},{"name":1019,"slug":1020,"type":15},{"slug":1086,"name":1086,"fn":1087,"description":1088,"org":1089,"tags":1090,"stars":25,"repoUrl":26,"updatedAt":1094},"build-parallelism","optimize MSBuild build parallelism","Diagnose and fix under-parallelized MSBuild builds. USE WHEN a multi-project solution build is slower than expected, doesn't speed up when you add cores, pegs a single core while others idle, or you want to know why `-m` isn't helping. Note: `\u002Fmaxcpucount` default is 1 (sequential) — always pass `-m` for parallel builds. Covers finding the critical path (longest serial ProjectReference chain), graph build (`\u002Fgraph`), BuildInParallel, and solution filters (`.slnf`). DO NOT USE FOR: single-project builds, incremental issues (use incremental-build), compilation slowness inside one project (use build-perf-diagnostics), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1091,1092,1093],{"name":13,"slug":14,"type":15},{"name":1019,"slug":1020,"type":15},{"name":930,"slug":931,"type":15},"2026-07-19T05:38:18.364937",{"slug":1096,"name":1096,"fn":1097,"description":1098,"org":1099,"tags":1100,"stars":25,"repoUrl":26,"updatedAt":1107},"build-perf-baseline","establish and optimize build performance baselines","Establish build performance baselines and apply systematic optimization techniques. USE FOR: diagnosing slow builds, establishing before\u002Fafter measurements (cold, warm, no-op scenarios), applying optimization strategies like MSBuild Server, static graph builds, artifacts output, and dependency graph trimming. Start here before diving into build-perf-diagnostics, incremental-build, or build-parallelism. DO NOT USE FOR: non-MSBuild build systems, detailed bottleneck analysis (use build-perf-diagnostics after baselining).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1101,1102,1105,1106],{"name":1019,"slug":1020,"type":15},{"name":1103,"slug":1104,"type":15},"Monitoring","monitoring",{"name":930,"slug":931,"type":15},{"name":20,"slug":21,"type":15},"2026-07-12T08:21:35.865649",{"slug":1109,"name":1109,"fn":1110,"description":1111,"org":1112,"tags":1113,"stars":25,"repoUrl":26,"updatedAt":1118},"build-perf-diagnostics","diagnose MSBuild build performance bottlenecks","Diagnose MSBuild build performance bottlenecks using binary log analysis. USE FOR: identifying why builds are slow by analyzing binlog performance summaries, detecting ResolveAssemblyReference (RAR) taking >5s, Roslyn analyzers consuming >30% of Csc time, single targets dominating >50% of build time, node utilization below 80%, excessive Copy tasks, NuGet restore running every build. Covers timeline analysis, Target\u002FTask Performance Summary interpretation, and 7 common bottleneck categories. Use after build-perf-baseline has established measurements. DO NOT USE FOR: establishing initial baselines (use build-perf-baseline first), fixing incremental build issues (use incremental-build), parallelism tuning (use build-parallelism), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1114,1115,1116,1117],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":1019,"slug":1020,"type":15},{"name":930,"slug":931,"type":15},"2026-07-12T08:21:40.961722",{"slug":1120,"name":1120,"fn":1121,"description":1122,"org":1123,"tags":1124,"stars":25,"repoUrl":26,"updatedAt":1128},"check-bin-obj-clash","detect MSBuild output path conflicts","Detects MSBuild projects with conflicting OutputPath or IntermediateOutputPath. USE FOR: builds failing with 'Cannot create a file when that file already exists', 'The process cannot access the file because it is being used by another process', intermittent build failures that succeed on retry, or missing\u002Foverwritten outputs in multi-project or multi-targeting builds where bin\u002Fobj (or project.assets.json) collide. Common causes: shared OutputPath, missing AppendTargetFrameworkToOutputPath, extra global properties (e.g. PublishReadyToRun), or SetTargetFramework on a ProjectReference to a single-targeting project. DO NOT USE FOR: file access errors unrelated to MSBuild (OS-level locking), single-project single-TFM builds, non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1125,1126,1127],{"name":23,"slug":24,"type":15},{"name":1019,"slug":1020,"type":15},{"name":974,"slug":975,"type":15},"2026-07-19T05:38:14.336279",144]