一键导入
slice-builder
Transform slice definitions from config.json into C# code using Wolverine + Marten (Critter Stack)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Transform slice definitions from config.json into C# code using Wolverine + Marten (Critter Stack)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate event-driven automation processors for AUTOMATION slices using Wolverine message handlers
Generate commands, events, aggregates, Wolverine HTTP endpoints (POST), and tests for STATE_CHANGE slices
Generate Marten read models, projections, and Wolverine HTTP GET endpoints for STATE_VIEW slices
Generate translators that map external events (from other bounded contexts or systems) into internal domain events using Wolverine handlers
| name | slice-builder |
| description | Transform slice definitions from config.json into C# code using Wolverine + Marten (Critter Stack) |
Transform slice definitions from config.json into C# code following CQRS/Event Sourcing patterns with the Critter Stack (Wolverine + Marten).
{
"slices": [
{
"title": "slice: <Name>",
"context": "<BoundedContext>",
"sliceType": "STATE_CHANGE|STATE_VIEW|UNDEFINED",
"commands": [...],
"events": [...],
"readmodels": [...],
"processors": [...],
"specifications": [...]
}
]
}
| sliceType | Skill | Generates |
|---|---|---|
STATE_CHANGE | state-change-slice | Command record, Event record, Aggregate, HTTP endpoint (POST), Tests |
STATE_VIEW | state-view-slice | ReadModel document, Projection, Query endpoint (GET), Tests |
TRANSLATION | translation-slice | External message type, Translator handler, Internal event, Tests |
UNDEFINED | Skip | - |
If slice contains processors with type: "AUTOMATION", also apply automation-slice.
| Pattern | Trigger | Output | Use when |
|---|---|---|---|
| STATE_CHANGE | User command | Domain event appended | User/UI changes aggregate state |
| STATE_VIEW | Domain event | Read model updated | Building a queryable projection |
| AUTOMATION | Internal event | Internal command emitted | Choreography within the domain |
| TRANSLATION | External event/message | Internal domain event | Bridging another system/context (ACL) |
SlicingWorkshop/
├── Common/ # Shared interfaces
│ ├── ICommand.cs
│ ├── IEvent.cs
│ ├── IQuery.cs
│ ├── IReadModel.cs
│ ├── IProcessor.cs
│ └── CommandResult.cs
├── Domain/ # Aggregates and Commands
│ ├── <Aggregate>.cs
│ └── Commands/
│ └── <CommandName>.cs
├── Events/ # All events (shared across contexts)
│ └── <EventName>.cs
├── Integrations/
│ └── <SourceSystem>/
│ └── <ExternalEventName>.cs # External message types (TRANSLATION)
└── <Context>/
└── Slices/
└── <SliceName>/
├── <SliceName>Endpoint.cs # Wolverine HTTP endpoint
├── <SliceName>ReadModel.cs # Marten document (STATE_VIEW)
└── Internal/
├── <SliceName>Projection.cs # Marten projection (STATE_VIEW)
├── <SliceName>Processor.cs # Automation processor
└── <SliceName>Translator.cs # External→internal translator (TRANSLATION)
| Type | Location |
|---|---|
| Commands | Domain/Commands/<CommandName>.cs |
| Events | Events/<EventName>.cs |
| Aggregates | Domain/<Aggregate>.cs |
| Slice artifacts | <Context>/Slices/<SliceName>/ |
| Internal (Projection, Processor) | <Context>/Slices/<SliceName>/Internal/ |
| Tests | <Context>/Slices/<SliceName>/Tests/ |
| config.json Type | C# Type |
|---|---|
| UUID | Guid |
| String | string |
| Date | DateOnly |
| Integer | int |
| Boolean | bool |
| Decimal | decimal |
| Multiple cardinality | List |
| optional: true | T? |
| Slice Title | Class Name | Folder Name |
|---|---|---|
| "Register Customer" | RegisterCustomer | RegisterCustomer |
| "Customer Registered" | CustomerRegistered | CustomerRegistered |
Rules: