Chuyển đến nội dung
Skillpedia
Lập trình chung40k · #7178

dotnet-design-pattern-review

Skill này làm gì

Công cụ này xem xét code C#/.NET của bạn để kiểm tra xem bạn đã dùng đúng các mẫu thiết kế đã biết chưa, như Command Pattern hoặc Factory Pattern. Nó gợi ý cách cải thiện cấu trúc code, giúp code có tổ chức hơn và dễ bảo trì hơn.

Khi nào nên dùng

  • ✓Khi bạn muốn biết mình đã dùng mẫu thiết kế trong code đúng chưa.
  • ✓Khi bạn cần tổ chức lại một dự án C#/.NET cho tốt hơn.
  • ✓Để bảo đảm code tuân theo thực hành lập trình tốt nhất.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/dotnet-design-pattern-review/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy xem code C# của tôi về command pattern và factory pattern.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn dán đoạn code muốn phân tích. Công cụ đọc code, so sánh với các quy tắc mẫu thiết kế và thực hành tốt nhất, rồi cho bạn biết phần nào tốt và phần nào có thể cải thiện.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

.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.

Câu hỏi thường gặp

Công cụ kiểm tra những mẫu thiết kế nào?

Nó kiểm tra các mẫu như Command, Factory, Dependency Injection, Repository, Provider và Resource, cũng như các nguyên tắc như SOLID và thực hành .NET chung.

Công cụ có thay đổi code của tôi không?

Không. Nó chỉ phân tích và gợi ý cải tiến. Bạn quyết định có áp dụng gợi ý hay không và áp dụng như thế nào.

Tôi có cần biết nhiều về lập trình để dùng không?

Không. Ý tưởng là giữ mọi thứ đơn giản. Công cụ giúp bạn hiểu code có được tổ chức tốt không, ngay cả khi bạn mới bắt đầu.

Chi tiết

Mô tả gốc của tác giả

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

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7178
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự