github/awesome-copilot

dotnet-best-practices

Ensure .NET/C# code meets best practices for the solution/project.

67Collecting
See how to use itView GitHub source
npx skills add https://github.com/github/awesome-copilot --skill "skills/dotnet-best-practices"

Quick start

Start using it in three steps

Install it or open the source, trigger it with a clear task, then follow the source workflow.

1

Install the Skill

npx skills add https://github.com/github/awesome-copilot --skill "skills/dotnet-best-practices"
2

Describe the task

Use dotnet-best-practices to help me with: [describe your task]. Before you begin, tell me what input you need, the steps you will follow, and the expected output.

3

Follow the workflow

No structured workflow was detected; follow the original SKILL.md below.

Continue to the workflow

Direct answers

Answers to review before you install

What is dotnet-best-practices?

Ensure . NET/C# code meets best practices for the solution/project.

Who should use dotnet-best-practices?

It is relevant to workflows involving Translation, Testing, Documentation, Engineering.

How do you install dotnet-best-practices?

SkillSignal detected this source-specific command: npx skills add https://github.com/github/awesome-copilot --skill "skills/dotnet-best-practices". Inspect the repository and command before running it.

Which Agent platforms does it support?

The upstream source does not declare a dedicated Agent platform.

What permissions or risks should you review?

No obvious permission action was detected by the static rules. This is not proof that the Skill is safe.

What are the current evidence limits?

This page combines upstream documentation with deterministic repository, quality, and static-risk signals. It is not described as a manual test or security review.

SkillSignal brief

Decide whether it fits your work first

Ensure . NET/C# code meets best practices for the solution/project.

Useful in these contexts

Not yet included in a workflow collection

Core capabilities

TranslationTestingDocumentationEngineeringDesign
Repository stars
37,126
Repository forks
4,654
Quality
67/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

67/100
Documentation16/30
Specificity11/25
Maintenance18/20
Trust signals22/25

Compare before choosing

Related Agent Skills and source variants

These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.

brand-landingpage by wshobson

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens —

ios-localization by dpearson2699

Implement, review, or improve localization and internationalization in iOS/macOS apps — String Catalogs (.xcstrings), generated localizable symbols, stable key naming, LocalizedStringKey, LocalizedStringResource, pluralization, FormatStyle for numbers/dates/measurements, right-to-left layout, Dynamic Type, and locale-aware formatting. Use when adding multi-language support, setting up String Catalogs, enabling generated symbols for compile-time-safe localization keys, handling plural forms, form

screen-recording by github

Create annotated animated GIF demos and screen recordings for pull requests and documentation. Covers frame capture, timing, imageio-based GIF creation, and per-frame annotation workflows.

create-technical-spike by github

Create time-boxed technical spike documents for researching and resolving critical development decisions before implementation.

chatgpt-apps by openai

Build, scaffold, refactor, and troubleshoot ChatGPT Apps SDK applications that combine an MCP server and widget UI. Use when Codex needs to design tools, register UI resources, wire the MCP Apps bridge or ChatGPT compatibility APIs, apply Apps SDK metadata or CSP or domain settings, or produce a docs-aligned project scaffold. Prefer a docs-first workflow by invoking the openai-docs skill or OpenAI developer docs MCP tools before generating code.

View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 2 min

.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

  • Use ResourceManager for localized messages and error strings
  • Separate LogMessages and ErrorMessages resource files
  • Access resources via _resourceManager.GetString("MessageKey")

Async/Await Patterns

  • Use async/await for all I/O operations and long-running tasks
  • Return Task or Task from async methods
  • Use ConfigureAwait(false) where appropriate
  • Handle async exceptions properly

Testing Standards

  • Use MSTest framework with FluentAssertions for assertions
  • Follow AAA pattern (Arrange, Act, Assert)
  • Use Moq for mocking dependencies
  • Test both success and failure scenarios
  • Include null parameter validation tests

Configuration & Settings

  • Use strongly-typed configuration classes with data annotations
  • Implement validation attributes (Required, NotEmptyOrWhitespace)
  • Use IConfiguration binding for settings
  • Support appsettings.json configuration files

Semantic Kernel & AI Integration

  • Use Microsoft.SemanticKernel for AI operations
  • Implement proper kernel configuration and service registration
  • Handle AI model settings (ChatCompletion, Embedding, etc.)
  • Use structured output patterns for reliable AI responses

Error Handling & Logging

  • Use structured logging with Microsoft.Extensions.Logging
  • Include scoped logging with meaningful context
  • Throw specific exceptions with descriptive messages
  • Use try-catch blocks for expected failure scenarios

Performance & Security

  • Use C# 12+ features and .NET 8 optimizations where applicable
  • Implement proper input validation and sanitization
  • Use parameterized queries for database operations
  • Follow secure coding practices for AI/ML operations

Code Quality

  • Ensure SOLID principles compliance
  • Avoid code duplication through base classes and utilities
  • Use meaningful names that reflect domain concepts
  • Keep methods focused and cohesive
  • Implement proper disposal patterns for resources
Skill path
skills/dotnet-best-practices/SKILL.md
Commit SHA
9933dcad5be5
Repository license
MIT
Data collected