/csharp:csharpfrom csharp
Writes, reviews, refactors and debugs C# and .NET code (types, nullable references, async and cancellation, exceptions, DI, options and logging in the generic host, file-based apps). Use for work in *.cs or *.csx files, "review this C# class", CS86xx nullable warnings, CA or IDE warnings and .editorconfig severity, a deadlock or sync-over-async bug, or a rename across a solution. Not for Godot C# (godot-csharp).
Ships in csharp. 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.
Keep the observable contract (public API, exceptions, nullability annotations, threading and cancellation behavior, serialized names) unless the request changes it.
Not for: MSBuild and build failures (msbuild), package versions (nuget), tests and dotnet test (dotnet-testing), TFM upgrades, SDK-style conversion and AOT readiness (dotnet-upgrade-guide), ASP.NET Core endpoints (aspnet-core), Blazor (blazor), EF Core (ef-core), hot-path tuning and benchmarks (dotnet-diagnostics), analyzers and source generators (roslyn-analyzers).
global.json, Directory.Build.props/.targets, the project file (TargetFramework(s), LangVersion, Nullable, ImplicitUsings, TreatWarningsAsErrors, AnalysisLevel), and .editorconfig. Run dotnet --version from the repo root.LangVersion, the TFM or the SDK unless asked. A multi-targeted project is limited by its oldest TFM; netstandard2.0 and .NET Framework also lack newer BCL APIs.search_graph, trace_path, get_code_snippet), then the C# language server (csharp-ls) through the LSP tool, then Grep. Before changing a member, list its references; include every partial declaration and edit generator inputs, never *.g.cs output.resolve-library-id then query-docs, or Microsoft Learn).build.sh, CI). Reproduce with the narrowest one.global.json doesn't resolve.private, then internal, then public. Seal classes not designed for inheritance. Treat every public member as a compatibility promise.readonly record struct for small values. Records give value equality, so don't put mutable collections or entities in them.required and init for objects that must be fully initialized; primary constructors for injected dependencies (their parameters are mutable captures, so assign to readonly fields when that matters).[], [..a, ..b]) and pattern matching (is, switch expressions, list patterns) where the language version allows. Return IReadOnlyList<T> or IEnumerable<T>, not List<T>, from public APIs._camelCase private fields, I prefix on interfaces, Async suffix on async methods, file-scoped namespaces).<Nullable>enable</Nullable>, a ? on a reference type is a promise about null; the compiler doesn't enforce it at runtime. Keep ArgumentNullException.ThrowIfNull(x) (and ArgumentException.ThrowIfNullOrWhiteSpace for strings) on public entry points.T?. Never return null! or default! behind a non-nullable signature.! only where the value is provably non-null and the compiler can't see it, with a comment. Prefer [NotNullWhen], [MemberNotNull] and similar attributes over ! at every call site.x.M() to x?.M(): that silently skips the call. Decide whether null is valid, then annotate or guard..Result, .Wait(), .GetAwaiter().GetResult()) in request, UI or library code; that is the classic deadlock and thread-pool starvation source. Avoid async void except event handlers.CancellationToken (last parameter, cancellationToken = default on public APIs) and pass it to every call that takes one, including Task.Delay. Check ThrowIfCancellationRequested() in long loops. Let OperationCanceledException propagate; don't log it as an error.using var cts = CancellationTokenSource.CreateLinkedTokenSource(ct); cts.CancelAfter(timeout); and pass cts.Token. If you use Task.WhenAny for a timeout, cancel the loser.ConfigureAwait(false) in library code; omit it in apps (ASP.NET Core has no sync context, UI apps need theirs).async/await only when there is no using, try or code after it.Task/Task<T>. Use ValueTask only where measured to help, and await it exactly once.await using for IAsyncDisposable; implement it when the type owns async resources.Channel<T> so errors are observed and shutdown waits for it.IHttpClientFactory or a long-lived HttpClient, never one per call. For large responses use HttpCompletionOption.ResponseHeadersRead, then stream (ReadFromJsonAsync, JsonSerializer.DeserializeAsync).await inside lock; use SemaphoreSlim.WaitAsync. On .NET 9+, System.Threading.Lock for synchronous locks.CancellationTokenSource, and exit with 130 on cancellation.ArgumentException, InvalidOperationException, KeyNotFoundException, or a domain exception); never throw or catch bare Exception except at a top-level boundary that logs and maps it.throw;, not throw ex;), or let it propagate. Use exception filters (catch (HttpRequestException e) when (e.StatusCode == ...)).TryX(out T), a result type) instead of exceptions, following the codebase's existing style.IServiceScopeFactory.CreateScope(). Keep ValidateScopes and ValidateOnBuild on in development.services.AddOptions<T>().Bind(config.GetSection(...)).ValidateDataAnnotations().ValidateOnStart(). Inject IOptions<T> (singleton, read once), IOptionsSnapshot<T> (scoped, recomputed per scope), or IOptionsMonitor<T> (singleton, change notifications) by need.logger.LogInformation("Order {OrderId} shipped", id)), never string interpolation. For hot paths use source-generated [LoggerMessage] partial methods. Never log secrets or personal data.TimeProvider (.NET 8+) instead of DateTime.Now/UtcNow, so tests can use FakeTimeProvider.appsettings.*.json; secrets from user-secrets in development and a secret store in production, never committed.dotnet build -warnaserror (or the repo's build) on the changed projects, and for every TFM of a multi-targeted project (-f net8.0), since a green default target hides breaks on another.dotnet-testing has the filter syntax for VSTest versus Microsoft.Testing.Platform), then the wider suite when a shared or public surface changed.dotnet format --verify-no-changes when the repo enforces style. Fix analyzer findings (IDE/CA) the repo enables; suppress only with a justification attribute or .editorconfig entry, never wholesale.partial, multi-targeted or reflection-reached symbols.dotnet run app.cs, #:package/#:sdk directives, and quick C# experiments without a project.global.json pinning.net11.0: new Process and System.Text.Json APIs (.NET 11 went GA on 2026-11-10).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin csharp