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.
npx skills add j5ik2o/okite-ai --skill cqrs-aggregate-modelinggit clone --depth 1 https://github.com/j5ik2o/okite-aiWrote 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.
[](https://agentmods.dev/skills/j5ik2o/okite-ai/cqrs-aggregate-modeling)<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/cqrs-aggregate-modeling"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cqrs-aggregate-modeling/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.
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/cqrs-aggregate-modeling"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cqrs-aggregate-modeling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00263 | $0.02725 |
| Opus 5 | $0.00131 | $0.01362 |
| Sonnet 5 | $0.00053 | $0.00545 |
| Haiku 4.5 | $0.00026 | $0.00272 |
Grade A, and why
cqrs-aggregate-modeling 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.
How it starts
The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CQRSによる集約の境界再定義
CQRSを導入すると集約のモデリングが変わる。集約はコマンド実行に必要な最小限の状態のみ保持し、読み取り責務はリードモデルに委譲する。
問題: 肥大化した集約
典型例: Thread集約が1000件のメッセージを保持
// 従来型: 集約がすべてのデータを保持
case class Message(id: MessageId, text: MessageText, senderId: AccountId,
createdAt: Instant, updatedAt: Instant)
case class Messages(values: List[Message])
class Thread(id: ThreadId, members: Members, messages: Messages,
createdAt: Instant)
更新時の問題
1. threadRepository.findById(threadId)
→ 1000件のメッセージを含むスレッド全体をDBから取得
2. thread.addMessage(...)
→ メッセージを1件追加
3. threadRepository.store(newThread)
→ 1001件全体をDBに更新
→ どのフィールドが更新されたか不明なため、全情報を更新する必要がある
1件のメッセージ追加のために1001件を更新する。 これは集約が「コマンドに必要なデータ」と「クエリに必要なデータ」を区別せずに保持していることが原因。
差分更新の誘惑
差分更新を実装しようとすると、集約の内部実装が複雑化する。どのフィールドが変更されたかを追跡する仕組みが必要になり、ドメインロジックとインフラの関心が混在する。
解決: CQRSによる集約の再設計
核心原則
CQRSを導入すると、集約はコマンド実行に必要な最小限の状態だけ持てばよい。
読み取り責務(クエリ)を集約から完全に除去し、リードモデルに委譲する。その結果、集約はコマンドの検証に必要な情報のみ保持する。
問い: このコマンドの検証に何が必要か?
Thread集約の場合、「メッセージ追加」コマンドの検証に必要なのは:
- 送信者がスレッドのメンバーであること → メンバーIDのリストが必要
- メッセージIDの重複がないこと → メッセージIDのリストが必要
メッセージの本文は不要。 本文は表示(クエリ)のために必要であり、コマンドの検証には関係ない。
再設計後の集約
// CQRS/ES: 集約はコマンド検証に必要な最小限の状態のみ保持
class Thread(id: ThreadId, memberIds: MemberIds, messageIds: MessageIds,
createdAt: Instant) {
def addMessage(messageId: MessageId, messageText: MessageText,
senderId: AccountId): Either[ThreadError, Thread] =
if (memberIds.contains(senderId)) {
// イベントを追記するだけ。1001件の更新は発生しない
persistEvent(MessageAdded(id, messageId, messageText, senderId, Instant.now))
Right(copy(messageIds = messageIds.add(messageId))) // IDのみ追加
} else {
Left(new AddMessageError)
}
}
メッセージ本文を持たないため、集約は大幅に軽量化される。
イベントの設計
sealed trait ThreadEvent
case class MemberAdded(threadId: ThreadId, accountId: AccountId,
occurredAt: Instant) extends ThreadEvent
case class MessageAdded(threadId: ThreadId, messageId: MessageId,
messageText: MessageText, senderId: AccountId,
occurredAt: Instant) extends ThreadEvent
case class MessageUpdated(threadId: ThreadId, messageId: MessageId,
messageText: MessageText, senderId: AccountId,
occurredAt: Instant) extends ThreadEvent
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.
- 11d ago First seen · 232 lines · 263 tokens per session scan A 50d312738e62
cqrs-aggregate-modeling is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 263 tokens to every session and 2,725 once invoked, about $0.0013 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.
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.
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.
nw-ddd-tactical
Tactical DDD — aggregate design rules, entities, value objects, domain events, repositories, domain services, and anti-pattern detection.
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…
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.
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…