with one click
with one click
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | game-system |
| description | Workflow and checks for adding a new game system |
| user-invocable | true |
Use docs/architecture/game-systems.md for the comprehensive guide, checklist, and
Daggerheart reference implementation.
Start at manifest.go โ open
internal/services/game/domain/systems/manifest/manifest.go first. It shows
all three registry surfaces (BuildModule, BuildMetadataSystem,
BuildAdapter) wired from one SystemDescriptor. Read an existing entry
(Daggerheart) to understand the shape, then add yours.
Pick the right DecideFunc helper โ see the decision tree in
docs/architecture/game-systems.md under "DecideFunc decision tree":
DecideFunc[P] โ no state needed, same payload for command/eventDecideFuncWithState[S, P] โ needs state for validationDecideFuncTransform[S, PIn, POut] โ event payload differs from commandDecide switch โ multi-event or custom routingFollow the numbered steps in docs/architecture/game-systems.md ยง "Adding a
new system (current flow)" (steps 1โ10).
Run conformance tests after wiring:
go test ./internal/services/game/domain/module/testkit/...
testkit.ValidateSystemConformance composes all startup validators for
module + adapter pairs and fails loudly on missing registrations.
Run full verification:
make test # unit tests
make smoke # quick gRPC + scenario confidence
make check # required before opening or updating a PR
Invariant: rationale.| Validator | What it checks | Fix |
|---|---|---|
ValidateDeciderCommandCoverage | Every registered system command has a decider case | Add missing command type to decider's DeciderHandledCommands() and Decide() |
ValidateSystemFoldCoverage | Every emittable event with replay intent has a fold handler | Register a HandleFold for the missing event type |
ValidateAdapterEventCoverage | Every emittable event with projection intent has an adapter handler | Register a HandleAdapter for the missing event type |
ValidateCommandTypeNamespace | System command types match sys.<system_id>.* | Fix the command type constant string |
ValidateEventTypeNamespace | System event types match sys.<system_id>.* | Fix the event type constant string |
| Concern | Location |
|---|---|
| Manifest registry | domain/systems/manifest/manifest.go |
| Module interface | domain/module/registry.go |
| Adapter interface | domain/systems/adapter_registry.go |
| ProfileAdapter | domain/systems/adapter_registry.go |
| DecideFunc helpers | domain/module/decide_func.go |
| FoldRouter | domain/module/fold_router.go |
| Conformance tests | domain/module/testkit/ |
| Daggerheart example | domain/systems/daggerheart/ |