home/roleplay/modular-monolith-communication-instructions

Modular Monolith Communication.instructions

GPTClaudeGemini··422 copies·updated 2026-07-14
modular-monolith-communication-instructions.prompt
---
applyTo: '**/*.{Application,Infrastructure}/**/*.cs'
description: Guidelines for implementing communication patterns between modules in a modular monolith architecture, including domain events, integration events, and message bus patterns.
---

# Modular Monolith Communication Patterns

## Purpose
Establish clear communication patterns that allow modules to interact without creating direct dependencies, ensuring loose coupling and maintaining the benefits of modular architecture.

## Rules and Guidelines
- ❌ **NO Direct Dependencies**: Modules MUST NOT have direct project references to each other
- ✅ **Async by Default**: Prefer asynchronous communication over synchronous calls
- ✅ **Event-Driven**: Use domain and integration events as the primary communication mechanism
- ✅ **Eventual Consistency**: Accept eventual consistency between modules for better scalability
- ✅ **Clear Contracts**: Define explicit interfaces for all inter-module communication

## Communication Types

### 1. Intra-Module Communication (Domain Events)
Use domain events within a single module boundary.
**→ See `domain-driven-design-event-csharp.instructions.md` for complete implementation.**

### 2. Inter-Module Communication (Integration Events)
Use integration events for communication between different modules.

## Integration Events Implementation

**→ See `domain-driven-design-event-csharp.instructions.md` for all SharedKernel interfaces.**

### Integration Event Example

fill the variables

This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.

{Application,Infrastructure}
Unlock with Pro →

when to use it

Community prompt sourced from the open-source GitHub repo SebastienDegodez/copilot-instructions (Apache-2.0). A "Modular Monolith Communication.instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

roleplaycommunitygeneral

source

SebastienDegodez/copilot-instructions · Apache-2.0