/csharp-dotnet-development:csharp-asyncfrom csharp-dotnet-development
Reviews, designs, and fixes C# async code using Task, Task<T>, ValueTask<T>, cancellation, ConfigureAwait, async streams, and TAP conventions. Helps with deadlock fixes, async naming, and replacing .Wait()/.Result.
Ships in csharp-dotnet-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Apply Task-based asynchronous pattern rules to C# code so async APIs are correctly named, awaitable, cancellable, exception-safe, and free of sync-over-async deadlocks in async/await code.
| Concern | Rule | Example |
|---|---|---|
| Naming | Add Async suffix to async methods and match synchronous counterparts when applicable. | GetData() → GetDataAsync() |
| Returns a value | Return Task<T> by default. | Task<Customer> |
| No value | Return Task. | Task SaveAsync(...) |
| High-performance cached or frequently synchronous result | Consider ValueTask<T> only when allocation reduction is measured and callers can obey its constraints; this is a high-performance exception, not the default. | ValueTask<int> |
| Event handler | async void is allowed only for event handlers; plain void async APIs are otherwise forbidden. | async void Button_Click(...) |
| Public API style | Follow the task-based asynchronous pattern (TAP). | Accept CancellationToken for cancellable work. |
try/catch around awaited operations when you can add context, translate known exceptions, or perform cleanup; keep this as the explicit try/catch rule.throw; or return a meaningful failed Task.Task.FromException() when constructing an already-faulted Task result without running an async state machine.CancellationToken for long-running operations and pass it through to I/O APIs.ConfigureAwait(false) in library code that does not need a captured synchronization context; avoid applying it blindly in app/UI code where context may be required.| Pattern | Use when | Avoid when |
|---|---|---|
await sequentially | Later work depends on earlier results. | Independent I/O could run in parallel. |
Task.WhenAll() | Multiple independent operations should run concurrently and all must complete. | Operations must be throttled or ordered. |
Task.WhenAny() | Implement timeout, fallback, or first-success behavior. | You would abandon tasks without cancellation/observation. |
| Pass through task | The method only returns another task with no cleanup, try/catch, or transformation. | You need using, finally, exception context, or post-processing. |
IAsyncEnumerable<T> | Stream asynchronous sequences without buffering all results. | Consumers require a materialized list and data size is small. |
| Pitfall | Why it is wrong | Fix |
|---|---|---|
.Wait(), .Result, .GetAwaiter().GetResult() | Blocks threads and can deadlock under synchronization contexts. | Make the call chain async and await. |
| Mixing blocking and async code | Wastes thread-pool threads and hides deadlocks. | Use async I/O end to end. |
Unnecessary async / await | Adds a state machine without benefit. | Return the existing Task directly when safe. |
Fire-and-forget Task | Exceptions can be lost and lifetime is unclear. | Await, return, or route to a supervised background service. |
| Missing await | Work may run after the caller thinks it completed. | Always await or intentionally capture and observe the Task. |
## C# async review - <file or API>
**Status:** pass | fixes recommended | fixed | blocked
| Finding | Evidence | Recommendation |
| --- | --- | --- |
| `<deadlock/naming/return/cancellation/concurrency issue>` | `<code reference>` | `<specific async pattern>` |
### Suggested shape
```csharp
<corrected signature or representative snippet>
```
### Validation
- Build/tests: `<command and result or not run>`
Async suffix unless they are event handlers or framework-mandated names.Task<T>, Task, justified ValueTask<T>, or event-handler-only async void..Wait(), .Result, or .GetAwaiter().GetResult() remains in async call paths without a documented boundary reason.CancellationToken where appropriate.Task.WhenAll() or Task.WhenAny() only when lifetime and exception handling are correct.ConfigureAwait(false) where context capture is unnecessary.What SKILL.md sets; muted values are Claude Code's defaults
9 skills in this plugin
/aspnet-minimal-api-openapiCreate or review ASP.NET Minimal API endpoints with typed results, DTO validation, endpoint groups, filters, ProblemDetails, and OpenAPI documentation. Use this skill when asked to add Minimal APIs, document endpoints with Swagger/OpenAPI, use .NET 9 built-in OpenAPI, or design request and response types./csharp-mstestApply modern MSTest 3.x/4.x testing practices for C# projects. Use when asked to write or review MSTest unit tests, choose assertion APIs, convert ExpectedException tests, design data-driven tests, use TestContext, configure lifecycle hooks, add categories or work items, or run dotnet test for MSTest./csharp-nunitDesign, write, and review NUnit tests for .NET projects, including standard tests, data-driven tests, assertions, setup/teardown, categories, and isolation with mocks. Use this skill when the user asks for NUnit best practices, `dotnet test`, `[TestCase]`, `[TestCaseSource]`, or C# unit test structure./csharp-tunitWrite, review, or migrate C# unit tests using TUnit. Use when the user asks for TUnit best practices, .NET test project setup, TUnit assertions, lifecycle hooks, data-driven tests, parallel execution, retries, categories, or xUnit-to-TUnit migration./csharp-xunitApply xUnit best practices for C# unit tests, including test project setup, Fact and Theory structure, data-driven tests, assertions, fixtures, mocking, categorization, diagnostics, and dotnet test execution. Use when asked for xUnit guidance or to write .NET unit tests./dotnet-best-practicesReview or improve .NET and C# code against solution/project best practices for documentation, architecture, dependency injection, resources, async, tests, configuration, Semantic Kernel, logging, performance, security, SOLID, and code quality. Use when asked for .net/c# or .NET/C# best practices or cleanup.npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin csharp-dotnet-developmentOther plugins' skills for the same job