cqrs-implementation – Writing & Content skill for AI agents
Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.
Install the cqrs-implementation skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/cqrs-implementation-93b3f.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /cqrs-implementation – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/cqrs-implementation-93b3f.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $cqrs-implementation – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/cqrs-implementation-93b3f.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /cqrs-implementation – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/cqrs-implementation-93b3f.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /cqrs-implementation – then describe the task you want done.
SKILL.md content
CQRS Implementation
Comprehensive guide to implementing CQRS (Command Query Responsibility Segregation) patterns.
When to Use This Skill
- Separating read and write concerns
- Scaling reads independently from writes
- Building event-sourced systems
- Optimizing complex query scenarios
- Different read/write data models needed
- High-performance reporting requirements
Core Concepts
1. CQRS Architecture
┌─────────────┐
│ Client │
└──────┬──────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Commands │ │ Queries │
│ API │ │ API │
└──────┬──────┘ └──────┬──────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Command │ │ Query │
│ Handlers │ │ Handlers │
└──────┬──────┘ └──────┬──────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Write │─────────►│ Read │
│ Model │ Events │ Model │
└─────────────┘ └─────────────┘2. Key Components
| Component | Responsibility |
| ------------------- | ------------------------------- |
| Command | Intent to change state |
| Command Handler | Validates and executes commands |
| Event | Record of state change |
| Query | Request for data |
| Query Handler | Retrieves data from read model |
| Projector | Updates read model from events |
Templates and detailed worked examples
Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.
Best Practices
Do's
- Separate command and query models - Different needs
- Use eventual consistency - Accept propagation delay
- Validate in command handlers - Before state change
- Denormalize read models - Optimize for queries
- Version your events - For schema evolution
Don'ts
- Don't query in commands - Use only for writes
- Don't couple read/write schemas - Independent evolution
- Don't over-engineer - Start simple
- Don't ignore consistency SLAs - Define acceptable lag
Related skills
- baoyu-post-to-x – Posts content and articles to X (Twitter). Supports regular posts with images/videos and…
- copy-editing – When the user wants to edit, review, or improve existing marketing copy, or refresh…
- boost-asio-pro – Use when writing or reviewing asynchronous C++ networking code with Boost.Asio or…
- dhdna-profiler – Applies the DHDNA framework as an exploratory rubric for reasoning and writing patterns…
- baoyu-translate – This skill should be used when the user asks to "translate", "翻译", "精翻", "translate…
- baoyu-wechat-summary – Summarizes WeChat group chat highlights into a structured digest using the local wx-cli…
- exa-search – Searches scientific and technical web content with Exa and extracts page or PDF text…
- caveman – Ultra-compressed communication mode. Cuts token usage ~75% by dropping filler, articles…