cqrs-implementation

cqrs-implementation is a skill for Claude Code, Codex from HK-hub/AgentSkills. It costs 35 tokens per session (3,418 once invoked), scanned A, a copy of cqrs-implementation, MIT.

A guide to CQRS, an architecture that separates operations that change data from operations that read data.

In plain words
What is it for?
Use it to design separate command and query handlers, independent read models, event-sourced systems, or complex reporting paths.
Why use it?
It helps when reading and writing have different scaling, performance, or data-model needs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to design separate command and query handlers, independent read models…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hk-hub/agentskills/cqrs-implementation
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 HK-hub/AgentSkills --skill cqrs-implementation
Clone the repo
git clone --depth 1 https://github.com/HK-hub/AgentSkills

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-implementation

README.md
[![agentmods](https://agentmods.dev/badge/skills/hk-hub/agentskills/cqrs-implementation.svg)](https://agentmods.dev/skills/hk-hub/agentskills/cqrs-implementation)
Your own site
<a href="https://agentmods.dev/skills/hk-hub/agentskills/cqrs-implementation"><img src="https://agentmods.dev/badge/skills/hk-hub/agentskills/cqrs-implementation.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,418 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 100% copy Near-identical to another mod 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.00035 $0.03418
Opus 5 $0.00017 $0.01709
Sonnet 5 $0.00007 $0.00684
Haiku 4.5 $0.00003 $0.00342

Measured 6d ago against content hash af5727c576fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

cqrs-implementation 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 6d 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

This is a copy

100% identical to cqrs-implementation — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

cqrs-implementation/SKILL.md · 555 lines

How it starts

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

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

Template 1: Command Infrastructure

from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import TypeVar, Generic, Dict, Any, Type
from datetime import datetime
import uuid

# Command base
@dataclass
class Command:
    command_id: str = None
    timestamp: datetime = None

    def __post_init__(self):
        self.command_id = self.command_id or str(uuid.uuid4())
        self.timestamp = self.timestamp or datetime.utcnow()


# Concrete commands
@dataclass
class CreateOrder(Command):
    customer_id: str
    items: list
    shipping_address: dict


@dataclass
class AddOrderItem(Command):
    order_id: str
    product_id: str
    quantity: int
    price: float


@dataclass
class CancelOrder(Command):
    order_id: str
    reason: str


# Command handler base
T = TypeVar('T', bound=Command)

class CommandHandler(ABC, Generic[T]):
    @abstractmethod
    async def handle(self, command: T) -> Any:
        pass


# Command bus
class CommandBus:
    def __init__(self):
        self._handlers: Dict[Type[Command], CommandHandler] = {}

    def register(self, command_type: Type[Command], handler: CommandHandler):
        self._handlers[command_type] = handler

    async def dispatch(self, command: Command) -> Any:
        handler = self._handlers.get(type(command))
        if not handler:
            raise ValueError(f"No handler for {type(command).__name__}")
        return await handler.handle(command)


# Command handler implementation
class CreateOrderHandler(CommandHandler[CreateOrder]):
    def __init__(self, order_repository, event_store):
        self.order_repository = order_repository
        self.event_store = event_store

    async def handle(self, command: CreateOrder) -> str:
        # Validate
        if not command.items:
            raise ValueError("Order must have at least one item")

        # Create aggregate
        order = Order.create(
            customer_id=command.customer_id,
            items=command.items,
            shipping_address=command.shipping_address
        )

        # Persist events
        await self.event_store.append_events(
            stream_id=f"Order-{order.id}",
            stream_type="Order",
            events=order.uncommitted_events
        )

        return order.id

Read the full file on GitHub · 555 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. 6d ago First seen · 555 lines · 35 tokens per session scan A af5727c576fa

Subscribe to this mod's changes

cqrs-implementation is a skill published in the GitHub repository HK-hub/AgentSkills (6 stars, last pushed 19d ago), licensed MIT. It adds 35 tokens to every session and 3,418 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to cqrs-implementation, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

api-tester

A tool for creating and checking API tests from the real API contract and implementation. An API is the agreed way that software sends requests and receives responses.

laolaoshiren/claude-code-skills-zh · 86 tokens

cmux-socket-policy

Socket command threading and focus policy for cmux CLI/socket work. Use when adding or changing socket commands, CLI commands, telemetry commands, focus/select/open/close/send-key behavior, or automation that could steal app focus.

manaflow-ai/cmux · 50 tokens

laravel-expert

Laravel & PHP Development Instructions for GitHub Copilot.

GulajavaMinistudio/awesome-copilot-id · 15 tokens

system-and-data-design

Decide whether the system will hold, and where the data lives: requirements and load first, then back-of-the-envelope numbers, building blocks (cache, queue, load balancer, CDN), and the data layer in depth — storage engines, indexes, replication, partitioning, transactions and consistency, batch vs stream. Use when…

AnastasiyaW/codex-claude-code-config · 217 tokens

minimax-h3-reference-video-prompt

Default downstream MiniMax H3 specialist for every image-based request unless the user explicitly declares boundary-only first/last frames with no reusable reference role. Use the official six-section full-reference format for character/person/object consistency, scene/style/action/camera/storyboard/voice/audio…

unknowlei/minimax-h3-opencode-skills · 89 tokens

minimax-h3-keyframe-video-prompt

Narrow downstream MiniMax H3 specialist for pure I2VA, FL2VA, and L2VA boundary-frame prompts. Use only after minimax-h3-creative-director verifies that the user explicitly declared the images as literal first/last frames and that they have no character, identity, person, object, costume, scene, style, voice, action…

unknowlei/minimax-h3-opencode-skills · 108 tokens