csharp

Enforce C# conventions, patterns, and dotnet CLI tooling across projects.

Updated Jun 9, 2017
One-click install
npx skills add https://github.com/dixonwille/.dotfiles --skill csharp-dixonwille
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp
Source: https://github.com/dixonwille/.dotfiles/tree/main/claude/.claude/skills/csharp
Command: npx skills add https://github.com/dixonwille/.dotfiles --skill csharp-dixonwille

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

C# conventions, patterns, and tooling are often inconsistently applied across projects, leading to maintenance headaches and onboarding delays. This skill standardizes how C# code should be documented, structured, and tested, reducing friction and improving code quality. It also provides a ready-to-use set of guidelines for teams adopting .NET practices.

Core Features & Use Cases

  • Documentation comments: Use XML doc comments to document public APIs and behavior.
  • Testing and quality: Emphasizes xUnit or similar testing patterns and test organization.
  • Dotnet tooling: Provides guidance on common commands like dotnet build, dotnet test, and dotnet format.
  • Design patterns: Encourages Dependency Injection, IOptions<T>, ILogger<T>, and Async/await with CancellationToken for robust, maintainable code.
  • Use Case: Apply these conventions when starting a new C# project or refactoring an existing codebase to improve consistency and maintainability.

Quick Start

Apply these conventions to initialize and align a C# project for consistent code quality and tooling.

Frequently Asked Questions about csharp

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

FAQPage Schema
How do I standardize C# conventions across multiple .NET projects?

To standardize C# conventions across multiple .NET projects, apply consistent guidelines for XML documentation comments, dependency injection via constructors, and xUnit testing patterns. This reduces maintenance friction and improves overall code quality and team onboarding.

What is the best way to structure async await calls in C#?

The best way to structure async await calls in C# is to consistently pass a CancellationToken through your asynchronous methods. This pattern ensures robust, maintainable code that can gracefully handle task cancellation and prevents hanging requests.

How do I document public APIs in C# for better maintainability?

To document public APIs in C#, use XML doc comments to describe behavior and parameters across your codebase. This standardizes documentation practices, reducing onboarding delays and maintenance headaches for development teams.

Can I use dotnet CLI commands to enforce code formatting and testing?

Yes, you can use dotnet CLI commands to enforce code formatting and testing. Running dotnet format, dotnet build, and dotnet test applies consistent tooling guidelines and quality checks across both new and existing C# codebases.

Do I need dependency injection for IOptions and ILogger in C#?

Yes, you need dependency injection to properly utilize IOptions<T> and ILogger<T> in C#. Injecting these services via constructors enforces robust design patterns and ensures your application maintains reliable, maintainable code structure.