csharp-async
Get best practices for C# async programming
Best use case
csharp-async is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Get best practices for C# async programming
Teams using csharp-async should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/csharp-async/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How csharp-async Compares
| Feature / Agent | csharp-async | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Get best practices for C# async programming
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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.
Related Skills
async-api-caller
Async Api Caller - Auto-activating skill for API Integration. Triggers on: async api caller, async api caller Part of the API Integration skill category.
csharp-xunit
Get best practices for XUnit unit testing, including data-driven tests
csharp-tunit
Get best practices for TUnit unit testing, including data-driven tests
csharp-nunit
Get best practices for NUnit unit testing, including data-driven tests
csharp-mstest
Get best practices for MSTest 3.x/4.x unit testing, including modern assertion APIs and data-driven tests
csharp-mcp-server-generator
Generate a complete MCP server project in C# with tools, prompts, and proper configuration
csharp-docs
Ensure that C# types are documented with XML comments and follow best practices for documentation.
csharp-pro
Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.
async-sync-advisor
Guides users on choosing between async and sync patterns for Lambda functions, including when to use tokio, rayon, and spawn_blocking. Activates when users write Lambda handlers with mixed workloads.
async-patterns-guide
Guides users on modern async patterns including native async fn in traits, async closures, and avoiding async-trait when possible. Activates when users work with async code.
rn-async-patterns
Async/await correctness in React Native with Zustand. Use when debugging race conditions, missing awaits, floating promises, or async timing issues in Expo/React Native apps.
react-async-patterns
Async/await correctness in React with Zustand. Use when debugging race conditions, missing awaits, floating promises, or async timing issues. Works for both React web and React Native.