
Define explicit transaction policies for different operation types and consistency requirements in .NET applications. Use when: - Different operations require different transaction isolation levels - Implementing explicit transaction policies per operation type - Handling complex consistency requirements - Building systems with varying transaction needs - Enforcing transaction boundaries via decorators or middleware Triggers: "transaction policy", "isolation level", "transaction strategy", "consistency requirement", "transaction configuration"
Generate a new business module following Clean Architecture, CQRS, and DDD principles with UseCase-driven and Model-driven separation. Use when: - Creating a new business module in Clean Architecture project - Generating module structure with CQRS separation - Scaffolding DDD aggregates and value objects - Setting up module with proper layer organization - Adding new bounded context to existing system Triggers: "create module", "generate module", "new module", "scaffold module", "module structure"
Enable domain entities to publish events when significant business events occur, allowing decoupled side effects in Clean Architecture applications. Use when: - Domain entities need to notify other parts of the system about business events - Implementing event-driven architecture with decoupled handlers - Coordinating side effects after domain changes - Building reactive systems that respond to domain state changes - Implementing eventual consistency between bounded contexts Triggers: "domain event", "event publishing", "event handler", "domain notification", "event-driven", "side effect"
Define explicit caching strategies for different data access patterns and consistency requirements in .NET applications. Use when: - Implementing caching for frequently accessed data - Optimizing read-heavy workloads - Reducing database load with appropriate caching - Handling cache invalidation strategies - Building systems with varying cache requirements Triggers: "caching strategy", "cache", "redis", "cache invalidation", "TTL", "cache warming"
Ensure reliable event publishing and message delivery by storing events in the same transaction as domain changes, solving the dual-write problem. Use when: - Implementing reliable event publishing in distributed systems - Ensuring events are published even if application crashes - Solving dual-write problem (domain changes + event publishing) - Building event-driven architectures with guaranteed delivery - Implementing eventual consistency between services Triggers: "outbox", "reliable event", "dual-write", "event publishing", "message delivery", "transactional outbox"
Enterprise backend structure built on Clean Architecture, DDD, CQRS, and Vertical Slice API Design with Dapper-first persistence. Use when: - Creating new enterprise backend projects - Implementing Clean Architecture with DDD and CQRS - Building vertical slice API endpoints - Using Dapper as primary persistence mechanism - Organizing modules by UseCase-driven and Model-driven separation Triggers: "dmis structure", "clean architecture", "enterprise backend", "DDD CQRS", "vertical slice", "dapper"
Provide transactional boundary control for write operations in .NET Clean Architecture applications. Use when: - Implementing command handlers that require database transactions - Managing transaction boundaries across multiple repository operations - Coordinating atomic operations in Clean Architecture applications - Handling nested transactions in scoped dependency injection scenarios - Preventing repository-level transaction management anti-patterns Triggers: "transaction", "unit of work", "atomic operation", "transaction boundary", "UoW", "database transaction"
Layered architecture with vertical slice organization following Clean Architecture principles. Use when: - Creating new .NET backend projects requiring strict layer separation - Building applications with Clean Architecture principles - Implementing vertical slice API organization - Projects requiring framework-agnostic domain layer - Applications that need CQRS support Triggers: "clean architecture", "layered architecture", "vertical slice", "clean structure", "layer separation"
Create adapter structure for integrating third-party APIs in Clean Architecture applications. Use when: - Integrating external APIs or services - Creating HTTP client adapters for third-party services - Implementing API integration with error handling - Setting up adapter pattern for external dependencies - Building resilient external service integrations Triggers: "api adapter", "third-party api", "external service", "http client adapter", "api integration"
Create Docker Compose configuration for containerized .NET application development and deployment. Use when: - Containerizing .NET applications - Setting up local development environment with dependencies - Creating multi-container setups (API + DB + Redis) - Defining service dependencies and networking - Building docker-compose.yml for development or production Triggers: "docker compose", "containerize", "multi-container", "docker-compose.yml", "docker setup"
Generate DDD Aggregate Root structure with Repository Interface, ValueObject, and Domain Event following DDD principles. Use when: - Creating new domain aggregates in DDD projects - Generating aggregate root with repository interface - Scaffolding value objects and domain events - Building domain entities with business invariants - Implementing aggregates with identity and business rules Triggers: "create aggregate", "generate aggregate", "domain aggregate", "aggregate root", "DDD aggregate"
Generate Repository implementation for Domain Repository Interface using EF Core or Dapper in Infrastructure layer. Use when: - Implementing repository interface defined in Domain layer - Creating data access layer with EF Core or Dapper - Building repository pattern implementations - Scaffolding persistence layer for aggregates - Implementing read/write separation (CQRS) Triggers: "create repository", "generate repository", "repository implementation", "EF repository", "Dapper repository"
Create reusable .NET atomic capability code snippets that can be directly copied and pasted. Use when: - Creating single-purpose code snippets - Building reusable code templates - Implementing atomic technical capabilities - Creating copy-pasteable code blocks - Building snippet library for common patterns Triggers: "create snippet", "code snippet", "reusable snippet", "atomic snippet", "copy-paste code"
Track handler execution for observability, auditing, and debugging in .NET applications. Use when: - Implementing observability and monitoring - Tracking handler execution for performance analysis - Building audit trails for business operations - Debugging production issues - Implementing distributed tracing Triggers: "execution tracking", "observability", "audit trail", "performance monitoring", "tracing", "correlation id"
Build cross-cutting concern pipelines using decorator pattern for handlers in Clean Architecture applications. Use when: - Implementing cross-cutting concerns (logging, validation, transaction, etc.) - Building handler pipelines with multiple concerns - Composing decorators for different operation types - Separating cross-cutting logic from business logic - Applying concerns in specific order Triggers: "decorator", "pipeline", "cross-cutting", "handler decorator", "middleware", "aspect"
Use Result wrapper pattern for explicit error handling without exceptions in .NET applications. Use when: - Handling business errors explicitly without exceptions - Building functional error handling pipelines - Separating business errors from system errors - Creating composable error handling flows - Implementing railway-oriented programming patterns Triggers: "result wrapper", "result pattern", "error handling", "railway oriented", "functional error", "maybe pattern"
Define explicit retry policies for handling transient failures in external dependencies in .NET applications. Use when: - Handling transient failures from external services - Implementing resilient service calls - Building systems that need to recover from temporary failures - Implementing circuit breaker patterns - Handling network timeouts and connection issues Triggers: "retry policy", "transient failure", "circuit breaker", "resilience", "exponential backoff", "retry logic"