csharp-async
Skill0 starsChanged 2 months agoMITView on GitHub
Get best practices for C# async programming
4 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- github/awesome-copilotedited, first seen Oct 25, 2026
- itsfatduck/optimizerDuckedited, first seen Oct 8, 2026
- glennawatson/CSharpAgentSkillstheir own version, first seen Oct 1, 2026
- Adhamxon/claude-code-skillsedited, first seen Jul 30, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- github/awesome-copilot★ 41k100% same
- itsfatduck/optimizerDuck★ 11k100% same
- Adhamxon/claude-code-skills★ 2100% same
Wrote their own version · 1
- glennawatson/CSharpAgentSkills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- angular-developerSkill
- channels-setupSkill
- copilotkit-channelsSkill
- copilotkit-cliSkill
- copilotkitSkill
- csharp-docsSkill
- csharp-xunitSkill
- ef-coreSkill
- github-actions-efficiencySkill
- github-actions-hardeningSkill
- github-actions-runtime-upgrade-conventionsSkill
- inspector-docsSkill
- inspector-workbenchSkill
- intelligence-docsSkill
- microsoft-agent-frameworkSkill
- microsoft-docsSkill
- ngrx-signal-storeSkill
- prdSkill
- setup-slack-channelSkill
- technical-writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 11 are common, 0 are distinctive, and 6 are very specific to this project.
11
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 12
Use the 'Async' suffix for all async methods
- Very specific: line 19
Consider ValueTask<T> for high-performance scenarios to reduce allocations
- Very specific: line 20
Avoid returning void for async methods except for event handlers
- Common: line 24
Use try/catch blocks around await expressions
- Common: line 25
Avoid swallowing exceptions in async methods
- Very specific: line 26
Use ConfigureAwait(false) when appropriate to prevent deadlocks in library code
- Very specific: line 31
Use Task.WhenAll() for parallel execution of multiple tasks
- Very specific: line 32
Use Task.WhenAny() for implementing timeouts or taking the first completed task
- Common: line 33
Avoid unnecessary async/await when simply passing through task results
- Common: line 34
Consider cancellation tokens for long-running operations
- Very specific: line 38
Never use .Wait(), .Result, or .GetAwaiter().GetResult() in async code
- Common: line 39
Avoid mixing blocking and async code
- Common: line 40
Don't create async void methods (except for event handlers)
- Common: line 41
Always await Task-returning methods
- Common: line 46
Use async streams (IAsyncEnumerable<T>) for processing sequences asynchronously
- Common: line 47
Consider the task-based asynchronous pattern (TAP) for public APIs
- Common: line 49
When reviewing my C# code, identify these issues and suggest improvements that follow these best practices.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

