Leaders, lesson 2 of 11

It is a loop, not a line: plan, build, ship, watch, learn

4 min read

Who it's for

Engineering leaders whose teams already use AI coding tools.

You'll be able to

Name the five stages of the loop and see which ones your team skips.

Most AI tools help with one step: writing the code. A factory treats the whole path, from idea to production and back again, as one loop.

A coding agent covers one box

Writing code is now cheap. Everything around it is still work. Someone has to decide what to build, check the result, release it, see how it behaves, and learn from what went wrong. With many agents writing code, that work grows.

So a factory is not a line that ends at "merged". It is a loop. When users find a problem, the path starts again.

Five stages in a loop. After learn, the path goes back to plan.

  1. Plan: A short spec says what "done" means. An agent breaks it into small tasks, each with its test. Who holds it: A person approves both.
  2. Build: An agent writes the test first, sees it fail, then writes the code. Who holds it: Agents.
  3. Ship: The gate runs every check. A person reviews and merges. The release goes live. Who holds it: Scripts, then a person.
  4. Watch: Errors and user reports from production are collected. Each one becomes a new task. Who holds it: Scripts.
  5. Learn: Each problem that got through leaves something behind: a new test, a check or a written rule. Who holds it: A person approves the change.

When users find a problem, the path starts again.

Not a line that ends at merged: five stages, and who holds each one.

Generating code is the easy part. A factory runs the whole loop.

Five stages

StageWhat happensWho holds it
PlanA short spec says what "done" means. An agent breaks it into small tasks, each with its test.A person approves both
BuildAn agent writes the test first, sees it fail, then writes the code.Agents
ShipThe gate runs every check. A person reviews and merges. The release goes live.Scripts, then a person
WatchErrors and user reports from production are collected. Each one becomes a new task.Scripts
LearnEach problem that got through leaves something behind: a new test, a check or a written rule.A person approves the change

Why the back half matters

Teams that adopt AI tools tend to start with plan and build. That is where the tools are. But industry reports from 2026 found the same pattern: AI raised the number of changes per person, and it also raised incidents and failed changes.

More changes reaching production means more chances to break something. If nobody watches, nobody knows which change did it. So measure speed and stability together, never speed alone.

Closing the loop

Here is the loop working end to end. A user reports a bad answer with one button in the app. A fixed script turns the report into a new task, without anyone copying text around. An agent turns the reported case into a test, and the test fails, as it should. The fix goes through the same gate and the same review as any other change. Then it goes live.

Two habits make this safe and useful:

  • The reader holds no keys. Error messages and user reports are text written by outsiders. The known attacks on AI workflows in 2026 had one shape: an agent read untrusted input while holding write access. So the agent that reads errors may only file a task. The normal gated path does the rest.
  • Fix forward. A bug that reached users is not closed until something exists that would have caught it: a test, a check, or a rule the agents read. A person approves that change, and it records why it was added, so it can be removed if it does not help.

Try it

Take your team's last three production bugs. For each one, write down:

  1. How you found out about it: a user, an alert, or by chance.
  2. Whether it became a task by itself, or someone copied it by hand.
  3. What test or check you added so it cannot come back.

Where the answers are "by chance", "by hand" or "nothing", that is the half of the loop you are missing.

Get one lesson a week

Short and practical, from a factory people and agents really work in. Leave any time.