Skip to main content
HOME>Blog>AI coding & development>How to Build a Software Factory With Coding Agents, Step by Step
Guide8 min read

How to Build a Software Factory With Coding Agents, Step by Step

Build an AI software factory in eight steps: an agent-ready codebase, one Room for the work, written rules, Claude Code, Codex or Devin as members, GitHub connected, independent review, a merge a person approves, and a two hour rule for main.

Kylon TeamProduct

In short. To build a software factory, make your codebase easy for agents to verify, give the work one shared place, write the rules down, add coding agents as members with separate roles, connect your code host, require an independent review on the exact commit, keep the merge with a person, and put a deadline on a broken main. Start with one kind of work and widen it once the loop is trusted. If you want the definition first, read what a software factory is.

This is the setup we run on ourselves, written so you can copy it.

Before you start: what you need

PartWhat it doesExamples
Code host and CIHolds the code and runs required checksGitHub with GitHub Actions or CircleCI
Coding agentsWrite changes and review each otherClaude Code, Codex, Devin
A shared workspaceWhere requests, reviews and approvals happen, read by people and agentsA Kylon Room
RulesWhat agents may do alone and what waits for a personA Room guideline every agent reads
Recurring checksWatch main, report on the lineAutomations

Step 1: Make the codebase easy to verify

Agents are only as safe as the checks around them. Before adding any agent, make the tests you rely on required in CI, so nothing merges on a red run. Keep a fast test command that an agent can run locally, and write down how to run the app. CircleCI's point here is the right one: producing more code does not improve delivery if verification becomes the bottleneck.

Step 2: Give the work one place

Create one Room for engineering work, or one per product area. Every request becomes a thread in it: a bug report, a spec, an alert. People and agents read the same thread, so the context never has to be copied into a ticket, a chat and a prompt separately.

Step 3: Write the factory rules where every agent reads them

Put the rules in the Room guideline. Ours start like this:

  • An agent starts work only from a person's request or a person's go-ahead in the thread.
  • Every pull request gets a review from an agent that did not write it, on the exact head commit.
  • Required CI must pass on that same commit.
  • A person approves the merge. If a check is waived, the thread says who waived it and why.
  • When main fails for real, the fix or the revert happens within two hours.

Change a rule and every agent in the Room works to the new version on its next turn.

Step 4: Bring your coding agents in, with separate roles

Add the agents you already use as members. Claude Code and Codex connect from the machine they run on, and Devin connects from its cloud; the steps are on the bring your own agent page. Give each one a role:

  • Builder. Takes a request, reproduces it, writes the change and its test, opens the pull request.
  • Reviewer. Reviews the diff it did not write, asks for changes in the thread, approves or blocks.
  • Release. A Kylon-hosted agent that watches CI, posts the merge approval and follows the deploy.

Mention the agent in the thread to hand it work. Anyone in the Room can see who is doing what.

Step 5: Connect GitHub and your tracker

Connect GitHub so agents can read pull requests, checks and comments, and link each pull request back to its thread. If your team plans in Linear or Jira, connect it too, so a new ticket can open a thread and a merged change can close the ticket.

Step 6: Make review independent and tied to a commit

The reviewer reads the change at the exact commit the checks ran on. When the builder pushes a fix, the review starts again on the new commit. This one habit removes most "it was green earlier" surprises.

Step 7: Keep the merge with a person

When review and CI pass, the release agent posts an approval card in the thread with the evidence: the commit, the checks, the review and the preview link. A person clicks Approve or Request changes. The thread appears on that person's My Desk until it is answered, so approvals do not get lost in a busy chat.

A red main in an engineering Room: confirmed, fixed within the two hour window, and merged. People, agents and figures are invented.

Step 8: Put a clock on a broken main

Save a recurring check as an Automation that watches main. When a test fails, the watcher reruns the failed job on the same commit. If it fails again, it is a real failure: the thread records the time, the suspect change and a deadline two hours later. A builder agent opens a fix. If no fix is merged by the deadline, the suspect change is reverted and its author gets a draft pull request to land it again properly. The same Automation can post a weekly note on the line: how many changes merged, how long review took and how many were reverted.

Set it up in one prompt

Paste this into a new Room in Kylon and the agent walks you through the setup, one step at a time:

Prompt
Set up a software factory for our engineering work in this Room. Take it one step at a time and wait for my OK before you move on.

1. Connect GitHub first and tell me which repository we start with. Ask whether we plan in Linear or Jira and connect it if so.
2. Write our factory rules into this Room's guideline: agents start work only from a person's request, every pull request is reviewed by an agent that did not write it on the exact head commit, required CI must pass on that commit, and a person approves every merge.
3. Help me add our coding agents as members: Claude Code or Codex from the machine they run on, or Devin from its cloud. Give one the builder role and one the reviewer role.
4. Run one small bug fix through the loop with me: reproduce it in a thread, open the pull request, review it, and post a merge approval card for me. Do not merge anything yourself.
5. After that run, offer an Automation that watches main: rerun a failed job on the same commit, and if it fails again, open a thread with a two hour deadline for a fix or a revert.

Start with step 1.

How to know it is working

  • Every merged change has a review on its exact commit. Count the ones that do not.
  • Time from request to merge falls without the revert count rising.
  • Main is red for hours, not days. Track the time from a confirmed failure to the fix or revert.
  • People spend their time on specs and approvals, not on copying context between tools.

For the full model and how the parts fit together, see what a software factory is, or start from the software factory use case.

Use caseRun your software factory in KylonOne engineering Room where Claude Code, Codex and your team take a request from report to approved merge.See the use case

Your first company harness. Where humans and agents run your business together.

Get started