# Factory engineering

> Factory engineering means building and tuning the agent system that builds the product. The engineer writes less code and designs the pipeline that writes, checks and measures it.

Every change takes three activities: plan, implement, verify. Before agents, implementation took most of the time. Once agents write most of the code, planning and review fill the day. Without a change in method, the job risks shrinking to meetings and tedious reviewing.

Hence two ways of working, often done by the same people on the same team. Product engineering decides what to build and with which architecture. Factory engineering automates implementation and review. It starts with low-risk work and calls on a person only when it has to.

These are system design questions, and answering them pays off more as the product grows and the number of agents goes up. When should the agent ask for input before writing? What goes into a good spec? Which secrets, tools and skills should it get? How does it prove that its change works? How do you estimate the risk of a PR? Which tasks can move to a cheaper model without losing quality?

**When**: When a team spends more time babysitting agents than improving them.

**Trade-offs**: Engineers spend their time on the pipeline instead of the product. The gain then shows up across every task the pipeline handles.

## Where to start

- Spot a task done by hand over and over, such as pasting an alert into an agent during on-call
- Automate it in the software factory, with checks matched to its risk
- Measure the result with a scorer
- Change one variable at a time and compare

## Common mistakes

- Calling on a person where an automated check would do
- Automating risky work first
- Fixing one machine’s settings instead of the shared configuration

## Metrics

- Cost per successful task, before and after each change
- Cycle time
- Quality scorer results

## Sources

- [Warp, Becoming a factory engineer](https://www.warp.dev/blog/factory-engineering-software-factories)
- [Warp, 7 core components for building a software factory](https://www.warp.dev/blog/7-ways-to-build-a-software-factory)
