One practical Cursor + .NET pattern per day.
Field notes from building a stateful AI partner for production C#/.NET codebases. A new Daily Senior Rule lands here every morning at 09:17 UTC, with longer essays mixed in.
Subscribe via RSS-
Rule 9: Scoped Capture in Singleton
The single most expensive .NET runtime bug: a Singleton holding a Scoped service. Cursor cheerfully writes this without warning. Audit constructor parameters of any class registered as Singleton — if any are typically Scoped (DbContext, repositories, MediatR sender), flag it before merge.
-
Teach Cursor Result<T> instead of throwing
Stop the AI from undoing your Result/ErrorOr error model with throw and null on every new prompt.
Read post → -
Rule 8: CancellationToken Propagation
Every async method in your codebase should accept and forward a CancellationToken. Make it a rule that any new async signature without one is flagged. Stops the AI from quietly losing cancellation half-way down a call chain.
-
Seven words that stop Cursor hallucination loops
The correction spiral — and the circuit-breaker rule that ends it before you type the stop phrase.
Read post → -
Rule 2: Persistence Boundaries
Never let the AI write database logic in your Controllers. Enforce a strict boundary where all IQueryable access stays in the Infrastructure layer. This keeps your business logic "pure" and readable for the LLM.
-
The Scoped→Singleton DI bug your AI just suggested (and how to catch it)
The .NET lifetime bug that ships to production silently — and the one Cursor rule that catches it before merge.
Read post → -
The Context Tax: Why every Cursor session costs you 15 minutes
The hidden cost senior engineers pay every morning — and a four-rule architecture for eliminating it.
Read post →
Don't want to wait for the next post?
The full kit — 4 specialist rules + the persistence engine — is £19.99 one-time.
Get Agentic Architect →