AX
Artifex.
GitHub
← All tools
🏗️Architecture

ArchGuard

Enforces microservice architecture rules across repos — automated at CI time.

Define your architecture rules once. ArchGuard enforces them on every PR — no direct DB calls from API services, no circular dependencies, no cross-domain imports. Architecture drift stops at the gate.

View on GitHub ↗
$pip install archguard
archguard — zsh
archguard --config .archguard.yml --scan src/

/ the problem

Architecture rules exist in your team wiki. Not in your CI pipeline.

You agree on boundaries in a design doc, then spend months in code review catching violations manually. One engineer adds a direct DB call from the API layer. Another imports a domain model across service boundaries. ArchGuard automates the enforcement.

/ how it works

Four steps. One command.

1
📐

Define rules

Write architecture rules in a simple YAML config: allowed imports, forbidden patterns, service boundaries

2
🔍

Scan the codebase

Parses imports, function calls, and module dependencies across all services in your monorepo

3
⚠️

Detect violations

Flags every rule violation with the exact file, line, and which rule it breaks

4
🚦

Gate the PR

Fails CI on violations — merge is blocked until the architecture is clean

/ use cases

When to reach for ArchGuard

Microservice boundary enforcement
Monorepo architecture governance
Domain-driven design compliance
Pre-merge architecture review

Ready to use ArchGuard?

MIT licensed. One command install. Works in CI today.

$pip install archguard
Full docs on GitHub ↗

/ stay in the loop

New tools ship weekly.

Get notified when new tools land, features ship, or a tool reaches 1k stars. No noise. Unsubscribe any time.