Csharp Language
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, then copy.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install multi-language-standards-csharp-languageWhat this does: Apply modern C# standards against the project's actual SDK, target framework, and nullable settings. Use for records, nullable reference types, pattern matching, file-scoped namespaces, and language-version choices; defer async/cancellation, testing, and MSBuild configuration to their focused skills.
Manual setup by platform
Claude Code
~/.claude/skills/multi-language-standards-csharp-language/SKILL.md
Instructions
C# Language Patterns
Priority: P0 (CRITICAL)
Compatibility Preflight
For a .NET project, read Directory.Build.props and the .csproj before using a newer construct:
- SDK: honor the pinned/declared SDK and
LangVersion; "latest" means the installed SDK, not every developer's machine. - TFM:
TargetFramework/TargetFrameworkssets the runtime API floor. A syntax feature can be available while the API it calls is not. - Nullable: honor
<Nullable>enable|annotations|warnings</Nullable>; do not mix contexts in one project. - Analyzers: existing
AnalysisLeveland.editorconfigseverities decide what is an error.
If project settings cannot be read, state the assumption and choose the lowest supported TFM/language version. See Language and framework selection.
For Unity, use the Editor version in ProjectSettings/ProjectVersion.txt for syntax and the target's API Compatibility Level for runtime APIs. Neither the host SDK nor Unity-generated project files establish that floor. Use serializable fields rather than records for Unity-serialized types.
Implementation Guidelines
- Nullable intent: Enable nullable for new projects and annotate intent at every public boundary. Use
?for optional references and!only after a validated invariant; never use!to silence a genuine null path. - Unity object liveness: Use
== nullor!= nullforUnityEngine.Object-typed references; null patterns bypass the overload for destroyed objects. - Records: Use
recordto carry immutable data and value equality. Userecord structfor small values; do not use a positional record as a mutable domain entity with validation logic. - Pattern matching: Prefer switch expressions and property, positional, or list patterns over type-check chains; keep matches exhaustive and readable.
- Namespaces and usings: Use file-scoped namespaces for new files when the project already accepts them; rely on implicit usings only when the project enables them.
- Newer syntax: Use collection expressions, target-typed
new, and primary constructors only when the effective language version allows and the team has adopted them. - Generics: Constrain generics deliberately (
where T : class?versusnotnull); avoid unconstraineddefaultfor reference types. - Interop: Isolate
unsafe,DllImport, anddynamicat a boundary with a typed wrapper.
Anti-Patterns
- No version guessing: Do not recommend a feature by marketing name without checking
LangVersionand TFM. - No blanket
#nullable disable: Disable at a narrow legacy boundary and document why. - No mutable public fields: Prefer properties or records.
- No suppression spree: Fix the nullability or analyzer cause; scoped
#pragmaneeds a reason. - No
async void: Async work belongs tocsharp-async.
Verification
- Use the project's configured build:
dotnet build -warnaserroronly for .NET repositories with that policy; verify Unity scripts in the pinned Editor. - Run the focused tests that exercise changed nullability or type contracts.
References
- Language, SDK, and TFM selection
- Records, nullability, and pattern examples
Security
Reviews (0)
Related skills
Browse all →More from Multi-Language Standards
View source →More Build skills
Browse category →Frequently asked questions about csharp-language
What does the csharp-language skill do?
Apply modern C# standards against the project's actual SDK, target framework, and nullable settings. Use for records, nullable reference types, pattern matching, file-scoped namespaces, and language-version choices; defer async/cancellation, testing, and MSBuild configuration to their focused skills. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the csharp-language skill?
Run `npx @skills-hub-ai/cli install multi-language-standards-csharp-language` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/multi-language-standards-csharp-language/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does csharp-language work with?
csharp-language runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the csharp-language skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use csharp-language after installing it?
In Claude Code, type `/multi-language-standards-csharp-language` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the csharp-language skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/multi-language-standards-csharp-language)<a href="https://skills-hub.ai/skills/multi-language-standards-csharp-language"><img src="https://skills-hub.ai/api/badges/skill/multi-language-standards-csharp-language" alt="Install on Skills Hub"></a>More options in the badge docs.