Official agent skill

Dotnet Best Practices

by github in github/awesome-copilot

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

OfficialMITAuto-check passedDevelopment

Install Dotnet Best Practices

skills CLI
$ npx skills add github/awesome-copilot --skill dotnet-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install github/awesome-copilot dotnet-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dotnet-best-practices .claude/skills/dotnet-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dotnet-best-practices
GitHub stars
40k
Used in
3 other repos
Token cost
~808 tokens
SKILL.md length
348 words
Files
1
Skills in repo
417
Repo updated
First seen
Licence
MIT

At a glance

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

  • Tasks that involve Design patterns
  • SKILL.md covers Documentation & Structure, Design Patterns & Architecture, Dependency Injection & Services and Resource Management &…, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Dotnet Best Practices is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Ensure .NET/C code meets best practices for the solution/project.

Its SKILL.md is about 810 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Design patterns. It works with .NET and C#. The repository describes itself as: Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot. The licence is MIT.

When your agent uses it

  • Tasks that involve Design patterns

Example prompts

  • “/dotnet-best-practices”

What it can do on your machine

Read from SKILL.md and the folder at commit 727ff2e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dotnet Best Practices loads about 808 tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 348 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~22
When it runs · the whole SKILL.md, loaded when a task matches
~808

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from github/awesome-copilot at commit 727ff2e, republished under its MIT licence (© github). 348 words, ~808 tokens.

Download SKILL.mdSave it as .claude/skills/dotnet-best-practices/SKILL.md (or your agent's skills folder).
name
dotnet-best-practices
description
Ensure .NET/C# code meets best practices for the solution/project.

.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<T> 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

© github, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/dotnet-best-practices of github/awesome-copilot.

Open the folder on GitHubat commit 727ff2e

Used in 3 other repositories

We found 4 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in github/awesome-copilot, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Dotnet Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dotnet Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dotnet Best Practices this skillgithub/awesome-copilot40k3 repos~808Automated safety check: PassMIT
GitVersion .NET DevelopmentGitTools/GitVersion3.1k—~1.7kAutomated safety check: PassMIT
Akka.Hosting Actor PatternsAaronontheweb/dotnet-skills1.2k1 repos~5kAutomated safety check: PassMIT
Dotnet Patternsaffaan-m/ECC274k1 repos~2.3kAutomated safety check: PassMIT
Dotnet Backend Patternswshobson/agents40k7 repos~6.6kAutomated safety check: PassMIT
Maui Data Bindingdotnet/skills5.6k1 repos~3.7kAutomated safety check: PassMIT

Similar skills

  • GitVersion .NET Development

    GitTools/GitVersion

    Gives repository-specific .NET guidance for GitVersion: build and test commands, central package management, project layout and coding conventions.

    3.1k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Akka.Hosting Actor Patterns

    Aaronontheweb/dotnet-skills

    Shows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production.

    1.2k GitHub starsUsed in 1 repo~5k tokens
    DevelopmentAuto-check passed
  • Dotnet Patterns

    affaan-m/ECC

    Idiomatic C and .NET patterns, conventions, dependency injection, async/await, and best practices for building robust, maintainable .NET applications.

    274k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Master C/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications.

    40k GitHub starsUsed in 7 repos~6.6k tokens
    Backend & APIsAuto-check passed
  • Maui Data Binding

    dotnet/skills

    Official

    Guidance for .NET MAUI XAML and C data bindings — compiled bindings, INotifyPropertyChanged / ObservableObject, value converters, binding modes, multi-binding, relative bindings, fallbacks, and MVVM…

    5.6k GitHub starsUsed in 1 repo~3.7k tokens
    MobileAuto-check passed
  • .NET Core Expert

    Jeffallan/claude-skills

    Guides building .NET 8 services with minimal APIs, clean architecture, Entity Framework Core, MediatR CQRS and JWT authentication, with build and test checks.

    12k GitHub stars~1.3k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed

More from github/awesome-copilot

All 417 skills in this repo
  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Azure Architecture Autopilot

    github/awesome-copilot

    Official

    Designs Azure infrastructure from a natural-language description, or diagrams an existing resource group, then refines the design through conversation and deploys it with Bicep.

    40k GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Draw.io Diagram Generator

    github/awesome-copilot

    Official

    Generates, edits and validates draw.io files with correct mxGraph XML, covering flowcharts, architecture, sequence, ER and UML class diagrams.

    40k GitHub starsUsed in 1 repo~4.9k tokens
    Auto-check passed
  • Credit Risk Data Cleaning

    github/awesome-copilot

    Official

    Cleans raw credit data and screens variables before loan modeling, dropping unstable, noisy or redundant features and writing an Excel report of every step.

    40k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Daily Focus Board

    github/awesome-copilot

    Official

    Builds a warm, browser-based daily focus board the user updates by talking to their agent, with Eisenhower priorities, a brain-dump box and kind not-today carryover.

    40k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Python Pypi Package Builder

    github/awesome-copilot

    Official

    End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI.

    40k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed

Works with

Categories

Questions about Dotnet Best Practices

What does Dotnet Best Practices do?

Ensure .NET/C code meets best practices for the solution/project. Dotnet Best Practices is an agent skill from github/awesome-copilot, published by the product's own GitHub organization.NET/C code meets best practices for the solution/project.

When should I use Dotnet Best Practices?

Dotnet Best Practices fits situations like: tasks that involve Design patterns.

How do I install Dotnet Best Practices in Claude Code?

Run `npx skills add github/awesome-copilot --skill dotnet-best-practices -a claude-code`. Or copy the skill folder (skills/dotnet-best-practices in github/awesome-copilot) into .claude/skills/dotnet-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Dotnet Best Practices in Codex?

Run `npx skills add github/awesome-copilot --skill dotnet-best-practices -a codex`. Or copy the skill folder (skills/dotnet-best-practices in github/awesome-copilot) into .agents/skills/dotnet-best-practices in your project. Codex loads it when a task matches its description.

Can I use Dotnet Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add github/awesome-copilot --skill dotnet-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dotnet-best-practices, .gemini/skills/dotnet-best-practices, .github/skills/dotnet-best-practices and .opencode/skills/dotnet-best-practices in your project.

What does Dotnet Best Practices need to run?

SKILL.md names no scripts, command-line tools or credentials: Dotnet Best Practices is instructions for the agent only.

Does Dotnet Best Practices access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dotnet Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dotnet Best Practices use?

Dotnet Best Practices is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dotnet Best Practices use?

About 808 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dotnet Best Practices?

Skills that share tags, products or a category with Dotnet Best Practices: GitVersion .NET Development (GitTools/GitVersion, 3.1k stars), Akka.Hosting Actor Patterns (Aaronontheweb/dotnet-skills, 1.2k stars), Dotnet Patterns (affaan-m/ECC, 274k stars) and Dotnet Backend Patterns (wshobson/agents, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dotnet Best Practices?

github (a GitHub organization, an official publisher) maintains it in github/awesome-copilot, which has 39,748 GitHub stars. The repository holds 417 skills in this directory. The repository was last updated on October 7, 2026.

Source: github/awesome-copilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.