add-projection

Creates Chronicle projections that populate read models from events in Cratis applications.

Updated Jul 15, 2026
One-click install
npx skills add https://github.com/Cratis/Screenplay --skill add-projection-cratis
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: add-projection
Source: https://github.com/Cratis/Screenplay/tree/main/.github
Command: npx skills add https://github.com/Cratis/Screenplay --skill add-projection-cratis

SYSTEM DOCUMENTATION & REQUIREMENTS

πŸ’‘ This Skill includes references (resource) components.

What problem does it solve? Adding a Chronicle projection to a Cratis-based .NET project requires choosing between model-bound attributes and fluent IProjectionFor<T> builders, applying correct AutoMap behavior, and respecting Chronicle-specific join semantics β€” mistakes like joining on read models or adding nonexistent Identifier properties cause build or runtime failures. ## Core Features & Use Cases - Model-Bound Projections (preferred): Generates read models annotated with [FromEvent<T>], [Key], [SetFrom<T>], [AddFrom<T>], [ChildrenFrom<T>], [Join<T>], and [RemovedWith<T>] attributes, with no separate projection class needed. - Fluent Projection Fallback: Produces IProjectionFor<T> builder-based projections only when attribute-based mapping cannot express the logic cleanly. - Rule Enforcement: Enforces AutoMap-first defaults, event-only joins (never on read models), and correct handling of appended event metadata such as tags, event stream types, and event source types. - Use Case: When asked to add a projection that keeps an Order read model up to date from OrderPlaced and OrderCancelled events, the Skill emits the correctly attributed record and verifies it with dotnet build. ## Quick Start Ask the AI to add a Chronicle projection for a specific read model from your domain events in the current Cratis project.

Frequently Asked Questions about add-projection

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

FAQPage Schema
How do I add a Chronicle projection to a Cratis project?β–Ό

Prefer a model-bound projection: put [ReadModel] and [FromEvent<T>] attributes directly on the read model record, marking the primary key with [Key]. Matching property names auto-map from the event, so no separate projection class is needed.

When should I use IProjectionFor<T> instead of model-bound attributes?β–Ό

Use the fluent IProjectionFor<T> builder only when the projection logic is too complex for attributes or would become less clear if forced into attributes. AutoMap is on by default, so call .From<T>() directly without .AutoMap().

Can Chronicle projections join on read models?β–Ό

No. Joins in Chronicle projections must be on Chronicle events only, never on a read model type. Use [Join<T>(on: ..., eventPropertyName: ...)] with an event type, or the fluent builder equivalent.

Why does my projection fail with an Identifier or ProjectionId property?β–Ό

Chronicle projections have no Identifier or ProjectionId property, so adding one causes errors. The read model key is declared with the [Key] attribute or via UsingKey in the fluent builder instead.

How do projections filter events by tags or stream types?β–Ό

Projections select input through event types, joins, and event sequence configuration; they do not filter by appended tags. For metadata-based filtering, pair the projection with a reducer or reactor using [FilterEventsByTag], [EventSourceType], or [EventStreamType].