cqrs-to-event-sourcing

cqrs-to-event-sourcing is a skill for Claude Code, Codex from j5ik2o/okite-ai. It costs 246 tokens per session (2,691 once invoked), scanned A, original, MIT.

An architecture guide explaining why CQRS—separating commands that change data from queries that read it—often leads to event sourcing, where events become the main record of changes.

In plain words
What is it for?
Use it when deciding how to update read models, introduce CQRS, or reason about event sourcing and data synchronization.
Why use it?
It examines synchronization problems between command and query data, including derived values, polling, triggers, and double commits.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when deciding how to update read models, introduce CQRS, or reason about event sourcing and data synchronization.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j5ik2o/okite-ai/cqrs-to-event-sourcing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j5ik2o/okite-ai --skill cqrs-to-event-sourcing
Clone the repo
git clone --depth 1 https://github.com/j5ik2o/okite-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cqrs-to-event-sourcing

README.md
[![agentmods](https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cqrs-to-event-sourcing/github.svg)](https://agentmods.dev/skills/j5ik2o/okite-ai/cqrs-to-event-sourcing)
Your own site
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/cqrs-to-event-sourcing"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cqrs-to-event-sourcing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cqrs-to-event-sourcing

Your own site · 80×15
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/cqrs-to-event-sourcing"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cqrs-to-event-sourcing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 246 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,691 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00246 $0.02691
Opus 5 $0.00123 $0.01345
Sonnet 5 $0.00049 $0.00538
Haiku 4.5 $0.00025 $0.00269

Measured 11d ago against content hash 134412506da5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

cqrs-to-event-sourcing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/cqrs-to-event-sourcing/SKILL.md · 223 lines

How it starts

The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CQRSはなぜEvent Sourcingになるのか

CQRSを実装すると、C側からQ側への同期問題に直面し、イベントソーシングに至る。これはオプションではなく、実装上の必然である。

よくある誤解: 「CQRSはモデルを分ける必要がない」

この解釈は危険な誤読である。

正しい意味は「システムのうち、CQRS領域と非CQRS領域に分けることができ、CQRSを部分導入できる」ということ。モデルを分けなくてよいのは非CQRS領域であり、CQRS領域内ではコマンドモデルとクエリモデルの分割は必須。

システム全体
├── CQRS領域     → モデル分割は必須
└── 非CQRS領域   → 分割不要(従来のCRUDで十分)

「CQRSはモデルを分割しなくてもいい」という解釈は、もはやCQRSではない。

C側とQ側のデータの違い

CQRSにおいて、C側(コマンド)とQ側(クエリ)のデータは根本的に異なる。

具体例: カートシステム

C側テーブル(ドメインモデルの永続化に必要な最小データ):

カートテーブル カートアイテムテーブル
カートID (PK) カートアイテムID (PK)
顧客アカウントID カートID (FK)
上限予算金額 商品ID
作成日時 数量
作成日時

Q側テーブル(表示・検索に必要なデータ):

カートテーブル カートアイテムテーブル
カートID (PK) カートアイテムID (PK)
顧客アカウントID 商品ID
顧客アカウント名 ★ 商品名 ★
上限予算金額 数量
合計金額 単価
価格

★の値はC側のデータベースに存在しない。ドメインオブジェクトの振る舞いによって計算される派生値である。

case class Cart(id: CartId, items: CartItems, ...) {
  // 合計金額はドメインオブジェクトの計算結果であり、DBに保存されない
  def totalPrice(priceResolver: ItemId => Price): Price =
    items.fold(Price.zero){ (t, item) => t + item.price(priceResolver) }
}

case class CartItem(id: CartItemId, itemId: ItemId, quantity: Quantity, ...) {
  // 単価は外部から提供され、価格は計算される
  def price(priceResolver: ItemId => Price): Price =
    priceResolver(itemId) * quantity
}

同期方法の段階的検討と限界

方法1: トリガーによる同期

C側のテーブル更新時にSQLでQ側を書き込む。

限界:

  • 静的データ(顧客名等)の転送には有効
  • 計算された値(★)は同期できない - ドメインロジックの計算結果はDBに存在しない
  • 同じ計算ロジックのSQLを書くのは困難であり、ビジネスロジックの重複を生む
  • 苦肉の策として計算結果もC側に保存すると、リポジトリのインターフェースが歪む
// ❌ リポジトリに計算ロジックの責務が漏れる
trait CartRepository {
  def store(cart: Cart, priceResolver: ItemId => Price): Unit
  // priceResolverはリポジトリの責務ではない
}

方法2: ポーリングによる同期

プログラムでC側テーブルを読み込み、ドメインオブジェクトで計算後、Q側に書き込む。

限界:

  • 計算結果のQ側転送は可能
  • 「いつ変更されたか」を検知できない - 変更トリガーがない
  • 全集約をポーリングする必要があり、スケーラビリティがない
  • 大量の集約が存在する場合、実用的ではない

結論: 最新状態を手に入れるにしても、更新イベントが必要

方法3: イベント通知キューの導入

変更時にイベントをキューに発行し、Q側更新プログラムがイベントを受信して同期する。

Read the full file on GitHub · 223 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 223 lines · 246 tokens per session scan A 134412506da5

Subscribe to this mod's changes

cqrs-to-event-sourcing is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 246 tokens to every session and 2,691 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other skills, from other repositories

api-onboarding

Reduce time-to-first-API-call (TTFAC) by optimizing every step of the developer onboarding journey. This skill covers authentication simplification, sandbox environments, interactive documentation, and identifying and eliminating common failure points.

sickn33/agentic-awesome-skills · 46 tokens

nw-sd-case-studies

25 real-world system design case studies condensed from Alex Xu's System Design Interview Vol 1 and 2 - requirements, architecture, deep dive insights, key takeaways.

nWave-ai/nWave · 40 tokens

nw-ddd-tactical

Tactical DDD — aggregate design rules, entities, value objects, domain events, repositories, domain services, and anti-pattern detection.

nWave-ai/nWave · 32 tokens

frontmcp-guides

Tutorials, end-to-end walkthroughs, and complete reference projects for FrontMCP. Use when you want a getting-started guide, a full worked example, or to learn best practices by following a step-by-step build rather than a single API reference. Includes a beginner weather-API server (tool plus static resource, Zod…

agentfront/frontmcp · 157 tokens

system-design-case-catalog

Answer classic system design problems as constraint-to-solution sketches and coach interview practice: URL shortener, rate limiter, news feed, chat, notification, autocomplete, crawler, unique id. Use for interview practice or naming the closest known shape for a new problem.

HoangNguyen0403/agent-skills-standard · 58 tokens

lw-lms-backend-extend

Backend extension contract for LW LMS v1.6.0. Use when extending enrollment, access, source-scoped revocation, progress, certificates, automation, analytics, settings tabs, companion-plugin logic, lwlmsaftergrant, lwlmsafterrevoke, lwlmspregrant, lwlmshascourseaccess, AccessChecker, AccessRepository, AccessQueries…

Lonsdale201/wp-agent-skills · 134 tokens