dotnet-middleware-patterns

Installation
SKILL.md

dotnet-middleware-patterns

ASP.NET Core middleware patterns for the HTTP request pipeline. Covers correct ordering, writing custom middleware as classes or inline delegates, short-circuit logic, request/response manipulation, exception handling middleware, and conditional middleware registration.

Scope

  • Correct middleware pipeline ordering and common ordering mistakes
  • Custom middleware classes (convention-based and IMiddleware)
  • Inline middleware (Use, Run, Map)
  • Short-circuit logic for early validation and feature flags
  • Request/response body manipulation
  • Exception handling middleware (IExceptionHandler, StatusCodePages)
  • Conditional middleware (UseWhen, MapWhen)

Out of scope

  • Authentication/authorization middleware configuration -- see [skill:dotnet-api-security]
  • Observability middleware (OpenTelemetry, health checks) -- see [skill:dotnet-observability]
  • Minimal API endpoint filters -- see [skill:dotnet-minimal-apis]
Installs
4
GitHub Stars
218
First Seen
Feb 24, 2026
dotnet-middleware-patterns — novotnyllc/dotnet-artisan