Working effectively with Legacy Code from Feathers which spoke about characterization tests is still a masterpiece. Agents don't change anything. Crap in Crap out still holds, only the speed of producing crap is multiplied.
I think your point about improving the system upon completion or compound engineering is very valid. Surprising many people dont study their traces or even ask codex/claude to learn from the implementation and write skills, hooks and update instructions.
Still how do you manage context switching between multiple agents when you have gotten your project to work well with one agent? What's your process like?
The red / yellow / green framing for codebases is great.
It makes a fuzzy idea very practical: not every part of a system deserves the same level of agent autonomy.
That connects strongly with what I’m exploring with https://howreadyfor.ai how much AI-generated change can an engineering system safely absorb?
Your framing adds a useful twist. Readiness should probably not just produce a score, but also show where agents can roam free, where they need guardrails, and where they should keep their hands off the furniture.
AI is becoming one hell of a codebase inspection tool. 😄
the "a person draws the map" rule is the part that breaks in real life, because that person usually left two jobs ago and took the map with them. we've got a billing module nobody fully understands anymore, so it stays red — agents can read it but nobody edits it without a human pairing on every step.
Really nice article covering huge and complex ground.
Yet, on the Durable artifacts part, I had an itch. For me, "durable" is what stays with the code, and for a long time I'm urging people not to commit stuff model can discover cheaply on itself of via tool. I think the better term is transient artifact - it transfers learnings across relevant task sessions. In most cases, some parts of it are later backed into durable ADR/PRD docs to stay with the code. I prefer to have this at the final stage of the implementation skill chain. What do you think of such framing?
The green / yellow / red zones map almost exactly to what a small-business owner in Japan wrote last month after 100 days of running agents on his company's website: two agents ended up editing the same page, so he made a "don't touch without approval" list and now requires a live URL before anything counts as done. It seems the zone idea works well outside codebases too. Have you seen teams apply the same map to non-code work, like which records or pages an agent may change?
One characterization test I’d add before expanding a yellow zone: the write commits, then the worker dies before reporting success. A fresh process should look up the result using an operation key saved before dispatch. If it cannot establish the outcome, it should stop for reconciliation rather than repeat the write.
We tested that boundary in Mission’s Trust Graduation reference: after killing the worker, two fresh-process resumes left one provider invocation and one verified receipt. This is a local synthetic provider, not proof for a production billing system. Runnable test and limits: https://github.com/gomission/trust-graduation/blob/main/docs/turn-boundary-recovery.md
Would you include recovery evidence in the yellow-to-green criteria? A module can have strong happy-path coverage while still being unsafe to retry after an interrupted agent run.
"Write down what the code can't say" is the clearest version of this I've seen. Most teams either over-document, stuffing context windows with things the agent could infer anyway, or under-document, losing the one fact that actually mattered.
The harder part is your harness test: every repeated correction is a missing piece of the harness. Most instruction files can't tell you which rule just got violated again, or whether it still applies to code that's since moved.
I built a small tool around that gap. Rules are anchored JSON instead of prose, each pointing at a real file or symbol, and a verifier flags it the moment an anchor breaks. An attempt to make "write down what the code can't say" checkable, not just aspirational: https://github.com/localnerve/agent-skills
Curious if you've seen teams track rule staleness this way, or if it's still mostly living in people's heads.
The distinction between preserving today’s behavior and testing a newly invented implementation against itself is the bit I’ll keep. A green suite can look reassuring while answering the wrong question.
Hey, the 'every repeated correction is a missing piece of the harness' line stuck with me. In practice, do you find teams actually move those into lint rules and hooks, or do they pile up as CLAUDE.md notes that drift?
the scariest-file thing is real — I had an agent immediately try to rewrite a billing module because the field names looked interesting, and it had no idea why they were shaped that way. The red-zone rule is the one most teams skip, and honestly it's exactly the one that bites you in prod.
Thanks for this article. It hits on a pain point that I constantly encounter in practice, but rarely see articulated so clearly: agents are brilliant at deriving structure from the code itself, but blind to anything that lies between the lines or in people’s minds. The zone model (green/yellow/red) is a really handy mental tool for this, and I’ll definitely be adopting the idea of keeping comprehension memos across individual sessions.
One thought that kept coming back to me whilst reading: you describe how a person rightly draws the map, and that the final decision should remain with a person. But I believe a good portion of the groundwork for this can be automated, because the raw data has long been available in every repository:
I’ve set out these thoughts in a short blog post in response to your article. You might like to have a read of it.
Your point that the repository is no longer a complete description of the system is the hard part of brownfield agent work. Characterization tests help, but some expectations live in neighboring services or user journeys. For a yellow-zone change, I’d want the research memo to name those external dependencies and the acceptance check to exercise at least one of them. What artifact gives you confidence when the relevant behavior can’t be captured by the repo’s existing tests?
I like the idea of the different zones. But how do you draw the borders of the zones and do the classification? Can you also leverage AI agents for this or should it rely more on human judgement?
I loved this post. I do think that getting these new models integrated into Brownfield projects is sort of a new frontier that wasn't available to us a few years ago. I really like it because it plays into its strengths, which I like to refer to as "interactive documentation". Once a model has enough context, the ability to query it on specific questions you have is so incredibly valuable. As long as they are reliable, of course, but I find, in these instances, hallucinations don't tend to be an issue because the context is so narrow and defined (e.g. "read these files and answer questions") and easily verifiable.
Working effectively with Legacy Code from Feathers which spoke about characterization tests is still a masterpiece. Agents don't change anything. Crap in Crap out still holds, only the speed of producing crap is multiplied.
I think your point about improving the system upon completion or compound engineering is very valid. Surprising many people dont study their traces or even ask codex/claude to learn from the implementation and write skills, hooks and update instructions.
Still how do you manage context switching between multiple agents when you have gotten your project to work well with one agent? What's your process like?
The red / yellow / green framing for codebases is great.
It makes a fuzzy idea very practical: not every part of a system deserves the same level of agent autonomy.
That connects strongly with what I’m exploring with https://howreadyfor.ai how much AI-generated change can an engineering system safely absorb?
Your framing adds a useful twist. Readiness should probably not just produce a score, but also show where agents can roam free, where they need guardrails, and where they should keep their hands off the furniture.
AI is becoming one hell of a codebase inspection tool. 😄
Technical debt is what happens when the undocumented becomes executable.
the "a person draws the map" rule is the part that breaks in real life, because that person usually left two jobs ago and took the map with them. we've got a billing module nobody fully understands anymore, so it stays red — agents can read it but nobody edits it without a human pairing on every step.
Really nice article covering huge and complex ground.
Yet, on the Durable artifacts part, I had an itch. For me, "durable" is what stays with the code, and for a long time I'm urging people not to commit stuff model can discover cheaply on itself of via tool. I think the better term is transient artifact - it transfers learnings across relevant task sessions. In most cases, some parts of it are later backed into durable ADR/PRD docs to stay with the code. I prefer to have this at the final stage of the implementation skill chain. What do you think of such framing?
The green / yellow / red zones map almost exactly to what a small-business owner in Japan wrote last month after 100 days of running agents on his company's website: two agents ended up editing the same page, so he made a "don't touch without approval" list and now requires a live URL before anything counts as done. It seems the zone idea works well outside codebases too. Have you seen teams apply the same map to non-code work, like which records or pages an agent may change?
One characterization test I’d add before expanding a yellow zone: the write commits, then the worker dies before reporting success. A fresh process should look up the result using an operation key saved before dispatch. If it cannot establish the outcome, it should stop for reconciliation rather than repeat the write.
We tested that boundary in Mission’s Trust Graduation reference: after killing the worker, two fresh-process resumes left one provider invocation and one verified receipt. This is a local synthetic provider, not proof for a production billing system. Runnable test and limits: https://github.com/gomission/trust-graduation/blob/main/docs/turn-boundary-recovery.md
Would you include recovery evidence in the yellow-to-green criteria? A module can have strong happy-path coverage while still being unsafe to retry after an interrupted agent run.
"Write down what the code can't say" is the clearest version of this I've seen. Most teams either over-document, stuffing context windows with things the agent could infer anyway, or under-document, losing the one fact that actually mattered.
The harder part is your harness test: every repeated correction is a missing piece of the harness. Most instruction files can't tell you which rule just got violated again, or whether it still applies to code that's since moved.
I built a small tool around that gap. Rules are anchored JSON instead of prose, each pointing at a real file or symbol, and a verifier flags it the moment an anchor breaks. An attempt to make "write down what the code can't say" checkable, not just aspirational: https://github.com/localnerve/agent-skills
Curious if you've seen teams track rule staleness this way, or if it's still mostly living in people's heads.
The distinction between preserving today’s behavior and testing a newly invented implementation against itself is the bit I’ll keep. A green suite can look reassuring while answering the wrong question.
I spent the last two weeks dropping agents into a codebase older than half the team.
The agent ships a "working" change. Tests look green. Then a constraint nobody wrote down breaks downstream.
Brownfield isn't a prompt problem. It's making the invisible cheap to see before you hand off the edit.
Harness and evals are the brakes. Without them you're just accelerating into tribal knowledge.
Hey, the 'every repeated correction is a missing piece of the harness' line stuck with me. In practice, do you find teams actually move those into lint rules and hooks, or do they pile up as CLAUDE.md notes that drift?
the scariest-file thing is real — I had an agent immediately try to rewrite a billing module because the field names looked interesting, and it had no idea why they were shaped that way. The red-zone rule is the one most teams skip, and honestly it's exactly the one that bites you in prod.
Hi Addy,
Thanks for this article. It hits on a pain point that I constantly encounter in practice, but rarely see articulated so clearly: agents are brilliant at deriving structure from the code itself, but blind to anything that lies between the lines or in people’s minds. The zone model (green/yellow/red) is a really handy mental tool for this, and I’ll definitely be adopting the idea of keeping comprehension memos across individual sessions.
One thought that kept coming back to me whilst reading: you describe how a person rightly draws the map, and that the final decision should remain with a person. But I believe a good portion of the groundwork for this can be automated, because the raw data has long been available in every repository:
I’ve set out these thoughts in a short blog post in response to your article. You might like to have a read of it.
https://medium.com/@alt.wibbing/from-metaphor-to-metric-automatically-color-coding-brownfield-zones-fa4914a35db0
Thanks again for the food for thought!
Best regards, Christian
Your point that the repository is no longer a complete description of the system is the hard part of brownfield agent work. Characterization tests help, but some expectations live in neighboring services or user journeys. For a yellow-zone change, I’d want the research memo to name those external dependencies and the acceptance check to exercise at least one of them. What artifact gives you confidence when the relevant behavior can’t be captured by the repo’s existing tests?
I like the idea of the different zones. But how do you draw the borders of the zones and do the classification? Can you also leverage AI agents for this or should it rely more on human judgement?
I loved this post. I do think that getting these new models integrated into Brownfield projects is sort of a new frontier that wasn't available to us a few years ago. I really like it because it plays into its strengths, which I like to refer to as "interactive documentation". Once a model has enough context, the ability to query it on specific questions you have is so incredibly valuable. As long as they are reliable, of course, but I find, in these instances, hallucinations don't tend to be an issue because the context is so narrow and defined (e.g. "read these files and answer questions") and easily verifiable.