{"id":"219e572c-f795-48d9-ac75-4a9089bfe795","shortId":"RC9WZZ","kind":"skill","title":"Dotnet Best Practices","tagline":"Awesome Copilot skill by Github","description":"# .NET/C# Best Practices\n\nYour task is to ensure .NET/C# code in ${selection} meets the best practices specific to this solution/project. This includes:\n\n## Documentation & Structure\n\n- Create comprehensive XML documentation comments for all public classes, interfaces, methods, and properties\n- Include parameter descriptions and return value descriptions in XML comments\n- Follow the established namespace structure: {Core|Console|App|Service}.{Feature}\n\n## Design Patterns & Architecture\n\n- Use primary constructor syntax for dependency injection (e.g., `public class MyClass(IDependency dependency)`)\n- Implement the Command Handler pattern with generic base classes (e.g., `CommandHandler<TOptions>`)\n- Use interface segregation with clear naming conventions (prefix interfaces with 'I')\n- Follow the Factory pattern for complex object creation.\n\n## Dependency Injection & Services\n\n- Use constructor dependency injection with null checks via ArgumentNullException\n- Register services with appropriate lifetimes (Singleton, Scoped, Transient)\n- Use Microsoft.Extensions.DependencyInjection patterns\n- Implement service interfaces for testability\n\n## Resource Management & Localization\n\n- Use ResourceManager for localized messages and error strings\n- Separate LogMessages and ErrorMessages resource files\n- Access resources via `_resourceManager.GetString(\"MessageKey\")`\n\n## Async/Await Patterns\n\n- Use async/await for all I/O operations and long-running tasks\n- Return Task or Task<T> from async methods\n- Use ConfigureAwait(false) where appropriate\n- Handle async exceptions properly\n\n## Testing Standards\n\n- Use MSTest framework with FluentAssertions for assertions\n- Follow AAA pattern (Arrange, Act, Assert)\n- Use Moq for mocking dependencies\n- Test both success and failure scenarios\n- Include null parameter validation tests\n\n## Configuration & Settings\n\n- Use strongly-typed configuration classes with data annotations\n- Implement validation attributes (Required, NotEmptyOrWhitespace)\n- Use IConfiguration binding for settings\n- Support appsettings.json configuration files\n\n## Semantic Kernel & AI Integration\n\n- Use Microsoft.SemanticKernel for AI operations\n- Implement proper kernel configuration and service registration\n- Handle AI model settings (ChatCompletion, Embedding, etc.)\n- Use structured output patterns for reliable AI responses\n\n## Error Handling & Logging\n\n- Use structured logging with Microsoft.Extensions.Logging\n- Include scoped logging with meaningful context\n- Throw specific exceptions with descriptive messages\n- Use try-catch blocks for expected failure scenarios\n\n## Performance & Security\n\n- Use C# 12+ features and .NET 8 optimizations where applicable\n- Implement proper input validation and sanitization\n- Use parameterized queries for database operations\n- Follow secure coding practices for AI/ML operations\n\n## Code Quality\n\n- Ensure SOLID principles compliance\n- Avoid code duplication through base classes and utilities\n- Use meaningful names that reflect domain concepts\n- Keep methods focused and cohesive\n- Implement proper disposal patterns for resources","tags":["dotnet","best","practices","awesome","copilot","github"],"capabilities":["skill","source-github","category-awesome-copilot"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/dotnet-best-practices","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T19:40:25.946Z","embedding":null,"createdAt":"2026-04-18T20:25:03.318Z","updatedAt":"2026-04-22T19:40:25.946Z","lastSeenAt":"2026-04-22T19:40:25.946Z","tsv":"'12':311 '8':315 'aaa':201 'access':157 'act':204 'ai':249,254,264,276 'ai/ml':336 'annot':232 'app':63 'applic':318 'appropri':127,186 'appsettings.json':244 'architectur':68 'argumentnullexcept':123 'arrang':203 'assert':199,205 'async':180,188 'async/await':162,165 'attribut':235 'avoid':344 'awesom':4 'base':89,348 'best':2,10,23 'bind':240 'block':302 'c':310 'catch':301 'category-awesome-copilot' 'chatcomplet':267 'check':121 'class':41,78,90,229,349 'clear':97 'code':18,333,338,345 'cohes':363 'command':84 'commandhandl':92 'comment':37,55 'complex':109 'complianc':343 'comprehens':34 'concept':358 'configur':222,228,245,259 'configureawait':183 'consol':62 'constructor':71,116 'context':291 'convent':99 'copilot':5 'core':61 'creat':33 'creation':111 'data':231 'databas':329 'depend':74,81,112,117,210 'descript':48,52,296 'design':66 'dispos':366 'document':31,36 'domain':357 'dotnet':1 'duplic':346 'e.g':76,91 'embed':268 'ensur':16,340 'error':149,278 'errormessag':154 'establish':58 'etc':269 'except':189,294 'expect':304 'factori':106 'failur':215,305 'fals':184 'featur':65,312 'file':156,246 'fluentassert':197 'focus':361 'follow':56,104,200,331 'framework':195 'generic':88 'github':8 'handl':187,263,279 'handler':85 'i/o':168 'iconfigur':239 'idepend':80 'implement':82,135,233,256,319,364 'includ':30,46,217,286 'inject':75,113,118 'input':321 'integr':250 'interfac':42,94,101,137 'keep':359 'kernel':248,258 'lifetim':128 'local':142,146 'log':280,283,288 'logmessag':152 'long':172 'long-run':171 'manag':141 'meaning':290,353 'meet':21 'messag':147,297 'messagekey':161 'method':43,181,360 'microsoft.extensions.dependencyinjection':133 'microsoft.extensions.logging':285 'microsoft.semantickernel':252 'mock':209 'model':265 'moq':207 'mstest':194 'myclass':79 'name':98,354 'namespac':59 'net':314 'net/c':9,17 'notemptyorwhitespac':237 'null':120,218 'object':110 'oper':169,255,330,337 'optim':316 'output':272 'paramet':47,219 'parameter':326 'pattern':67,86,107,134,163,202,273,367 'perform':307 'practic':3,11,24,334 'prefix':100 'primari':70 'principl':342 'proper':190,257,320,365 'properti':45 'public':40,77 'qualiti':339 'queri':327 'reflect':356 'regist':124 'registr':262 'reliabl':275 'requir':236 'resourc':140,155,158,369 'resourcemanag':144 'resourcemanager.getstring':160 'respons':277 'return':50,175 'run':173 'sanit':324 'scenario':216,306 'scope':130,287 'secur':308,332 'segreg':95 'select':20 'semant':247 'separ':151 'servic':64,114,125,136,261 'set':223,242,266 'singleton':129 'skill':6 'solid':341 'solution/project':28 'source-github' 'specif':25,293 'standard':192 'string':150 'strong':226 'strongly-typ':225 'structur':32,60,271,282 'success':213 'support':243 'syntax':72 'task':13,174,176,178 'test':191,211,221 'testabl':139 'throw':292 'transient':131 'tri':300 'try-catch':299 'type':227 'use':69,93,115,132,143,164,182,193,206,224,238,251,270,281,298,309,325,352 'util':351 'valid':220,234,322 'valu':51 'via':122,159 'xml':35,54","prices":[{"id":"89f13af8-dae1-4422-a2ac-053b1181a3bf","listingId":"219e572c-f795-48d9-ac75-4a9089bfe795","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:25:03.318Z"}],"sources":[{"listingId":"219e572c-f795-48d9-ac75-4a9089bfe795","source":"github","sourceId":"github/awesome-copilot/dotnet-best-practices","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/dotnet-best-practices","isPrimary":false,"firstSeenAt":"2026-04-18T21:49:10.861Z","lastSeenAt":"2026-04-22T18:52:51.874Z"},{"listingId":"219e572c-f795-48d9-ac75-4a9089bfe795","source":"skills_sh","sourceId":"github/awesome-copilot/dotnet-best-practices","sourceUrl":"https://skills.sh/github/awesome-copilot/dotnet-best-practices","isPrimary":true,"firstSeenAt":"2026-04-18T20:25:03.318Z","lastSeenAt":"2026-04-22T19:40:25.946Z"}],"details":{"listingId":"219e572c-f795-48d9-ac75-4a9089bfe795","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"dotnet-best-practices","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/dotnet-best-practices"},"updatedAt":"2026-04-22T19:40:25.946Z"}}