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 full-stack-skills/ddd-skills --skill ddd-cqrs-architecturegit clone --depth 1 https://github.com/full-stack-skills/ddd-skillsWrote 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/full-stack-skills/ddd-skills/ddd-cqrs-architecture)<a href="https://agentmods.dev/skills/full-stack-skills/ddd-skills/ddd-cqrs-architecture"><img src="https://agentmods.dev/badge/skills/full-stack-skills/ddd-skills/ddd-cqrs-architecture/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/full-stack-skills/ddd-skills/ddd-cqrs-architecture"><img src="https://agentmods.dev/badge/skills/full-stack-skills/ddd-skills/ddd-cqrs-architecture.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.00097 | $0.02705 |
| Opus 5 | $0.00048 | $0.01352 |
| Sonnet 5 | $0.00019 | $0.00541 |
| Haiku 4.5 | $0.00010 | $0.00270 |
Grade A, and why
ddd-cqrs-architecture 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 today.
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 — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DDD CQRS Architecture
CQRS (Command Query Responsibility Segregation) — L1/L2/L3 adoption, Event Sourcing, idempotency, integration with 5 DDD architectures.
When to Use This Skill
Trigger keywords: CQRS, 读写分离, Event Sourcing, 事件溯源, Command Bus, Query Model, 领域事件, domain event, 幂等, idempotency, eventual consistency, projection, materialized view
Workflow
Step 1: 判断是否需要 CQRS → 确认读写模式是否显著分化
Step 2: 选择 CQRS 级别 → L1/L2/L3
Step 3: 设计命令模型 → Command → Handler → 领域事件
Step 4: 设计查询模型 → Query → Handler → DTO
Step 5: 实现事件同步(L2/L3)→ Outbox → 发布器 → 投影
Step 6: 按架构集成 → 根据 Layered/Onion/Hexagonal/Clean/COLA
When to Use CQRS
适用场景
- 读写模式显著分化: 写操作与读操作用不同数据结构和优化策略
- 高并发写入: 写需 ACID 保证,读可接受最终一致性
- 多视图需求: 同一数据多种展示形式(列表/详情/统计/搜索)
- 审计追踪要求: 完整记录所有状态变更历史
- 团队具备事件驱动能力: 理解最终一致性和事件溯源概念
升级路径
CRUD 够用(读=写) → 单模型,无需 CQRS
↓
L1 模型分离 → CommandService / QueryService 分离,共享 DB
↓
L2 数据库分离 → Command DB + Query DB,事件同步
↓
L3 Event Sourcing → EventStore + Projection
不适用场景
| 场景 | 替代方案 |
|---|---|
| 简单 CRUD,读=写 | 单模型,不引入 CQRS |
| 原型/一次性项目 | 跳过 CQRS |
| 团队不熟悉事件驱动 | 先用 ddd-event-storming 建立事件思维 |
| 强一致性要求极高 | 评估分布式事务成本 |
CQRS Core Principles
| 维度 | 命令侧(Write) | 查询侧(Read) |
|---|---|---|
| 职责 | 处理状态变更,执行业务规则 | 返回数据视图,无业务逻辑 |
| 模型 | Command Model(命令对象+聚合根) | Query Model(DTO+物化视图) |
| 存储 | Write DB (3NF, ACID) | Read DB (反范式, 查询优化) |
| 一致性 | 强一致性(聚合内) | 最终一致性(跨聚合/服务) |
| 输出 | 领域事件 | DTO / View Model |
L1/L2/L3 Adoption Strategy
L1 — Model Separation
成本最低:仅代码层分离 Command/Query Service,共享数据库。适用于读写数据结构相同但逻辑分离的场景。
参考示例: examples/06-order-l1-model-separation.md
L2 — Database Separation
中等成本:分离 Command DB 和 Query DB,通过领域事件同步。适用于读负载高、独立优化策略需求的场景。
参考示例: examples/07-order-l2-db-separation.md
L3 — Event Sourcing
最高成本:以事件流作为唯一真相源,通过投影重建读模型。适用于审计追踪、时间旅行查询、事件重放的场景。
参考示例: examples/08-order-l3-event-sourcing.md
Event Lifecycle
领域行为 → 构建 DomainEvent → 持久化 → EventBus 发布
→ 本地处理器 (同步)
→ MQ 外发 (异步, 跨服务)
What ships with it
20 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/01-cqrs-testing.md 987 B
- examples/02-event-sourcing-bank.md 1.3 KB
- examples/03-inventory-cqrs.md 7.2 KB
- examples/04-multi-architecture-integration.md 5.9 KB
- examples/05-notification-cqrs.md 683 B
- examples/06-order-l1-model-separation.md 4.8 KB
- examples/07-order-l2-db-separation.md 4.4 KB
- examples/08-order-l3-event-sourcing.md 7.8 KB
- examples/09-payment-cqrs.md 732 B
- examples/10-user-command-query.md 679 B
- references/01-clean-ddd-hexagonal-cqrs.md 13 KB
- references/02-cqrs-events.md 8.6 KB
- references/03-cqrs-mindmap.md 2.3 KB
- references/04-ddd4j-cqrs-mindmap.md 7.0 KB
- references/05-domain-events-deep.md 4.4 KB
- references/06-domain-vs-integration-events.md 3.7 KB
- references/07-event-governance.md 12 KB
- references/08-partme-06-domain-events.md 12 KB
- references/architecture/01-clean-ddd-hexagonal-cqrs.md 3.7 KB
- references/domain-events/01-domain-events-deep.md 1.7 KB
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.
- today Changed e3d58e29c1ae
- 12d ago First seen · 196 lines · 97 tokens per session scan A 1f75a3db3b54
ddd-cqrs-architecture is a skill published in the GitHub repository full-stack-skills/ddd-skills (5 stars, last pushed yesterday), licensed Apache-2.0. It adds 97 tokens to every session and 2,705 once invoked, about $0.0005 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-08-31.
Other skills, from other repositories
mem0-oss-to-platform
Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…
agui-dotnet-protobuf
Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…
azure-mgmt-botservice-dotnet
Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".
fastapi-router-py
Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.
aws-sdk-java-v2-core
Provides AWS SDK for Java 2.x client configuration, credential resolution, HTTP client tuning, timeout, retry, and testing patterns. Use when creating or hardening AWS service clients, wiring Spring Boot beans, debugging auth or region issues, or choosing sync vs async SDK usage.
migrate-segw-to-rap
Reverse-engineer a SEGW-built OData V2 service (MPC/DPC/MPCEXT/DPCEXT) into a modern RAP V4 service — tables, CDS views (interface + projection), behavior definitions, draft entities, service definition + binding. Use when asked to "migrate this SEGW service to RAP", "convert OData V2 to V4 RAP", "modernize this…