Comment by cadamsdotcom
14 hours ago
The most powerful thing you can do in 2026: lint your architecture in a pre-commit check.
Agents & humans can’t commit, or stop work, unless they’ve passed all lint checks. Passing the linter requires complying with the architecture. Now architecture violations can’t creep in and entrench themselves - they have to be fixed upfront. Code review is free from worries about architecture too.
Start by having your agent install some import-linter rules. When you hit its limits, have your agent write a custom AST-based checker (a short python script will do) that can look for imports that violate your rules. Resist its attempts to add a `# noqa: imports` escape hatch, because future agents will gleefully abuse that and you’ll be back to human in the loop (ask me how I know!)
For python projects I created pytest-archon[1], initially for humans, but now I'm using it for agents, too.
[1]: https://github.com/jwbargsten/pytest-archon
Thanks, lots to love in here! You’re clearly a convert :)
The goal is codification.
Writing down knowledge as verifiable invariants. The more that is codified, the less context you need. And that means you can be fearless.