Building Your Agent
bxAgents build and the five-phase pipeline that turns your project into an app.
On this page
Building Your Agent
With Agent.yml and instructions.md in place, build your project:
bxAgents build
This runs the full build pipeline - config resolution, discovery, validation, code
generation, manifest normalization - and writes a real ColdBox application to
.build/, laid out like the ColdBox BoxLang template (the code in app/, the web root
in public/), plus .build/manifest.json.
The five phases, in order
flowchart TD
A["1 Β· Resolve config"] --> B["2 Β· Discover"]
B --> C{"3 Β· Validate"}
C -->|"any error"| X["Build throws.<br/>.build/app is never written"]
C -->|"clean"| D["4 Β· Generate"]
D --> E["5 Β· Normalize + write manifest"]
E --> F[".build/manifest.json<br/>+ .build/app and .build/public"]
style C fill:#fff3cd,stroke:#856404
style X fill:#f8d7da,stroke:#721c24
style F fill:#d4edda,stroke:#155724
- Resolve config - loads
Agent.yml(or a class-basedAgent.bx, calling itsconfigure()) and the active environment override, then deep-merges anyboxlang.json/boxlang-{env}.json. - Discover - walks the project and enumerates every convention folder into raw entries. Pure discovery - no interpretation of file contents yet.
- Validate - collects every error (never fails fast) plus warnings: duplicate
tool/skill/model/subagent names, circular references, bad model/provider config,
and more. If any errors were collected, the build throws here -
.build/appis never written or touched. - Generate - only reached once validation is clean. Interceptors, gateways, MCP,
the router, the agent API handler, the web UI (if any), the core app skeleton, a verbatim copy of
tools//skills/, the bundled ColdBox libraries, and the scheduler, in that order. - Normalize + write the manifest - produces the canonical
.build/manifest.json.
If your project fails validation
build fails with every collected error, not just the first one - a duplicate
tool name and an unknown model provider in the same project both get reported in one run.
Idempotency
Rebuilding an unchanged project produces byte-identical output, down to the manifest's per-file content hashes. This is the entire point of paying the assembly cost once, at build time, instead of deferring it into every request.
Useful flag: --verbose
bxAgents build --verbose
Prints one line per build phase live as it runs - what got resolved/discovered/
validated, per-phase counts, which agents ended up registered in config/WireBox.bx
and under which names, whether a scheduler was found, and a final timing line. Silent
otherwise, so it costs nothing when you don't need it.
Try it
cd ~/bxagents-course/acme-support
bxAgents build --verbose
...
Build succeeded: <anything>/acme-support/.build/app
You should see a .build/ directory appear, with app/ (the code) and public/ (the only folder a server
serves), and a manifest describing exactly what went into it. Two commands check a project without running it:
inspect reports what the source says, and doctor checks the machine and the project:
bxAgents doctor
[ OK ] BoxLang <anything>
[ OK ] bx-ai <anything>
[ OK ] Agent definition found at [<anything>]
[ OK ] Project structure validates cleanly
[ OK ] Data home [<anything>] (convention) can be written
Everything checks out.
doctor is the first thing to run when something does not work: it names a missing key, a bad Agent.yml or a
folder it cannot write. You'll talk to this built agent in the next lesson.
Full reference: The Build Pipeline.
Checkpoint
Nothing in the source changed; acme-support/ is built.
Next: Talking to Your Agent