dotnet-design-pattern-review
.NET/C# Design Pattern Review
Review the C#/.NET code in ${selection} for design pattern implementation and suggest improvements for the solution/project. Do not make any changes to the code, just provide a review.
Required Design Patterns
- Command Pattern: Generic base classes (
CommandHandler<TOptions>),ICommandHandler<TOptions>interface,CommandHandlerOptionsinheritance, staticSetupCommand(IHost host)methods - Factory Pattern: Complex object creation service provider integration
- Dependency Injection: Primary constructor syntax,
ArgumentNullExceptionnull checks, interface abstractions, proper service lifetimes - Repository Pattern: Async data access interfaces provider abstractions for connections
- Provider Pattern: External service abstractions (database, AI), clear contracts, configuration handling
- Resource Pattern: ResourceManager for localized messages, separate .resx files (LogMessages, ErrorMessages)
Review Checklist
- Design Patterns: Identify patterns used. Are Command Handler, Factory, Provider, and Repository patterns correctly implemented? Missing beneficial patterns?
- Architecture: Follow namespace conventions (
{Core|Console|App|Service}.{Feature})? Proper separation between Core/Console projects? Modular and readable? - .NET Best Practices: Primary constructors, async/await with Task returns, ResourceManager usage, structured logging, strongly-typed configuration?
- GoF Patterns: Command, Factory, Template Method, Strategy patterns correctly implemented?
- SOLID Principles: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion violations?
- Performance: Proper async/await, resource disposal, ConfigureAwait(false), parallel processing opportunities?
- Maintainability: Clear separation of concerns, consistent error handling, proper configuration usage?
- Testability: Dependencies abstracted via interfaces, mockable components, async testability, AAA pattern compatibility?
- Security: Input validation, secure credential handling, parameterized queries, safe exception handling?
- Documentation: XML docs for public APIs, parameter/return descriptions, resource file organization?
- Code Clarity: Meaningful names reflecting domain concepts, clear intent through patterns, self-explanatory structure?
- Clean Code: Consistent style, appropriate method/class size, minimal complexity, eliminated duplication?
Improvement Focus Areas
- Command Handlers: Validation in base class, consistent error handling, proper resource management
- Factories: Dependency configuration, service provider integration, disposal patterns
- Providers: Connection management, async patterns, exception handling and logging
- Configuration: Data annotations, validation attributes, secure sensitive value handling
- AI/ML Integration: Semantic Kernel patterns, structured output handling, model configuration
Provide specific, actionable recommendations for improvements aligned with the project's architecture and .NET best practices.
More from midudev/autoskills
bun
Use when building, testing, and deploying JavaScript/TypeScript applications. Reach for Bun when you need to run scripts, manage dependencies, bundle code, or test applications with a single unified tool.
14pydantic
Python data validation using type hints and runtime type checking with Pydantic v2's Rust-powered core for high-performance validation in FastAPI, Django, and configuration management.
11react-hook-form
React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, and useFieldArray. This skill should be used when building client-side controlled forms with React Hook Form library. This skill does NOT cover React 19 Server Actions, useActionState, or server-side form handling (use react-19 skill for those).
10azure-deploy
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: \"run azd up\", \"run azd deploy\", \"execute deployment\", \"push to production\", \"push to cloud\", \"go live\", \"ship it\", \"bicep deploy\", \"terraform apply\", \"publish to Azure\", \"launch on Azure\". DO NOT USE WHEN: \"create and deploy\", \"build and deploy\", \"create a new app\", \"set up infrastructure\", \"create and deploy to Azure using Terraform\" — use azure-prepare for these.
8sqlalchemy-orm
SQLAlchemy Python SQL toolkit and ORM with powerful query builder, relationship mapping, and database migrations via Alembic
8clerk
Clerk authentication router. Use when user asks about adding authentication,
8