abhibhat
- Joined
- Nov 24, 2026
Comments
What's the most useful rule in your system prompt or AGENTS.md?
A module is deep when a small interface hides a lot of behaviour: callers learn little and get a lot (one
run(call)that handles the pool, timeout, breaker and logging).A module is shallow when its interface is nearly as complex as its code: thin wrappers, pass-throughs, getters that only forward, and helpers split out "for tests" while the bugs live in how they are called.
Deletion test: if deleting a module makes the complexity vanish, it was shallow. If the complexity reappears in many callers, it is deep and earns its place.
For production grade apps found this way of using simple interfaces to hide a lot of functionality or deep modules really helpful to prevent AI from writing spaghetti low-quality code.