mediatorlite-source-generation

Reference MediatorLite.SourceGeneration Roslyn generator discovery pipelines and emitted dispatch code.

4|1|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/behl1anmol/MediatorLite --skill mediatorlite-source-generation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mediatorlite-source-generation
Source: https://github.com/behl1anmol/MediatorLite/tree/main/.cursor/skills/mediatorlite-source-generation
Command: npx skills add https://github.com/behl1anmol/MediatorLite --skill mediatorlite-source-generation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modifying or debugging the MediatorLite.SourceGeneration Roslyn incremental generator requires deep familiarity with its four discovery pipelines, emitted code structure, and compile-time strategy resolution logic, which is distributed across the generator implementation and scattered documentation. This Skill centralizes all critical reference material for working with the generator, eliminating hours of manual codebase traversal.

Core Features & Use Cases

  • Four discovery pipelines: Full reference for the handler, behavior, validator, and notification type discovery pipelines, including skip attribute handling, ordering logic, and open generic expansion rules.
  • Compile-time dispatch emission: Detailed guidance on the emitted MediatorLiteRegistration and SourceGeneratedMediator classes, including unrolled typed switch dispatch, nested pipeline behavior chaining, and zero-allocation request handling.
  • Use Case: Use this Skill when adding support for a new handler interface type, adjusting notification execution/error strategy resolution, debugging missing generated handlers or validators, or modifying inline logging and tracing emission logic.

Quick Start

Use the mediatorlite-source-generation skill to debug why a custom pipeline behavior is not being registered in the generated MediatorLiteRegistration code for your .NET project.

Frequently Asked Questions about mediatorlite-source-generation

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

FAQPage Schema
How does compile-time source generation work for .NET mediator dispatch?

Compile-time source generation for .NET mediator dispatch uses a Roslyn incremental generator to emit unrolled typed switch dispatch and nested pipeline behavior chaining, eliminating runtime reflection and enabling zero-allocation request handling.

How do I add a new handler interface type to a Roslyn incremental generator?

To add a new handler interface type, you modify the generator's handler discovery pipeline by adjusting its discovery rules, skip attribute handling, and open generic expansion logic to ensure the new type is registered in the emitted mediator classes.

Why is my custom pipeline behavior not showing up in generated mediator code?

A custom pipeline behavior might be missing from generated mediator code if the behavior discovery pipeline's ordering logic or skip attributes exclude it, requiring debugging of the compile-time strategy resolution and emitted registration logic.

How do I adjust notification execution strategy resolution in a .NET source generator?

You adjust notification execution and error strategy resolution by modifying the notification type discovery pipeline rules within the Roslyn incremental generator to change how emitted dispatch code handles multiple notification handlers.

Does MediatorLite source generation support zero-reflection dispatch for open generic types?

Yes, the source generator supports zero-reflection dispatch for open generic types by applying open generic expansion rules during the handler discovery pipeline to emit strongly-typed switch dispatch logic at compile time.