scaffold-consumer

Generates MassTransit IConsumer classes for handling RabbitMQ integration events in .NET microservices.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/GSU26SE55/backend --skill scaffold-consumer-gsu26se55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffold-consumer
Source: https://github.com/GSU26SE55/backend/tree/main/.claude/skills/dev/be/scaffold-consumer
Command: npx skills add https://github.com/GSU26SE55/backend --skill scaffold-consumer-gsu26se55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing MassTransit consumers for RabbitMQ integration events involves repetitive boilerplate — dependency injection, unit-of-work patterns, transaction handling, and retry semantics. This Skill scaffolds a complete, convention-compliant consumer class so developers avoid copy-paste errors and inconsistent patterns across services. ## Core Features & Use Cases - Two Consumer Templates: Generates either a DB-write-plus-notification consumer or a cross-service entity update consumer with explicit transaction handling. - Convention Enforcement: Places files in Infrastructure/Consumers/, wires assembly scanning for automatic discovery, and documents rules like not awaiting the void UpdateAsync() method. - Retry-Safe Error Handling: Templates throw on failure so MassTransit automatically retries, with rollback logic for transactional updates. - Use Case: When a BatteryAnomalyDetectedEvent must create a ticket in TicketService, run the scaffold to produce a ready-to-adapt BatteryAnomalyDetectedEventConsumer with logging, unit-of-work persistence, and DI registration guidance. ## Quick Start Ask the AI to scaffold a MassTransit consumer by providing the service name and event name, for example scaffold a consumer for TicketService handling BatteryAnomalyDetectedEvent.

Frequently Asked Questions about scaffold-consumer

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

FAQPage Schema
How do I create a MassTransit consumer for RabbitMQ events in .NET?▼

Implement IConsumer<TEvent> from MassTransit, inject your unit of work and logger, and handle the event inside the Consume method. Place the file in Infrastructure/Consumers and register it via assembly scanning with AddMessageBus so it is discovered automatically.

How does MassTransit retry failed consumers?▼

MassTransit automatically retries when the Consume method throws an exception. The scaffolded templates rethrow after logging and rolling back transactions, letting the configured retry policy handle redelivery without custom retry code.

How do I register MassTransit consumers with dependency injection?▼

Call AddMessageBus with the configuration and pass the consumer's assembly, such as typeof(MyEventConsumer).Assembly. MassTransit scans the assembly and registers all IConsumer implementations automatically.

Why should I not await UpdateAsync in a unit of work pattern?▼

In this codebase UpdateAsync is a void method that only marks the entity as modified in the change tracker. Awaiting it causes a compile error; the actual persistence happens when CommitTransactionAsync or SaveChangesAsync is called.

When should I use transactions inside a message consumer?▼

Use explicit BeginTransactionAsync, CommitTransactionAsync, and RollbackTransactionAsync when updating existing entities where partial writes would corrupt state. Wrap the update in try-catch, roll back on failure, and rethrow so MassTransit retries the message.