csharp-async

Reviews C# code against async programming best practices and naming conventions.

Updated May 22, 2026
One-click install
npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill csharp-async-viniciuscs84
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-async
Source: https://github.com/viniciuscs84/sdd-toolkit/tree/main/skills/csharp-async
Command: npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill csharp-async-viniciuscs84

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing asynchronous C# code correctly is error-prone: developers commonly create async void methods, block on tasks with .Result, or forget the Async suffix, leading to deadlocks, swallowed exceptions, and inconsistent APIs. This Skill provides a structured checklist of async best practices so an AI assistant can review your C# code and flag violations. ## Core Features & Use Cases - Naming and Return Type Guidance: Enforces the Async suffix convention and correct use of Task, Task<T>, and ValueTask<T> return types. - Deadlock and Exception Prevention: Detects blocking calls like .Wait() and .Result, missing ConfigureAwait(false) in library code, and swallowed exceptions. - Performance Patterns: Recommends Task.WhenAll for parallelism, cancellation tokens for long-running operations, and IAsyncEnumerable<T> for async streams. - Use Case: Paste a C# service class containing data access methods and ask for a review; the Skill identifies async void handlers, missing awaits, and blocking calls, then suggests corrected implementations. ## Quick Start Review my C# code for async programming best practices and suggest improvements following the csharp-async guidelines.

Frequently Asked Questions about csharp-async

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review C# async code for best practices?

Provide your C# code and ask for an async best practices review. The review checks naming conventions, return types, exception handling, and common pitfalls like blocking calls, then suggests concrete improvements.

What return type should async C# methods use?

Return Task<T> when the method produces a value and Task when it does not. Consider ValueTask<T> for high-performance scenarios to reduce allocations, and avoid async void except for event handlers.

Why is using .Result or .Wait() dangerous in async code?

Blocking calls like .Result, .Wait(), and .GetAwaiter().GetResult() can cause deadlocks, especially in UI or ASP.NET contexts, because they block the thread while waiting for a task that may need that same thread to complete.

When should I use ConfigureAwait(false) in C#?

Use ConfigureAwait(false) in library code to prevent deadlocks by avoiding capture of the synchronization context. It is generally not needed in application-level code like ASP.NET Core controllers.

How do I run multiple async tasks in parallel in C#?

Use Task.WhenAll() to execute multiple tasks concurrently and await all results together. Use Task.WhenAny() when you need the first completed task, such as for implementing timeouts.