
Csharp Async
Apply Microsoft-aligned async/await conventions while your agent writes or refactors C# services, APIs, and libraries.
Overview
csharp-async is an agent skill most often used in Build (also Ship review) that applies C# async/await best practices while you implement or refactor Task-based code.
Install
npx skills add https://github.com/github/awesome-copilot --skill csharp-asyncWhat is this skill?
- Naming and return-type rules (Async suffix, Task vs ValueTask, no async void)
- Exception handling with ConfigureAwait(false) and Task.FromException patterns
- Parallelism with Task.WhenAll/WhenAny and cancellation tokens
- Explicit anti-patterns: .Wait(), .Result, blocking on async code
- Covers naming, return types, exceptions, performance, and common-pitfalls rule groups from the SKILL.md
Adoption & trust: 9.2k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are shipping C# services but async methods hide deadlocks, swallowed exceptions, or blocking calls that only fail under load.
Who is it for?
Solo builders writing ASP.NET Core APIs, background workers, or .NET libraries who want agent output to match team-style async conventions without rereading MSDN each time.
Skip if: Greenfield projects with no C# stack, or teams that already enforce async rules solely via Roslyn analyzers and do not want conversational guidance layered on top.
When should I use this skill?
Writing or reviewing C# code that uses async/await, Task, or ValueTask.
What do I get? / Deliverables
Generated and reviewed C# async code follows consistent naming, return types, error handling, and parallelism patterns suitable for library and API code.
- Refactored async method signatures and bodies
- Inline rationale for ConfigureAwait and cancellation usage
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Async correctness is enforced during implementation of server-side C#—the canonical shelf for day-to-day coding guidance. Backend and API layers are where Task-based I/O, cancellation, and deadlock pitfalls matter most for solo builders shipping .NET services.
Where it fits
Shape new repository methods that return Task<T> with cancellation tokens for EF Core queries.
Scan a PR for .Result or .Wait() before merging a payment webhook handler.
Refactor a fire-and-forget path to propagate exceptions instead of swallowing await failures.
How it compares
Procedural async conventions in chat—not a substitute for dotnet format, analyzers, or full code-review skills.
Common Questions / FAQ
Who is csharp-async for?
Indie and solo developers using AI agents to write or review C# backend code who need consistent Task-based patterns and deadlock avoidance.
When should I use csharp-async?
During Build when adding HTTP clients, database calls, or queues; during Ship review before merging hot async paths; and when refactoring sync code to async in .NET services.
Is csharp-async safe to install?
It is read-only procedural guidance with no shell or network requirements; review the Security Audits panel on this Prism page before adding any skill from the registry.
SKILL.md
READMESKILL.md - Csharp Async
# C# Async Programming Best Practices Your goal is to help me follow best practices for asynchronous programming in C#. ## Naming Conventions - Use the 'Async' suffix for all async methods - Match method names with their synchronous counterparts when applicable (e.g., `GetDataAsync()` for `GetData()`) ## Return Types - Return `Task<T>` when the method returns a value - Return `Task` when the method doesn't return a value - Consider `ValueTask<T>` for high-performance scenarios to reduce allocations - Avoid returning `void` for async methods except for event handlers ## Exception Handling - Use try/catch blocks around await expressions - Avoid swallowing exceptions in async methods - Use `ConfigureAwait(false)` when appropriate to prevent deadlocks in library code - Propagate exceptions with `Task.FromException()` instead of throwing in async Task returning methods ## Performance - Use `Task.WhenAll()` for parallel execution of multiple tasks - Use `Task.WhenAny()` for implementing timeouts or taking the first completed task - Avoid unnecessary async/await when simply passing through task results - Consider cancellation tokens for long-running operations ## Common Pitfalls - Never use `.Wait()`, `.Result`, or `.GetAwaiter().GetResult()` in async code - Avoid mixing blocking and async code - Don't create async void methods (except for event handlers) - Always await Task-returning methods ## Implementation Patterns - Implement the async command pattern for long-running operations - Use async streams (IAsyncEnumerable<T>) for processing sequences asynchronously - Consider the task-based asynchronous pattern (TAP) for public APIs When reviewing my C# code, identify these issues and suggest improvements that follow these best practices.