dotnet-architecture-tests
Installation
SKILL.md
.NET architecture tests - fitness functions
dotnet-architecture decides what the structure should be (clean, vertical-slice, DDD, modular, microservices); this skill makes a test prove it, and fail the build the moment a boundary is crossed. Without that, a layering rule lives only in a diagram and a reviewer's memory, so it erodes silently - one stray using at a time - until the next big refactor. This is the enforcement counterpart to those concept skills, exactly as dotnet-code-quality enforces the csharp style rules. Baseline is .NET 8 / C# 12.
Pick the library: NetArchTest by default
Default to NetArchTest.Rules: lightweight, fluent, fast, and zero-ceremony - assertions over namespaces, dependencies, and layering that read cleanly in a normal test.
[Fact]
public void Domain_depends_on_nothing_outside_itself()
{
var result = Types.InAssembly(typeof(Order).Assembly)
.That().ResideInNamespace("Shop.Domain")
.ShouldNot().HaveDependencyOnAny("Microsoft.EntityFrameworkCore", "Shop.Infrastructure", "Microsoft.AspNetCore")
.GetResult();