RungerHeimdall
RungerHeimdall

Roslyn analyzers for .NET

Guard the architecture.
Catch the allocations.

RungerHeimdall turns architecture rules and hidden allocations into diagnostics you see in the IDE and in CI. No test project, no separate scan, no runtime profiler.

dotnet add package RungerHeimdall.Analyzers --version 1.0.0

Architecture guard

Declare layers once. Domain cannot reference infrastructure, endpoints cannot construct a DbContext, repositories must be interfaces. The rules run while you type.

Architecture rules

Allocation detection

Empty params arrays, ToList before foreach, string concatenation inside loops, Enum.HasFlag boxing. Deterministic patterns the compiler will not warn about.

Performance rules

Incremental adoption

Freeze existing violations in a baseline, declare temporary exemptions with an expiry date, and report only what new code breaks.

Baseline

A boundary violation, at the moment it happens

The analyzer reads your layer definitions and reports the dependency before it reaches review. The same rule fails the build in CI.

ARCH1001  'OrderService' is in layer 'Domain' but
depends on 'SqlRepository' in layer 'Infrastructure'.
Dependencies must flow inward.

Domain is the business core. It should not know
about persistence.

  1. Define IOrderRepository in Domain.
  2. Implement it in Infrastructure.
  3. Inject it at the Api layer.