This one is more opinion than how-to. I’ve been putting together a talk for my team about how we work with coding agents, and one of the slides had to answer a question I was sure someone in the room would ask, which is whether the whole setup is just a scripted workflow with extra steps. Writing that answer down made me look again at a few decisions I’d made for practical reasons, and a video by Joe Maddalone and an article by Rob West about the “software factory” idea helped me put words to the reasoning behind them, so they show up here too.
What the foundation is for
Agents write code quickly, and for most of our work writing code stopped being the hard part a while ago. What makes their output hard to ship is that every session starts from zero, so a decision we explained on Monday is gone by Tuesday’s session, that an agent will say the tests pass with the same confidence whether or not those tests could ever fail, and that all the extra code ends up on a reviewer’s desk, so the queue just moved from writing to reading. What helped with all three, in our case, was giving the agent something to stand on (knowledge it can read, a few rules it can’t ignore, and checks that leave evidence behind), and then leaving it to the developer to use that however suits the change in front of them.
The pull toward a script
When an agent gets something wrong often enough, the natural reaction is to take away its room to get it wrong. We write down the steps in order, then the exact prompt for each one, and eventually a command that runs them for us and keeps a state file so nothing gets skipped, and every one of those additions makes sense on the day it’s added, because it fixes something we just watched the agent do.
The trouble is that the thing we’re constraining keeps changing under us. Models and the tools around them change every few weeks, and a process tuned for the weaknesses of this month’s model turns into the thing that gets in the way when next month’s model doesn’t have those weaknesses, or has different ones. Anthropic’s post on effective context engineering for AI agents makes a similar point, that hardcoded, brittle logic “creates fragility and increases maintenance complexity over time”, and that smarter models need less prescriptive engineering.
The name the industry has for that idea, taken all the way, is the software factory, an assembly line of agents where tickets go in at one end and pull requests come out at the other. Rob West wrote a good piece on why the agentic software factory is the wrong metaphor, and his main point is one we sort of knew already, that source code is the design, and software has had a factory for a long time in the form of compilers, build pipelines and CI, which turn that design into something that runs. A factory assumes the design problem is solved before production starts, while in our work deciding what to build is most of the job, requirements change as soon as we test them, and a ticket that looks well defined usually hides some ambiguity, which an agent on an assembly line will fill with a plausible guess that nobody notices until much later.
Joe Maddalone makes the same argument in a video (there’s also a written version), and goes further, saying that a lot of our habits, the craftsman polishing code by hand included, were built around what code cost when people wrote all of it, and that the engineer’s value is moving toward intent, trade-offs, taste and verification. He also points out that experienced developers tend to use AI as a faster autocomplete for the way they already work, which is something a scripted workflow makes permanent, since the script is the way of working of whoever wrote it, frozen at the time they wrote it.
What I mean by a foundation
The setup I ended up with is a docs-only workspace that the agents read before touching any project, and it has four parts:
- Shared skills, which are Markdown files in the repo (some from a plugin, some our own), so everyone on the team gets the same
/brainstorming,/poke-holesor/pre-pr, and changing one is a pull request like any other. - Rules in
AGENTS.mdandCLAUDE.md, short and specific to the project, plus a playbook that every session reads first. - Reviewer agents that a change goes through before it becomes a PR.
- A repository that remembers, meaning decisions go into ADRs and lessons go into learnings files, so the next session can find them when the work touches the same area.
On top of that there is a flow, from spec to plan to build to PR, which is a recommended default that each developer can step off. Each developer picks the skills that fit the change, and the playbook sizes the flow so not everything runs every time:
| Size | Examples | Flow |
|---|---|---|
| Small | A typo, a config value, an obvious one-line bug | Failing test, fix, /pre-pr with a light review |
| Standard | A feature or behavior change | The full flow |
| Risky | Security, the public API, a contract between projects | The full flow, plus /poke-holes on the spec and a person reviewing the plan |
When you’re unsure, you pick the larger size, and a small change that turns out to need a design decision goes back to design. The one exception to sizing by how a change looks is a change to the agents’ own instructions, which is never sized small (a four-file change like that once had its core reviewers skipped as having nothing to check in prose, and running them afterwards found 3 P1s and 7 P2s).
The memory part is the one that matters most to me. Since every agent session starts from zero, the playbook has design start by reading the ADRs and learnings that touch the area, and when something breaks, the fix ends with a written learning, so the next session that works there knows about it. A future session picks those up when it needs them and has a decent chance of arriving at a good decision on its own, without anyone scripting that decision for it, and the reviews before a PR are there to catch it when it didn’t use what was written down. That also means the foundation changes in both directions, it grows a learning or a skill whenever the team runs into something new, and it loses a skill when a newer model no longer needs it.
Why developers keep free hands
Not scripting the flow leaves the choices with the developer, which skills to use, in what order, when a change needs /poke-holes and when it can do without, and I think that’s where those choices belong. If the work is design work, the person doing it needs room to try an alternative, throw a prototype away or go back to the spec when the plan turns out wrong, and two developers on the same team will reasonably take different routes through the same change. It’s also how the way of working itself gets better, since someone has to try something different before it can become the team’s default, and a script leaves no room for that.
How close I came to scripting it anyway
A while before the talk I asked an agent to review the flow with an eye on friction and reliability, and its main suggestion was a /flow conductor command, with a state file per feature, that runs the steps in order, takes the recommended option at every routine menu, and stops only at the few points where a person has to decide. I didn’t build it, at first only because the skills already stop and ask after the spec and after the plan, and that’s where we pick /poke-holes or /deepen-plan when the change needs it. It took writing the philosophy slide a few weeks later for me to see the better reason, that a conductor would have turned the flow into a small software factory of exactly the kind I was about to argue against in front of the team, so the talk now presents the flow as a default, on a slide that answers “Isn’t this a scripted workflow?” with “Constrain the outcomes, not the path.”
There’s a tweet by Dax Raad (SST, opencode) that went into the talk too, listing people moving to monorepos because of agents and others moving off them because of agents, and the same for infrastructure as code, and concluding that everyone is confused and doing random things. It’s funny, and it’s the same instinct as the conductor, reshaping everything around whatever the current model seems to want. I didn’t restructure any of our repos for the agents; they keep their own pipelines and release cycles, and what changed is only what the agent can read before it starts.
The limits that stay
What stays firm is the outcomes and the evidence for them. A person approves the spec for any change big enough to have one, picks the fix for any P0 finding, and reviews and merges the PR, and every new test has to be seen failing on its own assertion, which are all ways of making sure that a person’s judgment and some real verification happened, whichever route the work took. That’s the part of the engineer’s job that both Maddalone and West see growing, so it’s the part I’d make non-negotiable. The agent also doesn’t force-push, skip git hooks or merge.
Most of these stay as instructions in the skills and the playbook, and only the git rules are blocked by a hook before the command runs (how I decided which rules get that treatment is in the post on which agent rules to enforce). Those, together with the build and the tests, are the factory part of our setup, the production work that West says should be automated, and that part can be as rigid as it likes.
What the setup comes down to
The way I’d put the stance now is that agents made writing code cheap and left deciding and verifying as the expensive part, so the effort goes into a foundation that helps with those, meaning knowledge the agent can read, a short list of outcomes that need evidence, and the production steps automated properly, and everything in between is left to the developer and the agent. A scripted workflow, or a software factory, spends that effort on the cheap part, and it ages with whichever model it was written for. If a newer model stops needing one of our skills, we delete its Markdown file, and when the team learns something new, it goes into the repo for the next session to find.