scaffold-single-stream-projection

Community

Create Marten single-stream projections.

Authoraalmada
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps build a Marten Single Stream Projection that materializes a single read model from one aggregate's event stream, enabling fast reads and simplified queries for a given aggregate.

Core Features & Use Cases

  • Define the Projection Class: Create a {Resource}Projection class in src/BookStore.ApiService/Projections/ that inherits from SingleStreamProjection<T>, using the provided template at templates/Projection.cs.
  • Register & Configure in Marten: Wire up the projection in Marten via the infrastructure configuration (e.g., options.Projections.Add<YourProjection>(ProjectionLifecycle.Async)) to optimize for performance.
  • Indexing (Optional): Add a schema index for common query fields to improve read performance.
  • Querying: Load the projection by stream ID or query on relevant fields to serve read-model data.
  • Use Case: Build per-aggregate read models (e.g., AuthorDetails) from a single event stream to power fast UI reads or API endpoints.

Quick Start

Use the scaffold-single-stream-projection to generate an AuthorDetailsProjection, register it in Marten, and then query by the streamId to load the projection.

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: scaffold-single-stream-projection
Download link: https://github.com/aalmada/BookStore/archive/main.zip#scaffold-single-stream-projection

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 223,000+ vetted skills library on demand.