A module is a bounded code unit that groups related declarations and forms an independently managed compilation and architectural boundary. In an agent-heavy codebase, a monolith turns builds into a shared bottleneck: agents spend more time waiting for rebuilds and shared I/O than reasoning about changes. Independent modules replace that contention with narrower rebuilds, isolated cache keys, and parallel work. section 10.3.1 section 10.3.5
Use module boundaries as operational controls, not only as clean-code structure:
- Make each module independently compilable so a change rebuilds only its affected unit. section 10.3.1
- Choose boundaries that let separate agents or developers work without sharing source files, build artifacts, or cache keys. section 10.3.5
- Prefer fine-grained targets when they improve navigation accuracy, blast-radius precision, and parallel build capacity. section 10.3.5
- Treat modularization as a throughput investment whose value becomes more visible as concurrent work increases. section 10.3.1 section 10.3.5
Splitting a monolithic service
A 45,000-line service was divided into seven domain-oriented modules. The build for an individual change fell from 4.2 minutes to 47 seconds, while two agents working on different modules moved from serial execution to parallel builds with no cache contention. section 10.3.5











































