csharp-best-practices

Provide C# 14/.NET 10 coding conventions and performance guidance for Minecraft Console Client.

2.1k|471|Updated Jul 18, 2013
One-click install
npx skills add https://github.com/MCCTeam/Minecraft-Console-Client --skill csharp-best-practices-mccteam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-best-practices
Source: https://github.com/MCCTeam/Minecraft-Console-Client/tree/main/.skills/csharp-best-practices
Command: npx skills add https://github.com/MCCTeam/Minecraft-Console-Client --skill csharp-best-practices-mccteam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many contributions to the Minecraft Console Client can diverge in style, misuse modern C# features, or introduce avoidable performance and nullability issues; this guide consolidates C# 14 / .NET 10 conventions, idioms, and performance patterns to make code more consistent, safe, and efficient.

Core Features & Use Cases

  • Naming & Style: Clear rules for types, members, fields, parameters, interfaces, and async naming to standardize repository-wide code style.
  • Language Features: Recommendations for C# 14/C# 13/C# 12 features (extension blocks, field keyword, primary constructors, collection expressions) and when to prefer them.
  • Performance & Safety: Guidance on span-based parsing, ArrayPool/stackalloc, FrozenDictionary/FrozenSet, async/cancellation propagation, proper nullable handling, and exception/resource patterns; ideal for writing new modules, reviewing PRs, or refactoring hot paths.

Quick Start

Ask the skill to review a C# file or PR and list specific edits to align it with the project's .NET 10/C# 14 conventions, nullability rules, and performance recommendations.

Frequently Asked Questions about csharp-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review a C# PR for .NET 10 coding conventions and nullability issues?

To review a C# PR for .NET 10 coding conventions, you can use this skill to analyze the code and list specific edits required to align with project rules for naming, nullability, and performance best practices.

What is the best way to optimize hot paths in C# 14 using zero-allocation patterns?

The best way to optimize hot paths in C# 14 is by applying zero-allocation patterns using Span, stackalloc, and ArrayPool, which this skill recommends to minimize memory overhead and improve execution efficiency.

How do I enforce nullable reference types and async cancellation propagation in C# code?

To enforce nullable reference types and async cancellation propagation in C# code, apply the idiomatic guidance provided by this skill to ensure proper null handling and correct cancellation token forwarding across asynchronous operations.

When should I use C# 14 collection expressions and primary constructors in .NET 10?

You should use C# 14 collection expressions and primary constructors in .NET 10 when writing new modules or refactoring, following the language feature recommendations this skill provides for cleaner and more idiomatic code structure.

Does this C# best practices guide cover FrozenDictionary and exception handling patterns?

Yes, this C# best practices guide covers FrozenDictionary and FrozenSet for performance, alongside idiomatic exception and resource handling patterns to ensure safe and efficient resource management.

Are these C# coding conventions applicable to projects outside the Minecraft Console Client codebase?

These C# coding conventions are tailored for the Minecraft Console Client codebase, but the C# 14 and .NET 10 performance, nullability, and naming guidance is broadly applicable to any modern C# project seeking safe, performant code.