csharp-wolverinefx

Build .NET applications with WolverineFX for messaging, HTTP services, and event sourcing. Use when implementing command handlers, message handlers, HTTP endpoints with WolverineFx.HTTP, transactional outbox patterns, event sourcing with Marten, CQRS architectures, cascading messages, batch message

By wshaddix · 561 installs

npx skills add wshaddix/dotnet-skills --skill csharp-wolverinefx

Source repository · Upstream listing

WolverineFX for .NET When to Use This Skill Use this skill when: Building message handlers or command handlers with Wolverine Creating HTTP endpoints with WolverineFx.HTTP (alternative to Minimal API/MVC) Implementing event sourcing with Marten and Wolverine Setting up transactional outbox pattern for reliable messaging Configuring message transports (RabbitMQ, Azure Service Bus, Amazon SQS, TCP) Implementing CQRS with event sourcing Processing messages in batches Using cascading messages for testable, pure function handlers Configuring error handling and retry policies Pre generating code for optimized cold starts Related Skills efcore patterns Entity Framework Core patterns for data access csharp coding standards Modern C patterns (records, pattern matching) http client resilience Polly resilience patterns (complementary) background services Hosted services and background job patterns aspire configuration .NET Aspire orchestration Core Principles 1. Low Ceremony Code Pure functions, method injection, minimal boilerplate 2. Cascading Messages Return messages from handlers instead of injecting IMessageBus 3. Transactional Outbox Guaranteed message delivery with database transactions 4. Code Generation Runtime or pre generated code for optimal performance 5. Vertical Slice Architecture Organize code by feature, not technical layers 6. Pure Functions for Business Logic Isolate infrastructure from business logic Required NuGet Packages Core Messaging Persistence Integration Transports Basic Setup Program.cs (ASP.NET Core) Message Handlers Simple Message Handler Handler with Cascading Messages Using OutgoingMessages for Multiple Messages HTTP Endpoints (WolverineFx.HTTP) Basic GET Endpoint POST with Message Publishing Compound Handler (Load/Validate/Handle) Event Sourcing with Marten Aggregate Handler Workflow Read Aggregate (Read Only) Write Aggregate with Validation Returning Updated Aggregate Transactional Outbox Marten Integration Using Outbox in Controllers Transport Configuration RabbitMQ Azure Service Bus Amazon SQS Batch Message Processing Configure Batching Batch Handler Custom Batching Strategy Error Handling Retry Policies Circuit Breaker Scheduled Messages Delayed Messages Scheduled at Specific Time Using OutgoingMessages Request/Reply Pattern Sending with Response Request Handler with Response Middleware Custom Middleware Transaction Middleware Code Generation Pre Generate Types Generated code appears in ./Internal/Generated/WolverineHandlers/ Configure for AOT/Trimming Multi Tenancy Conjoined Tenancy Publishing to Specific Tenant Marten Side Effects Ancillary Stores (Modular Monolith) Command Line Tools Available Commands Best Practices 1. Prefer pure functions Business logic should be testable without mocks 2. Use cascading messages Return messages instead of injecting IMessageBus 3. Keep call stacks short Avoid deep service hierarchies 4. Pre generate code Optimize cold starts in production 5. Use compound handlers Separate load/validate/handle logic 6. Configure error handling Let Wolverine handle retries and errors 7. Use transactional outbox Guarantee message delivery 8. Batch when appropriate Improve throughput for high volume messages Anti Patterns to Avoid 1. Injecting IMessageBus deep in call stack Makes workflow hard to reason about 2. Over using constructor injection Prefer method injection 3. Ignoring transactional outbox Can lose messages on failure 4. Not pre generating code Slow cold starts in production 5. Mixing too many concerns in one handler Keep handlers focused 6. Not configuring error handling Messages end up in error queue unexpectedly