
How to build a software factory that ships code you can actually trust
Learn the isolate, build, prove, ship framework top AI builders use to run parallel coding agents without drowning in sloppy, unreviewable code.
Most people running AI coding agents right now are doing the equivalent of letting a new hire push straight to production with no code review, no tests, and no manager checking their work. It runs fine for a week. Then one Tuesday, three agents overwrite each other's files, a "feature" quietly breaks checkout, and nobody can explain why because nobody actually read the diff.
There's a better way to run this, and it doesn't require a bigger team or a fancier model. It requires a system — a repeatable, four-step production line that keeps agents from stepping on each other, keeps the code readable by an actual human, and gives you visual proof that something works before it ever reaches your main branch. People are calling this a "software factory," and the framework behind it is refreshingly simple: isolate, build, prove, ship.
What is a software factory, exactly?
An AI software factory is not a single tool or a single agent — it's the system wrapped around your coding agent. An AI software factory is the system around a coding agent rather than the agent itself, with an intake queue that decides what work is worth starting, isolated workspaces so parallel agents do not collide, a shared tool layer, automated verification, and an explicit merge gate.
The reason this matters: AI coding agents accelerate one step — writing code — while a software factory automates the loop around it, including triage, validation, release, and documentation, plus the handoffs between steps where context normally degrades. Without that surrounding system, you're just generating code faster. You're not shipping it safer.
And this isn't some fringe idea. Stripe, Spotify, Shopify, Uber, and Ramp have all published working versions of this pattern internally. The specific implementation that's been spreading fast among indie builders and small teams boils down to four steps, kept alive in nothing more than a handful of markdown files so the whole system is portable across any model or any coding harness.
Why does "one feature at a time" stop working past a certain point?
Every solo builder starts the same way: prompt the agent, get a feature, ship it, prompt again. That works right up until you try to run more than one thing at once. Two agents touching the same files. A half-finished branch blocking another. No clear record of what changed or why.
A factory fixes this at the structural level rather than trying to fix it with better prompting. Before an agent starts, it needs a contract that makes both execution and stopping conditions explicit — the objective, the non-goals, and the relevant context, files, tests, and known failure modes. That contract is what turns a chat with a chatbot into an actual production process.
Step 1: how do you isolate agents so they don't collide?
This is the foundation, and skipping it is the single most common reason people say multi-agent workflows "don't scale." The first move is to isolate: agents often create conflicts when working on shared codebases, so a true factory solves this by mimicking human development — every new feature starts in a fresh Git worktree or branch, letting agents operate in parallel, preventing file overwrites, and merging back into the main branch when done.
Git's own tooling makes this possible. A git worktree is a separate working directory attached to the same Git repository, and Git's documentation confirms a repository can support multiple working trees, allowing more than one branch to be checked out at a time. In practice, tools like Claude Code let you spin these up directly. With claude --worktree feature-auth, Claude creates an isolated checkout under .claude/worktrees/ and starts a session there.
One thing that trips people up here: a fresh worktree is genuinely fresh. A worktree is a fresh checkout, which means your .env is not in it, and neither is node_modules, nor a free port. That's the config gap that actually breaks parallel setups. This is the thing that actually breaks at agent four, and it is why teams conclude worktrees "do not scale" when what they hit was an unconfigured checkout. Claude Code has a fix baked in — it handles the gitignored-file half with a .worktreeinclude file at the project root, using gitignore syntax.
How to set this up:
- Open Claude Code's agent documentation and review the parallel sessions setup.
- Run
claude --worktree feature-namefor each new feature you want to build. - Add a
.worktreeincludefile so.env,node_modules, and ports carry over correctly. - Add
.claude/worktrees/to your.gitignoreso these directories don't pollute your main checkout.
Step 2: how do you build without shipping AI spaghetti?
Isolation stops collisions. It doesn't stop bad architecture. This is where a "code structure" skill comes in — a standing instruction set that forces the agent to write maintainable code instead of whatever gets the tests passing fastest.
The next step is Build: without guardrails, agent-generated code can quickly become tangled spaghetti, so a dedicated "code structure" skill ensures architectural integrity by enforcing consistent patterns, like a service layer, compelling agents to produce maintainable, high-quality code that integrates seamlessly into existing systems.
The point of this step isn't perfection — it's readability. If a human developer (or another agent) has to pick up this code six weeks from now, they should be able to follow the logic without archaeology. That's the actual bar: not "does it run," but "can someone else maintain it."
Step 3: how do you prove a feature actually works?
This is the step most solo AI builders skip entirely, and it's the one that separates a factory from a slot machine. Instead of trusting a written summary from the agent, you demand evidence.
The agent records a before state and an after state as video, screenshots, or numbers. That means before touching a checkout flow, the agent captures what it looks like broken (or before the change). After the fix, it captures the same view working. You're not reading code line by line and hoping — you're looking at a before/after that any non-technical founder can evaluate at a glance.
This "evidence-driven testing" approach solves a real trust problem. A pull request full of code you can't personally read is a leap of faith. A pull request with a screen recording showing the button now working, or a script printing test results, is proof. The gap between those two things is the entire reason people burn out on trusting AI-generated code.
Step 4: how does "ship" actually work, and what is the grep loop?
Once there's proof, the feature still isn't done. It needs a quality gate that isn't just "the human skimmed it and it looked fine." This is where automated PR review tools like Greptile come in.
Greptile constructs a graph index of your codebase, then uses a swarm of agents to catch potential issues that humans might miss, building a graph of files, functions, and dependencies before parallel agents review changes and flag issues. Instead of reviewing a diff in isolation, it reasons about ripple effects across the whole codebase — the kind of bug that hides three files away from the actual change.
The loop mechanic is what makes this a true factory step rather than a one-shot check. If the score comes back low, the agent doesn't just stop — it goes back to Build, fixes what was flagged, and resubmits. Greptile posts review comments automatically but does not merge code; it can send suggested fixes to coding agents like Claude Code, Cursor, Codex, or Devin, and iterate via a /greploop command. A human still makes the final call — a human still approves the merge.
How to wire this into your factory:
- Connect your GitHub or GitLab repo through Greptile's getting started docs.
- Let Greptile index your full codebase — this builds the dependency graph it reviews against.
- Open a PR from your feature branch and let the agent swarm score it.
- If the score isn't clean, loop the feedback back to your build step and resubmit automatically.
Why keep the whole system in markdown files instead of code?
The genius of this framework isn't the four steps — plenty of teams already do some version of isolate/build/test/ship. It's that the entire system lives in five or six plain markdown files rather than being hardcoded into one tool.
The idea is to transform a team's implicit knowledge and one-off prompts into explicit, reusable instructions — a structured playbook like an agents.md file, injected into every agent chat, that dictates precise agent behavior and gives agents the institutional memory they need. That's what makes the factory model-agnostic. Swap Claude for GPT, swap Cursor for Claude Code, and the factory keeps running because the instructions live outside any single tool.
A software factory is not defined by one model, vendor, or coding agent — it is defined by the operating model around the work, and the smallest useful version of it is "spec in, verified change out." Markdown files are just the cheapest, most portable way to encode that operating model.
What does running this at scale actually look like?
Once the four steps are wired together, the ceiling isn't compute — it's your own attention span. The practical ceiling is not compute, it is how many diffs you can review. Real numbers back this up: OpenAI's Codex team reports 3.5 merged PRs per engineer per day. That's the throughput a well-run factory can realistically sustain per person reviewing the output — not infinite, but a serious multiple of what one developer manually coding could ship solo.
Before scaling to a dozen parallel agents, though, run a quick sanity check. Parallel agents are multiple sessions, subagents, or teammates working on different parts of a software task at the same time, and they're useful when work can be split into independent units with clear ownership, tests, and merge order. If your feature set doesn't split that cleanly, more parallel agents just means more merge conflicts to untangle later.
What should you build first if you're starting from scratch?
Don't try to stand up all four steps simultaneously. Implement the workflow incrementally, starting with the robust Isolate step, then once that foundation is stable, progressively layer in Build rules for enforcing code quality standards.
A reasonable rollout order:
- Week one — get comfortable with Claude Code's parallel agents documentation and run two features in separate worktrees instead of one at a time.
- Week two — write your first
agents.mdfile capturing your code structure preferences (service layers, naming conventions, folder structure). - Week three — force every feature to produce a before/after screenshot or test log before you'll even look at the PR.
- Week four — connect Greptile or a similar review agent and start looping low scores back through the build step automatically.
Each layer is useless without the one below it. A review bot doesn't help if agents are overwriting each other's files. Proof doesn't matter if the underlying code is unmaintainable spaghetti nobody can extend next month.
The real unlock isn't more agents — it's trust you can verify
Anyone can spin up ten AI agents and watch them write code in parallel. That's not hard anymore, and it's not the bottleneck. The bottleneck is trusting what comes back without reading every line yourself — and that trust doesn't come from a bigger model or a longer prompt. It comes from a system that isolates the work, enforces structure, demands proof, and gates every merge behind a real check.
Build that system once, in a handful of markdown files, and it outlives whatever model you're using today. The agents will get smarter. The factory around them is what decides whether that intelligence turns into shipped software or just a faster way to generate a mess.