Skip to main content
ZICQ

Skills ZICQ category:Agent Workflows dotnet-best-practices

Dotnet Best Practices

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

15724 installs

Official URL:skills.sh

What this skill does

Intro in this page language first. The official description stays in its original wording; we do not rewrite SKILL.md.

What it does

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

When to use it

The official description does not include a separate “Use when”. Per the spec, agents activate this skill when the task matches keywords in that description.

How agents load it

Per Agent Skills progressive disclosure: name and description load at startup (~100 tokens); the full SKILL.md body loads when the skill activates; scripts/, references/, and assets/ load only as needed. This file's sections: .NET/C# Best Practices; Documentation & Structure; Design Patterns & Architecture; Dependency Injection & Services; Resource Management & Localization; Async/Await Patterns.

File analysis

File analysis: instruction-only skill (SKILL.md). The agent loads the full body when activated.

.NET/C# Best PracticesDocumentation & StructureDesign Patterns & ArchitectureDependency Injection & ServicesResource Management & LocalizationAsync/Await PatternsTesting StandardsConfiguration & SettingsSemantic Kernel & AI IntegrationError Handling & LoggingPerformance & SecurityCode Quality

Source category:skills.sh agent-skill

SKILL.md & Agent activation

Official spec ↗
name
dotnet-best-practices
description
Ensure .NET/C# code meets best practices for the solution/project.
  1. DiscoverThe client exposes names and descriptions to the agent.
  2. ActivateYour request or the task context selects the skill and loads its instructions.
  3. Load resourcesReferenced scripts, documentation and assets are used when needed.

Invocation syntax and available tools depend on your Agent client. Client integration guide ↗

Install this skill

Skills CLI ↗

Choose the target agent and installation scope, keep referenced package files, then verify the skill appears in the client's catalog.

Ask your Agent to install

Copy these instructions to a compatible agent and confirm the target directory matches your client.

Install the agent skill "dotnet-best-practices" into my project. The full SKILL.md and official description are at https://zicq.com/en/skills/skl-b4e842a5924f4035-Dotnet-Best-Practices.html
Save it as .cursor/skills/dotnet-best-practices/SKILL.md or .claude/skills/dotnet-best-practices/SKILL.md and keep the frontmatter name and description exactly as-is.

Full package on GitHub ↗

Install from the terminal · Skills CLI

Requires Node.js and npx. First inspect the repository's skill list to confirm the name.

npx skills add 'https://github.com/github/awesome-copilot' --list

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

The CLI lets you choose the agent interactively. The default scope is the project; use -g for user scope. Confirm package availability with the discovery command, then use npx skills list to inspect installed skills.

Readable layout
--- 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`) - 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

Related skills

Agent Workflows

Skill Creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that exte…

Agent Workflows

Clawdhub

Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fl…

Agent Workflows

Agent Team Orchestration

Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows. Use when: (1) Setting up a team …

Agent Workflows

Superpowers

Spec-first, TDD, subagent-driven software development workflow. Use when: (1) building any new feature or app — triggers brainstorm → plan →…