modern-csharp

modern-csharp is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 114 tokens per session (1,373 once invoked), scanned A, original, MIT.

A guide for writing current, idiomatic C# while respecting the .NET version and language-version limits of a project.

In plain words
What is it for?
Use it when adding modern C# features, reviewing feature compatibility, or updating code across C# versions.
Why use it?
It prevents code from using language features that the project's compiler or target framework cannot support.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it when adding modern C# features, reviewing feature compatibility, or updating code across C# versions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/modern-csharp
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.

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

Made for: Claude Code, Codex.

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 modern-csharp

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/modern-csharp/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/modern-csharp)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/modern-csharp"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/modern-csharp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for modern-csharp

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/modern-csharp"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/modern-csharp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,373 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00114 $0.01373
Opus 5.5 $0.00046 $0.00549
Sonnet 5.5 $0.00023 $0.00275
Haiku 4.5 $0.00011 $0.00137

Measured 2mo ago against content hash 429200c23c77, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

modern-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 2mo 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.

catalog/Tools/Modern-CSharp/skills/modern-csharp/SKILL.md · 125 lines

How it starts

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

Modern C# for .NET

Trigger On

  • the repo wants more modern idiomatic C# code
  • a change depends on language-version compatibility
  • the team is upgrading or reviewing C# feature usage across versions
  • you need to know whether a C# 13 or C# 14 feature is safe to use

Value

  • produce a concrete project delta: code, docs, config, tests, CI, or review artifact
  • reduce ambiguity through explicit planning, verification, and final validation skills
  • leave reusable project context so future tasks are faster and safer

Do Not Use For

  • non-C# .NET languages such as F# or VB
  • analyzer-only or formatter-only setup with no language feature choice

Inputs

  • target TFM or TFMs
  • explicit LangVersion, if any
  • current SDK version
  • team style rules in .editorconfig and AGENTS.md

Quick Start

  1. Read the nearest AGENTS.md and confirm scope and constraints.
  2. Run this skill's Workflow through the Ralph Loop until outcomes are acceptable.
  3. Return the Required Result Format with concrete artifacts and verification evidence.

Workflow

  1. Detect the real language ceiling from the repo's target framework and explicit LangVersion.
  2. Prefer stable features that the current repo actually supports.
  3. Use modern syntax when it reduces ceremony, improves correctness, or makes invariants clearer.
  4. Do not mass-rewrite a codebase into newer syntax unless the repo wants that churn.
  5. Treat preview features as opt-in only. Never assume preview because the current machine has a newer SDK.
  6. Pay special attention to C# 13 and C# 14:
    • C# 13 is the stable language for .NET 9
    • C# 14 is the stable language for .NET 10
  7. When feature selection changes architecture, style rules, or generated-code patterns, coordinate with:
    • dotnet
    • analyzer-config
    • architecture
  8. After feature-driven refactors, run the repo's .NET quality pass through dotnet.

Current Upstream Notes

  • .NET runtime v10.0.11 is servicing. It should not by itself justify language-feature rewrites.
  • .NET SDK v10.0.400 is the current 10.0.4xx feature band and expands file-based app behavior, but language features still depend on the compiler selected by the repository. Do not use C# 13 or C# 14 syntax in a repo pinned to an older toolset unless it explicitly configures a compatible compiler and LangVersion.

Read the full file on GitHub · 125 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2mo ago First seen · 125 lines · 114 tokens per session scan A 429200c23c77

Subscribe to this mod's changes

modern-csharp is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 114 tokens to every session and 1,373 once invoked, about $0.0005 per session on Opus 5.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-09-03.

Related

modern-csharp compared with skills from other repositories

modern-csharp next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
modern-csharpmanagedcode/dotnet-skillsSkill52716d agoMITA114Claude Code, Codex
clean-architecture-dotnetSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A50Claude Code, Codex
creating-dotnet-mcp-serversSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A43Claude Code, Codex
dotnetAterDev/Perigon.CLISkill544d agoApache-2.0A61Claude Code, Codex
blazorAterDev/Perigon.CLISkill544d agoApache-2.0A45Claude Code, Codex
cliAterDev/Perigon.CLISkill544d agoApache-2.0A52Claude Code, Codex
codegenAterDev/Perigon.CLISkill544d agoApache-2.0A53Claude Code, Codex