Building your own software factory — Eric Zakariasson, Cursor
Eric Zakariasson from Cursor explains the shift from single-agent pair programming to managing a multi-agent "software factory". He outlines the practical steps required, from establishing a well-structured codebase with guardrails to adopting a managerial mindset that focuses on automation, asynchronous work, and scaling agent fleets to increase software development throughput and consistency.
The Evolution to a Software Factory
The paradigm of software development is shifting from direct coding to managing autonomous agents. This evolution can be understood through different levels of autonomy, a concept detailed by Dan Shapiro.
- Level 1: Spicy Autocomplete: Basic code completion.
- Level 2: Pair Programmer: The current common state, involving back-and-forth interaction with a single AI agent.
- Level 3: Junior Developer: The AI generates the majority of the code, with the human acting as a reviewer.
- Level 4: Delegator: The human delegates entire tasks to agents and primarily reviews the outcomes, not just the code. This is where the speaker, Eric Zakariasson, currently operates.
- Level 5: Software Factory: A “dark factory” where agents handle the entire software development lifecycle (testing, building, shipping) based on high-level human intent.
The goal of building a “software factory” is to increase throughput by running agents 24/7, achieve consistent output through automated assembly lines, and better leverage human taste and creativity by focusing on high-level direction rather than manual implementation.
Building the Factory: Primitives, Guardrails, and Enablers
To create an effective software factory, the foundational work must be in place. This involves structuring the codebase and processes so agents can operate efficiently and safely.
Primitives and Patterns
- Codebase Structure: A modular, co-located codebase is crucial. If an agent can find all relevant files within a single directory, it can work more efficiently without needing to search the entire repository. An easily onboardable codebase for a human is also easily navigable for an agent.
- Usage Patterns: Establish clear, reusable patterns for common tasks like authentication, startup scripts, and tests. This allows you to point an agent to an existing reference and ask it to reproduce the pattern.
Guardrails
Guardrails are essential for letting agents operate freely but not too freely.
- Tests: The most critical guardrail. Agents must be able to verify their own work through unit, integration, or even UI tests (e.g., using Playwright to click around in the DOM). Verifiable systems are easier to build for backend services with clear contracts than for complex UIs.
- Hooks: Prevent agents from touching highly sensitive parts of the codebase, such as encryption or core authentication logic, where a mistake could be catastrophic.
- Rules: Rules should emerge dynamically as a response to agents going “off the rails.” They act as a Standard Operating Procedure (SOP) to guide agent behavior. For example, a rule can enforce not using foreign keys in database migrations if that’s a team convention, even if models are trained to add them by default.
Enablers
Enablers are tools and access points that empower agents to be more autonomous.
- Skills and MCPs: Give agents new capabilities, such as the ability to add a feature flag to their own changes. This allows for safe, autonomous merges that can be tested in production before a full rollout.
- External Context: Allow agents to interface with tools like Linear, Notion, DataDog, or Slack to gain a broader understanding of the user’s intent and the context of a task.
- Runnable Environments: Agents must be able to start the development environment on their own. This is a prerequisite for scaling, as it allows each agent to work in a clean, isolated VM.
Running the Factory: The Managerial Mindset
Once the foundation is laid, the human’s role fundamentally changes.
- From Worker to Manager: You stop writing code and start overseeing a fleet of agents. This means shifting from synchronous, hands-on work to asynchronous, background processes.
- Front-loading Context: As you delegate longer tasks, you must provide more context upfront through detailed plans and specifications. Trust in the agent’s ability to execute becomes paramount.
- Scoping and Parallelization: A key managerial task is to break down work into parallelizable units that can be assigned to individual agents, while being mindful of potential merge conflicts.
- Improving the Factory: Your job is to observe the system as a whole.
- Identify Human Bottlenecks: Find where a human is still in the loop (e.g., copy-pasting logs from DataDog, user feedback from Twitter) and automate those tasks away.
- Catch Failures: When an agent produces an incorrect result (e.g., wrong database schema, ugly UI), use it as a feedback loop to create a new rule or provide access to a design system.
- Codify Learnings: Continuously improve the factory by turning these observations into new guardrails and enablers.
Scaling the Factory
To go from a few agents to hundreds or thousands, the focus shifts to higher levels of abstraction.
- Observe Outcomes, Not Code: As the volume of agent-produced code becomes too large to review, you must trust your tests and automations. Observe the final artifacts and outcomes. An example is having an agent record a video of itself testing the UI changes it made, providing quick visual verification for the human manager.
- Automate the Automation: Build systems that improve the factory itself.
- Agentic Code Owners: An agent that reviews PRs, assesses risk, and either auto-approves low-risk changes or pulls in the correct human reviewer for high-risk ones, reducing bottlenecks.
- Continual Learning: An automation that scans agent transcripts to identify recurring corrections and automatically creates new rules or “memories” from them.
- Move Up the Abstraction Ladder: Ultimately, you will manage agents that, in turn, manage other agents, creating a hierarchical structure similar to a human organization.
Key Takeaways
- Be Clear About Intent: The quality of the output depends on the clarity of the initial goal.
- Don’t Outsource Critical Decisions: Humans must remain in the loop for key decisions regarding security, architecture, and safety.
- Build Tools and Systems: Focus on creating the “flywheels”—the codified rules, automations, and enablers—that improve the factory over time.
- Store Context for Later: Preserve transcripts, artifacts, and decisions to help agents learn what “good” looks like.
- Let the Agents Be Free: Provide agents with the tools they need to operate autonomously and even to “complain” or express when they are blocked, providing valuable feedback for improving the system.