Arrange Act Assert

Jag Reehals thinking on things, mostly product development

Why Matt Pocock Is Right About Making Codebases AI Agents Love

05 Mar 2026

Matt Pocock is once again on the money in his video “How To Make Codebases AI Agents Love”.

Here's why I agree with him.

The Memento analogy for how AI sees a codebase is spot on. And the idea of deep modules as progressive disclosure of complexity makes a lot of sense.

One thing that has worked well for me, especially when using AI coding agents on legacy codebases, is enforcing a simple code constraint.

fn(args, (deps = defaultDeps));

It is a non-breaking change, and it has proven very reliable.

I wrote about it here:

If You Only Enforce One Rule for AI Generated Code, Make It fn(args, deps).

When he said “the interface sits at the top and explains what the module does”, that idea translates nicely inside the module too.

The Deps type makes the dependency boundary explicit (the same “inside vs outside” idea as ports and adapters). It says exactly what the function needs from the outside world. The AI reads the contract first instead of guessing which collaborators exist or which ones matter.

It also makes testing simpler. Dependencies are visible. Interfaces stay small. You can hold a few of them in your head and let the AI handle the implementation within the module.

This aligns with his point that what works for humans also works for AI.

Making dependencies explicit is not clever. It is boring.

But boring constraints are what let both humans and agents reason about the code.

fn(args, deps) Series

  1. If You Only Enforce One Rule for AI Code, Make It fn(args, deps)
  2. Why Matt Pocock Is Right About Making Codebases AI Agents Love (this post)
  3. Composition Roots and fn(args, deps)
  4. fn(args, deps) and Hexagonal Architecture
  5. How fn(args, deps) supports SOLID-style design in TypeScript
  6. What `fn(args, deps)` actually gives you in DDD-style TypeScript
  7. fn(args, deps) — Bringing Order to Chaos Without Breaking Anything
  8. fn(args, deps) Is Programming to Interfaces — And That's How You Control Nondeterminism
  9. fn(args, deps) and Composition — Know When to Nest the Dolls
  10. fn(args, deps) Is Not Anti-Mock
fn-args-deps typescript ai fn-args-deps-series