scaffold-event-projection

Scaffold a Marten EventProjection class to transform each event into a queryable document.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers to scaffold a Marten Event Projection that transforms each event into a dedicated queryable document. It is ideal for building transparent, per-event read models.

Core Features & Use Cases

  • Projection scaffolding: Create a Projection class in src/BookStore.ApiService/Projections/ that inherits EventProjection and uses the templates/Projection.cs as a starting point.
  • Marten integration: Configure Marten projections in src/BookStore.ApiService/Infrastructure/Extensions/MartenConfigurationExtensions.cs with a line like options.Projections.Add<YourProjection>(ProjectionLifecycle.Async).
  • Use cases: History tables, audit logs, and flattened stream data for reporting or analytics without aggregation.

Quick Start

Create the Projection class file at src/BookStore.ApiService/Projections/AuditLogProjection.cs, implement the projection logic by extending EventProjection, and reference templates/Projection.cs as the base.

Frequently Asked Questions about scaffold-event-projection

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

FAQPage Schema
How do I create a Marten event projection for an audit log in ASP.NET?▼

To create a Marten event projection for an audit log, you scaffold a Projection class inheriting from EventProjection in your project's Projections directory. This transforms each event into a 1:1 queryable document, providing a transparent read model for tracking history without data aggregation.

What is a 1:1 event projection used for in event sourcing?▼

A 1:1 event projection in event sourcing transforms each event into a dedicated queryable document. It is specifically used for building history tables, audit logs, and flattened stream data for reporting or analytics without requiring complex aggregation logic.

How do I configure Marten projections in an ASP.NET C# application?▼

You configure Marten projections in an ASP.NET C# application by adding a line like options.Projections.Add<YourProjection>(ProjectionLifecycle.Async) within your Marten configuration extensions file, registering the projection class to run asynchronously.

Does this Marten event projection approach support aggregated read models?▼

No, this Marten event projection approach does not support aggregated read models. It specifically targets use cases like history tables, audit logs, and flattened streaming data by transforming each event into a 1:1 document per event without aggregation.

Can I use this event projection scaffolding for flattened streaming data?▼

Yes, you can use this event projection scaffolding for flattened streaming data. It transforms each event into a dedicated queryable document, which is ideal for flattening stream data for reporting or analytics purposes without performing aggregations.