DEV Community

Cover image for This week in Cursor + .NET — 8 rules + 1 essay (week ending July 12, 2026)
Agentic Architect
Agentic Architect

Posted on • Originally published at agentic-architect.dev

This week in Cursor + .NET — 8 rules + 1 essay (week ending July 12, 2026)

Every weekday a single, opinionated rule for senior C#/.NET engineers using Cursor. Here's the full week in one read — canonical posts live on the Agentic Architect blog.

New essays this week

GLM 5.2 vs Claude Fable 5: agentic coding at a fraction of the cost

Tue 07 Jul · AI models

I ran the same agent task on both. Fable 5 is faster and stronger on benchmarks, but GLM 5.2 finished for $2.76 vs over $10. The honest cost math for running agents on open weights.

8 daily senior rules

Rule 10: AsNoTracking for Reads

Sun 12 Jul

Every read-only EF Core query should call AsNoTracking. Add a rule that recognises query methods returning DTOs (not entities) and inserts the call. Cursor never does this by default and your read perf degrades silently across releases.

→ Permalink on the blog

Rule 9: Scoped Capture in Singleton

Sat 11 Jul

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.

→ Permalink on the blog

Rule 8: CancellationToken Propagation

Fri 10 Jul

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.

→ Permalink on the blog

Rule 7: IHttpClientFactory Discipline

Thu 09 Jul

Refuse new HttpClient() in any generated code. Force Cursor to inject IHttpClientFactory or a typed client. The classic socket-exhaustion bug is exactly the kind of footgun an AI hands you without realising.

→ Permalink on the blog

Rule 6: TimeProvider Injection

Wed 08 Jul

Never let Cursor hardcode DateTime.Now or DateTime.UtcNow in business logic. Inject TimeProvider (or your own IClock) instead. This makes time deterministic for tests and stops the AI reaching for static APIs whenever it generates time-aware code.

→ Permalink on the blog

GLM 5.2 vs Claude Fable 5 — the full comparison

Wed 08 Jul

Side-by-side: pricing per million tokens, benchmarks, context windows, and the honest verdict on which model to use for which kind of agent run. Open weights vs closed frontier, with the real cost math.

→ Permalink on the blog

Rule 5: Minimal API Groups

Tue 07 Jul

Use MapGroup and EndPoints for .NET 9 services. It keeps the context window lean and focused, helping the AI provide more accurate code suggestions than it can with massive, bloated Controllers.

→ Permalink on the blog

Rule 4: Validator Enforcement

Mon 06 Jul

Every MediatR Request must have a FluentValidation rule. Force the AI to check the validator before writing handler logic. This prevents "context rot" where the AI forgets your business constraints.

→ Permalink on the blog


Try one rule before you trust the whole kit

The free arch-core-lite.mdc is one drop-in Cursor rule that ends the morning re-explanation ritual. Install in 60 seconds, see whether Cursor actually remembers your DI lifetimes, and decide for yourself whether the full kit is worth £9.00.

Canonical home for everything in this digest: https://agentic-architect.dev/blog/.

Top comments (0)