rules-csharp

Enforce Microsoft C# naming, formatting, and async conventions in dotnet projects.

4|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/NSObjects/specpowers --skill rules-csharp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules-csharp
Source: https://github.com/NSObjects/specpowers/tree/main/skills/rules-csharp
Command: npx skills add https://github.com/NSObjects/specpowers --skill rules-csharp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures C# development follows Microsoft naming, formatting, error handling, and async conventions rather than general guidelines, so agents produce idiomatic, maintainable C# code.

Core Features & Use Cases

  • C# overrides for naming, file layout, and formatting that inherit from rules-common but reflect Microsoft conventions.
  • Type safety, async, and resource management guidance that enforces nullable reference types, async/await best practices, IDisposable patterns, and dependency injection usage.
  • Testing and data protection advice for xUnit/NUnit styles, SQL parameter safety, and dependency injection so reviewers can catch issues before code merges.

Quick Start

Ask the assistant to apply the C# coding rules from this skill when writing or reviewing code.

Frequently Asked Questions about rules-csharp

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

FAQPage Schema
How do I enforce Microsoft C# naming and formatting conventions in my dotnet project?

You enforce Microsoft C# naming and formatting conventions by applying coding rules that override general guidelines, ensuring agents produce idiomatic and maintainable C# code. These rules cover file layout, naming, and formatting specific to Microsoft standards.

What are the best practices for async and nullable reference types in C# development?

Best practices for async and nullable reference types involve enforcing async/await conventions and nullable reference safety rules. Applying these C# coding rules ensures proper type safety, asynchronous conventions, and resource management in your dotnet projects.

How do I set up dependency injection patterns and resource cleanup policies in C#?

You set up dependency injection and resource cleanup by applying C# coding rules that enforce IDisposable patterns and DI usage. This ensures proper resource management and correct dependency injection configurations in dotnet applications.

Does this C# coding rules skill support xUnit and NUnit testing conventions?

Yes, the C# coding rules support xUnit and NUnit testing styles. The skill provides testing and data protection advice that helps reviewers catch issues related to testing conventions, SQL parameter safety, and dependency injection before code merges.

How do I prevent SQL injection in C# Entity Framework applications?

You prevent SQL injection in C# Entity Framework applications by enforcing SQL parameter safety rules. The C# coding skill includes data protection advice that ensures proper SQL parameter handling and prevents injection vulnerabilities during code generation.

Can I use these C# coding rules with a common rules base for other languages?

Yes, you can use these C# coding rules with a common rules base. The skill is designed for dotnet projects that inherit from rules-common, applying C# specific overrides for naming, formatting, and error handling while maintaining foundational coding standards.