dotnet-best-practices Skill for Claude: A C# and .NET Code Checklist
dotnet-best-practices makes Claude review and fix C# code against one fixed .NET checklist from GitHub's awesome-copilot.
- Installs
- 15.9K
- on skills.sh
- Stars
- 40.7K
- on GitHub
- Updated
- Oct 2026
- last repo commit
dotnet-best-practices is a one-file checklist from the github/awesome-copilot collection. It tells Claude to make the C# code you point at meet the practices listed in 11 sections, from XML doc comments and primary constructor injection to async patterns, testing and logging.
It is opinionated and tied to a particular project style. It asks for the namespace pattern {Core|Console|App|Service}.{Feature}, the Command Handler pattern with generic base classes, MSTest with FluentAssertions and Moq, and Microsoft.SemanticKernel for AI work. Check that this matches your solution before you apply it.
It bundles no scripts and names no tools. The text is written to act on ${selection}, the code you have selected.
Good for
- .NET developers who want Claude to apply the same conventions to every class
- Reviewers who want a consistent checklist for C# changes
- Teams that already use MSTest, Moq, FluentAssertions or Semantic Kernel
Install dotnet-best-practices
Claude Code
- 1
Copy this prompt.
Install the dotnet-best-practices skill in Claude Code. Run this command: npx skills add https://github.com/github/awesome-copilot --skill dotnet-best-practices Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Ensure .NET/C# code meets best practices for the solution/project.
Sections in SKILL.md
- Documentation & Structure
- Design Patterns & Architecture
- Dependency Injection & Services
- Resource Management & Localization
- Async/Await Patterns
- Testing Standards
- Configuration & Settings
- Semantic Kernel & AI Integration
- Error Handling & Logging
- Performance & Security
- Code Quality
Key facts
- License (per GitHub)
- MIT
- Author
- github (repo owner)
- Installs on skills.sh
- 15,922 as of 2026-11-02
- Repo stars
- 40,666 as of 2026-11-02 (whole repo)
- Last repo commit
- 2026-10-30
- Files in the skill folder
- 1 file including SKILL.md
- skills.sh audits
- Gen Agent Trust Hub: pass; Socket: pass; Snyk: pass
What it includes
XML doc comments on public members, a fixed namespace pattern
Asks for XML comments with parameter and return descriptions, and the namespace layout {Core|Console|App|Service}.{Feature}.
Documentation and structurePrimary constructors, Command Handler, factories
Primary constructor injection, a generic CommandHandler<TOptions> base, I-prefixed interfaces and the Factory pattern for complex creation.
Design patterns and architectureConstructor injection with null checks, service lifetimes
Uses Microsoft.Extensions.DependencyInjection, picks Singleton, Scoped or Transient lifetimes and puts services behind interfaces.
Dependency injection and servicesResourceManager strings, split log and error resources
Keeps messages in resource files and reads them with _resourceManager.GetString.
Resource management and localizationasync for all I/O, Task returns, ConfigureAwait(false)
Covers async I/O, return types, ConfigureAwait(false) and async exception handling.
Async/await patternsMSTest, FluentAssertions, Moq, Arrange-Act-Assert
Tests both success and failure paths and includes null parameter validation tests.
Testing standardsTyped settings classes with validation attributes
Uses IConfiguration binding, data annotations and appsettings.json.
Configuration and settingsKernel setup, model settings, structured output
Uses Microsoft.SemanticKernel for AI operations and structured outputs for reliable responses.
Semantic Kernel and AI integrationStructured logging, scoped context, specific exceptions
Uses Microsoft.Extensions.Logging with scoped context and descriptive exceptions.
Error handling and loggingC# 12+, .NET 8, input validation, parameterized queries
Asks for C# 12+ and .NET 8 features where they apply, input validation and parameterized database queries.
Performance and securitySOLID, no duplication, disposal patterns
Asks for SOLID principles, shared base classes, domain names, focused methods and proper disposal.
Code quality
From the official docs
Questions
What does the dotnet-best-practices skill do?
It makes Claude check C# code against an 11-section checklist and bring the code in line. The sections run from XML documentation and dependency injection to async, testing, logging and security.
How do I install it?
Use the install box above. The skills CLI command installs this one skill from github/awesome-copilot into the agent you choose.
Does it work for any .NET project?
Only partly. Several rules assume a specific project style, such as the namespace pattern {Core|Console|App|Service}.{Feature}, a CommandHandler<TOptions> base class, MSTest with Moq and Semantic Kernel. Drop the rules that do not fit your solution.
Does it need an API key?
The SKILL.md names no API key and bundles no scripts. It is one text file of instructions.
Is it safe to install?
It bundles no scripts: the folder is one SKILL.md of coding rules. The awesome-copilot README says its content comes from third-party developers and asks you to inspect it before installing. Review the diff Claude makes to your code as you would any other change.
Why does it mention ${selection}?
The text says to check the C# code in ${selection}, a placeholder for the code you have selected. Name the file, class or folder in your prompt so Claude knows what to review.
Information
updated Nov 2, 2026
- Repository
- github/awesome-copilot
- Folder
skills/dotnet-best-practices
Sources
Docs, issue trackers and discussions this page is built from.
Show all 1Hide
- dotnet-best-practices SKILL.md · github.com