Modules, Features and Slices
Module
Section titled “Module”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
Section titled “Features”Features are vertical slice groupings. They nest arbitrarily deep for sub-features.
feature <Name> [description "<text>"] [feature <Name>]* ← sub-features [slice <type> <Name>]+Slices
Section titled “Slices”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>Descriptions
Section titled “Descriptions”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. ```Slice types
Section titled “Slice types”| Type | Description |
|---|---|
StateChange | A command → events flow; something that changes the system |
StateView | A query + projection + screen; something that reads the system |
Automation | A reactor or reducer; something that reacts to events |
Translate | A capture; converts external data into events |
What goes in a slice
Section titled “What goes in a slice”| Construct | Typical slice type | Page |
|---|---|---|
event | any | Events |
command | StateChange | Commands |
constraint | StateChange | Constraints |
query | StateView | Queries |
readmodel | StateView | Read models |
projection | StateView | Projections |
reducer | StateView | Read models |
screen | StateView | Screens |
reactor | Automation | Reactors |
capture | Translate | Captures |
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.
Example
Section titled “Example”module Invoicing
feature InvoiceManagement
slice StateChange RegisterInvoice command RegisterInvoice ... event InvoiceRegistered ...
slice StateView InvoiceList query ListInvoices => InvoiceListReadModel[] projection InvoiceList => InvoiceListReadModel ... screen InvoiceList ...