dotnet-csharp-api-design

Guide public .NET API design with naming, parameter, and error conventions.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-csharp-api-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-csharp-api-design
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-csharp-api-design
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-csharp-api-design

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance on designing public .NET APIs that are intuitive, consistent, and forward-compatible, reducing developer friction and improving maintainability.

Core Features & Use Cases

  • Naming Conventions: Establishes clear rules for types, methods, and parameters.
  • Parameter Ordering & Overloads: Ensures consistent and predictable method signatures.
  • Return Type Selection: Guides the choice of appropriate return types for various scenarios (e.g., nullable, collections, async streams).
  • Error Handling Strategies: Defines best practices for exceptions, the Try pattern, and result objects.
  • Extensibility: Promotes design patterns that allow for future expansion without breaking changes.
  • Wire Compatibility: Addresses considerations for serialized types to ensure backward compatibility.
  • Use Case: When designing a new library, use this skill to ensure all public APIs adhere to established .NET design principles, making them easier for other developers to understand and use.

Quick Start

Follow the guidelines in this skill to design a new public API for a .NET library.

Frequently Asked Questions about dotnet-csharp-api-design

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

FAQPage Schema
What are the best practices for .NET API design regarding naming conventions and parameter ordering?

To design a public .NET API, establish clear rules for types, methods, and parameters, and ensure consistent parameter ordering and overloads to make the library intuitive and predictable for other developers to use.

How do I choose appropriate return types and error handling strategies for a C# library?

When designing C# APIs, choose appropriate return types like nullable types or async streams, and implement robust error handling strategies using exceptions, the Try pattern, or result objects based on the specific scenario.

Does this .NET API design guidance cover modern C# features and .NET 8.0+ baseline?

Yes, the guidance addresses modern C# features and uses a .NET 8.0+ baseline, ensuring your public API design principles align with current framework capabilities and standards.

How do I ensure wire compatibility for serialized types in a .NET library?

You ensure wire compatibility by addressing specific design considerations for serialized types during API creation, which guarantees backward compatibility and prevents breaking changes when data structures evolve.

When should I design extension points in a public .NET API?

You should design extension points when you want to promote design patterns that allow for future expansion of your library, enabling growth and new features without introducing breaking changes for existing consumers.