github avatar

Dotnet Best Practices

The dotnet-best-practices skill analyzes .NET/C# code within a solution or project to ensure compliance with established best practices, including XML documentation, design patterns, dependency injection, async/await patterns, testing standards, and security protocols. It is designed for .NET developers and teams who need to maintain code quality and consistency across their projects. This skill solves the problem of enforcing architectural standards, improving code maintainability, and reducing technical debt by providing guidance on proper use of C# 12+ features, Microsoft.Extensions libraries, and established patterns like Command Handlers and Factory patterns.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
24
skills.sh installs
16.1K
GitHub stars
41K
last updated
Aug 21, 2026

Install

$ npx -y skills add github/awesome-copilot --skill dotnet-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

.NET/C# Best Practices

Your task is to ensure .NET/C# code in ${selection} meets the best practices specific to this solution/project. This includes:

Documentation & Structure

  • Create comprehensive XML documentation comments for all public classes, interfaces, methods, and properties
  • Include parameter descriptions and return value descriptions in XML comments
  • Follow the established namespace structure: {Core|Console|App|Service}.{Feature}

Design Patterns & Architecture

  • Use primary constructor syntax for dependency injection (e.g., public class MyClass(IDependency dependency))
  • Implement the Command Handler pattern with generic base classes (e.g., CommandHandler<TOptions>)
  • Use interface segregation with clear naming conventions (prefix interfaces with 'I')
  • Follow the Factory pattern for complex object creation.

Dependency Injection & Services

  • Use constructor dependency injection with null checks via ArgumentNullException
  • Register services with appropriate lifetimes (Singleton, Scoped, Transient)
  • Use Microsoft.Extensions.DependencyInjection patterns
  • Implement service interfaces for testability

Resource Management & Localization

Sponsors

Details

Repository
github.com/github/awesome-copilot
Categories
Git & Pull Requests, AI & Agent Building, .NET & C#

More from github/awesome-copilot

All 318
1github avatarsql-optimizationgithub/awesome-copilotUniversal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases16Kskills.sh installs
2github avatarchrome-devtoolsgithub/awesome-copilotExpert-level browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, capturing screenshots, analy15.4Kskills.sh installs
3github avatarmicrosoft-docsgithub/awesome-copilotQuery official Microsoft documentation to find concepts, tutorials, and code examples across Azure, .NET, Agent Framework, Aspire, VS Code, GitHub, and more. Us15Kskills.sh installs
4github avatarplaywright-explore-websitegithub/awesome-copilotWebsite exploration for testing using Playwright MCP14.8Kskills.sh installs
5github avatarazure-devops-cligithub/awesome-copilotManage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints. Use when workin14.8Kskills.sh installs
6github avatarjavascript-typescript-jestgithub/awesome-copilotBest practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.14.5Kskills.sh installs