Audits C#/.NET async/await code for anti-patterns and concurrency bugs. Applies a checklist and rewrites code with one-line reasons. For deadlocks, async void, sync-over-async, fire-and-forget, CancellationToken issues.
Ships in TheCodeMan .NET AI ToolKit. 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.
Read when SKILL.md points to them.
Find async/await anti-patterns and concurrency bugs in C# code, then return corrected code with a one-line reason for each fix.
You don't need pasted snippets. Work directly from whatever target the user gives:
path/to/Service.cspath/to/Features/.csproj / .sln or the repo rootgit clone --depth 1 <url> /tmp/repo && cd /tmp/repoFind the async code yourself with Glob/Grep/Bash. Sweep for the anti-patterns first, e.g.:
grep -rn "\.Result\b\|\.Wait()\|GetAwaiter().GetResult()\|async void" --include=*.cs <target> | grep -vi "/obj/\|/bin/"
grep -rln "async Task" --include=*.cs <target>
On a large project, scan the files that matched the dangerous patterns first, then the broader async surface. Always report which files you scanned — and if it's clean, say so plainly instead of inventing issues. Group findings by file.
The user shares async C# (services, controllers, handlers, background workers) or a project/repo and wants it reviewed, or reports a hang/deadlock/threadpool-starvation symptom. They may give a path, folder, solution, or GitHub link — scan it yourself. Only ask for more if you need to know how an entry point is called (ASP.NET Core, console, library, UI).
.Result, .Wait(), .GetAwaiter().GetResult())Blocks a thread on an async call — deadlocks under a sync context, starves the thread pool otherwise.
await. If truly at a sync boundary you can't change, isolate it and document why.async voidExceptions can't be caught by the caller and crash the process; can't be awaited.
async void methods (except genuine event handlers).Task. For event handlers, wrap the body in try/catch and keep them thin._ = DoAsync(); or unawaited tasks swallow exceptions and may be killed when the request ends.
IHostedService, Channel<T>, a queue). Never just drop a task in request scope.CancellationTokenAsync APIs should accept and propagate a token.
CancellationToken parameter; tokens received but not passed down.CancellationToken in the action — it's bound to the request abort.ConfigureAwait(false) in library codeIn libraries, not capturing the context avoids deadlocks and is slightly faster.
ConfigureAwait(false).ConfigureAwait(false) in libraries. In ASP.NET Core app code it's unnecessary (no sync context) — don't litter it everywhere.async/await (elision vs. using)return await SomeAsync(); as the only statement with no try/using around it.return SomeAsync();) — but NOT inside using/try, where eliding changes when disposal/exception handling happens. Know the difference.Independent awaits run one after another.
awaits in sequence.await Task.WhenAll(...). Watch out: a single DbContext is NOT thread-safe — don't parallelize EF queries on one context.Task.Run to "make things async"Wrapping CPU-trivial or already-async work in Task.Run wastes a thread pool thread, especially on the server.
Task.Run around I/O or in ASP.NET request paths.Task.Run for genuine CPU-bound work offloaded from a UI thread.async lambdas passed where Action is expectedBecomes async void silently (e.g. list.ForEach(async x => ...)).
await, or Task.WhenAll(list.Select(async x => ...)).ValueTask misuseValueTask more than once, or storing it.ValueTask exactly once, immediately. Use ValueTask only on proven hot paths that often complete synchronously.async methodsThread.Sleep, blocking locks, or heavy CPU inside async methods block the pool thread.
await Task.Delay(...) instead of Thread.Sleep; SemaphoreSlim.WaitAsync() instead of lock when awaiting inside.## Summary
<headline issues and the deadlock/starvation risk, if any>
## Findings
🔴 [Sync-over-async] <where> — <why it's a bug> → <fix>
🟡 [Missing token] ... → ...
## Corrected code
<rewritten, ready to paste>
## Notes
<behavior changes, anything the caller must also update>
ConfigureAwait(false) into ASP.NET Core app code; do use it in libraries.DbContext.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
async-await, csharp, dotnet, concurrency, anti-patterns, code-review
49 skills in this plugin
/adonet-data-access-auditorAudit and fix classic ADO.NET data-access code (SqlConnection / SqlCommand / SqlDataReader / DataSet) on .NET Framework. Use this skill whenever the user shares raw ADO.NET code, a DAL / repository built on SqlCommand, stored-proc calls, string-concatenated SQL, or mentions SQL injection, parameterized queries, connection leaks, "using / Dispose", reading the same column multiple times, transactions, or "why does my old data layer leak connections / is it safe". Always use this skill for classic ADO.NET review instead of answering from memory; it applies a fixed security + correctness + performance checklist and rewrites the code./authorization-policy-generatorDesign ASP.NET Core authorization — policy-based, role-based, and claims/requirement-based with custom authorization handlers and resource-based checks. Use this skill whenever the user wants authorization policies, role/claim checks, custom AuthorizationHandler, resource-based authorization, permission checks, or asks "how do I authorize this / policy vs role / restrict this endpoint to X". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmarkdotnet-setupSet up BenchmarkDotNet for a .NET project and interpret the results — proper benchmark classes, memory diagnostics, baselines, and reading ns/op + allocations. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations, set up BenchmarkDotNet, or asks "which is faster / how do I benchmark this / interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks and explains the numbers./caching-strategy-setupAdd the right caching to a .NET app — IMemoryCache, distributed cache, or HybridCache (.NET 9+) — with correct keys, expiration, stampede protection, and invalidation. Use this skill whenever the user wants caching, to cache a query/response, IMemoryCache, Redis/distributed cache, HybridCache, output caching, or asks "how do I cache this / add caching / avoid cache stampede". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly./cicd-pipeline-generatorGenerate a CI/CD pipeline for a .NET app — GitHub Actions or Azure DevOps — with restore, build, test, coverage, vulnerability scan, container build, and deploy stages. Use this skill whenever the user wants a CI/CD pipeline, GitHub Actions workflow, Azure DevOps YAML, build/test automation, a release pipeline, or asks "how do I set up CI / pipeline for .NET / automate build and deploy". Always use this skill for CI/CD requests; it generates a complete, sensible pipeline./clean-architecture-scaffolderScaffold a .NET solution using Clean Architecture or Vertical Slice Architecture. Use this skill whenever the user wants to start a new .NET project/solution, structure an existing one, add a new feature/use-case/slice, set up layers (Domain, Application, Infrastructure, API), wire up CQRS/MediatR, or asks "how should I structure my .NET project" / "scaffold a clean architecture solution". Always use this skill for .NET project-structure and scaffolding requests; it generates a consistent folder layout, project references, and a working sample feature rather than prose advice./dotnet-ai-toolkit:async-await-auditorfrom TheCodeMan .NET AI ToolKit
npx claudepluginhub stefanthecode/dotnet-ai-toolkit --plugin dotnet-ai-toolkitOther plugins' skills for the same job