csharp-async

Identify anti-patterns in C# async codebases and enforce recommended practices.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/iliasjennane/LearningAgent --skill csharp-async-iliasjennane
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-async
Source: https://github.com/iliasjennane/LearningAgent/tree/main/.agents/skills/csharp-dotnet-development/csharp-async
Command: npx skills add https://github.com/iliasjennane/LearningAgent --skill csharp-async-iliasjennane

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlines the adoption of robust asynchronous programming practices in C#, reducing deadlocks, race conditions, and maintenance overhead.

Core Features & Use Cases

  • Consistent naming: enforce Async suffix and clear method names.
  • Return type guidance: choose Task, Task<T>, or ValueTask appropriately.
  • Error handling and cancellation: promotes safe use of try/catch, ConfigureAwait(false), and cancellation tokens.
  • Performance patterns: recommends WhenAll, WhenAny, and avoiding unnecessary awaits.

Quick Start

Audit your existing async methods and apply these practices to improve reliability and performance.

Frequently Asked Questions about csharp-async

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

FAQPage Schema
How do I avoid deadlocks in C# async code?

Avoid deadlocks in C# async code by applying ConfigureAwait(false) and proper exception handling. This approach identifies anti-patterns and ensures compliance with recommended task-based APIs to prevent synchronization context blocking.

When should I use ValueTask instead of Task in C# asynchronous methods?

Use ValueTask instead of Task in C# asynchronous methods when performance optimizations are needed for frequently cached or synchronous completions. Return type guidance helps choose appropriately to reduce memory allocations and improve overall async performance.

What are the best practices for exception handling and cancellation in C# async programming?

Best practices for exception handling and cancellation in C# async programming involve promoting safe use of try/catch blocks and cancellation tokens. This ensures robust error handling and prevents unobserved task exceptions across your projects.

How do I audit existing C# async methods for common anti-patterns?

Audit existing C# async methods by checking for deviations from recommended practices in naming conventions, return types, and error handling. Identify anti-patterns across codebases to streamline maintenance and reduce potential race conditions.

Does this approach support performance optimization for Task-based APIs using WhenAll and WhenAny?

Yes, this approach supports performance optimization for Task-based APIs by recommending WhenAll and WhenAny patterns. It helps avoid unnecessary awaits and ensures safe, fast C# async code execution across your projects.