Factorik Factorik Start free trial
← See all articles

Build Your Own Software Factory With Factorik

Quick answer: To build your own software factory, pick one GitHub repository and set up a few narrow agents: a Bug Fixer, a CI Fixer, a Code Reviewer and a Dependency Updater. Give each one a trigger: a bug label, a failed build, a newly opened pull request or a schedule. Then set a merge policy that requires passing checks and protects sensitive paths. Start every agent at review-only, and promote it as its record of merged changes grows.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

What does it mean to build your own software factory?

To build your own software factory, you set up a small group of narrow AI agents on one repository. They turn routine engineering events into tested pull requests that have been reviewed. Each agent has one job, one trigger and one set of rules. A merge policy decides what it can ship without a person. The term caught on this year for systems that run coding agents on their own, in loops, with GitHub issues going in and merged pull requests coming out. That's a useful picture, but it skips the part that matters most. Running unattended isn't what makes a factory worth having. What matters is that every change it produces can be traced, checked and reversed, and that you can see which station is doing good work and which isn't.

You don't need an orchestration layer, a fleet manager or a platform team to get started. On Factorik, the Overview page walks you through four steps. First, "Connect GitHub" and choose which repositories agents may see. Then "Add your AI credential" so runs are billed to your own provider account. Next, "Start your first agent". Finally, "Start a run" with a small task and watch it work. The quickest way to create agents is the Start page. Pick a "Repository" and press "Read it and suggest agents". Factorik reads the code and suggests presets that have real work to do there, each with its first task. It also writes down what it learned about the repository, and every agent you create from that page starts with that as its memory.

Here's the opinion the rest of this article defends: start with one repository and three or four agents, not twenty. Teams that set up a large fleet on day one end up with a review queue nobody wants and no idea which agent caused which mess. A narrow agent is easier to judge. If the Dependency Updater opens ten pull requests and nine merge cleanly, you've learned something real about it. If a general-purpose engineering agent touches everything, its record tells you very little. Narrow jobs also make failures cheap. When something goes wrong, you know exactly which agent, which run and which commit to look at. You can also pause that one agent by switching off "Agent is on" while the others keep working.

Which agents should one team start with?

For most teams, the right first four are a Bug Fixer, a CI Fixer, a Code Reviewer and a Dependency Updater. Together they cover the routine work that eats the most attention: reported bugs, a red default branch, review load and stale dependencies. Each one also produces results that are easy to judge. The bug is fixed or it isn't. The build is green or it isn't. That clarity matters, because these agents start building a record from their very first run, and you want that record to mean something when promotion comes up. You can adjust every preset, so treat them as sensible starting points. Change the instructions, add rules and grant tools until each agent fits the way your team already works.

The Bug Fixer diagnoses a reported bug, using production tools such as Sentry or Datadog if you grant them. It fixes the cause and proves the fix with a test. The CI Fixer repairs a broken default branch. On someone else's pull request, it explains what broke and how to fix it, but doesn't push code. The Code Reviewer reads every pull request in context, including ones from other agents, and ends with a verdict on the exact commit it read. The Dependency Updater handles outdated or vulnerable dependencies one safe group at a time. That keeps each pull request small enough to review in a few minutes instead of an afternoon, and makes a bad upgrade easy to spot and revert.

Write each agent's "Instructions" in plain words and keep them short. Then add "Rules from the team": standing rules that every run follows. Only people write them, and no run ever rewrites them. Good rules are specific to your repository. For example: every fix includes a test that fails before the change and passes after it; never edit the generated files under api/gen; use the existing logger, never print statements. Under "Autonomy and limits", leave "What it may do without a person" at the first level for now and set a sensible "Time limit per run". Also cap "Runs at once" so a burst of new issues doesn't flood the review queue. Your rules will grow over time. When you rate a run, "Make this a standing rule" turns your feedback into one.

AgentWhat wakes itWhat it finishes with
Bug FixerIssue labeled bugA pull request with the fix and a test that proves it
CI FixerCI failed on the default branchA pull request that repairs the build, or a comment on someone else's pull request
Code ReviewerPull request openedA verdict on the exact commit it read
Dependency UpdaterScheduleOne pull request per safe group of updates
A starter set of four agents for one repository, with what wakes each one and how it finishes.

How do you connect each agent to the right trigger?

Pick the trigger that matches the moment the work becomes real: a label for bugs, a failed build for repairs, a new pull request for review and a schedule for upkeep. Open the agent form, go to "Triggers", press "Add trigger" and pick the kind. For the Bug Fixer, choose a GitHub event and set "When" to "Issue labeled", with "With this label" set to bug. Using a label instead of "Issue opened" is deliberate. It means a person has read the report and agreed it's a real bug before an agent spends a run on it. Vague or duplicate reports never reach the agent. If you're weighing other options, the trade-offs between each kind of trigger are worth reading before you decide.

Here's what a single run looks like from start to finish. Someone labels issue #482, "Export fails for accounts with no invoices", as a bug. The Bug Fixer wakes, and a sandbox starts with a short-lived, read-only token for that one repository. The agent reads the issue and checks Sentry for the matching error. It writes a failing test that reproduces the bug, then fixes the cause until the test passes. The sandbox never writes to GitHub itself. Factorik's server publishes the change as one commit on a branch it names, never force-pushed and never to the default branch, and opens the pull request. CI runs and the checks pass. The Code Reviewer reads the change and gives its verdict. Then the pull request waits for whatever the merge policy says.

The CI Fixer uses "CI failed on the default branch", and you can also tick "Also when CI fails on a pull request". It receives the end of the failed job's log, so it starts from evidence, not guesswork. There's more on that pattern in our guide to repairing a red build without guesswork. The Code Reviewer uses "Pull request opened (review it)". The Dependency Updater suits a "Schedule": set "Repeats" or a "Cron expression", a "Timezone", "Days of the week" and "What to do each time", such as updating one group of patch-level dependencies. If your bugs live in Jira or Linear, an "Incoming webhook" can wake the Bug Fixer from a ticket automation. Grant it the matching tool so it can reply on the ticket.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

How should a merge policy handle low-risk changes and protected paths?

A good merge policy lets small, well-tested changes through and keeps anything sensitive in front of a person. In Repositories, choose "Merge policy" on the repository. "Merge automatically" is off by default, so every agent pull request waits for a person until you turn it on. Keep "Require all checks to pass" on. Use "Allow merging when there are no checks" only on a repository that really has no CI, and think twice even then, because checks are what make the rest of this setup trustworthy. Policy changes apply to the next pull request. That means you can tighten or loosen the rules without disturbing work that's already in flight, and try a stricter setting for a week before deciding.

"Protected paths" takes glob patterns such as src/payments/** or migrations/**. Any pull request that touches one waits for a person, whatever the agent's level. Add your billing code, authentication and permissions, secrets handling, deploy configuration and database migrations. Then set "Largest change, in files" and "Largest change, in lines" to limits that suit your codebase. Factorik judges whether a change is low-risk from facts about it: how many files and lines it touches, how much it deletes, and whether it reaches sensitive areas like dependencies, build and deploy, secrets, migrations or money. It never asks an AI whether a change feels safe. That's the right call, because a model's opinion of its own diff is the last thing you want deciding what reaches production.

Reviews add a second gate. When the Code Reviewer requests changes on an agent's pull request, the author agent answers on the same branch. It fixes or argues each point, then gets a second look. This repeats for a limited number of rounds before a person decides. Auto-merge waits for every reviewer to approve the current commit, so a new push restarts the review and can't slip through on an old approval. A person's approval can override. If CI fails on an agent's own pull request, that agent fixes it on the same branch a limited number of times. On anyone else's pull request, it only leaves a comment. If you're designing this gate yourself, read up on why a review verdict should be tied to the exact commit.

How does an agent earn the right to merge on its own?

An agent earns merge rights through its record: enough merged changes, a high merge rate and no problems traced to its work. Every agent starts at level one, where it opens pull requests and a person merges them. At level two, it merges low-risk changes by itself when the merge policy allows. At level three, it merges whatever the merge policy allows. When an agent clears the bar for the next level, Factorik offers the promotion on the agent page and in Slack, and a person presses "Promote" or "Not now". In Settings, "How agents are promoted" can be "A person promotes" or "Automatic". We'd keep a person in that loop for the first few months, until you've seen how each agent behaves on your codebase.

Promotion is only half the system. Any problem traced to one of an agent's merged changes moves it down a level at once. A problem can be CI or a deploy failing at the merged commit, a revert, or a person pressing "Report a problem with this change" and filling in "What went wrong". Each finding is recorded and the team is told by Slack, webhook, email or a pull request comment. Every level change is listed with who or what made it and why. For riskier work, mark a change with "Watch in production" so a Change Watcher checks it after it merges. A watcher's suspicion counts only once a person confirms it. That stops one jumpy check from demoting a good agent.

Day to day, the Board shows every change as a card moving through Up next, Proposed, Building, In review, Merged and Watched. The Inbox collects what agents are waiting on a person for: merges to approve, blocked runs and promotions to decide. Results shows what held up: changes merged, merge rate and problems caused. That's the honest test of your factory. Say that a few weeks in, the Dependency Updater has a clean record and the Bug Fixer keeps getting sent back. Promote the first and rewrite the second's rules. That's what autonomous coding agents that earn the right to merge look like in practice. It's also what has to be true before agents merge their own code. To try it on your own repository, start a free 7-day trial of the Team plan. No payment details are needed.

Frequently asked questions

Can I build a software factory on GitLab or Bitbucket?

Not with Factorik today. GitHub is the only git host it supports. You install the Factorik app on your GitHub account or organization and choose which repositories agents may work on, and Factorik can't see any others. If your code lives elsewhere, the ideas in this article still apply: narrow agents, one trigger each, a merge policy with protected paths, and autonomy earned through a record. You'd just need to build them with different tooling.

Who pays for the AI usage when agents run?

Your organization does, through its own AI provider account. An owner adds the credential in Settings. It's stored encrypted, and only its last four characters are ever shown again. Every run is billed to that account, and runs wait instead of failing until a working credential is in place. The Spend page breaks costs down by agent, by model and by repository, so you can see which agents are worth what they cost.

Can one agent start another agent in the pipeline?

No. Agents never start other agents, and that's deliberate. Each agent wakes only on its own triggers: a GitHub event, a schedule, a webhook, a Slack mention or "Run now". Agents can still work together. The Code Reviewer reviews pull requests opened by the Bug Fixer, and an agent can finish with a proposal that a person chooses to build. A person stays at every hand-off, which keeps the chain of cause and effect easy to follow.

What happens if an agent's merged change breaks something?

The agent is moved down a level at once. If CI or a deploy fails at the merged commit, the change is reverted, or a person reports a problem, Factorik records a finding and notifies the team through Slack, a webhook, email or a pull request comment. The level change is logged with the reason. The agent then has to rebuild its record before it can climb again, and its next runs read that finding.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

How helpful was this article?

Articles by Factorik →