C# coding agents require deliberate tool selection. A production-ready .NET workflow pairs modern language standards with focused execution: records and readonly record structs, nullability, pattern matching, asynchronous Task management, XML API documentation, unit and integration tests, runtime diagnostics, Native AOT compilation, native P/Invoke bindings, ASP.NET Core web endpoints, and OpenTelemetry instrumentation.
This guide curates ten primary-source skills across five verified repositories. Aaron Stannard's modern-csharp-coding-standards acts as the single universal core standards default for all C# repositories. Every other skill defines an explicit conditional boundary: activate async, testing, documentation, performance, trace collection, Native AOT trimming, unmanaged interop, web API, or observability workflows only when your project architecture demands them.
How this list was picked
Primary source verification. Every workflow is inspected directly against its repository SKILL.md file, verifying concrete prompt rules, tool calls, and conventions for AI coding agents.
Five verified maintainer sources. The catalog selects ten cards from Aaronontheweb/dotnet-skills, github/awesome-copilot, affaan-m/ecc, dotnet/skills, and openai/skills, combining core language patterns with official Microsoft diagnostic plugins.
Single universal core standard. modern-csharp-coding-standards serves as the single core baseline. It provides guidance on records, nullability, composition, performance-oriented APIs, and async/cancellation without imposing framework-specific baggage.
Explicit conditional scope. Every remaining card carries a Conditional tier label. Diagnostic, AOT, interop, web, and telemetry skills are selected only when the target framework and operational tasks require them.
Top 10 C# Skills for AI Coding Agents at a glance
A comparative index of the top picks. Click any card to navigate directly to its detailed review.
Install counts are hydrated observations from the skills.sh registry. Core and conditional labels explain how each skill should be selected.
Core Language Standards and Quality
Start with modern-csharp-coding-standards for baseline C# design guidance. The remaining cards in this group provide specialized execution for Task-based concurrency, public XML documentation, and automated test suites.
Best for: Designing maintainable, null-safe, composable, and high-performance C# APIs
modern-csharp-coding-standards focuses on practical C# design across records and readonly record structs, nullability, pattern matching, and composition. Authored by Aaron Stannard and Petabridge, it also covers Result handling, Span/Memory, asynchronous code with cancellation, and high-performance API design.
This card serves as the single universal core standards default in the C# catalog. Use it broadly when authoring, modifying, or refactoring C# source code, while loading the other cards only for their specific testing, diagnostic, runtime, or framework workflows.
Records and readonly record structs for clear data-oriented design
Nullability and pattern matching for safer, expressive code
Composition and Result handling for explicit application flow
Span/Memory, async/cancellation, and high-performance API design
Best for: Asynchronous method authoring, cancellation plumbing, and async concurrency performance
csharp-async provides specialized guidance for the Task-based Asynchronous Pattern in C#. It teaches coding agents how to structure asynchronous methods cleanly, correctly propagate CancellationToken instances through async call stacks, and select ValueTask for high-frequency methods that frequently complete synchronously.
Load this skill conditionally when working on asynchronous workflows, concurrent pipelines, background hosted services, or I/O-bound integrations. It explicitly guards against sync-over-async hazards like .Result and .GetAwaiter().GetResult() that lead to thread pool starvation and application deadlocks.
CancellationToken propagation and cooperative cancellation handling
ValueTask allocation reduction on synchronous completion paths
Deadlock prevention by avoiding sync-over-async blocking calls
IAsyncEnumerable streaming for asynchronous data sequences
9.5K installs GitHub/Aaron PowellConditional · XML Documentation
Best for: Documenting public C# APIs, NuGet package libraries, and IntelliSense annotations
csharp-docs directs agents in generating accurate XML documentation comments for C# types and public members. It structures standard documentation tags including summary, param, typeparam, returns, exception, and remarks blocks so that public interfaces are thoroughly documented for consumers.
Select this skill conditionally when building public libraries, preparing NuGet packages, writing shared API contracts, or executing codebase documentation audits. It is not required during internal logic modifications where XML doc authoring is out of scope.
Standard XML documentation tags for classes, methods, and properties
Explicit exception documentation with cref type references
Generic type parameter annotations and remarks examples
IntelliSense-friendly formatting and NuGet package doc generation
Best for: Writing maintainable xUnit unit and integration tests, parameterizing cases, and asserting behavior
csharp-testing is an xUnit-centered workflow for .NET unit and integration tests. It guides clean Arrange-Act-Assert structures, parameterized test cases, and expressive assertion chains with FluentAssertions, alongside test doubles using NSubstitute or Moq.
Activate this skill conditionally when writing tests, validating bug fixes with regression coverage, or building integration environments. It covers WebApplicationFactory, Testcontainers, and data builders while keeping tests isolated, readable, and resilient to refactoring.
xUnit-centered unit and integration test structure
Parameterized test theories for diverse scenario validation
FluentAssertions for readable and expressive test verifications
NSubstitute/Moq, WebApplicationFactory, Testcontainers, and data builders
Use these diagnostic and low-level runtime cards conditionally when scanning source for performance anti-patterns, capturing live process traces, migrating to Native AOT trimming, or invoking native unmanaged libraries.
analyzing-dotnet-performance
2.4K installs Microsoft .NET / dotnet-diagConditional · Hot-Path & .NET 8+ Target Framework Only
Best for: Static source scans for known C#/.NET performance anti-patterns
analyzing-dotnet-performance is a static C#/.NET source scan from the official Microsoft .NET diagnostics repository. It checks for known performance anti-patterns across async code, allocations, strings, LINQ, regex, and I/O operations.
Use this card conditionally during source review and refactoring to find those known patterns. It is not algorithmic complexity analysis or runtime profiling, so use dotnet-trace-collect for investigation of a running process.
Static scan for known C#/.NET performance anti-patterns
Async and allocation pattern checks
String, LINQ, regex, and I/O pattern checks
Explicitly separate from algorithmic complexity analysis and runtime profiling
Best for: Diagnosing live production or staging process hangs, CPU spikes, and GC stalls across platforms
dotnet-trace-collect provides command recipes and procedures for collecting diagnostic traces from running .NET applications using the dotnet-trace CLI tool. It guides process discovery, provider configuration (such as EventPipe CPU sampling and GC events), trace duration management, and export into Speedscope or Chromium trace formats.
Select this skill conditionally when investigating active runtime issues, CPU spikes, or deadlocks in environments where diagnostic tools can be executed. Because it requires process-level access, it is a runtime operations workflow rather than a static source code authoring skill.
dotnet-trace command synthesis for live process inspection
EventPipe provider selection for CPU and runtime event capture
Cross-platform trace output generation for Speedscope and PerfView
Low-overhead collection suitable for production troubleshooting
1.6K installs Microsoft .NET / dotnet-upgradeConditional · Modern .NET (.NET 8+) & Native AOT/Trimming Only
Best for: Preparing .NET 8+ applications for Native AOT publishing, trimming, and small container images
dotnet-aot-compat assists in adapting .NET applications for Native Ahead-Of-Time (AOT) compilation and IL trimming. It guides agents in identifying and fixing IL2026 and IL3050 warnings, replacing dynamic reflection with compile-time C# source generators, and configuring System.Text.Json source generation.
Load this skill conditionally when targeting Native AOT deployments, building lightweight container images, or optimizing cold-start latency on .NET 8+. It is not required for standard JIT-compiled applications that do not enable trimming.
Trimming and Native AOT warning diagnosis and resolution
Source generator adoption for JSON serialization and dependency injection
Type annotations with DynamicallyAccessedMembers and RequiresUnreferencedCode
Publish verification and container binary footprint minimization
Best for: Calling C/C++ native libraries and operating system APIs from .NET Framework or modern .NET 7+/Native AOT
dotnet-pinvoke delivers advanced patterns for platform invocation (P/Invoke) across .NET targets. It distinguishes traditional DllImport for .NET Framework from the compile-time LibraryImport source generator for modern .NET 7+ and Native AOT scenarios, and covers custom marshaling plus safe unmanaged resource encapsulation with SafeHandle.
Use this card conditionally when integrating native C or C++ dynamic libraries, operating system APIs, or custom unmanaged drivers into a .NET solution. Pure managed C# applications do not need this interop workflow.
DllImport for .NET Framework and LibraryImport for modern .NET 7+/Native AOT
SafeHandle encapsulation for unmanaged resource lifetime safety
Custom marshallers for complex native struct and string conversions
Architecture-specific calling conventions and platform target handling
These framework cards guide web application architecture and telemetry. Load them only when building ASP.NET Core endpoints or instrumenting .NET services with OpenTelemetry.
aspnet-core
2.8K installs OpenAIConditional · ASP.NET Core Web Tier
Best for: Building REST APIs, backend microservices, and web endpoints in ASP.NET Core
aspnet-core from OpenAI provides structured architecture workflows for building web applications and backend APIs in ASP.NET Core. It guides agents through Minimal API route declarations, controller design, dependency injection service lifetime registration (Transient, Scoped, Singleton), and HTTP middleware pipeline orchestration.
Choose this skill conditionally when implementing web endpoints, REST services, or backend APIs with ASP.NET Core. It provides domain-specific expertise for web servers that goes beyond general language syntax.
Minimal APIs and controller-based routing patterns
Dependency injection service lifetime management and configuration binding
HTTP middleware pipeline construction and exception handling
Entity Framework Core integration with LINQ query optimization
2.0K installs Microsoft .NET / dotnet-aspnetcoreConditional · OpenTelemetry/.NET Observability
Best for: Exporting distributed traces and runtime metrics to OpenTelemetry collectors and monitoring backends
configuring-opentelemetry-dotnet guides the setup of standardized OpenTelemetry observability within .NET services. It covers ActivitySource tracing, Meter metrics instrumentation, built-in telemetry for ASP.NET Core and HttpClient, and OTLP exporter integration for streaming telemetry to monitoring platforms.
Load this skill conditionally when adding distributed tracing, metrics dashboards, or structured telemetry pipelines to .NET microservices. It focuses specifically on telemetry configuration rather than core business logic.
ActivitySource and Meter setup for custom application telemetry
Built-in instrumentation for ASP.NET Core, HttpClient, and SQL queries
OTLP exporter configuration for OpenTelemetry collector ingestion
Resource attribute tagging with service names and environment metadata
Select a skill by matching its purpose to your repository target framework and task boundary. Always start with the core coding standards workflow for general code construction, then load conditional cards when specific asynchronous, testing, diagnostic, compilation, or web features are required.
1.Establish core C# coding standards. Load modern-csharp-coding-standards by default across all C# projects. It instructs agents on records and readonly record structs, nullability, pattern matching, composition, Result handling, Span/Memory, async/cancellation, and high-performance API design for day-to-day feature development and refactoring.
2.Handle asynchronous tasks and documentation. Activate csharp-async when implementing asynchronous methods, ValueTask allocations, and CancellationToken propagation. Switch to csharp-docs when documenting public API contracts, NuGet packages, or class libraries with standardized XML doc tags.
3.Verify behavior with automated test suites. Use csharp-testing when authoring xUnit-centered unit or integration tests. It covers structured Arrange-Act-Assert flows, parameterized test cases, FluentAssertions, NSubstitute/Moq, WebApplicationFactory, Testcontainers, and data builders.
4.Scan performance patterns and collect runtime traces. Load analyzing-dotnet-performance for a static C#/.NET scan of known async, allocation, string, LINQ, regex, and I/O performance anti-patterns; it is not algorithmic complexity analysis or runtime profiling. When investigating live production stalls, invoke dotnet-trace-collect to capture EventPipe traces from running processes.
5.Build web APIs, Native AOT, and observability. Select aspnet-core for Minimal APIs and middleware pipelines, dotnet-aot-compat when preparing applications for Ahead-Of-Time trimming, dotnet-pinvoke for native C/C++ interop using DllImport on .NET Framework or LibraryImport on modern .NET 7+/Native AOT, and configuring-opentelemetry-dotnet to export metrics and distributed traces via OTLP.
Language standards versus runtime diagnostics
Modern C# provides high-level developer ergonomics alongside low-level memory control. General coding tasks benefit from records and readonly record structs, pattern matching, composition, Result handling, and strict nullability guidance. The standards skill also covers Span/Memory, async/cancellation, and high-performance API design.
Diagnostic and performance workflows address different operational concerns. Static performance scans identify known async, allocation, string, LINQ, regex, and I/O anti-patterns in source; they are not algorithmic complexity analysis or runtime profiling. Keeping core coding standards separated from diagnostic workflows ensures that agents use the right source review or live-trace workflow for the task.
Ahead-of-Time compilation, native interop, and observability
Modern .NET deployments increasingly target containerized cloud environments, serverless functions, and microservice architectures. Native AOT compilation and assembly trimming drastically reduce binary size and startup latency. Achieving clean AOT builds requires replacing runtime reflection with compile-time source generation for JSON serialization and dependency injection.
Similarly, native interop depends on the target framework: use DllImport for .NET Framework, while modern .NET 7+ and Native AOT scenarios can use source-generated LibraryImport to avoid runtime marshaling overhead. Pairing these compiled binaries with standardized OpenTelemetry distributed tracing and metrics gives engineering teams complete runtime visibility into microservices, database calls, and outgoing HTTP requests.
Keep C# skills visible with LazySkills
LazySkills scans installed skills across your machine, shows which coding agents can discover them, validates SKILL.md configurations, and searches the same skills.sh registry used for this catalog. Install the catalog manager to inspect and manage your .NET agent workflows with interactive terminal keybindings.
Which C# skill should I install as my default across every .NET project?
Install modern-csharp-coding-standards from Aaron Stannard and Petabridge. It is the single core C# standards default in this catalog, covering records and readonly record structs, nullability, pattern matching, composition, Result handling, Span/Memory, async/cancellation, and high-performance API design. Every other skill in this guide is conditional on a specific runtime, platform, diagnostic, or framework requirement.
How does modern-csharp-coding-standards guide C# design?
Without an explicit coding standards skill, language models can miss important C# design guidance. Loading modern-csharp-coding-standards focuses generated code on records and readonly record structs, nullability, pattern matching, composition, Result handling, Span/Memory, async/cancellation, and high-performance API design.
When should I load csharp-async instead of relying on general coding standards?
Activate csharp-async when implementing asynchronous methods, background workers, concurrent data pipelines, or cancellation flows. The skill guides agents through CancellationToken propagation, ValueTask allocation optimizations on hot paths, and avoiding sync-over-async anti-patterns like .Result or .Wait() that cause thread pool starvation and deadlocks.
How do .NET diagnostic skills differ from code authoring skills?
Code authoring skills instruct agents on design and structure during feature development. analyzing-dotnet-performance performs a static C#/.NET scan for known async, allocation, string, LINQ, regex, and I/O anti-patterns; it is not algorithmic complexity analysis or runtime profiling. dotnet-trace-collect separately guides EventPipe trace collection from running processes using the dotnet-trace CLI tool.
Can these skills help migrate applications to Native AOT and trimming?
Yes. The dotnet-aot-compat skill specifically targets Ahead-Of-Time (AOT) compilation and trimming compatibility on .NET 8+. It helps agents diagnose IL2026 and IL3050 warnings, replace runtime reflection with compile-time C# source generators (such as System.Text.Json source generation), and apply DynamicallyAccessedMembers annotations for safe assembly trimming.
How does LazySkills manage per-agent visibility and project-level C# skills?
LazySkills inspects your workspace and global configuration directories across Claude Code, Codex, Cursor, Gemini CLI, OpenCode, and Copilot. It verifies that skill files adhere to standard SKILL.md specifications, displays agent compatibility matrices, and allows you to install skills directly from skills.sh into project or global scope with interactive keybindings.