Skip to content

Modules, Features and Slices

The module is the top-level namespace and maps to a bounded context. One module per file is the convention but not enforced.

module <Name>
[description "<text>"]
[<layouts>]
[<features>]

Layout templates declared at module level are described in Screens.

Features are vertical slice groupings. They nest arbitrarily deep for sub-features.

feature <Name>
[description "<text>"]
[feature <Name>]* ← sub-features
[slice <type> <Name>]+

The slice is the atomic unit of behavior, aligned with Event Modeling. A slice has a type and a name, and contains the constructs that implement the behavior.

slice <SliceType> <Name>
[description "<text>"]
<constructs>

Modules, features, slices, personas, and commands take an optional description as their first body line — a human-readable summary consumers such as Prologue surface when presenting the model. At most one per declaration.

module Invoicing
description "Everything related to invoicing customers"
feature InvoiceManagement
description "Registering and managing the lifecycle of invoices"
slice StateChange RegisterInvoice
description "Registers a new invoice"

When one line is not enough, use a fenced block — the same ``` convention as inline code blocks. The fenced text is kept verbatim:

module Invoicing
description
```
Everything related to invoicing customers.
Registration, lifecycle and payment tracking of invoices.
```
TypeDescription
StateChangeA command → events flow; something that changes the system
StateViewA query + projection + screen; something that reads the system
AutomationA reactor or reducer; something that reacts to events
TranslateA capture; converts external data into events
ConstructTypical slice typePage
eventanyEvents
commandStateChangeCommands
constraintStateChangeConstraints
queryStateViewQueries
readmodelStateViewRead models
projectionStateViewProjections
reducerStateViewRead models
screenStateViewScreens
reactorAutomationReactors
captureTranslateCaptures

Every one of these may appear as many times as the behavior needs — several events, several commands, several projections. Only description is limited to one. A slice is one behavior, not one artifact of each kind.

module Invoicing
feature InvoiceManagement
slice StateChange RegisterInvoice
command RegisterInvoice
...
event InvoiceRegistered
...
slice StateView InvoiceList
query ListInvoices => InvoiceListReadModel[]
projection InvoiceList => InvoiceListReadModel
...
screen InvoiceList
...