AGENTS.md is a request, ArchUnit is a check: enforce agent rules in the build

therealdanvega · x · 2026-11-21

The author contrasts two ways to constrain AI coding agents: a rule like "controllers never talk to repositories" in AGENTS.md is just a request the agent follows most of the time; encoding it as an ArchUnit @ArchTest rule — e.g. classes in ..web.. must not depend on ..repository.. — makes the build fail instead. Rules in prose for the agent, rules in tests for the build. Includes a ready-to-use ArchUnit snippet.

Original post →

More from coding & agent

coding & agent channel →