# Implement Reliable CQRS Architectures

Complex systems often mix writes and reads, limiting scalability and clarity. This skill guides separate models, projections, synchronization, and consistency decisions.

## Install

```bash
npx skillstore add sickn33/cqrs-implementation
```

## Metadata

- Status: approved
- Slug: sickn33-cqrs-implementation
- Skillstore revision: r2
- Version status: missing
- Tree hash: 7e72384c3db53d44bf577632952836de97b838f09693788e59c7aae7e3a62569
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/cqrs-implementation
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: network, external\_commands
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-cqrs-implementation
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-cqrs-implementation/manifest

## Capabilities

- Identifies command, query, handler, event, and projection boundaries.
- Provides Python templates for command buses and query buses.
- Demonstrates parameterized read model queries and pagination.
- Shows FastAPI endpoints separated by command and query responsibilities.
- Explains projection rebuilding, checkpoints, and read-your-writes handling.

## Use Cases

- Separate a Growing Service: Map an existing service into commands, queries, handlers, and independently optimized data models.
- Plan Scalable Read Models: Design projections, checkpoints, pagination, and synchronization for workloads with heavy reporting demand.
- Review Consistency Tradeoffs: Define acceptable projection lag, read-your-writes behavior, rebuild procedures, and failure handling.

## Prompt Templates

### Identify CQRS Boundaries

```
Review this application description: [description]. Identify commands, queries, handlers, and read models. Explain whether CQRS is justified.
```

### Design a CQRS Feature

```
Design a CQRS flow for [feature]. Include command validation, emitted events, query models, projection updates, and consistency expectations.
```

### Adapt the Implementation Templates

```
Adapt the CQRS patterns to [language and framework]. Preserve parameterized queries, handler boundaries, projection checkpoints, and explicit failure behavior.
```

### Audit a Production CQRS Design

```
Review this CQRS design: [design]. Assess idempotency, ordering, retries, projection rebuilds, schema evolution, observability, consistency targets, and recovery risks.
```

## Limitations

- Does not provide a complete deployable application or infrastructure configuration.
- Uses Python and FastAPI examples that require adaptation for other stacks.
- Does not select databases, brokers, or event stores for a specific environment.
- Cannot replace load testing, recovery testing, or domain expert review.

## Best Practices

- Define consistency targets and acceptable projection lag before implementation.
- Keep command validation, event persistence, and query retrieval responsibilities explicit.
- Test projection idempotency, checkpoint recovery, and complete rebuild procedures.

## Anti Patterns

- Do not introduce separate models when simple CRUD meets the requirements.
- Do not share persistence schemas tightly between command and query paths.
- Do not ignore ordering, retries, duplicate events, or stale read behavior.

## Security Audit

- Audited at: 2026-07-23T21:54:17.36\+00:00
- Summary: All 12 static findings are false positives caused by database client methods, ordinary identifiers, UUID generation, and Markdown code formatting. No malicious intent, prompt injection, external command execution, or network request was found.

## Stats

- Views: 127
- Downloads: 9
- Favorites: 0
- Popularity score: 0
