diagnosing-bugslisted
Install: claude install-skill lamuniercosta/dotnet-agent-harness
# Diagnosing Bugs (.NET)
A discipline for hard bugs. Skip phases only when explicitly justified.
Assumes only .NET 8+, xUnit, and Docker. Concrete examples below name specific technologies (MongoDB, SQL Server, Redis, Hot Chocolate, gRPC) because a vague technique is useless — treat them as *instances of a pattern*, not as the stack. Read `harness.yml` and the repo's own `CLAUDE.md`/`AGENTS.md` for what is actually in use, and substitute the equivalent tool.
When exploring the codebase, read `CONTEXT.md` (if it exists) to get a clear mental model of the relevant modules, and check ADRs in the area you're touching.
## Phase 1 — Build a feedback loop
**This is the skill.** Everything else is mechanical. If you have a **tight** pass/fail signal for the bug — one that goes red on _this_ bug — you will find the cause; bisection, hypothesis-testing, and instrumentation all just consume it. If you don't have one, no amount of staring at code will save you.
Spend disproportionate effort here. **Be aggressive. Be creative. Refuse to give up.**
### Ways to construct one — try them in roughly this order
1. **Failing xUnit test** at whatever seam reaches the bug — unit, integration, or end-to-end. Run it narrowly and fast:
```bash
dotnet test --filter "FullyQualifiedName~OrderCancellationTests" --nologo -v q
```
For integration seams, prefer `WebApplicationFactory<Program>` so the whole ASP.NET pipeline (middleware, DI, Hot Chocolate) is in the loop without a running