$ cat what-the-agent-reads.md
What the agent reads.
People ask which model and which prompt. I think that is the wrong end of the problem; the work is in what the agent reads before it writes, and what checks it after.
- Published
- 2026
- Reading
- 7 min
- Tags
- ai · engineering
In November I put a browser test suite into CI, and it lasted exactly one day. To its credit it had already caught a real bug by then; it also fell over whenever the runner was busy, which on a shared runner is most of the time. So I pulled it back out, wrote down why, and somewhere in the writing landed on a sentence I’ve been repeating to myself ever since: a gate that fails on noise guards nothing.
Now, why open a post about AI tooling with a flaky test suite? Because an agent writes most of the code these days, same as engineering at Elective built with coding agents from November 2025, and the question I get is always some version of which model, which tool, what’s your prompt. Fair question; wrong end of the problem if you ask me. The agent is the easy part. What it reads before it writes, and what checks it once it has, is where all my time goes.
One file every tool reads
I have a single instruction file, AGENTS.md, and every tool I use reads it. The file says so itself, right at the top:
> This is the one instruction file every agent reads (ADR 0049).
> Rules that bind one directory live in an `AGENTS.md` beside it.
That’s it; that’s the whole trick. I try new tools constantly, and I surely wasn’t going to keep three copies of the rules in sync by hand.
What’s in there is what I’d tell a new engineer on day one: who the app is for, how a use case is laid out, that we don’t hard delete anything, that a migration can never break the code that’s already running. Every rule links to the decision behind it, so the why is one click away.
It also grew to about 6,700 words, which is… a lot. Nobody, human or otherwise, needs all of that to change a button. So the rules that only matter in one directory now live in that directory - the web app has its own file, so does the marketing site, so does the MCP server - and the agent reads what applies to where it’s working. The stack all of this sits on has its own post.
Write the decisions down
158 decision records at the time of writing. Each one says what I decided, why, and what I turned down. An agent starts every session knowing nothing, so “why is it like this?” is the question it needs answered most, and it turns out future me needs the exact same answer about three weeks later.
The catch is that docs rot. A change lands, a paragraph that was true yesterday is false today, and the agent will follow it off a cliff none the less. So on every push a check reads the diff and asks one thing: does this change make a section of the instructions, or one of the decision records, untrue? If it might, it tells me which one.
A model sorts, code writes
One of those records is about the product itself, and its title is the rule: a model may sort the data, never write the sentence.
Concrete example. I need to know whether a recurring charge is a commitment or a habit. The first version was a prompt that politely begged for JSON, plus a parser that quietly dropped whatever it couldn’t read. Not ideal. Now the model gets a typed question and hands back a typed choice with a confidence, and there’s no prose to parse because there is no prose. With the exception of the review written when a month closes, every sentence you read in the app comes out of code.
I hold the tooling to the same rule. The useful question about a new tool is what happens when it’s wrong, and “it wrote me a very confident essay” is a much worse answer than “it said yes at 0.6”.
Checks that ask questions
ESLint can tell me an import is in the wrong place. It can’t tell me a test is useless. So I built semantic-lint (on top of drift, both published from dcwt, my build studio), where every rule is one yes-or-no question put to a small, fast model about one file. Here’s one of them, trimmed:
export const testAssertsBehavior: LintRule = {
slug: "test-asserts-behavior",
title: "Test would pass against a no-op implementation",
appliesTo: (path) => path.endsWith(".test.ts"),
// context and the rest of the question left out
question: (file) =>
`File "${file.path}" is a test file. state.related[0], when present, is the unit ` +
`under test. Reading both: would this test file still pass if the unit were ` +
`replaced with an implementation that returns empty/zero/null for every output ` +
`and performs no writes?`,
floors: { error: 0.75, warn: 0.45 },
};
You know this test. It calls the function, checks that something came back, goes green, and would go just as green against an empty function. I’ve written it; the agent writes it too, and with a lot more enthusiasm.
The two numbers at the bottom are what make this usable and not just vibes. The model answers with a probability; 0.75 and up is an error, 0.45 is a warning. Those floors come from a folder of examples per rule - files that follow it and files that break it, some pulled from my test history, some made by taking a perfectly good test and weakening it on purpose - and the floor sits where the rule catches the bad ones and leaves the good ones alone.
There are 20 rules at the moment: some for the architecture, some for the design system, three for the tests, and one that reads the copy a person actually sees on the page. And yes, I’m aware this is a model marking another model’s homework.
Where the checks run
A gate that fails on noise guards nothing.
Which brings me back to the browser suite, because that sentence now decides where every check runs.
On my machine they advise. They run on every push, print what they found and always exit clean, because the day a check blocks me on a maybe is the day I start skipping it. In CI the build only fails on a finding above its error floor, and if the model provider is having a day, the job skips; an outage is noise too. That same push runs a second check that reads the diff and tells me whether it deserves a proper deep review. Some things always do: a migration that drops a column, anything near auth, a payment webhook.
The browser suite still runs, on my machine, where a slow run is just a slow run. Next to it is flow-lab: an agent gets a goal in the app and a budget of turns, and a second model judges the run against yes-or-no questions. 18 scenarios so far. When the agent can’t get there inside its budget, that tells me something about my design and very little about the agent.
What’s new and unproven
Skills are the newest layer and I’ve had them for all of a few days, so take this part with some salt. I installed Matt Pocock’s set: one interviews me until a plan has no holes left in it, one keeps the glossary and the decision records sharp, one turns a plan into a spec and the spec into tickets. This very post was planned with the first of them, which put forty-odd questions to me before I was allowed to write a word. Ask me in a few months whether they stuck.
There are also hooks that stop an agent from running something destructive or reading a secret, and that’s all you’re getting out of me on those.
So, if I started a fresh repo tomorrow, this is the order I’d go in:
- One instruction file that every tool reads, with the rules a new engineer would need and the reason for each.
- A decision record whenever I pick between two real options, so the reason outlives the session.
- One check that asks a question a normal linter can’t, with its threshold set against real examples, and only advising until it has earned the right to block.
If you made it this far you’ve probably noticed none of it is new. It’s onboarding, documentation and code review, for a colleague who is very fast and forgets everything overnight.