integration-events

Generates MassTransit integration events for decoupled inter-module communication in modular monolith ERP systems.

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/Aurelian1974/ERPEnterprise --skill integration-events-aurelian1974
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: integration-events
Source: https://github.com/Aurelian1974/ERPEnterprise/tree/main/.github/skills/integration-events
Command: npx skills add https://github.com/Aurelian1974/ERPEnterprise --skill integration-events-aurelian1974

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Modules in a modular monolith ERP must communicate without direct project references, and this Skill provides the complete pattern for publishing and consuming integration events via MassTransit without coupling modules together. ## Core Features & Use Cases - Contract Generation: Creates immutable sealed record contracts in Shared.Contracts with mandatory EventId and OccurredAt fields. - Publisher & Consumer Scaffolding: Produces DomainEvent handlers that publish after transaction commit, plus idempotent consumers in the receiving module. - MassTransit Registration: Wires consumers per module through IModuleInstaller with in-memory transport for monoliths and RabbitMQ for extracted services. - Use Case: When approving an invoice in the Finance module must trigger stock reservation in Inventory and journal entries in Accounting, this Skill generates the full event flow without any cross-module project reference. ## Quick Start Generate an integration event flow where approving an invoice in Finance notifies the Inventory and Accounting modules via MassTransit.

Frequently Asked Questions about integration-events

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

FAQPage Schema
How do I implement integration events between modules in a modular monolith?▼

Define a sealed record contract in Shared.Contracts, publish it from a DomainEvent handler in the source module via MassTransit IPublishEndpoint, and consume it with an IConsumer implementation in the destination module. Modules never reference each other directly.

How to make MassTransit consumers idempotent?▼

Check whether the event was already processed before applying business logic, using the EventId or a business key like InvoiceId. If a duplicate is detected, log a warning and return without reprocessing, so handling the same message N times yields the same result.

Should I use in-memory transport or RabbitMQ with MassTransit?▼

Use UsingInMemory for a modular monolith where all modules run in one process. Switch to UsingRabbitMq when you extract a module into a separate service, configuring the host through application configuration.

When should integration events be published relative to the database transaction?▼

Publish after the transaction commits, never inside it. A TransactionBehavior pipeline commits first and then lets domain event handlers publish integration events, preventing consumers from reacting to rolled-back changes.

What naming convention should integration event contracts follow?▼

Use the pattern {Entity}{PastTense}IntegrationEvent, such as InvoiceApprovedIntegrationEvent, placed in the namespace Shared.Contracts.Events.{Module}. Contracts must be sealed records containing only primitive types or other records, never domain entities.