view-to-query-model

Community

Derive read models from view specs for CQRS.

Authorbflandev
Version1.0.0
Installs0

System Documentation

What problem does it solve?

In CQRS, aggregates are optimised for enforcing invariants, not serving screens. Querying them directly couples read performance to write-side structure and blocks UI evolution on domain model changes.

A read model is a projection — it consumes domain events and maintains a denormalised, query-optimised representation shaped for one view. Each read model serves a specific view spec, updated asynchronously as events occur.

Core Features & Use Cases

  • Start from the view spec (V-XX) and map fields, filters, and sorts to read model fields.
  • Trace back to source events that create or modify data. A single read model typically consumes events from multiple aggregates.
  • Define the schema, indexes, and staleness tolerance to match UX requirements.
  • Integration test pattern to verify that consuming domain events produces the expected projection state.

Quick Start

Generate the read-model specification RM-XX from the view spec V-XX and related domain events, then create the initial projection tests.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: view-to-query-model
Download link: https://github.com/bflandev/threadline-ai/archive/main.zip#view-to-query-model

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.