Introduction: The model is not your bottleneck
Most teams working with AI coding agents are waiting for the same thing: the next, even smarter model. The assumption behind this is that better results are mainly a question of model quality.
That assumption is wrong — and it is why so many AI projects disappoint in development. TypeScript educator and former Vercel engineer Matt Pocock puts it bluntly in a widely noted interview:
"Fix the environment your agent operates in."
An AI agent doesn't get better because the model gets better. It gets better because the environment it works in gets better: clear terminology, documented decisions, tight feedback loops, and automatic, deterministic checks. This environment can be built systematically — and that is exactly what this article is about.
At Reto Grau Consulting we observe the same effect in our own infrastructure: the quality of autonomous agents rises and falls not with the model, but with the discipline of the environment. This article distils the workflow that has emerged as the leading practice for this.
The core thesis: strategic beats tactical
The most important idea first, because everything else builds on it:
AI has taken over tactical programming — the pure typing of code. It cannot do strategic programming. And that is now more valuable than ever.
What does that mean in practice?
| Tactical (handled by AI) | Strategic (delivered by human + environment) | |
|---|---|---|
| Question | How do I write this function? | What exactly are we building and why this way? |
| Example | Typing a component, writing a loop, formulating a test | Deciding which modules exist, where the boundaries lie, which terms apply |
| Cost | Seconds, now trivial | Thinking, alignment, documentation |
| Who | Agent, reliably | Human + maintained environment (glossary, decision logs, specs, checks) |
The point: because the tactical part is now almost free, the real value shifts upward — to the strategic level. Whoever is sloppy there gets garbage produced by the AI at full throttle. Or as Pocock puts it: "Agents also accelerate software entropy." Because the agent produces code so quickly, the codebase also becomes complex and unmaintainable faster — if nobody maintains the strategic level.
The following workflow is, at its core, a single principle: give the agent the strategic level before and after it does tactical work. In practice this happens through a chain of reusable steps.
Step 1: Alignment before code
The most common failure in software development is not bad code — it is misalignment:
"You think the developer knows what you want. Then you see what they built — and realise they never understood you."
With AI agents the risk is identical. The fix is a structured clarification session before a single line of code is written: instead of starting immediately, the agent interviews the stakeholder — it explores the existing codebase and keeps asking targeted questions until every branch of the decision tree is resolved.
Two artefacts make the decisive difference:
a) A shared glossary. The agent decodes and maintains the project-specific vocabulary. An example shows the effect:
- Before: "There's a problem when a lesson in a course section is made 'real', i.e. gets a place in the file system."
- After: "There's a problem with the materialization cascade."
A precise term instead of a whole sentence. This pays off session after session: variables, functions and files are named consistently, the codebase becomes easier to navigate, and the agent spends fewer resources on thinking because it has a more precise language.
b) Decision logs (Architectural Decision Records). Small documents, each capturing one hard-to-explain architectural decision: why was X built this way and not another? The agent reads them before touching anything — and doesn't constantly propose overturning decisions already made.
Step 2: From conversation to specification
Not a new interview, but a clean synthesis: what was just discussed is turned into a clear specification and filed in the task tracker. In the process it is briefly clarified which modules the planned change touches — coupling the specification directly to architectural thinking.
Step 3: From specification to small, runnable tickets
The specification is broken down into small tickets that declare their own dependencies ("this ticket blocks that one"). Crucially, each ticket is a thin but end-to-end, genuinely runnable slice — not half a layer that does nothing on its own. This follows the proven principle:
"Always take small, deliberate steps. Your feedback rate is your speed limit."
Step 4: Building with test-driven development
Now it gets implemented. The tickets are treated as a dependency graph, and multiple implementation agents work in parallel on all tickets that are currently ready. At predefined critical points, test-driven development (TDD) comes into play.
TDD reverses the usual order: the test is written first, the code afterwards. The test thereby defines, precisely and in advance, what the code must accomplish — it is effectively the executable specification. The core is a short, repeating cycle:
| Phase | What happens | Why |
|---|---|---|
| Red | Write a test for a function that doesn't exist yet — it fails. Example: calculateDiscount(100, 10%) must return 90. | The goal is defined objectively before a single line of code exists. |
| Green | Write just enough code to make the test pass — no extra features. | Minimal path to provably correct behaviour. |
| Refactor | Clean up the code while the test stays green. | The test catches it instantly if the cleanup breaks something. |
In the agent context this is especially valuable: the test gives the agent a deterministic goal ("make this test pass") instead of a vague description. The agent cannot drift — the test is objective proof that the code does the right thing. Without this loop the agent flies blind: it produces code at full throttle, but nobody knows whether it is correct. This is "strategic before tactical" in its purest form — the precise specification comes before the fast execution.
Step 5: The two-axis review
Before changes are committed, a review examines exactly the diff — the line-by-line list of all changes, i.e. only the delta from the previous state, not the whole code. The clever part: this review runs as two separate, parallel checks that do not influence each other:
| Axis | Question | Checks against |
|---|---|---|
| Standards | Does the code follow our quality standards? | Coding standards + established "code smell" criteria |
| Specification | Does the code faithfully implement the original requirement? | The original specification |
Why separate? A single reviewer mixes "is this clean code?" with "is this even the right thing?" — and then often misses one because they are fixated on the other. Two isolated axes catch both reliably.
Step 6: The pull request as a decision template
Not every change needs the same level of scrutiny. A good change request makes the risk assessment explicit and consists of three parts:
- Summary: the smallest element that makes the change clear.
- Evidence: a before/after proof that it really works (screenshot, execution result).
- Risk assessment in two dimensions:
- One-way or two-way door: Is the change reversible?
- Blast radius: How big is the damage if something goes wrong?
The rule of thumb: a reversible change with a small blast radius → minimal review, you can effectively test it in production. An irreversible change with a large blast radius → maximum care; here you deliberately try to break the change before it goes live.
Step 7: Improve the system, not just the task
The strategically most valuable step comes right at the end. After the review, a retrospective looks at the entire session and asks systematically:
"How do I prevent exactly this mistake next time — deterministically?"
The goal is radical: not "please don't do that again" (prose, unreliable), but a script, an automatic check or a type definition that makes the mistake impossible. Each pass raises the automatic checks one level higher, until a particular mistake simply cannot happen anymore. The principle that runs through the entire workflow:
"Always pick determinism over non-determinism."
This one step turns a good process into a self-improving one: every correction improves not just the current result, but the system permanently.
The foundation: deep modules instead of shallow ones
In addition to the daily loop, a regular architecture review pays off. It looks for opportunities to encapsulate building blocks more cleanly — following the principle from John Ousterhout's A Philosophy of Software Design:
"The best modules are deep: a lot of functionality behind a simple interface."
What does that mean? Every building block in the code (a function, a file, a service) has two sides:
- The interface — the narrow control surface facing outward: how you use the building block (what goes in, what comes out). That is all the rest of the program needs to know.
- The implementation — the inner workings: how the task is actually done. That stays hidden.
A good image is a thermostat: on the outside just a dial (interface — "set 21 °C"), on the inside the complicated mechanics (implementation) that are none of the user's concern.
- A deep module has a small, simple interface but a lot of functionality behind it. Little to learn, few sources of error.
- A shallow module has a large, complicated interface for little value in return — pure friction.
Why does this matter precisely in the AI context? A deep module can be tested from the outside through its narrow interface — and its inner workings can later be rebuilt at will without the tests breaking. That is the foundation for an agent being able to change things safely and quickly. Shallow modules, by contrast, force you to touch numerous other places with every small change. A few deep building blocks with clear control surfaces beat many small ones that all have to know about each other. This keeps the codebase changeable — the precondition for being able to delegate work to agents at all.
Conclusion: the strategic level is the lever
AI agents will not replace software development — but they shift where the value is created. The tactical typing of code has become a commodity. The difference between a team that excels with AI agents and one that sinks into growing chaos lies entirely at the strategic level:
- Alignment before code — let the agent interview first, then build.
- Shared language and documented decisions — glossary and decision logs.
- Small, runnable steps — the feedback rate is the speed limit.
- Deterministic goals — tests instead of vague descriptions.
- Separate review axes — check quality and correctness separately.
- Risk-based approval — not every change needs the same effort.
- Self-improvement through determinism — make mistakes impossible via script, not by admonishing in prose.
Perhaps the most fitting sentence from Pocock's interview: "It comes down to caring." Not the computer science degree (he himself holds a drama degree), not the model, but whether you truly maintain the strategic level: shared language, documented decisions, tight feedback loops — and always determinism over good intentions.
About Reto Grau Consulting
Reto Grau Consulting GmbH supports Swiss companies and municipalities in the productive and responsible use of AI — from strategy through autonomous agents to on-premise operation for full data sovereignty. With over 25 years of experience at the intersection of technology, financial markets and public administration.
Source: The workflow described is based on an interview by Matt Pocock (AIHero.dev) with NetworkChuck; his skills are publicly available at github.com/mattpocock/skills.
Contact:
Reto Grau Consulting GmbH
Langmoosstrasse 68, 8135 Langnau am Albis
kontakt@reto-grau-consulting.ch
https://reto-grau-consulting.ch