# Software factory

> A system of work where triggers, not humans, start agent sessions, so more work runs AFK and HITL time is saved for what needs it.

A system of work where [agent](https://ai9k.vercel.app/en/agent) [sessions](https://ai9k.vercel.app/en/session) are started by triggers — an issue being created, a schedule, a CI failure, another session finishing — rather than by a human, so more work runs [AFK](https://ai9k.vercel.app/en/afk) and human attention is spent on the [human-in-the-loop](https://ai9k.vercel.app/en/human-in-the-loop) decisions that remain.

Without a factory, every session starts because someone started it. Even fully AFK work waits on a person to open the session, point it at the [ticket](https://ai9k.vercel.app/en/ticket), and set it going. Teams want to ship more than that allows. A factory takes the human out of starting sessions, and not necessarily out of anything else.

Common triggers and the sessions they start:

| Trigger                        | Session it starts                    | Example                                                                                                                   |
| ------------------------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Issue created or labelled      | Exploration, bug fix, implementation | An issue labelled `ready-for-agent` gets a session that opens a PR                                                        |
| Schedule (cron)                | Recurring maintenance                | One lint rule fixed per night                                                                                             |
| CI failure or monitoring alert | Diagnosis, fix attempt               | A failing build on main gets a session that finds the breaking commit and proposes a fix                                  |
| Another session finishing      | Follow-on work                       | A PR opened by one agent triggers an [automated review](https://ai9k.vercel.app/en/automated-review), whose comments trigger a fix-up session |

A factory doesn't have to cover the whole software process. One cron job that runs one kind of session and opens one reviewable PR is a factory. Starting that small is useful: a narrow loop produces small, similar PRs, and reviewing them shows how far the loop can be trusted before it's widened.

Humans can sit anywhere in a factory — writing and labelling the issues that trigger sessions, approving a plan before implementation starts, doing [human review](https://ai9k.vercel.app/en/human-review) before merge. Deciding which of those decisions stay human is the main design question. A codebase, or part of one, where no human reviews the factory's output is a [dark factory](https://ai9k.vercel.app/en/dark-factory).

**Usage**

"Who fixed all the `no-floating-promises` violations?"

"The factory. Cron job picks one lint rule a night, opens a PR. I just review it in the morning."

---

- Section 7 — Patterns of Work · Term 71 of 72
- Page: https://ai9k.vercel.app/en/software-factory
- Learn step by step: https://ai9k.vercel.app/en/learn#/software-factory
- On the map: https://ai9k.vercel.app/en?term=software-factory
- JSON: https://ai9k.vercel.app/data/terms/software-factory.json
- Mentioned in: [Ticket](https://ai9k.vercel.app/en/ticket.md), [Home Repo](https://ai9k.vercel.app/en/home-repo.md), [Human-in-the-loop](https://ai9k.vercel.app/en/human-in-the-loop.md), [Vibe coding](https://ai9k.vercel.app/en/vibe-coding.md), [Dark factory](https://ai9k.vercel.app/en/dark-factory.md)
- Previous: [AX](https://ai9k.vercel.app/en/ax.md)
- Next: [Dark factory](https://ai9k.vercel.app/en/dark-factory.md)

Every term page has a markdown copy: add .md to its address.
