Software factories should be built on an infrastructure stack that is open, composable and defined in code:
Open == works with any model, agent and hosting configuration
Composable == you can adopt part or all of the stack, and use the pieces however you want
Defined in code == factory state is versioned, testable, and revertible
Let’s break this down layer by layer:
Factories-as-code
Define your agent infrastructure in a version-controlled file like factory.yaml: agent configuration, runners, repository access, external integrations (Slack, Jira), webhooks (Grafana, Sentry) and automation triggers (crons, taskboard changes, PR updates, etc).
The format matters less than having a code-based approach that allows versioned changes to the factory definition. Versioning enables benchmarking, A/B testing and rollbacks. It’s Terraform for factories.
Data and context
One level up sits the Context Layer. It includes internal MCPs and CLIs, agent memories (blob storage, skill files), conversation logs, access logs, and agent rules / skills.
If you use a third-party context layer, you should be able to store all its data on your infrastructure. No outside provider should train on this data. ZDR is a must.
Compute
Next is the Compute Layer, where your agents run. Centralized runs need remote dev environments, likely defined in Docker or k8s. They should be pausable and resumable, with state portable across machines.
You should also be able to connect computer use models to test the apps agents build in your remote dev environments. This is useful for reproduction, verification and prototyping.
Inference
The Inference Layer should support any model and agent so you can evolve and test your factory configuration to optimize quality, cost and speed. It should support frontier and open-weight models plus multiple agent harnesses.
Improvement
An important part of any factory is the Improvement Infrastructure, which ensures software gets built at higher quality and lower cost over time.
Start by tracking DORA metrics like cost-per-PR and qualitative metrics like code quality and efficiency using LLM-as-a-judge.
Once you have these metrics, close the loop:
Self-improvement: agents automatically find failure points and suggest skill improvements.
Benchmarking: test suites with varied configs measure how the model and harness combinations perform on real work.
Orchestration
Your factory needs a control plane to launch agents, manage crons, drive work to subagents, and provide live sessions for human steering.
Access
Work enters and leaves through UIs, a direct MCP, and third-party surfaces like code forges and knowledge work tools.
All access points should use unified APIs for launching work, monitoring progress, updating the factory definition, and more. This benefits humans and agents.
-
As we move to automated development, think of software factories as an Infrastructure Stack. If you are exploring this approach, we would love to chat.
ALT A layered diagram illustrates the "Factories Stack," detailing components like Access, Orchestration, and Data, emphasizing an open, composable infrastructure.