Agent skill
marten__single_stream_projection
Create a Marten Single Stream Projection to aggregate events from a single stream into a view (e.g., entity details).
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/marten-single-stream-projection
SKILL.md
Follow this guide to create a Single Stream Projection in Marten. This projection creates a single document for a single event stream (aggregate instance).
-
Define the Projection Class
- Create a
classinsrc/BookStore.ApiService/Projections/ - Naming:
{Resource}Projection(e.g.,AuthorDetailsProjection) - Base Class:
SingleStreamProjection<T>matches the standard pattern for explicit single stream aggregation. - Template:
templates/Projection.cs
- Create a
-
Configure in Marten
- Open
src/BookStore.ApiService/Infrastructure/Extensions/MartenConfigurationExtensions.cs - Register the projection in
RegisterProjections:csharpoptions.Projections.Add<AuthorDetailsProjection>(ProjectionLifecycle.Async); - Note:
Asyncis recommended for performance.Inlinehandles consistency but impacts write performance.
- Open
-
Indexing (Optional)
- In
ConfigureIndexes:csharpoptions.Schema.For<AuthorDetailsProjection>().Index(x => x.Name);
- In
-
Querying
- Query this projection by ID (matching the stream ID) or other fields.
- Example:
session.LoadAsync<AuthorDetailsProjection>(streamId)
Related Skills
/marten__aggregate_scaffold: Create the events first./marten__get_by_id: Create an endpoint to query this projection./marten__list_query: Create list endpoints if the projection supports browsing.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?