Our SWE-in-a-team benchmark research is ready.Read the results.
Four factory belts in the dark, each with a row of vermilion and white items.← Blog
||Guides

How to build an AI software factory: a roadmap in four stages

A four-stage roadmap from a first readiness check to a factory that runs every day. See what each stage needs, when it starts and what it delivers.

To build an AI software factory, move in four stages. Assess your repositories, enable them for agents, run a delivery pilot, and then operate the factory as a standard lane. Each stage has a clear start, a short list of what it needs, and a decision at the end.

I build SHIP with SHIP. Its agents take tickets from SHIP's own backlog and open pull requests on its own repository. In my runs, the model was rarely the reason a mission failed. The ticket text, the CI or the repository usually was. This guide puts those lessons in the order a team meets them on the way to an AI SDLC.

The numbers come from SWE-in-a-team, SHIP's study of 260 missions: 20 tickets for each of 13 builder configurations.

Plan the roadmap in four stages

  1. Assess

    Measure how ready your projects and organization are for agents.

    You put the pilot where agents can succeed, and you get a baseline to measure the factory against.

    Start when
    You want agents to do real delivery work, but you do not know where to start.
    What you need
    • Read access to the repositories, the CI and the tracker
    • One engineer who knows the codebase
    What you get
    • A readiness result for each repository
    • A list of blockers, with the cheapest fix first
    • A baseline of lead time and review wait

    MilestoneYou know what needs to be done in your environment to enable agentic engineering.

    BuildCITestsPreviewwebapimobilePilotPilot ticket typesBug fixDependency upgrade
    Example A booking app team checks its three repositories. The api repository passes every check, so it becomes the pilot, with bug fixes and dependency upgrades as its ticket types.
  2. Enable

    Give your repositories and your engineers what agents need to finish work.

    You build agentic engineering fundamentals for agentic software delivery.

    Start when
    You want to delegate work to agents, but you do not know how.
    What you need
    • The blocker list from the assessment
    • Time from the engineers who own CI/CD and the conventions
    • AI model provider contract and API access to their platform
    What you get
    • An AGENTS.md file and role instructions in each repository
    • CI that is fast, stable and required on every pull request
    • Issue templates with acceptance criteria that a test can check
    • Engineers who write tickets that an agent can finish

    MilestoneA ticket goes from issue to a pull request through agents using your conventions.

    IssueBuilderCIwaitingPull requestAGENTS.mdCIpassedNo person in between
    Example With AGENTS.md in the repository, a test ticket goes from the issue through the Builder and CI to a pull request. No person steps in.
  3. Orchestrate

    Run a delivery pilot on one part of your backlog.

    You see real pull requests on your own code, each with its proof and its cost.

    Start when
    CI/CD is stable, and the tickets have acceptance criteria that a test can check.
    What you need
    • A part of the backlog whose ticket types a test or a preview can prove
    • A preview environment for each pull request
    • One person who accepts each pull request
    What you get
    • Reviewed and tested pull requests, each with its proof and its cost
    • The cost and the cycle time of each accepted change
    • A record of each place where the agents stopped, and why

    MilestoneYou orchestrate agents in your software factory floor for a division of work.

    PlannerBuilderGatesPull requestsGatesRejectedProof and cost on eachTicket types for the factoryBug fixUpgradeFeaturenext round
    Example Three pilot tickets go through the chain of agents. The feature fails a gate once and goes back to the Builder with the feedback. The team then keeps bug fixes and upgrades in the factory.
  4. Operate

    Run the factory as a standard part of how your team delivers.

    Tickets ship autonomously, and each change shows its cost and agent configuration.

    Start when
    The pilot shows a cost and an acceptance rate that you can defend.
    What you need
    • A backlog lane that goes to the factory by default
    • One person who owns the factory configuration
    • A review of the numbers each quarter
    What you get
    • Cost, time and result for each change, for each model and coding agent
    • More ticket types, added one at a time

    MilestoneYou deliver software on multiple projects with or without a human in the loop.

    BacklogFactoryplan to testAuto-mergePersonMergedAuto-merge for upgrades
    Example The factory runs as a lane. The team turns on auto-merge for dependency upgrades, so upgrades merge on their own and bug fixes still wait for a person.
The four stages of the roadmap. A round marker starts a stage, and a diamond marks the decision that ends it.

Take the stages in order. A team that starts a pilot before its CI is stable pays for each flaky test in agent runs. Each extra round is a full run (retry limits).

See what changes for your engineers

In a software factory, the main output of your engineers is no longer code. It is the spec that goes in, the guardrails around the line, and the decision to accept what comes out.

Your engineers

Agent factory floor

Write the spec

Planner

Turns the issue into a plan

Builder

Writes the change in a sandbox

Set the guardrails

Gates

CI, Reviewer and Tester check the work

Accept the change

Verified pull request

Reviewed and tested, with its cost

Rejected work goes back to the Builder with the feedback

Guardrails on every run: your CI, your repository conventions, retry limits and an isolated sandbox

Your engineers set the intent and the rules, and accept the result. The agents do the work between those points.

The diagram shows the line SHIP runs. The Planner reads the issue and writes a plan. The Builder writes the change in an isolated sandbox. CI, the Reviewer and the Tester check the work, and a gate that rejects it sends it back to the Builder with the feedback. When every gate passes, the pull request waits for a person.

The work of your engineers moves to the two ends of the line: what goes in, and what they accept.

What is an AI software factory explains each part, and Agentic SDLC, defined follows one change through the loop. This guide covers the order in which you put the parts in place.

Find the constraint before you buy more agents

Most teams that ask me where to start already pay for coding agents. Their engineers write code faster, and the pull requests wait longer. Faros AI measured that "PR review time increases 91%" on teams with high AI adoption. The data is telemetry from more than 10,000 developers across 1,255 teams (The AI Productivity Paradox Report 2025).

A software factory is like 100 new engineers who join your team on the same day. They open pull requests right away. Each pull request needs a CI run, a review, a preview environment and a place to deploy. Your systems and your DevOps team carry all of that load at once. It is the same pressure as 100 new hires who start to ship code together.

Agentsopen PRsMergedCI/CDrunnerswaits fora runnerReviewreviewerswaits fora reviewerTesttesterswaits fora tester
Illustration Agents open pull requests faster than CI/CD runners, reviewers and testers can take them, so a queue grows in front of each gate.

Faster agents move the constraint from code to review. A factory puts that check inside the line, so agents do the first rounds of review and test before a person reads anything.

The second reason a pilot stalls is the choice of work. A pilot on tickets that no test can prove done ends in a debate about whether the work is done. In my own runs, a criterion that the preview could not show stopped the mission and sent it to a person.

Assess your repositories for agents

Start with facts about each repository. The question for this agent readiness check is narrow: if an agent took a normal ticket in this repository today, what would stop it?

Check each repository against this list. Each item is a gate the factory depends on, or a failure I saw in a real mission.

  • One documented command builds the project and runs its tests from a clean checkout.

    An agent starts from a fresh clone, so a step that exists only on one laptop fails.

  • Every install uses a committed lockfile.

    The same versions install on every run, so each environment stays reliable.

  • CI runs on every pull request, ends in minutes and has stable required checks.

    A flaky test sends good work back to the Builder, and each round costs a full agent run.

  • A failed CI run has logs that the agent can read.

    A bare "CI failed" gives the Builder nothing to fix until the retry limit stops it.

  • Tests check behavior, not only that the code compiles.

    The Reviewer and the Tester can confirm only what a test or a preview can show.

  • Each pull request gets a preview environment.

    The Tester checks the change the way a user would, on a live copy of the app.

  • Tickets have acceptance criteria that a test can check.

    The Planner and the Tester grade against them, and vague text sends the agents in circles.

  • Review has a named owner and a time limit.

    The factory opens more pull requests, so the wait for a person grows first.

Record two numbers before you change anything: the lead time from ticket to merge, and the time a pull request waits for its first review. You measure the pilot against this baseline.

The milestone at the end of the assessment is a clear list of what your environment needs for agentic engineering. Use it to pick the pilot repository: the one that passes the most checks, not the one with the most urgent backlog.

Enable your codebase and your engineers

Enablement fixes the blockers from the assessment, in the order of the list. Most of the work is ordinary engineering discipline. Agents only make its absence more expensive.

Start with the instruction file. AGENTS.md at the repository root holds the conventions that every agent needs. Every agent picks it up by default (agent prompts). Keep it short and specific, because every line costs context on every run.

AGENTS.md
# Conventions

## Commands
- Install: `pnpm install --frozen-lockfile`
- Check before a push: `pnpm lint && pnpm typecheck && pnpm test`

## Code
- TypeScript strict mode. No `any`: use `unknown` and a type guard.
- One module does one job. Split a file before it passes 500 lines.
- Every new function with logic gets a unit test next to it.

## Boundaries
- Do not edit `.github/workflows/`. Do not skip or delete a test to make CI pass.
- Database changes go in a new migration file. Never edit an applied one.

To add rules for one role, give that role its own prompt entry in ship.yml. SHIP adds the file to what the role already gets from AGENTS.md:

ship.yml
agents:
  builder:
    prompt: .ship/agents/builder.md

Then change how your team writes tickets. A ticket the factory can finish names the outcome and the way to check it, not the steps to get there.

.github/ISSUE_TEMPLATE/agent-task.md
---
name: Agent task
about: A change the factory can build and verify
---

## Outcome
What a user can do after this change.

## Acceptance criteria
- [ ] A result that a test or the preview can prove
- [ ] An edge case, with the exact expected result

## Out of scope
What the change must not touch.

Write criteria about results, not methods. The ticket is the source of truth for the whole SDLC. The Builder builds to it, the Reviewer reviews against it, and the Tester tests to confirm it. So an instruction in a ticket becomes a criterion for every agent. In one of my missions, a note about how to do the work became a check that the change had to pass. A correct change then failed on a detail no user cared about.

Last, harden CI from the assessment list: required checks, readable logs on a failed run, and no flaky test in the required set. The milestone is one ticket that agents take from issue to a pull request, with your conventions.

note

A factory must work on a repository that has never heard of it, and SHIP does. Enablement is not a condition for access. It raises the share of tickets that pass every gate without help.

Orchestrate a delivery pilot on one backlog slice

The pilot is where the chain of agents runs on real work. Tickets go in, and reviewed and tested pull requests come out, each with its proof and its cost.

Take the slice from work a test can prove: bug fixes with a reproduction, dependency upgrades, migrations, and small features with exact criteria. The use cases list ready-made slices with their acceptance criteria already written.

To keep a human in the loop after a specific stage, set a checkpoint on that role. The mission holds when the role finishes, and a person reads its result before the next stage starts. You can set a checkpoint on the Planner, the Builder (after CI) and the Reviewer (human in the loop). This example holds the mission after the plan and after the review:

ship.yml
agents:
  planner:
    checkpoint: true
  reviewer:
    checkpoint: true

Keep the retry limits at their defaults. A mission that fails the same way twice stops and goes to a person. The docs say that this usually costs less than five failed rounds (retry limits).

Expect the loop to do most of the correction. In SWE-in-a-team, it fixed 40 of the 46 runs its gates rejected, with no person involved. Among the configurations that resolved all 20 tickets, the cost per resolved ticket was $3.16 to $5.48.

Expect it to miss some things too. 4 of the 260 runs passed every gate and were still not complete, and only the hidden acceptance tests caught them. So read each pull request in the pilot, and keep a list of every place the agents stopped, and why. That list is the backlog for the next round of enablement.

Measure the pilot against the baseline from the assessment. Track the cost per accepted change, the cycle time from ticket to merge, and the share of pull requests accepted as they are. Divide the cost by the changes you accepted, not by the ones the agents opened. The milestone is a software factory floor where you orchestrate agents for a division of work.

Operate the factory as a service for your team

After the pilot, the factory is a lane in how your team delivers. Tickets of the proven types go to it by default, and one person who owns the configuration decides when a new type joins.

SHIP records the cost, the duration and the result of each stage. It attributes them to the harness, model and prompt that ran (capabilities). That makes the quarterly review concrete. You compare configurations on your own tickets, not on a public benchmark.

Mission record - SWE-in-a-team

Feature (F1): Export a date-range CSV of bookings for accounting

claude-code 2.1.211claude-sonnet-5Hidden tests passed

Cost
$7.23
Time
35m 37s
Builder runs
2
Gate rejections
1
StageRunsTimeCost
Planner12m 23s$0.60
Builder26m 38s$0.86
CI-2m 40s-
Reviewer21m 13s$0.46
Preview deploy-2m 28s-
Tester215m 16s$5.31
  1. Plan
  2. Build
  3. CI passed
  4. Review approved
  5. Preview deployed
  6. Test failed
  7. Build
  8. CI passed
  9. Review approved
  10. Preview deployed
  11. Test passed
  12. Ready for acceptance
A real mission from the SWE-in-a-team study. The Tester rejected the first build, and the Builder fixed it on the second run. Cost is the API-equivalent at list price.

Widen in one direction at a time: one new ticket type, or one checkpoint fewer, never both at once. When a number gets worse, you then know which change caused it.

The last decision is how much the factory merges with no human in the loop. By default, a person accepts every pull request. Auto-merge, for a project or for one mission, lets a change that passes review and QA merge itself. It stays off until you turn it on (human in the loop). Before you turn it on, read what a dark software factory misses.

The milestone is software delivery on several projects, with or without a human in the loop.

Choose to build the line or run it on SHIP

You can build the line yourself from open parts: tracker webhooks, your own CI, a container for each run and a headless coding agent. What is an AI software factory shows the Claude Code version step by step. The part you write yourself is the orchestration, with the retry limits, the gates and the cost ledger.

SHIP runs that line as a managed service on your repository, with the coding agents and model keys you choose. Stages 1 and 2 are work in your own repositories either way. SHIP matters from stage 3, when the pilot needs the gates and a cost record for each change.

You now have the roadmap and an agent readiness checklist for each repository. Run the checklist on one repository first, and write down the two baseline numbers before you change anything.

Questions

How do you build an AI software factory?

Build it in four stages. First assess your repositories for agents. Then enable them with an instruction file, fast CI and testable tickets. Run a delivery pilot on one part of your backlog, and then operate the factory as a standard delivery lane. Each stage ends with a decision, so you widen the scope only when the numbers support it.

Where should a company start with an AI SDLC?

Start with an assessment of one or two repositories, not with a tool purchase. Check that each repository builds from a clean checkout, that CI is fast and required, and that tickets have acceptance criteria a test can check. Those three facts decide how much of the work agents can finish, in an agentic or an autonomous SDLC alike.

What does a repository need before AI agents can work on it?

A repository needs a build that works from a clean checkout, and CI that is fast, stable and required. It also needs tests that check behavior and an AGENTS.md file with its conventions. Each ticket needs acceptance criteria that a test or a preview can prove. A preview environment for each pull request lets a test agent check the change as a user would.

What is a chain of agents in software delivery?

A chain of agents gives each delivery stage to its own AI agent, with CI between them. In SHIP, the agents are a Planner, a Builder, a Reviewer and a Tester. A stage that rejects the work sends it back to the Builder with the feedback. In SHIP's 260-mission SWE-in-a-team study, that loop fixed 40 of the 46 runs its gates rejected.

What is a software factory model?

A software factory model describes how work moves from intent to a shipped change, and who does each part. In an AI software factory, people write the specs, set the guardrails and accept each change. AI agents plan, build, review and test the work between those points.

Can you get an AI software factory as a service?

Yes. SHIP runs the agent line as a managed service on your own repository, with the coding agents and model keys you choose. Your team keeps the specs, the guardrails and the decision to merge, and SHIP records the cost and the result of each change.

Run your pilot on SHIP

Start with one repository and one ticket type. SHIP plans, builds, reviews and tests each change, and records what it cost.