> ## 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.

# Build

> Stage ② — implement a validated spec into your framework or harness, test-first.

<Note>Stage ② of the loop · owned by the **Builder** skill.</Note>

**Build** takes a validated [`agentspec.yaml`](/helix/lifecycle/spec) and implements it into the
target you chose — a framework or a coding-agent harness. It works test-first: it lays down the
checks the spec implies, then builds until they pass.

Two agents run in tandem: an **implementer** writes the code, and a **reviewer** checks each pass
against the spec and flags drift. They loop — implement, review, correct — until the checks are
green. You get the finished agent and a build report, not the intermediate steps.

## Run it

Point Helix at the spec and the target:

```text theme={null}
Build the Refund Processing agent on Mastra with the Stripe tool and get its test suite green.
```

Other ways people ask:

* *Implement the Lead Qualification agent for Codex — enrich each lead, score it, and route the hot ones to sales — and stop at a working agent I can run.*
* *Add the escalation rule so the Refund Processing agent hands disputes over \$500 to a human instead of auto-approving.*

Build implements the spec, runs its checks, and stops when you have a working agent.

## Keeping spec and code in sync

Code drifts from the spec as you iterate. When that happens, ask Helix to **resync the spec** — it
reconciles `agentspec.yaml` against what the implementation actually does, so the definition and the
code stay in agreement. Any change to the spec is shown to you before it's written.

## What you get

* A working agent that implements your spec.
* A spec and an implementation that agree.

<Card title="Next: Evaluate" icon="arrow-right" href="/helix/lifecycle/evaluate">
  Score the agent against your real traces.
</Card>
