MCPInstall
iii-hq/iii avatar

iii-event-driven-cqrs

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.

Installs
193
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/iii-hq/iii --skill iii-event-driven-cqrs
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads iii-event-driven-cqrs automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Event-Driven CQRS & Event Sourcing

Comparable to: Kafka, RabbitMQ, CQRS/Event Sourcing systems

Key Concepts

Use the concepts below when they fit the task. Not every CQRS system needs all of them.

  • Write side: Commands validate input and publish domain events via pubsub
  • Read side: Multiple projections subscribe to events independently, building query-optimized views in state
  • Event log: Events are appended to state as an ordered log (event sourcing)
  • PubSub handles fan-out — one event reaches all projections and downstream consumers
  • HTTP triggers expose both command endpoints (POST) and query endpoints (GET)

Architecture

HTTP 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

iii Primitives Used

PrimitivePurpose
registerWorkerInitialize the worker and connect to iii
registerFunctionDefine commands, projections, and queries
trigger state::set, state::get, state::listEvent log and projection state
trigger({ function_id: 'publish', payload })Publish domain events
registerTrigger({ type: 'subscribe', config: { topic } })Subscribe projections to events
registerTrigger({ type: 'http' })Command and query endpoints
trigger({ ..., action: TriggerAction.Void() })Fire-and-forget notifications

Reference Implementation

See ../references/event-driven-cqrs.js for the full working example — an inventory management system with commands that publish domain events and multiple projections building query-optimized views.

Common Patterns

Code using this pattern commonly includes, when relevant:

  • registerWorker(url, { workerName }) — worker initialization
  • trigger({ function_id: 'state::set', payload: { scope: 'events', key, value } }) — event log append
  • trigger({ function_id: 'publish', payload: { topic, data } }) — domain event publishing
  • registerTrigger({ type: 'subscribe', function_id, config: { topic } }) — projection subscriptions
  • Command functions with cmd:: prefix, projection functions with proj:: prefix, query functions with query:: prefix
  • Multiple projections subscribing to the same topic independently
  • const logger = new Logger() — structured logging per command/projection

Adapting This Pattern

Use the adaptations below when they apply to the task.

  • Add new projections by registering subscribe triggers on existing event topics
  • Use separate state scopes for each projection (e.g. inventory-list, inventory-stats)
  • Commands should validate before publishing — reject invalid commands early
  • For critical event processing, use TriggerAction.Enqueue({ queue }) instead of pubsub for guaranteed delivery
  • Event IDs should be unique and monotonic for ordering (e.g. evt-${Date.now()}-${counter})

Pattern Boundaries

  • If the task is about simple CRUD with reactive side effects, prefer iii-reactive-backend.
  • If the task needs durable multi-step pipelines with retries, prefer iii-workflow-orchestration.
  • Stay with iii-event-driven-cqrs when command/query separation, event sourcing, and independent projections are the primary concerns.

When to Use

  • Use this skill when the task is primarily about iii-event-driven-cqrs in the iii engine.
  • Triggers when the request directly asks for this pattern or an equivalent implementation.

Boundaries

  • Never use this skill as a generic fallback for unrelated tasks.
  • You must not apply this skill when a more specific iii skill is a better fit.
  • Always verify environment and safety constraints before applying examples from this skill.

FAQ

What does the iii-event-driven-cqrs skill do?

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.

How do I install iii-event-driven-cqrs?

Run npx skills add https://github.com/iii-hq/iii --skill iii-event-driven-cqrs in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/iii-event-driven-cqrs/ (personal) or .claude/skills/iii-event-driven-cqrs/ (project).

Which AI agents can use iii-event-driven-cqrs?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is iii-event-driven-cqrs safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains iii-event-driven-cqrs?

It is published by iii-hq/iii in iii-hq/iii. It has 193 recorded installs.

More from iii-hq/iii

View all →

Configure a managed iii engine through worker-compose.yaml or a directly supervised engine through config.yaml. Use for engine ports, RBAC via the rbac-proxy worker, observer limits, streams, sandboxes, and configuration storage.

5.5K installs

Install the iii engine, set up your first worker, and get a working backend running. Use when a user wants to start a new iii project, install the SDK, or needs help with initial setup and configuration.

Backend & APIs5.5K installs

Handle iii engine and SDK errors across Node, Python, Rust, and browser workers. Use when interpreting error codes, retryability, RBAC denial, timeouts, handler failures, or SDK-specific exception surfaces.

Backend & APIs5.3K installs

Use when composing iii primitives into backend architectures: durable workflows, reactive backends, observer side effects, agentic pipelines, event-driven CQRS, effect pipelines, and trigger-transform-action automation.

Use when working with iii SDK APIs across Node.js, browser, Python, Rust, or Go: package installation, worker initialization, function/trigger registration, observers, invocation, local dispatch, channels, logging, OpenTelemetry, and language-specific caveats.

Backend & APIs5.2K installs

Use when registering iii functions, binding triggers, observing functions, selecting sync/void/enqueue invocation, creating workers, inspecting the live worker registry, installing registry workers, authoring event sources, moving channel data, or adapting external HTTP functions across TypeScript, Python, and Rust.

Backend & APIs5.2K installs

Popular other skills

View category →
heygen-com avatar

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.7M installs
mattpocock avatar

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1.1M installs
mattpocock avatar

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

881.5K installs
mattpocock avatar

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

609.4K installs
mattpocock avatar

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

560.9K installs
mattpocock avatar

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

521.7K installs