csharp-async
What it does
This AI agent helps you write C# code more efficiently and safely by following best practices for asynchronous programming. It checks your code to ensure it's fast and avoids common errors.
When to use it
- ✓When writing C# code that needs to do multiple things at once without freezing.
- ✓When you want your program to respond more quickly.
- ✓To avoid common mistakes in C# code that handles long-running operations.
Skill link
https://github.com/github/awesome-copilot/blob/main/skills/csharp-async/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Review this C# code and tell me if I'm using asynchronous programming correctly: [your C# code here]”
5 new skills a week. 1 minute to read.
How it works
The agent compares your code against a set of rules and recommendations for C# asynchronous programming. It identifies where you can improve naming, error handling, performance, and avoid common pitfalls.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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()forGetData())
Return Types
- Return
Task<T>when the method returns a value - Return
Taskwhen the method doesn't return a value - Consider
ValueTask<T>for high-performance scenarios to reduce allocations - Avoid returning
voidfor 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.
FAQ
What is asynchronous programming?
It's a way of writing code that allows your program to do other things while waiting for a time-consuming task (like fetching data from the internet) to finish, instead of just waiting idly.
Why should I use best practices?
Following best practices makes your code faster, easier to understand, less prone to bugs, and simpler to maintain by you and other programmers.
What are 'deadlocks'?
Deadlocks occur when two or more parts of your code are waiting for each other indefinitely, causing the program to freeze.
Details
Original description by the author
Get best practices for C# async programming
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #7151
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
40kHelps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
acreadiness-assess
40kEnables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
acreadiness-generate-instructions
40kHelps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
acreadiness-policy
40kEnables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.