Most codebases assume a person who remembers things. Someone knows why the billing module is odd, which command really runs the tests, and what you must never touch. More and more often, the next one to open your repository is an agent, and it remembers none of that. It starts from what's on disk, and whatever it can't find there, it guesses. So how readable your code is becomes a cost you pay on every task, and it's worth treating an agent as the next maintainer from the first commit.
Tell it where things are
Keep a short AGENTS.md at the root of the repository. It only needs four things: the commands that build and test the project, where things live, the conventions you follow, and the boundaries an agent shouldn't cross. Write down what the code doesn't make obvious and leave out the rest, because every line gets read again on every task.
Write down why
Code shows what happens and rarely says why. Keep a second document for the modules, how data moves between them, and a dated list of decisions. That list is what stops an agent from tidying away something you did on purpose. Update it in the same change as the code. A document that has drifted is worse than none, because the agent will believe it.
Give it one command to trust
An agent needs a quick way to find out whether it broke something. A single check script that runs the type check, lint and unit tests gives it that, and it's the same command whatever the task. Keep it fast enough that running it after every change is the obvious thing to do.
Make mistakes loud and useful
Strict types, plus validation wherever data comes in from outside, turn a wrong assumption into an immediate error. One shared error type with a stable code and a message that says what to do next gives the agent something to act on. Tests named as sentences of behaviour pull double duty, because the list of tests reads as a description of what the app does. Modules with a single public entry help as well: an agent can change the inside of one without reading everything that calls it.
How this works in 1904
Every later change to an app 1904 builds is made by an agent, so we hold every app to this bar, at every depth, whether or not the app itself uses AI. It isn't a setting. The first task of a build creates AGENTS.md and ARCHITECTURE.md, the check, typecheck and test scripts, and strict typing. Every later task keeps them true, and each agent is told to read them first. A check during the build looks for a missing document, an empty section, a missing script or loose typing, and sends the work back with a sentence saying what to add. Apps built before this don't suddenly start failing. The first feature build on an older app documents the code as it stands, without reorganising modules that already work.
You can start on any repository with a short AGENTS.md and one check script.