mismagent-realize-read-model

Implements CQRS read-model projections with consumer-driven view contract tests.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/lucolucus/mismagent --skill mismagent-realize-read-model-lucolucus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mismagent-realize-read-model
Source: https://github.com/lucolucus/mismagent/tree/main/codex/skills/mismagent-realize-read-model
Command: npx skills add https://github.com/lucolucus/mismagent --skill mismagent-realize-read-model-lucolucus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building the read side of a CQRS architecture often goes wrong: projections silently re-implement domain rules, views drift from the shape the UI expects, and event folds break when delivery order is not guaranteed. This Skill guides an agent to realize a read-model block that stays read-only, respects the pinned view_shape, and carries its own consumer-driven contract test. ## Core Features & Use Cases - Read-only projection enforcement: Ensures the read-model decides nothing and takes predicates already computed by the Aggregate, keeping domain rules on the write side. - Pinned view_shape compliance: Verifies the output fields, types, and names match the manifest's Published Language toward the UI consumer. - Event-fold correctness: Designs folds against the boundary's pinned delivery guarantees, handling single-writer streams, commutative folds, tombstones, and orphan buffers. - Ordering discipline: Rejects sorting on fields not pinned ORDERABLE, bouncing the block instead of sorting on unpinned formats. - Use Case: When the mismAgent worker decomposes a feature into building blocks and encounters a block with type read-model, it loads this Skill to implement the projection, translate the user's tests_nl into view test cases, and return the realized PUBLIC_API. ## Quick Start Ask the agent to realize the read-model block defined in the building-block manifest, respecting its pinned view_shape and writing the consumer-driven view test.

Frequently Asked Questions about mismagent-realize-read-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a CQRS read-model projection?

Implement the read-model as a read-only query or projection whose output matches the view_shape pinned in the manifest. Keep all domain rules on the Aggregate, take predicates already computed, and write a consumer-driven contract test where the consumer is the UI.

How to handle out-of-order events in an event-sourced projection?

Design the fold against the boundary's pinned delivery guarantees, since cross-stream order does not exist unless pinned. Use single-writer streams, commutative folds, tombstones for late events, or orphan buffers for effects preceding their cause, as pinned in the manifest.

Can a read-model contain business logic or domain rules?

No, a read-model decides nothing and contains zero domain rules; those live on the Aggregate. If a predicate is needed, it is taken already computed from the root or port rather than recomputed in the projection.

Why does sorting fail on some read-model fields?

Sorting is only valid on fields pinned ORDERABLE, because lexicographic ordering over unpinned strings breaks at digit boundaries. If the field's format is not pinned upstream, the block is bounced rather than sorted on an assumption.

When should I use a read-model block instead of querying the aggregate directly?

Use a read-model when a view needs projected or aggregated data from multiple aggregates or tables served to a consumer like the UI. It separates the read side from the write side in CQRS, with the view_shape acting as Published Language toward the consumer.