跳到正文
Mastra Blog·· 2 小時前AI 評分65

甚麼是 AI 軟件工廠?Mastra 解説其運作模式與開發流程

What is an AI software factory?

AI 導讀

AI 軟件工廠以 AI 智能體自動化並協調軟件開發生命週期,將來自 GitHub、Slack、Sentry 和 Linear 等入口的工作拆成任務,按流程推進至測試、部署和維護。

正文

An AI software factory uses AI agents to automate and optimize the software development lifecycle (SDLC), from planning and implementation, to testing, deployment, and maintenance.

It takes work from defined intake surfaces (like GitHub, Slack, Sentry, and Linear), turns it into discrete tasks, and moves them through a structured development process autonomously. Humans shift from working within the development cycle to overseeing and improving the loop itself.

We build and use our own software factory at Mastra so I can tell you there is a lot more to it, but to keep it simple, you can think of an AI software factory as a good way for a dev team to structure software engineering work around AI agents.

In this article I’ll go over what a software factory is, all the benefits it brings to the development process and how we think about it at Mastra.

Want to skip the explanations and try a software factory for yourself? We built Mastra Factory just for that. It gives you an issue-to-production loop you can configure and connect to GitHub, Linear and Slack.

What makes it a "software factory"

Coding with agents lets developers delegate individual tasks. But a software factory takes the next step by coordinating those tasks into a repeatable development process that agents can carry forward without a human directing every handoff.

It connects request surfaces, development environments, agents, harnesses, tools, checks, and people in an end-to-end process.

AI agents own tasks at each step of the process, handle handoffs between the steps and run continuously without waiting for a human to tell them what to do next.

For a walkthrough of how a software factory works, watch this AI Agents Hour conversation with HumanLayer co-founder Dex Horthy. He joins Shane Thomas and Abhi Aiyer to map out the development loop and explain why teams still need architecture planning and code review when agents write the code.

Every task enters the process with context, responsibilities, outcomes and checks already defined so an engineer can follow its progress without personally directing every handoff.

A software factory doesn’t have to cover the entire development process.

For example, a pattern we often see with our Factory clients is that they start with a small part of their development lifecycle and expand from there.

A software factory is the next step in agentic software development

The “Software Factory” concept is not new.

Before AI: CI and templates

Back in 2005, the Software Engineering Institute described building software products from shared core assets in its report on product-line variability.

In 2006, Microsoft's Web Service Software Factory packaged reusable code, reference implementations, development guidance, and generation tools.

Developers could start from an established architecture and use templates and recipes to implement it.

DevSecOps applied the factory idea to the delivery system, bringing development, security, testing, and deployment into a repeatable process.

By 2021, teams such as Kessel Run and Black Pearl were sharing engineering practices across software factories, including ways to test resilience.

These approaches laid the groundwork for AI software factories by creating repeatable development processes that agents could take on.

Coding agents

Early workflows with tools like Cursor and ChatGPT centered on helping individual developers write code, understand unfamiliar systems, and debug problems.

The developer supplied the context, evaluated the response, and decided what to do next. AI handled parts of the work, while the person coordinated the process.

Today, coding agents let developers delegate large tasks. An agent can investigate a repository, plan a change, edit files, run tests, and revise its implementation based on the results.

Developers assign an outcome and let the agent work through the steps. But when that work stays inside individual sessions, teammates have less visibility into the decisions behind a change. At Mastra, we found ourselves pairing more with agents and less with each other.

Software factories

An AI software factory takes that delegation beyond individual agent sessions and turns it into a continuous process the full team can manage.

Examples of the current approach appeared in late 2025, as teams published results from agents working within structured development workflows.

In November 2025, Spotify reported more than 1,500 merged agent-generated PRs. In February 2026, OpenAI described building an internal product with agents writing the code and engineers designing the environment and feedback loops.

The factory framing became explicit in BCG Platinion’s March article and Factory’s June announcement.

These teams automated more of software delivery by giving coding agents shared context, clear plans, tests, and review checkpoints. Issues move through defined stages, context follows the tasks, and when a human needs to review what’s been done, it comes with all the context trail and what was checked.

Example of an AI software factory dashboard with its stages in Mastra Factory

The dev team can easily see where work stands, contribute missing information, and participate in decisions without reconstructing someone else’s agent session.

Agents handle execution between those checkpoints, while developers collaborate on requirements and testing.

Benefits of an AI software factory

You’re already under pressure to ship quickly, and you may have a workflow with your own agents that works well. Building a software factory means investing time you don’t have much of in a process you’ll need to maintain and refine over several iterations.

That investment needs to pay off, so let's review what you can gain.

Context follows the task

With a software factory, requirements, research results, and previous decisions stay connected to the work, so the next agent or reviewer can continue without reconstructing its history.

Development moves faster

Work advances through defined stages with context and checks already in place, reducing manual handoffs and waiting between steps.

At Mastra, we’ve seen this in PR review. Our review agent supplies codebase context that helps us assess changes faster, while notifications reduce idle time.

Collaboration is easier

Shared task state makes progress, blockers, and pending decisions visible. Teammates can contribute context or take over work without reconstructing someone else’s agent session.

It’s been a big change for us! Our shared dashboard is helping us spend more time working together strategically instead of focusing individually on tasks with our agents.

4 approaches to AI software factories

We see four broad approaches to software factories. Each emphasizes a different part of the development process, and a factory can combine several of them.

1. Goal-driven

A supervising agent takes a goal, breaks it into tasks, and delegates work to other agents. It coordinates their outputs and determines what needs to happen next as results come back.

The team defines the desired outcome, constraints, and decisions that require human input. The supervisor has flexibility to organize the work within those boundaries.

2. Staged automation

Tasks move through a defined lifecycle, such as intake, triage, planning, building, review, and completion. Each stage establishes what work happens and what must be checked before the task advances.

Agents execute the work between those checkpoints. Tests, review requirements, and approval rules make the process repeatable and give the team clear opportunities to intervene.

3. Learning infrastructure

The factory carries useful knowledge into future work. That includes repository conventions, previous decisions, review feedback, and production outcomes.

Teams use that information to improve the context agents receive and refine their instructions, checks, and workflows. A recurring failure becomes a reason to improve the process for future tasks.

4. Human workflow redesign

Teams change how they collaborate around agent execution. Shared sessions, visible task state, and clear ownership let people contribute context, resolve questions, and review outcomes together.

Engineers also take responsibility for improving the factory itself, including identifying where work stalls, where agents need better information, and which decisions should remain with people.

Our approach with Mastra Factory builds on staged automation and learning infrastructure. We use explicit lifecycle stages and retained context to coordinate work, with the option to implement /goal mode through a supervising agent and subagents.

Our AI software factory development stages

There are many ways to organize your factory. We’ve found these six phases work well, so Mastra Factory includes them by default. You can customize them to fit how your team works.

1. Intake

Intake brings incoming work into the factory as a tracked item. GitHub and Linear issues become tasks on the Work board, while pull requests enter a separate Review board.

Work can wait for someone to start an investigation or begin automatically when its source and the factory’s policies allow. Our intake system gives the team a consistent place to see what is available for work.

2. Triage

An agent investigates the task, classifies the work, and identifies missing context or unresolved decisions. The investigation establishes what the team knows about the request and what still needs clarification before implementation.

People answer questions, narrow the scope, or accept proposed work when required. In our built-in workflow, non-bug tasks require human acceptance before entering planning or building. That acceptance authorizes the work to proceed. Work items documentation

3. Planning

The agent turns the investigation into an implementation approach. The plan identifies the scope, relevant files, validation checks, and intended deliverable.

This gives the team a concrete proposal to assess before changes begin. Approving the plan authorizes the implementation it describes. Our first-change walkthrough shows what that review covers.

4. Building

The agent changes the repository and runs the planned checks. Its session keeps the conversation, commands, tool results, files, and changes together so engineers can inspect progress and investigate failures.

The output is a patch with evidence of what was checked. Reviewers can examine the actual changes and command results instead of relying entirely on the agent’s account of its work.

5. Review

Review brings the proposed change, test results, and agent findings together for assessment. We give each pull request its own review session, separate from the session that authored the implementation.

Feedback can return to the authoring session for further changes. Updated code may need another review, and people make the merge decision through the repository’s normal review process.

6. Done

The task is complete when its intended outcome and acceptance criteria are met. We assess that outcome separately from the status of an individual pull request, because one task can require several PRs.

In Mastra Factory, merging a PR completes its Review card and prompts the originating Work session to assess whether the underlying task is finished. The Work item tracks that broader outcome.

How to build an AI software factory

We recommend starting small, with one recurring workflow.

Define its expected outcome, the validation checks needed to establish success, and decide what decisions humans still need to own.

You can follow our guide to building an AI software factory in TypeScript, where we cover the implementation, agents, tools, orchestration, memory, and observability.

If you don’t want to start from scratch and build everything yourself, give Mastra Factory a try. We bring issue intake, planning, coding agents, and PR review into a shared dashboard that’s easy to connect to your codebase and get started with.

Frequently asked questions

Can a software factory cover just part of development?

Yes. A factory can focus on a recurring workflow, such as issue triage or PR review. It still provides a repeatable process, retained context, and coordination, while other development work happens outside it.

Can an AI software factory work with an existing codebase?

Yes. A factory can work with an established repository, its conventions, and its delivery process. It can cover selected workflows within that codebase, such as maintenance or review.

Do we need multiple agents or a custom-trained model?

Neither defines the category. A factory can use existing models and one or several agents. Its defining feature is the repeatable process coordinating the work, including context, validation, and acceptance.

Does a software factory replace developers or DevOps?

It changes the work people delegate and the systems they maintain. Teams still need product judgment, architecture, reliable infrastructure, and ownership of production outcomes. Engineers also design and improve the factory's behavior.

Can a small team run one?

Yes. A software factory does not imply a large organization or a large fleet of agents. Its scope can be a recurring workflow operated by a small team.

Can we keep human approval for every release?

Yes. Agents can investigate, implement, and validate changes while people retain merge and deployment approval. Human checkpoints are part of the factory's operating model.

來源:Mastra Blog · mastra.ai