csharp-async — GitHub Copilot skill: install and use
This skill guides Copilot through C# async best practices and flags common mistakes. Use it when reviewing async methods, tasks, and public APIs.
npx skills add github/awesome-copilot --skill csharp-asyncWhat csharp-async does
The skill reviews async C# against concrete rules: Async method suffixes, suitable Task and Task return types, careful use of ValueTask, and no async void outside event handlers. It also checks exception handling and suggests ConfigureAwait(false) where library code needs it.
Its guidance covers Task.WhenAll() for parallel work, Task.WhenAny() for timeouts or the first completed task, cancellation tokens for long-running operations, and cases where async/await only adds a pass-through. It flags .Wait(), .Result, .GetAwaiter().GetResult(), mixed blocking and async code, and Task-returning calls that are never awaited.
Use it for C# code review and for public APIs built around TAP, async streams with IAsyncEnumerable, or long-running commands. Install it when Copilot should apply a shared async checklist; it has no role in projects that do not use C#.
What it helps with
- check
Asyncsuffixes on methods - spot blocking
.Wait()and.Resultcalls - choose
Task.WhenAll()for concurrent tasks - catch lost exceptions in async code
- review
IAsyncEnumerableusage
Example prompts for the agent
- Review this C# code with the csharp-async rules and suggest fixes.
- Find `.Wait()`, `.Result`, and `async void` usages that should change.
- Show where `Task.WhenAll()` and a cancellation token fit here.
How to install csharp-async
1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill csharp-async2GitHub CLI
gh skill install github/awesome-copilot csharp-async3Manually: put the files in place
.github/skills/csharp-async/SKILL.md1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill csharp-async -a claude-code2Manually: put the files in place
~/.claude/skills/csharp-async/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/csharp-async/
Manually: put the files in place
.agents/skills/csharp-async/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/csharp-async/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
Platform CLI
gemini skills install https://github.com/github/awesome-copilot --path skills/csharp-asyncManually: put the files in place
.devin/skills/csharp-async/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set554
The whole set →Similar
Questions about csharp-async
How do I install csharp-async in GitHub Copilot?
Run npx skills add github/awesome-copilot --skill csharp-async, gh skill install github/awesome-copilot csharp-async, or place the skill at .github/skills/csharp-async/SKILL.md.
What does csharp-async do?
It helps Copilot review async C# code by checking return types, exception handling, awaited tasks, and common blocking calls.
Which performance patterns does csharp-async check?
It covers Task.WhenAll(), Task.WhenAny(), unnecessary async/await, ValueTask, and cancellation tokens for long-running operations.
Source text
SKILL.md · MIT
--- name: csharp-async description: 'Get best practices for C# async programming' --- # 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.
© github · MIT · github/awesome-copilot