← ClaudeAtlas

csharp-conventionslisted

Use when a ticket adds or changes C#/.NET code — ASP.NET Core services, libraries, workers — and it must follow the repo's C# conventions — the .NET coding conventions, nullable reference types on and honoured, async all the way with cancellation tokens, dependency injection through the container with correct lifetimes, records for values, IDisposable and thread safety handled, Roslyn analyzers and dotnet format clean — as the language pack for any C# change. Invoke for "add this in C#", "fix the async void", "the nullable warnings", or when reviewing a .NET diff.
tmj-90/gaffer · ★ 1 · AI & Automation · score 70
Install: claude install-skill tmj-90/gaffer
# Write idiomatic modern C# Modern C# puts nullability in the type system, values in records, and asynchrony in a first-class model with cancellation. Code that suppresses warnings, blocks on tasks, or news up its dependencies gives that back. For the builder and the reviewer of a .NET diff; the solution's config and existing code win over it. ## Procedure 1. **Discover the solution's conventions first.** Call `search_lore` for .NET conventions. Read `global.json` (SDK pin), `Directory.Build.props` and `Directory.Packages.props` (central package versions; a new or bumped package is a blocker: `mark_ticket_blocked` with the exact command a human should run), the `.csproj` (`TargetFramework`, `LangVersion`, `Nullable`, `TreatWarningsAsErrors`, `AnalysisLevel`/`AnalysisMode`, `ImplicitUsings`), `.editorconfig` (naming and diagnostic severities), `.config/dotnet-tools.json`, and the CI workflow. Identify the test framework (xUnit v2/v3, NUnit, MSTest), assertion and mocking libraries, the error policy (exceptions vs a `Result` type) and minimal APIs vs controllers. Copy a sibling class and its test. 2. **Pin the exact commands** from CI (the `run-tests` and `run-lint` skills). Use the defaults below only when the repo defines none. 3. **Write the change with the idioms below**, then walk the concurrency section for every task, disposable, shared field, `DbContext` and outbound call you touched. 4. **Test each acceptance criterion's own behaviou