Skip to main content
skill CX Codex

dotnet-csharp-async-patterns — Claude Code skill: guide and install

dotnet-csharp-async-patterns teaches AI agents proper C# async patterns, stopping common blunders like .Result deadlocks, unhandled fire-and-forget tasks, and dropped cancellation tokens.

no license 136 installs ★ 92 updated 2026-02-27

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a claude-code
Open on GitHub

What dotnet-csharp-async-patterns does

Language models frequently introduce subtle concurrency bugs into .NET code. They block on tasks synchronously, drop incoming cancellation tokens, or spawn unmonitored async void methods that can crash an entire process. This skill supplies concrete instructions to enforce the standard async pipeline across every layer.

The rules define when to prefer ValueTask over standard tasks during high-throughput synchronous completions and how to apply IAsyncEnumerable for memory-efficient streaming. It also details parallel operations using Parallel.ForEachAsync from modern .NET runtime versions.

Using .GetAwaiter().GetResult() or .Result in ASP.NET Core controllers will exhaust the thread pool under load. Because of this, the guide strictly redirects background jobs into BackgroundService or managed worker channels.

What it helps with

  • Eliminate deadlocks caused by .Result and synchronous task waiting
  • Pass CancellationToken instances across asynchronous call chains
  • Stream batch query responses with IAsyncEnumerable
  • Prevent unobserved exceptions originating from async void routines

Example prompts for the agent

  • Refactor this repository method to accept and propagate a CancellationToken
  • Convert this cache lookup routine to return a ValueTask
  • Set up parallel processing for this list using Parallel.ForEachAsync

How to install dotnet-csharp-async-patterns

1Skills CLI (Vercel)

npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a claude-code

2Manually: put the files in place

~/.claude/skills/dotnet-csharp-async-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/dotnet-csharp-async-patterns/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about dotnet-csharp-async-patterns

How to install dotnet-csharp-async-patterns in Claude Code?

Run npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a claude-code. The file will be placed at ~/.claude/skills/dotnet-csharp-async-patterns/SKILL.md.

What does dotnet-csharp-async-patterns do?

It equips the coding agent with rules for C# asynchronous operations, covering task allocations, cancellation propagation, and background job handling.

Where does the skill advise using ConfigureAwait(false)?

Only inside standalone class libraries without a synchronization context. It is explicitly omitted in ASP.NET Core application controllers and endpoints.

Similar skills

All skills for Backend and APIs →
dotnet-patterns affaan-m dotnet-patterns is a Claude Code skill that sets C# and ASP.NET Core conventions for AI coding agents generating or refactoring code, covering dependency injection, async/await, and error handling. CX Codex +1 6,300installs csharp-async official github csharp-async — a GitHub Copilot skill that flags async pitfalls in C# and proposes fixes. It kicks in during code review, covering method signatures, exceptions, and task composition. CX Codex +1 10,883installs csharp-concurrency-patterns Aaronontheweb csharp-concurrency-patterns guides AI agents in selecting the right .NET concurrency abstractions, from async/await to Channels and Akka.NET. Useful when refactoring work queues and eliminating thread locks. CX Codex +1 1,600installs openapi-to-application-csharp-dotnet official Awesome Copilot Community openapi-to-application-csharp-dotnet is a GitHub Copilot plugin that builds .NET applications from OpenAPI specifications. It creates an ASP.NET Core scaffold and generates controllers. ★ 41,430repo stars dotnet-backend-patterns Seth Hobson dotnet-backend-patterns — a skill for C# and .NET development: patterns for async code, dependency injection, Entity Framework Core, caching, and testing. Use when building backend APIs, MCP servers, or reviewing C# code. CX Codex +1 19,076installs async-python-patterns Seth Hobson The async-python-patterns skill guides async Python work with asyncio, async/await, and concurrent tasks. Use it for APIs and applications with many I/O-bound operations. CX Codex +1 18,055installs

From the same set24

The whole set →
dotnet-winforms-basics dotnet-winforms-basics teaches coding agents how to build WinForms apps on modern .NET 8+. Helps configure dependency injection, SDK-style projects, and high-DPI scaling. CX Codex +1 295installs dotnet-csharp-code-smells dotnet-csharp-code-smells — a C# review skill: the agent catches leaked IDisposable, misused async and DI, suppressed warnings and other anti-patterns while it plans, writes or reviews code. CX Codex +1 180installs dotnet-security-owasp dotnet-security-owasp flags OWASP Top 10 vulnerabilities in .NET solutions and guides safe coding. Useful for reviewing ASP.NET Core endpoints and data queries. CX Codex +1 175installs dotnet-api-security dotnet-api-security is a Claude Code skill that handles authentication and authorization in ASP.NET Core APIs. CX Codex +1 169installs dotnet-architecture-patterns dotnet-architecture-patterns guides scalable .NET Minimal API architecture using vertical slices, route groups, endpoint filters, and structured error handling. CX Codex +1 125installs dotnet-csharp-dependency-injection dotnet-csharp-dependency-injection guides Microsoft DI in .NET, from service lifetimes and keyed registrations to decoration and hosted workers. CX Codex +1 125installs bootstrap5-ui bootstrap5-ui provides Bootstrap 5.3 layout patterns and component snippets for HTML and ASP.NET Core Razor views. CX Codex +1 122installs dotnet-performance-patterns dotnet-performance-patterns is a Claude Code skill for .NET 8+ architecture patterns that reduce allocations using Span, Memory, and ArrayPool. CX Codex +1 122installs

Project sponsors

Companies that keep this analytics open