AI workflows
The core of a software factory: the decisions every team makes
A software factory is a set of decisions, not a product you install. Thirteen of them in the order a task meets them, with the options for each and what I recommend, then a builder to make your own.

TL;DR: I built an artifact that would walk you through your specific software factory. Go ahead and enjoy.
People who want a software factory usually go looking for one to install: a product, a plugin pack, a framework with "factory" in its name. Then they start wiring autonomy, agents handing work to other agents, before anyone has decided how a piece of work moves from an idea to production. A software factory is not one product you install. It is a set of decisions every team must make for itself, from where agents run and how a ticket is classified, through who critiques the plan, how a task is reviewed and tested, to how it is deployed, checked and logged so each part can improve. Not every component is critical: start from a baseline measurement and the few that matter, skip or adapt the rest, and use the builder to make your own.
This post walks through thirteen decisions in the order a task meets them, folded into eight sections. Each section gives the options a team has, then what I recommend. After them comes the builder, a page that turns the decisions into your own factory, and then a short look at what I run myself. The first post in this series listed the parts of a factory with one question each; this one goes a level down.
Here is the line as a task meets it:
ticket sources
-> classify (agent)
-> route: fast lane, or
stages with named people
-> plan -> critique
-> human decision?
-> execute -> review
-> tests and CI
-> preview + end-to-end
-> deploy -> verify
(roll back on failure)
-> log the run
-> improve the line
frame: baseline, measured
before you change anything
In words: work arrives from its sources, an agent classifies it, and the class picks a route. The task is planned, the plan is attacked, and a person may decide before execution. Code is written and reviewed, tested in CI and on a preview, deployed and verified, and every step is logged so the line can improve. The baseline frames all of it, because you measure before you change anything and read it again after.
The first decision is physical. Agents can run on your laptop, which is simple, stops when the lid closes, and keeps you babysitting. They can run on an always-on server with a terminal multiplexer, which is cheap and keeps going while you sleep, though it is one machine. Disposable cloud sandboxes with warm snapshots scale out and make full permissions safe, at a real setup cost. Vendor background agents need no infrastructure and give you less control.
There is one more option that most teams skip: a running copy of the system per pull request or per worktree, so an agent can test the change end to end instead of guessing from unit tests.
What I recommend is to start local or on one always-on machine, then add a running environment per worktree so a QA agent can drive the app. Look at sandboxes only when you need more than a handful of concurrent runs. Before that, they are infrastructure you maintain for capacity you do not use.
What a day looks like is a decision too. One option is to sit with one agent all day and steer it. Another is to batch your decisions at set times while agents work in between. A third is to let agents run overnight and review the results in the morning. The guide The Software Factory argues for the batching side in its play Decide up front, in batches: before work starts, the agent hands back a decision brief with every open question as multiple choice and its recommended answer ticked, so you answer once instead of being interrupted all afternoon. Whichever rhythm you pick, decide it on purpose, because the rest of the line assumes it.
Work has to enter somewhere. The options run from typing prompts with no tickets at all, which is fast for one person and leaves no memory, to one backlog that an intake agent fills from every channel, to triggers where a label on an issue starts an agent, to signal-driven intake where alerts and user feedback become candidate work. The trigger and signal options skip human judgment unless you add it back.
I recommend one backlog, filled by an agent that drafts each ticket for your yes. Keep the ticket to the problem, the idea and the direction, and leave the how to planning.
Then an agent reads each ticket and classifies it. A typo fix and a change that touches several repos and needs many checks should not run through the same process. Each class gets its own workflow, with its own retries, reviewers, QA depth and model tiers. One heavy workflow for everything wastes time on small work; one light workflow under-checks big changes.
The class decides the route: straight to production, or through stages, and which people must step in. Joe Paravisini describes a triage agent that labels each issue and "picks a route (small things go straight to implementation, bigger things get a spec first, judgment calls come to me)". Nothing proceeds until he applies a label, because "LLMs are not ready to determine their own work".
My recommendation is close to his. The classifier sets the route, the people are named per class, and straight to production is a class a task earns with a clean record, not a default.
Agents need two kinds of knowledge. One is what a single repo needs: how it builds, how it tests, why it is shaped the way it is. The other is what many repos share: how systems connect, the company's practices, the research behind past decisions.
The options run from one giant context file, to a short map file that points into structured docs in the repo, to copies synced into each repo, to a central context repo in git, to an LLM wiki or curated library that every agent reads on demand. A giant file goes stale and eats context. Synced copies drift apart.
I recommend keeping repo knowledge in the repo, as a short map plus docs, and sending only cross-repo knowledge up to the wiki, the company's second brain. When the two disagree, the repo's decision record wins, because it was reviewed with the code. I wrote about the wiki side in an LLM wiki as the source of truth.
Here is a test you can run today. Clone a repo into an empty folder, start an agent with no tools beyond reading files, and give it the prompt below, which I wrote for this page. Whatever it cannot answer is missing from the docs, or belongs one level up.
Read only this repository. How do I run its tests, and what must a change pass before it can merge? Cite the file for each answer, and list what you could not find.
Read only this repository. How do I run its tests,
and what must a change pass before it can merge?
Cite the file for each answer, and list what you
could not find.
A plan can live in the harness's plan mode, which is easy and buries its decisions in long prose. It can be a decisions-first artifact that shows several options per decision, so you can decide quickly across parallel sessions. Or it can be a short plan keyed to your architecture docs, which is fast to read if those docs exist.
I recommend decisions first, each with a measure and a review date, and a validation section before the steps. If you cannot say how a decision will be checked, it is not ready to build.
Then someone attacks the plan before you see it. The options are devil's-advocate agents, reviewers with no conversation context (one checks the plan against the code, one looks for what is missing), and a reviewer from another model family. Cap the rounds at two or three, or the critique loops. Write your own critics around your domain instead of importing a generic pack.
Critique ends with a rule I recommend: the session that wrote the plan answers every rejection, each with a fix or a reason. A finding that is neither fixed nor answered is how a plan reaches execution with a known hole in it. Then comes one decision: does a person step in before execution? The task's class sets that. A small fix may go straight on; a feature waits for a yes.
Execution can be one long session that plans, codes and reviews. That is simple, and the agent grades its own work too kindly. It can be a workflow that gives the implementer and the reviewer fresh context each, so the reviewer has not been persuaded by the implementer's reasoning. You can add capped retries with escalation: a cheaper model tries, a stronger model tries after it, and then the loop stops and asks a person.
I recommend the workflow, with fresh context per role, capped retries, and cheaper models for the implementation itself.
Review parameters should differ by task type. Narrow lenses grounded in your own practices work better than one general reviewer, and the weights follow the task: a design task weights design over other things, a migration weights data safety.
Who reviews is a trade-off both ways. A reviewer from another model family avoids the self-preference that inflates same-family review. A same-family reviewer in a fresh context is cheaper and simpler to run. I lean to fresh context by default and another family for risky paths, and I am measuring that, not treating it as settled.
The hardest question is how you know the code was really done right. A green CI run is not the answer. Spotify's engineering team calls it "a PR that passes CI but is functionally incorrect" and names it "the most serious error". My answer has three parts: a check must exist, and fail, before the work starts; some checks are held out so the builder never sees them; and a guard flags any edit to existing tests.
Agents write tests freely, and many of them restate the code or exist only to pass the agent's own gate. The fix is not fewer tests up front. Write them before the implementation, so the agent has a target, then add a prune step at review that removes duplicates and tests that only restate the code. Keep end-to-end checks as the gate. Unit tests are scaffolding, not proof.
Give each repo one verify command that runs lint, tests and build in that order, and fails when zero tests ran. The agent, CI and the pre-commit hook all run that same command, so nobody passes a different bar.
After CI passes, deploy the pull request to a preview environment and run end-to-end tests there, with Playwright or an alternative. I recommend one walker per user journey, and a pass that counts only when it comes with a screenshot or the command output as proof.
This is the thinnest part of the research. Deploy is the least mature station in the research behind this post, so take this section as a starting point.
The options are merge equals deploy, with automatic rollback on a failed health check; feature flags and progressive rollout, which shrink the blast radius at the cost of running a flag system; and a human-gated release tied to the reviewed commit, which gives control and costs speed.
I recommend merge equals deploy only where rollback is one command and you have rehearsed it. Put risky behaviour behind a flag that is off by default. Keep a human gate where a bad release has standing consequences.
Then verify the deploy. A release gate is the verify command passing plus the site's health check answering, followed by a watch for an agreed window. I recommend going one step further: a QA agent walks the live site's basic and important functions after the deploy, and only then is the release a success. A status code tells you the server answered, not that a user can sign in.
Document every task so each part can improve. That means a folder per run with a journal (stage, model, duration, verdict, every human intervention) and a summary. It means a retro that turns your corrections into proposed changes to rules, skills and checks, applied only on your yes. And it means each decision kept as a record with a measure and a review date, read daily, weekly or monthly, so a choice that stopped paying shows up.
Last on the list and first in time: measure before you change. Without a baseline of what matters, you cannot judge progress, efficiency or the factory's place in the company. The research I keep suggests three numbers: minutes per merged pull request, the revert rate two weeks later, and dollars per merged pull request. The guide's play Set a baseline. Keep measuring. makes the same case in business terms, and adds that a baseline taken once goes stale, so the numbers should keep updating.
Each team works these out for itself. Not every component is critical, so skip or adapt what you want.
Before you choose anything, take a reading of the line you already have. The Software Factory guide, written by Ofir Makmal, offers three things for that. Its playbook has ten plays, each opening with a scene and closing with a first move. Its Lights Out simulator runs a delivery line from numbers you type in. And factorymeter is a free, open-source CLI that reads your GitHub history with a read-only token, follows each change through seven stations, splits agent work from human work, names the station holding your line today, and opens the simulator with your measured numbers. The guide gives the install as:
curl -fsSL https://marshal-org.github.io/factorymeter/install.sh | sh
factorymeter init
factorymeter serve
That reading is also a first baseline. It is one voice among the sources here, and a useful one, because it measures instead of asking how fast you feel.
Then make the decisions. I collected the research behind this post into a builder, a page with 25 components and 105 decisions, each with its options and a recommendation. You load your own system and it suggests what to change. Not everything in it is critical: skip what does not fit your team, or adapt it. Open the builder and copy it to your own account first.
The first step is your system. Copy one prompt into Claude Code or your own agent, run it in your repo, and paste the JSON it returns back into the page. Every decision then shows what you have today.

Then choose, decision by decision. Each decision has four tabs: understand the recommendation, choose an option (or write your own, or skip it), do it for what you chose, and measure that it works. Your picks are saved in the browser.

Last, export. Export JSON keeps your picks. Hand to agent gives you a factory.yaml and a brief. Paste the brief into Claude and ask it to build your own factory, one station at a time, starting with the baselines.

My agents run on an always-on dev server in herdr panes, besides the laptop. Tickets are GitHub issues in each repo plus one Project board with Todo, In Progress and Done. A /ticket skill opens one from a single sentence, with a body of problem, idea and direction only.
The /drive skill sizes each goal into a kind (answer, direct edit, bug fix, feature, new system, refactor, docs research), and the kind sets how much planning it gets and what proof counts as passing. Plans are decisions first, each with a measure and a review date. For features, new systems and refactors, two reviewers with no conversation context attack the plan before I see it: one against the code, one for what is missing.
Review is a fresh-context reviewer from the same model family by default. A reviewer from another family takes over when a diff touches auth, secrets, migrations or deletions, or changes 500 lines or more. A four-week side-by-side decides whether that split holds.
Each repo has one verify script, run by /drive, CI and the pre-commit hook. New systems and refactors get holdout checks, and a guard flags edits to existing tests. For features, new systems and refactors on web and CLI repos, QA walkers go through each user journey on the pull request's preview or a local copy, and a pass needs a screenshot or command output.
Every merge waits for my go-ahead. Auto-merge classes exist and every one of them is switched off. Merge equals deploy on my two Vercel repos. After a merge a watch probes the live site, but it only checks status and reports; it is not the QA walk I recommend above. On trouble it prints the rollback command and never runs it, and I have not rehearsed rollback yet, because rehearsing it deploys.
Every run writes a journal and a summary. A retro proposes changes from my corrections and never edits anything itself. Decisions are records that a weekly review reads.
The baseline is chosen, a replay of four weeks of history, and not computed yet. The part I recommend first is the part I have not finished. The commands and the setup are in How I work.
