dotnet-csharp

dotnet-csharp is a skill for Claude Code, Codex from novotnyllc/dotnet-artisan. It costs 115 tokens per session (1,489 once invoked), scanned A, original, MIT.

A guide to writing idiomatic C# and using .NET runtime features, including language patterns, asynchronous code, dependency injection, data queries, and code quality practices.

In plain words
What is it for?
Use it when writing or reviewing C# involving async/await, LINQ, records, pattern matching, dependency injection, serialization, analyzers, concurrency, or native interoperability.
Why use it?
It collects the baseline conventions and common pitfalls needed to produce maintainable C# code across different .NET projects.

Skill for Claude CodeCodex

Part of the dotnet-artisan plugin — 9 skills, 14 agents, 2 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/novotnyllc/dotnet-artisan/dotnet-csharp
Any agent
npx skills add novotnyllc/dotnet-artisan --skill dotnet-csharp
Clone the repo
git clone --depth 1 https://github.com/novotnyllc/dotnet-artisan

Made for: Claude Code, Codex.

Or install dotnet-artisan, the plugin that ships this one along with the rest of its 9 skills, 14 agents, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dotnet-csharp

README.md
[![agentmods](https://agentmods.dev/badge/skills/novotnyllc/dotnet-artisan/dotnet-csharp.svg)](https://agentmods.dev/skills/novotnyllc/dotnet-artisan/dotnet-csharp)
Your own site
<a href="https://agentmods.dev/skills/novotnyllc/dotnet-artisan/dotnet-csharp"><img src="https://agentmods.dev/badge/skills/novotnyllc/dotnet-artisan/dotnet-csharp.svg" alt="Measured on agentmods" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,489 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00115 $0.01489
Opus 5 $0.00057 $0.00745
Sonnet 5 $0.00023 $0.00298
Haiku 4.5 $0.00012 $0.00149

Measured 5d ago against content hash 30b7e321d811, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dotnet-csharp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/dotnet-artisan/skills/dotnet-csharp/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

dotnet-csharp

Overview

C# language patterns, coding standards, and .NET runtime features for idiomatic, performant code. This consolidated skill spans 25 topic areas. Load the appropriate companion file from references/ based on the routing table below.

Always-Load Baseline

These references define correctness and quality standards that apply to all C# code — load them by default whenever producing or reviewing code, regardless of what the user asked for:

  • references/coding-standards.md — naming conventions, file layout, style rules
  • references/async-patterns.md — async/await correctness, ConfigureAwait, cancellation propagation (nearly all .NET code uses async)
  • references/solid-principles.md — SOLID, DRY, single responsibility, dependency inversion, anti-pattern detection
  • references/code-smells.md — common mistakes the agent should avoid without being told (async void, DI lifetime misuse, swallowed exceptions)
  • references/dotnet-releases.md — .NET 10/11 and C# 14/15 features, version matrix, TFM-specific code generation rules (compensates for training data cutoff)

On-Demand References

Load these when the topic matches (see Routing Table keywords):

Routing Table

Topic Keywords Description Companion File
Coding standards naming, file layout, style rules Baseline C# conventions (naming, layout, style rules) references/coding-standards.md
Async/await async, Task, ConfigureAwait, cancellation async/await, Task patterns, ConfigureAwait, cancellation references/async-patterns.md
Dependency injection DI, services, scopes, keyed, lifetimes MS DI, keyed services, scopes, decoration, lifetimes references/dependency-injection.md
Configuration Options pattern, user secrets, feature flags Options pattern, user secrets, feature flags, IOptions<T> references/configuration.md
Source generators IIncrementalGenerator, GeneratedRegex, LoggerMessage IIncrementalGenerator, GeneratedRegex, LoggerMessage, STJ references/source-generators.md
Nullable reference types annotations, migration, agent mistakes Annotation strategies, migration, agent mistakes references/nullable-reference-types.md
Serialization System.Text.Json, Protobuf, MessagePack, AOT System.Text.Json source generators, Protobuf, MessagePack references/serialization.md
Channels Channel<T>, bounded/unbounded, backpressure Channel<T>, bounded/unbounded, backpressure, drain references/channels.md
LINQ optimization IQueryable vs IEnumerable, compiled queries IQueryable vs IEnumerable, compiled queries, allocations references/linq-optimization.md
Domain modeling aggregates, value objects, domain events Aggregates, value objects, domain events, repositories references/domain-modeling.md
SOLID principles SRP, DRY, anti-patterns, compliance checks SOLID and DRY principles, C# anti-patterns, fixes references/solid-principles.md
Concurrency lock, SemaphoreSlim, Interlocked, concurrent collections lock, SemaphoreSlim, Interlocked, concurrent collections references/concurrency-patterns.md
Roslyn analyzers DiagnosticAnalyzer, CodeFixProvider, multi-version DiagnosticAnalyzer, CodeFixProvider, CodeRefactoring references/roslyn-analyzers.md
Editorconfig IDE/CA severity, AnalysisLevel, globalconfig IDE/CA severity, AnalysisLevel, globalconfig, enforcement references/editorconfig.md
File I/O FileStream, RandomAccess, FileSystemWatcher, paths FileStream, RandomAccess, FileSystemWatcher, MemoryMappedFile references/file-io.md
Native interop P/Invoke, LibraryImport, ComWrappers, marshalling P/Invoke, LibraryImport, ComWrappers, marshalling, cross-platform references/native-interop.md
Input validation .NET 10 AddValidation, FluentValidation .NET 10 AddValidation, FluentValidation, ProblemDetails references/input-validation.md
Validation patterns DataAnnotations, IValidatableObject, IValidateOptions DataAnnotations, IValidatableObject, IValidateOptions<T> references/validation-patterns.md
Modern patterns records, pattern matching, primary constructors Records, pattern matching, primary constructors, C# 12-15 references/modern-patterns.md
API design naming, parameter ordering, return types, extensions Naming, parameter ordering, return types, error patterns references/api-design.md
Type design/perf struct vs class, sealed, Span/Memory, collections struct vs class, sealed, Span/Memory, collections references/type-design-performance.md
Code smells anti-patterns, async misuse, DI mistakes, fixes Anti-patterns, async misuse, DI mistakes, fixes references/code-smells.md
.NET releases .NET 10, .NET 11, C# 14, C# 15, TFM, version, union, extension blocks, field keyword Version matrix, new features, TFM-specific code generation references/dotnet-releases.md
Globalization CultureInfo, StringComparison, TimeZoneInfo, Rune, encoding Culture-aware coding, string comparison, time zones, character processing references/globalization.md
WASM interop JSImport, JSExport, standalone WASM, wasm-experimental, browser JSImport/JSExport, standalone .NET WASM, browser APIs, WASM AOT references/wasm-interop.md

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 75 lines · 115 tokens per session scan A 30b7e321d811

Subscribe to this mod's changes

dotnet-csharp is a skill published in the GitHub repository novotnyllc/dotnet-artisan (228 stars, last pushed 17d ago), licensed MIT. It adds 115 tokens to every session and 1,489 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

dotnet-reverse

.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy MCP。不用于纯 native 二进制(走 reverse-engineering /…

zhaoxuya520/reverse-skill · 144 tokens

build-and-test

How to build and test .NET projects in the Agent Framework repository. Use this when verifying or testing changes.

microsoft/agent-framework · 26 tokens

agui-dotnet-streaming-chat

Get started with the AG-UI .NET SDK: bootstrap and run your first streaming-chat app (client + server) with the AG-UI .NET NuGet packages (AGUI.Client, AGUI.Server, AGUI.Formatting, AGUI.Abstractions). USE FOR: which packages to install and how to wire them; constructing an AGUIChatClient against an endpoint and…

ag-ui-protocol/ag-ui · 223 tokens

agui-dotnet-wire-types

Add or modify a wire/protocol type in the AG-UI .NET SDK AGUI.Abstractions package — a new event, message, or content-part type, the AOT source-gen serializer context, or a polymorphic JSON converter, keeping it AOT-safe, JSON-wire-compatible with the TypeScript reference, and PublicAPI-clean. USE FOR: adding an AG-UI…

ag-ui-protocol/ag-ui · 174 tokens

azure-mgmt-apicenter-dotnet

Azure API Center SDK for .NET. Centralized API inventory management with governance, versioning, and discovery. Use for creating API services, workspaces, APIs, versions, definitions, environments, deployments, and metadata schemas. Triggers: "API Center", "ApiCenterService", "ApiCenterWorkspace", "ApiCenterApi", "API…

microsoft/skills · 97 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

dotnet/skills · 149 tokens