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
npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a claude-codeWhat 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
.Resultand synchronous task waiting - Pass
CancellationTokeninstances across asynchronous call chains - Stream batch query responses with
IAsyncEnumerable - Prevent unobserved exceptions originating from
async voidroutines
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-code2Manually: put the files in place
~/.claude/skills/dotnet-csharp-async-patterns/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/dotnet-csharp-async-patterns/
1Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a codex2Manually: put the files in place
.agents/skills/dotnet-csharp-async-patterns/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a cursor2Manually: put the files in place
.cursor/skills/dotnet-csharp-async-patterns/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshaddix/dotnet-skills skills/dotnet-csharp-async-patterns2Manually: put the files in place
.github/skills/dotnet-csharp-async-patterns/SKILL.md1Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a gemini-cli2Platform CLI
gemini skills install https://github.com/wshaddix/dotnet-skills --path skills/dotnet-csharp-async-patternsManually: put the files in place
.devin/skills/dotnet-csharp-async-patterns/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill dotnet-csharp-async-patterns -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.