Structure
Architecture rules that fail the build when an import crosses a line.
An agent asked to fix a bug takes the shortest path, and the shortest path often runs straight through a layer it shouldn't touch. Write the boundaries down once and these tools enforce them on every change. A module boundary is a standard, and rule 19 says machines enforce those.
Show tools for
24 tools
Architecture and boundaries
Start here
ArchSpec
Declares Ruby and Rails components and boundaries in one file, and checks every change against them.
Built for code agents write, and the check is plain static analysis, so a pass means the same thing every run.
Start here
ArchUnit
Writes Java architecture rules as unit tests covering layers, slices, cycles and naming.
A change that breaks a layer fails the build with a clear message, so the rule holds without a reviewer.
Start here
ArchUnitNET
C# port of ArchUnit that runs architecture rules inside your .NET test framework.
The same test-based boundary checks for .NET, so a stray reference fails the build.
Start here
Boundary
Mix compiler that limits which Elixir modules may call each other and which libraries they may use.
Violations show up as compile warnings, so every build tells an agent where it crossed a line.
Start here
cargo-deny
Checks Rust dependencies for banned crates, duplicate versions, advisories and license rules.
A ban list stops a second HTTP client or an unwanted crate from slipping in unnoticed.
Start here
dependency-cruiser
Checks JavaScript and TypeScript imports against dependency rules and flags circular imports.
An import across a line you drew fails the build, and the tool draws the graph so the damage is visible.
Start here
Deptrac
Defines architectural layers in PHP and fails when code depends across them in forbidden ways.
Layer rules live in a YAML file and run in CI, so agent-written PHP stays inside its layers.
Start here
go-arch-lint
Maps Go packages to components in a YAML file and fails when dependencies break the declared layers.
One YAML file describes the layers, and CI checks every import against it.
Start here
Harmonize
Swift architecture and convention rules written as unit tests, in the style of Konsist.
Swift has few architecture-test options, and this one keeps layer rules in the test suite.
Start here
import-linter
Lets you declare allowed imports between Python packages and fails CI on violations.
Contracts live in config and fail CI the moment an agent adds a forbidden import.
-
depguard
Go linter that allows or denies imports per package using lists and file globs.
Banning a package or blocking one layer from importing another takes a few lines of golangci-lint config.
-
eslint-plugin-boundaries
ESLint plugin that classifies files into elements and checks which elements may import which.
Boundary breaks appear as lint errors in the editor and in CI, right where the agent is working.
-
Konsist
Kotlin static analyzer where architecture and convention rules are written as JUnit or Kotest tests.
Naming and layer rules for Kotlin and Android code get checked on every test run.
-
lintel
One arch.yaml for dependency rules across Go, TypeScript and Python.
A repo with several languages can keep all its dependency rules in a single file.
A very young project, at version 0.1.0.
-
Nx module boundaries
Nx's enforce-module-boundaries ESLint rule limits which workspace projects may depend on which, using tags.
Inside an Nx monorepo this check already exists, so agents meet it on every lint run.
-
Packwerk
Shopify's Ruby tool that enforces package boundaries and privacy in Rails apps.
A violation shows up the moment an agent reaches into another package's internals in a modular monolith.
-
PHPArkitect
Architecture rules for PHP written as plain PHP: namespaces, naming, inheritance and types.
Rules read like code, and baselines let a legacy project adopt them a step at a time.
-
PHPat
PHPStan extension for architecture tests, written in readable rule objects.
It runs inside PHPStan, so the pipeline gains no extra step.
-
pks
Rust implementation of Packwerk from the Ruby at Scale toolchain.
A compiled checker stays cheap enough to run after every agent edit.
Its authors mark it as work in progress.
-
PyTestArch
ArchUnit-style architecture rules for Python, written as pytest tests.
Rules sit beside the other tests, so the team has one place to look.
-
Sheriff
Enforces module boundaries in TypeScript projects through barrel files and tag-based dependency rules.
A small set of tag rules covers Angular and plain TypeScript, with CLI and ESLint modes.
-
Sonargraph
Architecture checker with a rule language for layers and cycles, plus a free build tool for quality gates.
The rule file lives in version control and can fail the build.
-
Spring Modulith
Spring Boot library that verifies module structure and generates module documentation.
One verify call fails the tests when a module reaches into another module's internals.
-
Tach
Rust-based tool that enforces module boundaries and public interfaces in Python projects.
It runs fast enough for pre-commit and adds public-interface checks to the import rules.
Nothing in this section is built for the stacks you picked, and nothing here works with any language. Pick another stack, or .
Gone quiet 4
These tools are archived or shut down, or nobody has released or committed to them in two years. Some still work fine. Read the note before you adopt one.
-
JDepend
Old Java package metrics tool for coupling, stability and cycles.
It still turns up in older Java builds, and ArchUnit now covers the same ground with tests.
Dormant since 2020.
-
madge
Draws module dependency graphs and finds circular dependencies and orphan modules in JavaScript.
Its circular check works as a quick CI gate against the tangles agents create.
Dormant since 2024. dependency-cruiser does more.
-
NetArchTest
Fluent .NET library for enforcing architecture rules inside unit tests.
Older .NET suites still use it for layer checks written as plain tests.
Dormant since 2024. ArchUnitNET is the maintained alternative.
-
Structure101
Commercial tool that shows code structure as a map and checks architecture rules against it.
Large legacy codebases can see their tangles here before anyone sets rules.
No longer for sale. Existing customers keep support while features fold into Sonar products.
Missing a tool that belongs here? Suggest it.
Every tool here was checked against its GitHub repository or its own site on 6 October 2026. Stars and dates come from GitHub on that day.