The Axon builder
The Axon builder renders an application’s Screenplay model into a Java application on Axon Framework (Spring Boot and Maven), with the Axon Stage renderer. It supports the same four levels as the Cratis builder, through the same builder system: it is cratis build run with --target axon, packaged with the axon build kit, which says how to verify the result and what an agent may write.
The Axon renderer is experimental. It reports what it cannot place as warnings, and refuses the model in strict mode. It builds backend slices only: commands, events, read models, automations and translations. Screens are not part of the Axon target, so Studio offers the Axon builder no user interface work.
Before you start
Section titled “Before you start”- The Cratis CLI, connected to Studio and approved. See Connect a builder and approve it.
- A clean clone of the application’s repository, with Git credentials that can push to it.
- Without
--docker: a JDK 21 or later. With it, only Docker. - For the Code and AI and AI levels, a coding agent, and an AI provider in Studio under Settings > AI if its calls go through Studio.
Run a level
Section titled “Run a level”Install the kit into the project once. It tells the builder how to verify the result and what an agent may write:
cratis build init --kit axon --agent claudeThen run a level:
cratis build run --level screenplay --target axoncratis build run --level code --target axoncratis build run --level code-ai --target axon --agent claude --ai studiocratis build run --level ai --target axon --agent claude --ai studio--kit <folder> uses another kit for one run.
At each level the builder:
- writes the model to the
screenplayfolder of the project, - renders it with the Axon renderer at Code and Code and AI,
- at Code and AI, lets the agent add the behavior the model describes on top of the rendered code: the slices’ descriptions, the described handlers and queries, the specifications and the feedback. It completes the bodies the renderer left, which the renderer lists in
UNSUPPORTED.mdandruntime/UnsupportedImplementations.java. At AI nothing is rendered, and the agent writes the slices from the model and the same instructions. See The instructions the agent gets, - verifies with
./mvnw -q -B test, and - commits on the branch Studio names and reports the outcome.
Generated files carry a managed header and belong to the renderer. The kit keeps agents out of them and lets them write the slots the renderer leaves.
In Docker
Section titled “In Docker”The Axon builder has its own image on Docker Hub, cratis/studio-axon-builder: the Cratis builder image with the axon kit.
cratis build run --level code --target axon --dockerWith --target axon, --docker picks this image for you; the Cratis builder image has the same tools but not the kit. The image is built from the Cratis Grip repository, versioned with it and published with every Grip release. The CLI uses the newest version, tells you when a newer one is out, and cratis update pulls it.
Make it the builder
Section titled “Make it the builder”Open the application’s Settings > Building in Studio, set Builder to the machine, and mark slices Ready for implementation. See Choose who builds. The builder’s manifest says it builds the backend only, so an application whose builder is the Axon builder gets its screens from another builder, or from none.