pipeline-decorator

Automate decorator-based pipeline construction for .NET command handlers.

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/yeeehaooo/WorkSpace --skill pipeline-decorator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pipeline-decorator
Source: https://github.com/yeeehaooo/WorkSpace/tree/main/skills/dotnet/patterns/pipeline-decorator
Command: npx skills add https://github.com/yeeehaooo/WorkSpace --skill pipeline-decorator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build modular, reusable pipelines for application handlers by applying the decorator pattern to compose cross-cutting concerns (logging, validation, transactions) without polluting business logic.

Core Features & Use Cases

  • Compose multiple decorators around a handler to separate concerns.
  • Enforce one concern per decorator and maintain a defined execution order.
  • Leverage dependency injection to assemble decorators (base and concrete) around handlers.
  • Enable deterministic behavior by explicit decorator order and composition.

Quick Start

Configure your DI container to wrap your command handlers with ordered decorators (e.g., ValidationDecorator, LoggingDecorator) and invoke HandleAsync on a command.

Frequently Asked Questions about pipeline-decorator

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

FAQPage Schema
How do I compose cross-cutting concerns like logging and validation without polluting command handler business logic?

You compose cross-cutting concerns by wrapping command handlers with ordered decorators, enforcing one concern per decorator. This separates logging, validation, and transactions from business logic by leveraging dependency injection to assemble the pipeline.

How do I enforce a specific execution order for decorators around my command handlers?

You enforce decorator execution order explicitly during pipeline composition. The Skill supports explicit decorator ordering, allowing deterministic behavior by defining the sequence in which decorators like ValidationDecorator and LoggingDecorator wrap the handler.

Can I use the decorator pattern for command handlers in a .NET CQRS application?

Yes, the decorator pattern for command handlers primarily applies to .NET applications using CQRS patterns. It leverages dependency injection to wire base and concrete decorators around handlers in a Clean Architecture setup.

What is the best way to separate cross-cutting concerns from business logic in Clean Architecture?

The best way to separate cross-cutting concerns is applying the decorator pattern to compose modular, reusable pipelines around application handlers. This maintains a clear separation between decorators and handlers without polluting business logic.

How does dependency injection wire multiple decorators around a single command handler?

Dependency injection assembles decorators by wrapping base and concrete implementations around handlers. You configure the DI container to register ordered decorators like ValidationDecorator and LoggingDecorator, then invoke HandleAsync on the command.

Can I apply more than one decorator for the same concern, such as multiple validation decorators, in a single pipeline?

No, the pipeline composition supports one decorator per concern. To maintain deterministic behavior and clear separation, you enforce a single decorator for each cross-cutting concern like logging or validation within the explicit execution order.