AI engineering is like gardening
Written by Bob, my BusyYaks agent · open source. Thanks, Bob :)Agents are not magic. It’s math. So are plants.
A plant grows well in a steady environment, from healthy parent plants. Any disease spreads quickly. Agents work the same way. They copy the code they find. Give them good code and they grow more of it. Let one bad pattern in and it spreads, unless something stops it.
That matters the moment you scale agents up to build faster. The problem is not a weak model producing slop. The problem is the environment, and the code that is already there.
So the job changes. Less writing code, more gardening: keep the soil clean, build the frames the growth follows, pull the weeds early. I tried this on my own site. The checks found bugs I had shipped. Then one of my own checks turned out to be broken.
Weeds spread
Before agents, a workaround was one bad line. Now it is a seed. The next agent finds it, copies it, and next week it is everywhere. Deprecated APIs, old tech debt, the quick fix nobody undid: all of it spreads the same way. An agent can’t tell a precedent from a mistake. To it, both are just code that exists.
So keep the codebase clean enough to copy. Not because clean code is pretty. Because it is now the seed bank for every change that lands.
Pour concrete, don’t put up signs
Not every fix holds the same. Some are concrete: the plant can’t grow through them. Some are signs: a note asking it nicely. Spend most of the effort on concrete.
Think of it as an upside-down pyramid. The deterministic layers are wide at the top. Prose sits at the narrow bottom, because prose needs judgment, and judgment is exactly what a copying agent doesn’t have.
Small examples work best:
- Directories as a boundary. Code that must not mix lives in separate top-level directories. A dependency-graph check bans imports between them.
- Every correction becomes a check. When you correct an agent, ask: can this be a lint rule or a better API, instead of one more line in AGENTS.md? Do that often enough and code review runs out of things to find.
One rule on top: a new check gets fixed everywhere in the same change. A baseline file of “known offenders” is a weed with a permit.
Comments are where the weeds hide
Agents leave comments that justify the shortcut: why this quick fix is fine, just this once. That comment is a disease in disguise. Nothing enforces it, it goes stale, and it tells the next agent the shortcut is allowed. Ban most comments. Write lint errors that tell the agent to fix the root cause instead.
Rules can get sick too. Agents over-rotate: one small correction turns into a rule forever. Prune them.
I tried it on this site
My site had the same disease. Articles kept coming back with the same corrections, and every time the fix was one more sentence in an instruction file. So I read 19 recent cards on my board, mostly articles, and wrote down every correction I made and every finding the QA agents raised. About 60 kinds.
Every one a script could catch became a check. They run in CI on every push: a lint over the Markdown, and a rendered audit of every article page at 1280 and 390 px. What needs judgment went into a writing skill, each rule pointing to the card it came from.
| count | what the checks found |
|---|---|
| 277 | lint hits on the first run, before tuning (JRuby versions read as IP addresses, and the like) |
| 33 | real findings after tuning: blank lines inside figures, a repeated sentence, a leftover draft marker |
| 1 | a figure whose labels were never painted, live on the site |
| 3 | pages that scrolled sideways on a phone or a laptop |
| 88/125 | pages whose figure labels render under 10 px |
The 33 findings, the broken figure and the 3 pages are fixed. The 88 small-label pages are a project of their own. That check goes on with the PR that fixes the last of them. Not before, and not with an exemption list.
Check the weed killer
Then a QA agent planted seven violations on purpose, to see if the checks fire. Six were caught. The seventh slipped through: a “Related” link whose text didn’t match the article it pointed to. The check worked mid-file but not at the end of a file, because I had written \Z for end-of-input, and JavaScript regular expressions don’t have it. A real mismatch of exactly that kind was already live.
A check that never fails looks the same as a check that works. The fix was one regular expression. The lesson: plant weeds. Every check gets a test that breaks the rule on purpose and expects a failure.
Review becomes reading proof
The other half is looking at the plant, not the seed packet. Let agents run the code and show it, then review what they bring back instead of the diff. Model checks of user flows, proofs of small algorithms, property-based UI tests: all of it fits here.
None of this is new. It used to be too expensive to write and keep up. Agents made it cheap. On my site it looks like this: simulators with a checkable answer ship a selfTest() against ground truth (the event-loop simulator runs 32 cases against a real browser Worker), and cards reach me with a QA verdict and screenshots at both widths.
Where the metaphor breaks
A garden grows without you. A codebase rots without you, and with agents it rots faster. What stays human is taste: what not to build, which correction deserves a check, and when a rule is wrong for everyone and should change instead of being worked around.
Fix the soil first: the code, the checks, the verification. If your loop grows slop, automating it grows more slop, faster. Then build the factory on top. That part is in How I reached 100 quality PRs a day with an agents kanban.
Related
- How I reached 100 quality PRs a day with an agents kanban — the factory half: the board, the agency, the throughput.
- How I manage teams of coding agents on a private project locally — Human Check, the gate the checks feed.
- busyyaks: self-hosted kanban for Claude Code — the board as open source.