> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mutagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How the loop works

> The five ADLC stages, how they hand off, and the two rules that keep the loop honest.

The Agentic Development Lifecycle is one loop with five stages. Each stage is owned by a standalone
skill, and you can enter at any stage — the orchestrator routes onward from there.

```mermaid theme={null}
flowchart LR
  S["Spec"] --> B["Build"] --> E["Evaluate"] --> D["Diagnose"] --> O["Optimize"]
  O -. "you approve" .-> B
  classDef s fill:#140d22,stroke:#7E47D7,color:#ede7f8;
  class S,B,E,D,O s;
```

| Stage        | What happens                                       | You get                            |
| ------------ | -------------------------------------------------- | ---------------------------------- |
| **Spec**     | Define what the agent should do.                   | A portable `agentspec.yaml`.       |
| **Build**    | Implement the spec into your framework or harness. | A working agent.                   |
| **Evaluate** | Score the result against real traces.              | A pass/fail verdict per criterion. |
| **Diagnose** | Root-cause the failures on evidence.               | Ranked remedies.                   |
| **Optimize** | Apply an approved remedy, then run again.          | A better agent, re-checked.        |

## You stay in control

No stage advances on its own. Every change to your code or config is held for your explicit approval
before it lands, and nothing runs until you ask — Helix is on-demand, not a background process.

The stages are also kept separate on purpose: **Evaluate** only decides pass or fail and routes any
failures to **Diagnose**, which proposes the fixes. The stage that scores your agent is never the one
that changes it, so a passing verdict can't come from the tool that was supposed to earn it.

## Enter anywhere

You don't have to start at Spec. Point Helix at an agent you already have and ask it to **evaluate**;
it will derive criteria from your traces and score the current behaviour. Ask it to **diagnose** and it
will root-cause what the evaluation flagged. The loop is a flexible path, not a fixed pipeline.

<Note>
  Two of the lifecycle skills — the **Evaluator** and **Diagnostics** — also publish on npm and run
  on their own, without the rest of Helix. See [the lifecycle pages](/helix/lifecycle/evaluate).
</Note>
