Layer dependencies
Prevent inner layers from depending on forbidden outer layers or other disallowed architecture edges.
Architecture as executable policy
A project-agnostic Roslyn analyzer for C# that reads a JSON Architecture Contract from your repository and turns architecture rules into compiler diagnostics.
Declare layers, forbidden dependency directions, forbidden APIs, optional layer attributes, and interop boundaries. Normal IDE analysis, dotnet build, and CI then check the code against that contract.
Prevent inner layers from depending on forbidden outer layers or other disallowed architecture edges.
Keep I/O, framework calls, or other APIs out of layers where your architecture contract forbids them.
Optionally require configured architecture attributes and detect missing, conflicting, or namespace-mismatched declarations.
Restrict configured interop declarations to the layers where native or external boundaries are intended to live.
Architecture documents and ADRs record intent, but they do not enforce it. ArchitectureAnalyzer makes selected structural rules executable so architecture drift can surface during development instead of depending entirely on manual review.
The analyzer contains no application-specific layer names, namespace roots, dependency graph, or API policy. Those rules live in the consuming repository's architecture.contract.json.