Skip to content

Run Your First Slice

This walkthrough shows a slice going from Planned on your Eventmodelers board to a tested, working Cratis vertical slice in your .NET / C# project — with no manual coding in between.

Install the kit and connect it to a board first. The loop needs a running agent (node .build-kit/ralph-claude.js) and valid credentials in .eventmodelers/config.json.

Every install ships a working example under SomeModule/SomeFeature/ — a Registration slice (a command and its event) and a Listing slice (a projection and read model). Open them before you build your own; they show every convention the kit’s build skills reproduce:

  • One file per slice, with the command/event/reactor together
  • @Command/@EventType-style artifacts with a handle()-shaped method that returns the event
  • The React screen and command wiring in .tsx/.ts files beside them
Terminal window
node .build-kit/ralph-claude.js

The loop polls for two independent triggers — see Understanding the Loop — and idles quietly until one fires.

On app.eventmodelers.ai, create or open a slice and set its status to Planned. For example, a “Register Author” slice might look like:

{
"id": "slice-123",
"title": "Register Author",
"status": "Planned",
"contextName": "Authors",
"sliceType": "StateChange",
"commands": ["RegisterAuthor"],
"events": ["AuthorRegistered"],
"description": "Register a new author with name and email"
}

The real-time subscription picks up the status change and saves the definition to .build-kit/.slices/Authors/register-author/slice.json.

Because the slice only carries commands/events (no processors, no projections/queries), the loop routes to the build-state-change skill, which generates Authors/Registration/RegisterAuthor.cs:

[Command]
public record RegisterAuthor(AuthorId Id, AuthorName Name) : ICanProvideEventSourceId
{
public EventSourceId GetEventSourceId() => Id;
public AuthorRegistered Handle() => new(Id, Name);
}
[EventType]
public record AuthorRegistered(AuthorId Id, AuthorName Name);
Terminal window
dotnet build Authors.Registration
dotnet test Authors.Registration.Specs

Once the build and tests pass, the kit calls back to the platform and marks the slice Done — closing the loop without you touching an editor.

  • Try a slice with projections/readModel set — it routes to build-state-view instead
  • Try a slice with processors set — it routes to build-automation
  • If a slice gets stuck in InProgress, check the loop’s terminal output, confirm dotnet build succeeds locally, then re-run the loop