← ClaudeAtlas

dotnet-best-practiceslisted

Ensure .NET/C# code follows maintainable, modern best practices. Use when reviewing or improving C# code, solution structure, async patterns, dependency injection, or testability.
bg-szy/TOP-SKILLS · ★ 1 · AI & Automation · score 70
Install: claude install-skill bg-szy/TOP-SKILLS
# .NET/C# Best Practices > Optimized for current .NET SDK-style projects, C# 12+, ASP.NET Core LTS, and current xUnit, NUnit, or MSTest workflows. Your task is to ensure .NET/C# code in the selected scope or current solution meets the best practices specific to this project. This includes: - Leverage native parallel subagent dispatch and 200k+ context windows where available. ## 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 - Use ResourceManager for localized messages and error strings - Separate LogMe