Backend Cqrs Patterns
Use when the user asks about CQRS, splitting read and write models, command and query handlers, read models, materialized views or projections for reporting. Produces a CQRS design with handlers and projection updates. Not for event stores (use backend-event-sourcing).
Install
npx skills add j4flmao/agent-skills --skill backend-cqrs-patternsgit clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/backend/universal/cqrs-patterns ~/.claude/skills/backend-cqrs-patternsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# 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?Details
- Skill name
backend-cqrs-patterns- Repository
- j4flmao/agent-skills
- Path
skills/backend/universal/cqrs-patterns/SKILL.md- License
- MIT
- Repo updated
- 17 November 2026
FAQ
What does the Backend Cqrs Patterns skill do?
Use when the user asks about CQRS, splitting read and write models, command and query handlers, read models, materialized views or projections for reporting. Produces a CQRS design with handlers and projection updates. Not for event stores (use backend-event-sourcing).
How do I install the Backend Cqrs Patterns skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill backend-cqrs-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Backend Cqrs Patterns popular?
It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.
Related skills
Agent Observability
45j4flmao/agent-skills
Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).
AI Agent Architectures
45j4flmao/agent-skills
Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).
AI Agent Core Loop
45j4flmao/agent-skills
Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).
Backend Data Masking
45j4flmao/agent-skills
Use when the user asks about PII masking, redaction, field-level encryption, tokenization, anonymization or pseudonymization, GDPR erasure or masking production data for test environments. Produces a data protection plan with code. Not for encryption at rest and key management (use security-data-security).
Backend Concurrency Mechanics
45j4flmao/agent-skills
Use when the user asks about race conditions, data races, deadlocks, mutex vs atomic, memory model, thread pool sizing, virtual threads, goroutines vs threads or blocking the event loop. Produces an explanation of runtime concurrency mechanics with fixes. Not for distributed locks (use backend-distributed-locking).
Backend Distributed Locking
45j4flmao/agent-skills
Use when the user asks about a distributed lock, two workers processing the same job, Redis lock (SET NX PX), Redlock, pg_advisory_lock, leases or fencing tokens. Produces a lock design with TTLs, fencing and failure handling. Not for job deduplication via idempotency keys (use backend-idempotency).
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.