Architecture is a behavior.Test it with ArchUnit libraries for TypeScript, Python, .NET, Ruby, Rust, Zig, Go, Java, and PHP.

Guard boundaries, detect cycles, measure design health, and keep architecture honest as code changes, inside the test suite your team already runs.

Open source · Test-runner native · CI ready

Interface

Presentation

24 files
Domain

Business rules

37 files
Infrastructure

Adapters

19 files
✓ Rule passesdomain.shouldNot().dependOn(infrastructure)

One mental model

Rules that read like the decision.

Different language conventions, one recognizable flow: select code, state the expectation, then let the existing test runner enforce it.

  • 01 Select files, folders, classes, layers, or slices.
  • 02 Describe an allowed direction, forbidden edge, metric, or diagram.
  • 03 Run the rule locally and in CI with actionable evidence.
architecture.test.ts
import { projectFiles } from 'archunit';

it('keeps the domain independent', async () => {
  const rule = projectFiles()
    .inFolder('src/domain/**')
    .shouldNot()
    .dependOnFiles()
    .inFolder('src/infrastructure/**');

  await expect(rule).toPassAsync();
});

Beyond import rules

A feedback system for architectural intent.

Architecture tests turn diagrams and conventions into fast, repeatable evidence for people, pull requests, and coding agents.

01 / Boundaries

Stop forbidden dependencies before review.

Define who may depend on whom and fail on the exact source edge that crosses the line.

02 / Cycles

Keep the graph directional.

Detect circular dependencies while the loop is still small enough to remove.

03 / Diagrams

Compare code with the map.

Validate slices against PlantUML or export the architecture that actually exists.

04 / Metrics

See design pressure early.

Track coupling, cohesion, file size, abstractness, and distance from the main sequence.

05 / Reports

One graph, many useful views.

Produce test failures, CI artifacts, structured JSON, dependency diagrams, and standalone HTML reports from the same model.

Built in the open

A family shaped by contributors.

Maintainers and first-time contributors work across languages, test frameworks, graph algorithms, documentation, and real-world examples.

LukasNiessenTristanKruseRobeyBeswickDebanKsahubrutalmaths

Your architecture can be more than a promise.

Pick the implementation for your stack and add the first boundary rule to the test suite you already trust.

Find your library