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 j4flmao/agent-skills --skill cqrs-patternsgit clone --depth 1 https://github.com/j4flmao/agent-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/j4flmao/agent-skills/cqrs-patterns)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/cqrs-patterns"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/cqrs-patterns/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/j4flmao/agent-skills/cqrs-patterns"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/cqrs-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00125 | $0.04063 |
| Opus 5 | $0.00063 | $0.02031 |
| Sonnet 5 | $0.00025 | $0.00813 |
| Haiku 4.5 | $0.00013 | $0.00406 |
Grade A, and why
backend-cqrs-patterns 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 5d 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 — 521 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Backend CQRS Patterns
Purpose
Separate read and write models so each can be optimized independently — write side for consistency and validation, read side for query performance and projection flexibility.
Agent Protocol
Trigger
Exact user phrases: "CQRS", "command query segregation", "separate read write", "command model", "query model", "read model", "write model", "materialized view", "command handler", "query handler", "command bus", "query bus".
Input Context
- Whether the system is greenfield or existing.
- Current data access pattern (CRUD, repository, ORM).
- Read-to-write ratio and query complexity.
- Consistency requirements (strong vs eventual).
Output Artifact
CQRS design as text. No file unless requested.
Response Format
Command: {name}
Handler: {class/module}
Validation: {rules}
Write model: {storage}
Query: {name}
Handler: {class/module}
Read model: {storage/projection}
Completion Criteria
- Commands and queries are in separate model classes.
- Commands return success/failure, never data.
- Queries return data, never cause side effects.
- Write model uses transactional consistency.
- Read model tolerates eventual consistency.
- Command validation is separate from command execution.
- Synchronization mechanism defined (if separate stores).
Max Response Length
Per command/query: 6 lines. Full design: 30 lines.
Architecture Decision Tree
Should I Use CQRS?
Are read and write data shapes significantly different?
├── Yes → CQRS candidate
└── No → Is the read-to-write ratio > 10:1?
├── Yes → Consider CQRS for read optimization
└── No → Is query complexity causing write model compromises?
├── Yes → CQRS may help separate concerns
└── No → Simple CRUD is sufficient — skip CQRS
Same Database vs Separate Databases?
Do queries require different storage technology than writes?
├── Yes → Separate databases (e.g., PG for writes, Elasticsearch for reads)
└── No → Can you use materialized views or same-DB projections?
├── Yes → Same database, different models (simpler)
└── No → Separate databases
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.
- 5d ago First seen · 521 lines · 125 tokens per session scan A b9d4dccbc739
backend-cqrs-patterns is a skill published in the GitHub repository j4flmao/agent-skills (22 stars, last pushed 2d ago), licensed MIT. It adds 125 tokens to every session and 4,063 once invoked, about $0.0006 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-03.
Other skills, from other repositories
architecture-paradigm-cqrs-es
Applies CQRS and Event Sourcing for read/write separation and audit trails. Use when designing systems with complex domain logic or full state-change history.
event-driven
Event-driven architecture authority — Redis pub/sub, event bus patterns, async event pipelines, channel management, startup recovery, dead-letter handling, and reactive system design.
clean-architecture
Implement Clean Architecture combined with CQRS for scalable NestJS applications.
database-performance
Database access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins. Works with EF Core and Dapper.
symfony:doctrine-events
React to Doctrine entity lifecycle in Symfony with attribute listeners (#[AsDoctrineListener]/#[AsEntityListener], ORM 3) and lifecycle callbacks.
symfony:doctrine-batch-processing
Process large datasets with Doctrine (ORM 3 toIterable, flush+clear, bulk DQL) and memory management.