dynamic-consistency-boundary

Implement Dynamic Consistency Boundary handlers for multi-stream consistency in .NET with Wolverine and Marten.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/erikshafer/CritterCab --skill dynamic-consistency-boundary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dynamic-consistency-boundary
Source: https://github.com/erikshafer/CritterCab/tree/main/docs/skills/dynamic-consistency-boundary
Command: npx skills add https://github.com/erikshafer/CritterCab --skill dynamic-consistency-boundary

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Wolverine, Marten, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps design and implement Dynamic Consistency Boundary (DCB) handlers in CritterCab, providing a solution for multi-stream consistency without using sagas.

Core Features & Use Cases

  • DCB Pattern: Implements the canonical [BoundaryModel] pattern and the manual FetchForWritingByTags fallback.
  • EventTagQuery Construction: Guides on constructing EventTagQuery for selecting events based on tags.
  • Tag Type Registration: Covers tag-type registration with the .NET-10 Guid-wrapper requirement.
  • DcbConcurrencyException Handling: Explains handling the DcbConcurrencyException.
  • Use Case: Use when a command's invariants span multiple event streams selected by query.

Quick Start

Run the dynamic-consistency-boundary skill command to apply the DCB pattern to your CritterCab application.

Frequently Asked Questions about dynamic-consistency-boundary

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

FAQPage Schema
How do I implement multi-stream consistency in event sourcing without using sagas?

You can achieve multi-stream consistency without sagas by implementing the Dynamic Consistency Boundary pattern, which handles command invariants spanning multiple event streams selected by query using Wolverine and Marten. This approach avoids saga coordination entirely.

What is a dynamic consistency boundary in .NET event sourcing?

A dynamic consistency boundary is a pattern for maintaining consistency across multiple event streams. In .NET, it uses Wolverine and Marten to select events by tags via EventTagQuery, allowing commands to enforce invariants that span streams without saga coordination.

How do I register tag types for EventTagQuery in Marten?

Tag-type registration for EventTagQuery in Marten requires using a .NET-10 Guid-wrapper for the tag types. This setup allows the Dynamic Consistency Boundary pattern to correctly select and aggregate events across multiple streams based on those tags.

How do I handle DcbConcurrencyException when applying a dynamic consistency boundary?

When applying a dynamic consistency boundary, you must handle the DcbConcurrencyException to manage concurrent write conflicts. This exception occurs during multi-stream event processing and ensures tag-based invariants remain consistent during parallel command execution.

Do I need Wolverine and Marten to use the dynamic consistency boundary pattern?

Yes, Wolverine and Marten are required dependencies to implement the dynamic consistency boundary pattern. They provide the underlying event sourcing infrastructure and command handling necessary to execute multi-stream tag queries and boundary models.

When should I use a dynamic consistency boundary instead of a saga?

Use a dynamic consistency boundary instead of a saga when a command's invariants span multiple event streams that can be selected by query. This pattern provides an alternative to saga coordination by fetching events for writing using tags and a boundary model.