Stop one part of a .NET codebase from referencing internals of another part it should not touch.
Enforce which NuGet packages and project references a given project is allowed to use.
Catch layering violations automatically during dotnet build instead of relying only on code review.
| lennykean/seam-guard | erikphilips/cs4ai | jakobsung/luthn | |
|---|---|---|---|
| Stars | 3 | 3 | 3 |
| Language | C# | C# | C# |
| Setup difficulty | easy | moderate | hard |
| Complexity | 3/5 | 4/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
SeamGuard is a tool for C# and .NET projects that checks whether your code follows the architecture rules you set for it. Instead of relying on developers to remember which parts of a codebase should not talk to each other, SeamGuard reads a JSON configuration file and enforces those boundaries automatically every time the project builds. It works in two ways. You can install it as a Roslyn analyzer, which means it becomes a permanent part of a project and checks the code continuously as you write. Or you can run it as a separate command line tool that checks a build one time without adding anything to the project itself. The rules you write in the configuration file can cover several kinds of things: which types a project is allowed to expose, which other types or projects a piece of code is allowed to reference, which NuGet packages are permitted, and which internal friend assemblies are visible to other projects. It can also check how mocking is used in test code and apply layered rules based on namespace and project structure. To use it, you add the SeamGuard.Analyzer package to a project, then create a .seamguard/config.json file that lists the projects and rules you want enforced, such as denying certain project references or restricting which dependencies a class constructor can use. When you run dotnet build, any rule violations show up as build diagnostics labeled SGA, right alongside normal compiler warnings and errors. This is aimed at teams who want to keep a growing codebase from turning into a tangle of unintended dependencies, since it catches architectural violations automatically instead of relying only on code review. The project is small, with just a few stars, but includes documentation covering getting started, configuration, policy reference, the command line tool, and diagnostics.
A Roslyn analyzer and .NET tool that checks your C# code against JSON-defined rules about which parts of a project are allowed to depend on each other.
Mainly C#. The stack also includes C#, Roslyn, .NET.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.