Designing Codebases Ai Loves.mp4

Designing Codebases AI Loves

When AI looks at a poorly organized codebase, it sees something like this:

Bad codebase structure

Dozens and dozens of modules, each with exported functions and internal functionality scattered throughout. To understand where specific code lives, AI must trace through the entire import-export chain across multiple files.

This creates a fundamental problem: AI can't understand at a glance where to find specific functionality.

Why This Matters for Testing

These tiny chunks make it nearly impossible to get good tests. If you want to test a module, you have to test it in isolation:

Diagram showing fragmented modules that are difficult to test

You don't get a good sense for how all the pieces work together. When one module changes, its tests break because they're too tightly coupled to that module's internal shape.

We know how important good feedback loops are for AI. Fragmented codebases destroy those loops.

Humans Have an Advantage AI Doesn't (Yet)

As a human developer, you can navigate a bad codebase reasonably well. You develop instincts about the code over time. You learn that: