Skip to main content

Csharp Language

v1.0.0New

Unsigned, install at your own risk

Unverified

This 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-language

What 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.

Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/multi-language-standards-csharp-language/SKILL.md

Setup guide →
0Save

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/TargetFrameworks sets 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 AnalysisLevel and .editorconfig severities 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 == null or != null for UnityEngine.Object-typed references; null patterns bypass the overload for destroyed objects.
  • Records: Use record to carry immutable data and value equality. Use record struct for 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? versus notnull); avoid unconstrained default for reference types.
  • Interop: Isolate unsafe, DllImport, and dynamic at a boundary with a typed wrapper.

Anti-Patterns

  • No version guessing: Do not recommend a feature by marketing name without checking LangVersion and 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 #pragma needs a reason.
  • No async void: Async work belongs to csharp-async.

Verification

  • Use the project's configured build: dotnet build -warnaserror only 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
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →

More from Multi-Language Standards

View source →
typescript-best-practicesWrite idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic.32 installscavemanUltra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.26 installsphp-securityPHP-only security standards for database access, password handling, and input validation. Use when securing PHP apps against SQL injection, XSS, or weak password storage; defer Laravel middleware and security questions in other languages.16 installscommon-security-auditProbe for hardcoded secrets, injection surfaces, unguarded routes, business logic flaws, and platform-specific weaknesses across backend (Node, Go, Java, Python, Rust), frontend (React, Angular, Vue), and mobile (iOS, Android, Flutter) codebases. Use when performing security audits, vulnerability scans, secrets detection, or penetration testing.13 installsandroid-performanceOptimize Android app startup, UI rendering, frame stability, and benchmark performance with Baseline Profiles, Macrobenchmark, and lazy initialization. Use when reducing startup time, diagnosing jank, or measuring rendering; defer Compose state API and test-only questions.10 installsnextjs-architectureStructure Next.js projects with Feature-Sliced Design layers, domain-grouped slices, and strict import hierarchy. Use when organizing features into FSD layers, enforcing slice boundaries, or keeping page.tsx thin.9 installs

More Build skills

Browse category →
senior-frontendShowcaseBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.658 installsui-design-systemShowcaseUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.562 installsfounder-consumerThe consumer panel. Spins up a swarm of buyer sub-agents (default 100, --quick for 20) trained on the user's target customer, each with a different income, age, buying behaviour and objection, shows every one the same pitch, and runs the business through 100 buyer scenarios to see who buys, who doesn't, and why. Tallies the answers into buy rates by segment, the reasons people pass in their own words, what would flip a no, and price answers for founder-pricing. Use when the user says "would people buy this", "test it on customers", "run the consumer panel", "simulate buyers", "who is my customer", or "validate demand".419 installsfrontend-designShowcaseGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.376 installssenior-backendShowcaseBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.270 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.188 installs

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.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/multi-language-standards-csharp-language)](https://skills-hub.ai/skills/multi-language-standards-csharp-language)
HTML
<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.