github avatar

Csharp Async

A solid code reviewer for async C# that catches the stuff that actually matters. It'll flag when you're mixing .Wait() with async code, remind you about ConfigureAwait(false) in library scenarios, and push you toward Task.WhenAll() instead of sequential awaits. The skill knows the difference between when to use ValueTask versus Task, and it won't let you get away with async void methods outside event handlers. Good for both fixing existing async code that's causing deadlocks and writing new async methods that follow TAP patterns correctly.

skills.sh installs
11.1K
GitHub stars
41K
last updated
Aug 21, 2026

Install

$ npx -y skills add github/awesome-copilot --skill csharp-async --agent claude-code

Installs into .claude/skills of the current project.

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() 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

Sponsors

Details

Repository
github.com/github/awesome-copilot
Categories
Git & Pull Requests, AI & Agent Building, .NET & C#

More from github/awesome-copilot

All 318
1github avatareditorconfiggithub/awesome-copilotGenerates a comprehensive and best-practice-oriented .editorconfig file based on project analysis and user preferences.11Kskills.sh installs
2github avatarjava-docsgithub/awesome-copilotEnsure that Java types are documented with Javadoc comments and follow best practices for documentation.10.8Kskills.sh installs
3msw-git avatarmsw-generalmsw-git/msw-ai-coding-plugins-officialFoundation skill for MSW (MapleStory Worlds). Read this FIRST before anything else in MSW.10.7Kskills.sh installs
4msw-git avatarmsw-scriptingmsw-git/msw-ai-coding-plugins-officialAuthoring MSW scripts (.mlua) plus integrated playtest and debugging. Covers mlua syntax, annotations (@Component/@Logic/@ExecSpace/@Sync), lifecycle, exec spac10.7Kskills.sh installs
5msw-git avatarmsw-defaultplayermsw-git/msw-ai-coding-plugins-officialMSW DefaultPlayer (character) management. Use the msw-general ModelBuilder to inspect/patch DefaultPlayer.model and Player.model, add/remove components, configu10.7Kskills.sh installs
6msw-git avatarmsw-searchmsw-git/msw-ai-coding-plugins-officialMSW search integration — (1) vector search for API docs and implementation guides via the msw-mcp MCP server (mlua_api_retriever / mlua_document_retriever), (2)10.7Kskills.sh installs