Loading...
Loading...
Implements CQRS with event sourcing on the iii engine. Use when building command/query separation, event-sourced systems, or fan-out architectures where commands publish domain events and multiple read model projections subscribe independently.
npx skill4agent add iii-hq/skills iii-event-driven-cqrsHTTP POST /inventory (command)
→ cmd::add-inventory-item → validate → append event to state
→ publish('inventory.item-added')
↓ (fan-out via subscribe triggers)
→ proj::inventory-list (updates queryable list view)
→ proj::inventory-stats (updates aggregate counters)
→ notify::inventory-alert (sends low-stock alerts)
HTTP GET /inventory (query)
→ query::list-inventory → reads from projection state| Primitive | Purpose |
|---|---|
| Initialize the worker and connect to iii |
| Define commands, projections, and queries |
| Event log and projection state |
| Publish domain events |
| Subscribe projections to events |
| Command and query endpoints |
| Fire-and-forget notifications |
registerWorker(url, { workerName })trigger({ function_id: 'state::set', payload: { scope: 'events', key, value } })trigger({ function_id: 'publish', payload: { topic, data } })registerTrigger({ type: 'subscribe', function_id, config: { topic } })cmd::proj::query::const logger = new Logger()inventory-listinventory-statsTriggerAction.Enqueue({ queue })evt-${Date.now()}-${counter}iii-reactive-backendiii-workflow-orchestrationiii-event-driven-cqrsiii-event-driven-cqrs