scaffold-composite-projection

Build a Composite Projection in Marten to chain multiple projections.

15|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/aalmada/BookStore --skill scaffold-composite-projection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-composite-projection
Source: https://github.com/aalmada/BookStore/tree/main/.claude/skills/scaffold-composite-projection
Command: npx skills add https://github.com/aalmada/BookStore --skill scaffold-composite-projection

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables teams to efficiently compose multiple Marten projections by constructing a Composite Projection, reducing data processing time and simplifying projection pipelines.

Core Features & Use Cases

  • Composite Projection: Chains multiple projections into a single, efficient read path.
  • Staged Projections: Supports Stage 1 basic projections and Stage 2 dependent projections that consume outputs from Stage 1.
  • Indexing Best Practices: Aligns with Marten's indexing to optimize throughput and query performance.

Quick Start

Follow these steps to implement a composite projection in Marten (v8.18+): define the Projection class in src/BookStore.ApiService/Projections/, configure MartenConfigurationExtensions.cs with options.Projections.CompositeProjectionFor(...) to add Stage 1 and Stage 2 projections, and verify indexing in ConfigureIndexes.

Frequently Asked Questions about scaffold-composite-projection

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

FAQPage Schema
How do I chain multiple Marten projections together in a .NET application?

You can chain Marten projections by defining a Projection class and configuring options.Projections.CompositeProjectionFor(...) in your Marten setup. This adds Stage 1 and Stage 2 projections to establish a single, efficient read path for faster queries.

What is a composite projection in Marten and when do I need it?

A composite projection in Marten is a pattern that chains multiple projections into a single read path. You need it when basic projections must feed outputs into dependent projections, reducing data processing time and simplifying complex projection pipelines in .NET.

How do I configure CompositeProjectionFor in Marten to improve query throughput?

To configure CompositeProjectionFor, define your Projection class and use MartenConfigurationExtensions.cs to add options.Projections.CompositeProjectionFor(...) with your Stage 1 and Stage 2 projections. Verify indexing in ConfigureIndexes to optimize throughput and query performance.

Does the Marten composite projection pattern require a specific version?

Implementing the Marten composite projection pattern requires Marten v8.18 or higher. You need a .NET application using Marten where you can define projection classes and configure the CompositeProjectionFor extension to manage staged projections and indexing.

What is the best way to manage indexing for staged Marten projections?

The best way to manage indexing for staged Marten projections is to align with Marten's indexing best practices by verifying configurations in ConfigureIndexes. This optimizes throughput and query performance when Stage 1 basic projections feed into Stage 2 dependent projections.