The Tests Are Green. The Architecture Is Not: Why I Built Archfit
Description and use
Archfit provides deterministic architecture checks, generates repair tasks, and integrates into agent feedback loops to prevent architectural erosion.
Problem
AI coding agents can make locally correct changes that violate architectural boundaries, leading to gradual architecture erosion.
Outcome
Archfit provides deterministic CI gates, actionable repair tasks, and modularity-aware coupling scores, enabling agents to respect architectural boundaries while maintaining rapid development.
Workflow
- Define architectural boundaries in .archfit.yaml
- Run Archfit analyze to collect dependency facts
- Archfit compares facts to declared rules and outputs decisions
- If violations exist, Archfit generates structured repair tasks
- Agent applies fixes guided by the task
- Run Archfit check to confirm resolution
Evidence
Archfit reads architectural intent from .archfit.yaml. Language adapters collect dependency facts using ecosystem tools such as go list, dependency-cruiser, ast-grep, and grimp.
Archfit can detect structural problems such as: forbidden dependencies; cross-module access to internal APIs; incorrect layer direction; dependency cycles; configured coupling or score regressions.
- Record date: 2026-09-08T12:45:37.939Z