How our development factory works
We build with AI agents. Most of the code in our games and tools this year was written with one, and we don’t think there’s anything clever about admitting that — the interesting question is what you put around it.
Because the failure mode is well known by now. An agent is good at producing something that looks finished. It’s much worse at holding a whole system in its head over weeks, and it will cheerfully tell you a job is done. Left alone, you get a codebase that grows faster than anyone’s understanding of it.
So we built a factory. The one-line version: scripts decide whether a change works, agents do the judging, every step leaves a file, and a human merges.
The seven steps
A job starts from a GitHub issue or a described change and goes through the same path every time.
Triage reads the request and decides whether it’s worth building at all — accept, reject, or come back with more information — and cuts it down to something that fits in one pull request. It also rates the risk and names which parts of the system the change touches.
Spec turns that into acceptance criteria anyone with the repo can check. Anywhere the spec has to assume something a person should really decide, it marks it as a decision rather than quietly picking one.
The human check is a person reading the whole spec before a line gets written, including the commands its acceptance criteria name. In practice that person is me. Nothing builds until someone has read it.
Build writes the code.
The gate runs the project’s checks and the structural rules. More on this below, because it’s the part that does the real work.
Review goes over the diff. Approve decides between “ready to merge as it is” and “a named human decision is needed first,” and it has to name the decision.
Every one of those leaves a file on disk — the request, the triage, the spec, the build notes, the check log, the reviews, the decision. When something goes wrong three weeks later, the reasoning is still there instead of scrolled off the top of a chat window.
The three rules that matter
Most of the design is unremarkable. Three parts are doing the heavy lifting.
The judging agents are read-only. Triage, spec and approve get Read, Grep and Glob, and nothing else. They can’t write a file or run a command. That isn’t about trusting them less than the builder — it’s that a reviewer which can edit the thing it’s reviewing isn’t a reviewer.
The checks come from the base commit, not the branch. This is the one we’d keep if we could only keep one. A job is gated against the checks that existed on the base it was created from, pinned by full commit hash. A branch cannot weaken the tests that judge it, because the tests that judge it aren’t on the branch. Delete a test in your change and the gate still runs the original.
Some paths are off limits. A job can’t add, modify, delete or rename anything under .factory, .claude, .github, the git hooks directories, and a handful of others — at any depth. The automation doesn’t get to edit its own gate, its own CI, or its own instructions while running through them. Changing those is a person’s job, committed straight to the base branch.
The gate fails a few other things worth naming: credential-shaped strings in added lines, new symlinks, control characters in paths, and paths that differ from an existing one only by case. Changes to CLAUDE.md, ARCHITECTURE.md and CONVENTIONS.md are allowed but flagged, and the approver has to escalate them to us — because a change that rewrites the project’s own description of itself is exactly the kind we want to read personally.
Request text is data, never instructions
An issue’s title, body and comments get quoted into a file as data. They never become part of a prompt.
That matters more than it used to. If anyone can file an issue, then anyone can write text that tries to talk to your tooling. The tool limits on the agents are the actual boundary — a read-only agent can’t act on a malicious instruction because it can’t act at all. The wording in their prompts is a second layer, not the control.
For a job created from someone else’s issue, we read the diff before the first check run, because that’s the first moment code derived from somebody else’s text actually executes.
What it deliberately doesn’t do
We’d rather state the limits than let anyone assume they’re not there.
The checks still run the branch’s own test code, and the build step before them runs code that was just written. The environment is filtered but the filesystem isn’t. So the gate guards against drift and careless changes — not against a builder actively trying to get around it. Reading the diff before merging is still the real control, and that one stays with a person.
Nothing in it merges, pushes to a base branch, or deploys. It ships no git hooks. Nothing runs on its own. Every one of those is a deliberate no.
It has its own bugs, and they’re written down
The factory has a known-issues file, and the first entry is a good example of the kind of problem this sort of tooling creates.
Gating against a pinned base and rebasing don’t get along. Rebase a job onto a newer main after main has gained a change to a protected path, and the gate’s diff inherits that change — so it fails your job for somebody else’s work. We hit it on two Starwright jobs on the same day in November. Job 007 touches .github exactly zero times and the gate failed it for a .github file that arrived in main through an unrelated CI pull request.
Each entry in that file says what was seen, where, and what it cost, so the next person meets evidence instead of a hunch. That’s the same standard the factory holds our projects to, and it would be a bit rich to exempt the thing doing the holding.
The next post is about what this actually catches — including the time it rejected our own design twice and was right both times.
— Bruno