Skip to content
Skillpedia
General coding40k · #5121

dotnet-design-pattern-review

Helps your agent review C#/.NET code for design patterns. It suggests improvements to make the code more efficient and organized.

What it does

This tool examines your C#/.NET code to check if you've correctly used known design patterns, like the Command Pattern or Factory Pattern. It suggests ways to improve your code's structure, making it more organized and easier to maintain.

When to use it

  • ✓When you want to know if you've used design patterns well in your code.
  • ✓If you need to better organize a C#/.NET project.
  • ✓To ensure your code follows programming best practices.

Example of what to ask your AI

“Review my C# code for the command pattern and factory pattern.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/github/awesome-copilot/blob/main/skills/dotnet-design-pattern-review/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/dotnet-design-pattern-review/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

You paste the code snippet you want to analyze. The tool reads the code, compares it against design pattern rules and best practices, and tells you what's good and what can be improved.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add github/awesome-copilot --skill dotnet-design-pattern-review

Or download just the file:

curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/dotnet-design-pattern-review/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

.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, CommandHandlerOptions inheritance, static SetupCommand(IHost host) methods
  • Factory Pattern: Complex object creation service provider integration
  • Dependency Injection: Primary constructor syntax, ArgumentNullException null 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.

FAQ

Which design patterns does it check for?

It checks for patterns like Command, Factory, Dependency Injection, Repository, Provider, and Resource, as well as principles like SOLID and general .NET best practices.

Does it change my code?

No, it only analyzes and suggests improvements. You decide if and how to apply the suggestions.

Do I need to know a lot about programming to use it?

No, the idea is to keep it simple. It helps you understand if your code is well-structured, even if you're a beginner.

Details

Original description by the author

Review the C#/.NET code for design pattern implementation and suggest improvements.

repo: github/awesome-copilot

Popularity

GitHub stars
40k
Ranking position
#5121
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills