Skip to content

Commit d6b20c1

Browse files
respencer-nclclaude
andcommitted
Update cheat sheet to match corrected metadata placement
Align the cheat sheet with the concepts page fixes: - Author: distinguish defined-in vs referenced-in - Term and Option: Lives in metadata blocks, not vital defs - Containment table: separate body definitions from metadata - Fix option syntax to include 'is' keyword - Update Vital description to mention with { } blocks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dc0aa98 commit d6b20c1

1 file changed

Lines changed: 42 additions & 32 deletions

File tree

docs/riddl/references/cheat-sheet.md

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ Root
7474
└── Module (for organizing large roots)
7575
```
7676

77-
| Level | What it can contain |
78-
|---|---|
79-
| **Root** | Domain, Module, Author |
80-
| **Domain** | Context, User, Epic, Saga, Type, Author, Include |
81-
| **Context** | Entity, Repository, Projector, Saga, Adaptor, Streamlet, Connector, Group, Handler, Function, Type, Constant, Include |
82-
| **Entity** | State, Handler, Function, Type, Constant, Invariant, Include |
83-
| **Repository / Projector / Adaptor** | Handler, Function, Type, Constant, Include |
84-
| **Streamlet** | Inlet, Outlet, Handler, Function, Type, Constant, Include |
85-
| **Epic** | Use Case |
86-
| **Saga** | Saga Step |
77+
| Level | Body definitions | Metadata (`with { }`) |
78+
|---|---|---|
79+
| **Root** | Domain, Module, Author | briefly, described by |
80+
| **Domain** | Context, User, Epic, Saga, Type, Author, Include | term, option, by author, briefly, described by, attachment |
81+
| **Context** | Entity, Repository, Projector, Saga, Adaptor, Streamlet, Connector, Group, Handler, Function, Type, Constant, Include | term, option, by author, briefly, described by, attachment |
82+
| **Entity** | State, Handler, Function, Type, Constant, Invariant, Include | term, option, by author, briefly, described by, attachment |
83+
| **Repository / Projector / Adaptor** | Handler, Function, Type, Constant, Include | term, option, by author, briefly, described by, attachment |
84+
| **Streamlet** | Inlet, Outlet, Handler, Function, Type, Constant, Include | term, option, by author, briefly, described by, attachment |
85+
| **Epic** | Use Case | term, option, by author, briefly, described by, attachment |
86+
| **Saga** | Saga Step | term, option, by author, briefly, described by, attachment |
8787

8888
---
8989

@@ -110,6 +110,8 @@ contexts, types, users, and epics.
110110

111111
**Lives in**: Root or another Domain.
112112
**Contains**: Context, User, Epic, Saga, Type, Author, Include.
113+
Metadata (in `with { }`): term, option, by author, briefly,
114+
described by, attachment.
113115

114116
**Key details**:
115117

@@ -137,8 +139,9 @@ own data models and message contracts. Contexts are also how you model
137139
applications (by adding Groups).
138140

139141
**Lives in**: Domain.
140-
**Contains**: Entity, Repository, Projector, Saga, Adaptor, Streamlet,
141-
Connector, Group, Handler, Function, Type, Constant, Include.
142+
**Contains**: Entity, Repository, Projector, Saga, Adaptor,
143+
Streamlet, Connector, Group, Handler, Function, Type, Constant,
144+
Include.
142145

143146
**Key details**:
144147

@@ -159,7 +162,8 @@ mutable state and business rules (e.g., Order, Customer, Account).
159162

160163
**Lives in**: Context.
161164
**Contains**: State, Handler, Function, Type, Constant, Invariant,
162-
Include.
165+
Include. *(Note: options like `event-sourced` and `aggregate` go
166+
in the `with { }` metadata block, not in the body.)*
163167

164168
**Key details**:
165169

@@ -685,12 +689,16 @@ without affecting core semantics.
685689

686690
### Author
687691

688-
**Purpose**: Attribution metadata—who created or maintains a definition.
692+
**Purpose**: Attribution metadata—who created or maintains a
693+
definition.
689694

690-
**When to use**: At the domain level to identify the model author(s).
691-
Authorship is inherited by all contained definitions.
695+
**When to use**: At the domain level to identify the model
696+
author(s). Reference them from any definition's `with { }` block
697+
using `by author Name`.
692698

693-
**Lives in**: Root, Domain.
699+
**Defined in**: Module, Domain (body definitions only).
700+
**Referenced in**: Any definition's `with { }` metadata block via
701+
`by author Name`.
694702
**Contains**: `name`, `email` fields only.
695703

696704
**Syntax**: `author Name is { name is "..." email is "..." }`
@@ -699,35 +707,36 @@ Authorship is inherited by all contained definitions.
699707
700708
### Term
701709

702-
**Purpose**: A glossary entry—defines domain-specific terminology within
703-
the model itself.
710+
**Purpose**: A glossary entry—defines domain-specific terminology
711+
within the model itself.
704712

705-
**When to use**: When your domain uses jargon that readers (human or AI)
706-
might not know.
713+
**When to use**: When your domain uses jargon that readers (human
714+
or AI) might not know.
707715

708-
**Lives in**: Any vital definition.
709-
**Contains**: A description string.
716+
**Lives in**: Metadata blocks (`with { }`) on any definition.
717+
**Contains**: A doc block (description).
710718

711-
**Syntax**: `term "SKU" is described by "Stock Keeping Unit"`
719+
**Syntax**: `term SKU is { |Stock Keeping Unit... }`
712720

713721
> *[For more details →](../concepts/term.md)*
714722
715723
### Option
716724

717-
**Purpose**: An instruction to translators about how a definition should
718-
be implemented or interpreted.
725+
**Purpose**: An instruction to translators about how a definition
726+
should be implemented or interpreted.
719727

720728
**When to use**: To annotate definitions with technology hints,
721729
behavioral flags, or classification metadata.
722730

723-
**Lives in**: Any vital definition.
731+
**Lives in**: Metadata blocks (`with { }`) on any vital definition.
724732

725733
**Key details**:
726734

727-
- `technology("Kafka")` — implementation hint
728-
- `kind("core")` — classification
729-
- Boolean if no arguments: `option event-sourced`
730-
- Entity options: `event-sourced`, `aggregate`, `transient`, `available`
735+
- `option is technology("Kafka")` — implementation hint
736+
- `option is kind("core")` — classification
737+
- Boolean if no arguments: `option is event-sourced`
738+
- Entity options: `event-sourced`, `aggregate`, `transient`,
739+
`available`
731740
- Context options: `service`, `gateway`, `package`
732741

733742
> *[For more details →](../concepts/option.md)*
@@ -811,7 +820,8 @@ directly instantiated in RIDDL models:
811820
- **[Definition](../concepts/definition.md)** — The base concept:
812821
anything with a name and optional metadata.
813822
- **[Vital](../concepts/vital.md)** — A definition that supports
814-
options, terms, authors, includes, and descriptions. All processors,
823+
metadata (options, terms, author references, descriptions, and
824+
attachments in `with { }` blocks), plus includes. All processors,
815825
Domain, and Context are vital.
816826
- **[Processor](../concepts/processor.md)** — The abstract parent of
817827
Context, Entity, Repository, Projector, Saga, Adaptor, and Streamlet.

0 commit comments

Comments
 (0)