If your team has built ten API integrations, the eleventh should benefit from that work. The examples, tests, and review comments should become inputs to the next run. That's where a software factory becomes useful - if not essential - in the AI era.
Stripe and Ramp have published software factory examples for payment integrations and API connectors. Shopify has documented a migration workflow built the same way. Stripe and Ramp call their systems factories.
Shopify doesn't use the term directly in their post, but "Helix" splits the work into discrete checkpoints, moves each one through fixed gates, and carries review feedback into later checkpoints. We call that a factory.
All three reuse instructions and run checks. The differences show up when a check fails, a requirement is ambiguous, or someone has to approve a change. Those are the parts worth studying as you're considering software factories for your engineering team.
Software factory examples at a glance
What makes these examples software factories?
An AI software factory is a repeatable software delivery process that gives agents reusable instructions, an environment to work in, checks to run, and rules for when to continue or involve a person.
A factory can specialize in one job, such as building connectors or migrating screens, or a factory can be responsible for building an entire application.
Take the example of a test migration: a one-off prompt might convert a file, and to run the migration across a repository you also need to decide which files to process. You must provide examples of successful conversions, run the tests, feed errors back into another attempt, and stop when retries are exhausted - and you need a way to review the results.
The surrounding process is what makes the work repeatable, and it is what we mean by an AI software factory. Engineers can still approve plans and review changes, and how much autonomy is allowed is up to the team.
Let's take a look at some examples of software factories from notable engineering organizations who have covered their approaches in their engineering blogs.
1. Stripe's software factory for payment integrations
Payment providers differ in behavior, but integrating them involves recurring development work. Stripe's Payment Method Factory separates the provider requirements from the instructions agents can reuse.
A planning agent interviews an engineer for context, such as which currencies the payment method supports in which regions, and builds a plan in which each step links to one of more than 100 reusable prompts.
Stripe first used an orchestrator agent to hand out steps and found it slow, expensive, and sometimes unreliable. Code now assigns each step to an isolated implementation agent, with each step intended to produce one PR.
Where a provider has a sandbox, the factory runs end-to-end payment scenarios against it and snapshots the responses into immutable contracts that replace hand-written mocks.
Stripe reported three new integrations and ten migrations, with timelines reduced from as long as six months to two–six weeks.
Stripe also uses the work to improve its prompts. While hardening them, an observer agent read each implementation agent's transcript and noted where it got lost or had to re-learn something.
Each integration now produces learning logs, decision logs, and the engineer's PR review comments. When the integration is complete, an agent turns those into suggested prompt updates. A correction from one review can inform the next integration.
Stripe's separate Minions architecture post explains why some steps belong in code. Its blueprints mix agent tasks with deterministic operations. An agent can implement a change or repair a failure, while code runs a linter or pushes a branch. You can inspect the sequence without having to infer it from an agent's conversation.
2. Ramp's software factory for API connectors
Ramp's Integrations That Write Themselves blog post describes customer-created integrations feeding an internal connector factory. Ramp reports 75 integrations shipped across both paths.
The internal workflow researches a provider, implements a connector, tests it with test credentials collected through a secure link that keeps them out of the model's context, repairs failures, and opens a PR. Engineers get API requests, responses, and product recordings to review alongside the code.
On the customer path, the model builds and tests an integration. A generated deterministic script then executes it. That working integration can become a specification for the internal factory.
This changes what the reviewer receives. The PR contains evidence of how the connector behaves. Ramp also scopes the change: each new provider lives in its own module in an isolated connectors service and touches no shared code. If you are building a connector factory, generating that evidence and keeping the blast radius that small is important.
Ramp applies a similar idea to security remediation. Specialist detectors propose findings, adversarial agents challenge them, validators reproduce vulnerabilities in tests, and fixers produce patches. If the test already passes before the patch, the finding is rejected. Humans review and land the PRs. The validator has to demonstrate the bug before a fixer gets to claim it repaired one.
3. Shopify's software factory: checkpointed screen migrations
Shopify's Helix post describes migrating Shopify app screens from React Native to Swift and Kotlin.
This example from Shopify is very specific and very relatable, as they describe how they migrated app screens from React Native to Swift and Kotlin.
An engineer selects a screen, Helix proposes small checkpoints, and implements them in order. Each checkpoint must pass four gates: behavior tests, a UI review that compares screenshots against the React Native app, two adversarial code reviews, and engineer approval.
When a gate fails, the agent fixes the implementation and runs the check again. It can't override a failed check. Engineer approval is required by default. But interestingly, engineers can let Helix run several checkpoints or skip approval while the automated gates stay in place.
The checkpoint in this system is the part to call out (in a good way.) Helix remembers feedback from every review, so later checkpoints start from earlier corrections, while a failed check requires repair before work moves forward. This gives the engineer a chance to correct anything while the change is still small.
Shopify also discusses extending this approach to new features from designs or product documents.
How to get started with a software factory for your team
These examples are all variations on the same process: give an agent a bounded task, run checks, repair failures, and route the result for review. You could put that structure in a reusable template, or assemble it from Mastra agents and workflows with Mastra Factory.
The work is in making the checks mean something. Stripe can test against provider behavior. Shopify has to preserve what a screen looks like and does. Ramp's security pipeline has to show a vulnerability is real, so it writes a test that fails before the patch.
Before you get started, it might be useful to run through a set of questions to help design the system.
| Question | Useful answers |
|---|---|
| What is the unit of work? | One integration step, connector, screen checkpoint, or security fix |
| What context is reusable? | A reference implementation, reusable prompt, architecture guide, or migration skill |
| What must remain true? | Required API behavior, secure behavior, visual parity, or unchanged business semantics |
| What evidence proves it? | Recorded calls, executable checks, screenshots, and a reviewable diff |
| What happens on failure? | A limited repair loop, a paused item, or an explicit human handoff |
| Who accepts the result? | A named owner or a defined approval policy |
But ultimately we recommend getting to a place where you're building and testing your framework as early as possible - that's where the real learning and iteration happens.
After a PR is opened, measure how many changes were accepted. How much work did reviewers have to do? What broke after merge? A system that opens hundreds of PRs isn't useful if everything breaks.
Keep the instructions used for each run alongside its logs, checks, and review comments. When a run fails, you should be able to work out whether the agent lacked context, couldn't use a tool, made a bad change, or passed a check erroneously. Each failure calls for a different fix.
How to apply these patterns in Mastra Factory
Mastra Factory ships with the scaffolding these teams had to build first. npm create factory provisions authentication, storage, and cloud sandboxes on Mastra platform. With Factory, all you do is connect a GitHub repository, your essential tools, and select a model provider in the UI - and issues start arriving in intake.
From there, the default board moves each Work item through triage, planning, building, and review. The agent asks questions during triage, a person approves the plan before implementation, and each session runs in its own sandbox clone of the repository. Every pull request gets a separate Review session, and merging stays with your repository's normal process.
For a repeated job like a migration, most of your work is what's specific to the codebase. Put examples and instructions in a custom skill, add the commands your tests need to the sandbox setup, and change the boards and rules only if you want different stages or approvals.
Some steps in these examples are specific to each company, so you would build them on top: capturing provider contracts, coordinating dependent migrations, or turning review feedback into instruction updates. Factory treats incoming work items as independent, and CI check results do not wake sessions, so ordered dependencies and CI-triggered runs need your own coordination.
Start with a few changes an engineer can inspect closely. The setup guide takes one GitHub issue to a reviewed pull request. Use the failures from your first batch to improve the skill and the checks before expanding it. And of course, let us know how it goes.
Frequently asked questions
What is the difference between a coding agent and a software factory?
A coding agent performs development work. A software factory organizes repeated work around agents: how tasks arrive, what context they receive, where they run, how results are checked, and when work proceeds or stops. Mastra Factory provides that structure for coding agents, from issue intake to a reviewed pull request.
Does a software factory require fully autonomous development?
No. Human approval can be part of the process, as long as the handoffs are defined and repeatable. In Mastra Factory, starting a run, accepting a non-bug task, approving the plan, and merging wait for a person by default. Turn on Auto-start runs or Auto-approve plans once you trust the results, and keep merging with your reviewers. Our post on where to put approval in agents and workflows covers the same tradeoff in your own Mastra code.
What is a good first software factory project?
Choose repeated work with clear inputs, a small reviewable output, and checks your team trusts. A connector with a provider test environment or a constrained framework migration is a reasonable starting point. If using Mastra Factory, you can get set up in minutes with just running one issue through to a reviewed PR. Document failures, iterate, repeat.
Can I run these workflows in Mastra Factory?
The linked posts describe each company's own implementation, so there is no drop-in template for them. Mastra Factory gives you the parts they built first: issue intake, a staged board with approvals, isolated sandboxes, and a separate review session for each PR - and you can customize it to make it your own.
