DO

dotnet-sdk-builder

Generates idiomatic, DI-friendly .NET client libraries from APIs or classes.

Install

mkdir -p .claude/skills/dotnet-sdk-builder && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17895" && unzip -o skill.zip -d .claude/skills/dotnet-sdk-builder && rm skill.zip

Installs to .claude/skills/dotnet-sdk-builder

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Generates complete .NET SDK libraries with DI support, interfaces, typed HTTP clients, Options pattern, and typed exceptions. Use when asked to create a .NET SDK, build a .NET client library, wrap a REST API in C#, or generate a typed HTTP client. Invokes csharp-docs for XML documentation and tester for tests.
311 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Analyze C# classes or API documentation as input
  • Determine the target .NET version and project for the SDK
  • Derive service/client names from input
  • Generate required components like interfaces, implementations, and options classes

How it works

The skill analyzes input, determines .NET version and target project, derives names, asks about resilience and type handling, then generates library code following Microsoft's design guidelines, and finally documents and tests it.

Inputs & outputs

You give it
existing C# classes or API documentation
You get back
complete .NET SDK library with DI support, interfaces, and typed HTTP clients

When to use dotnet-sdk-builder

  • Create a .NET client for a REST API
  • Build a DI-friendly SDK
  • Wrap C# classes in a library

About this skill

.NET SDK Library Builder

Generate complete, production-ready .NET SDK libraries from existing C# classes or API documentation. The output follows Microsoft's library design guidelines with full DI support, testability via interfaces, and idiomatic C# patterns.

Workflow Overview

Follow these steps in order. See the reference files for detailed guidance on each phase.

Step 1: Analyze Input

Determine what the input is:

  • Existing C# classes: Read and understand the public API surface, method signatures, and responsibilities.
  • Documentation (OpenAPI, Swagger JSON/YAML, Markdown): Parse endpoints, request/response models, authentication, and error responses.

Step 2: Determine .NET Version

  1. Find all .csproj files in the solution.
  2. Extract the <TargetFramework> (or <TargetFrameworks>) value.
  3. If all projects use the same version → use that version.
  4. If versions differ → ask the user which version to target.
  5. Enable nullable reference types based on version:
    • New project: add <Nullable>enable</Nullable> to .csproj.
    • Existing project with nullable disabled: add #pragma warning disable CS8600 / #nullable enable per source file, not globally.

Step 3: Determine Target Project

  1. If the user specified a project → use it.
  2. If no project specified → scan the solution for existing library projects (.csproj with no Sdk="Microsoft.NET.Sdk.Web" and no executable output).
  3. If a candidate project is found → ask the user before adding files to it.
  4. If no suitable project exists → create a new class library project. See project-setup.md for conventions.

Step 4: Derive Names

Derive the service/client name from the input:

InputDerived Name Example
GitHubService classGitHubIGitHubClient, GitHubClient, AddGitHub(...)
PaymentsApi classPaymentsIPaymentsClient, PaymentsClient, AddPayments(...)
OpenAPI title: Stripe APIStripeIStripeClient, StripeClient, AddStripe(...)

If the name cannot be derived with confidence → ask the user.

Step 5: Ask About Resilience

Before generating HTTP client code, ask:

"Should resilience policies (retry, circuit breaker) be added to the HTTP client using Microsoft.Extensions.Http.Resilience?"

If yes → add the Polly-based resilience pipeline. See http-client-patterns.md.

Step 6: Ask About Existing Types Used as Arguments or Return Values

When wrapping existing C# classes, identify all types that appear directly as method parameters or return values in the wrapped API (e.g. classes, records, enums from the source assembly).

For each such type, ask the user once (grouped into a single question):

"The following types from the source are used directly as parameters or return values:

  • OrderRequest (argument of PlaceOrder)
  • ProductDto (return value of GetProduct)
  • ...

Should these types be passed through as-is (reused from the source), or should new equivalents be generated in the SDK library?"

Options and consequences:

ChoiceWhen to recommendWhat to generate
Pass throughSource types are already in a shared/public assembly that consumers will referenceNo new model code; use source types directly in the interface and implementation
Generate new typesSource types are internal, in a non-distributable assembly, or consumers should not depend on the source projectNew model classes/records in Models/; add mapping logic between source and SDK types in the implementation

If the user chooses to generate new types, apply the same conventions as for response DTOs (see http-client-patterns.md). Add a private mapping method or a XxxMapper internal class to the implementation to convert between the source type and the SDK type.

Step 7: Generate Library Code

Generate all components. See di-patterns.md and http-client-patterns.md for full patterns.

Required components:

ComponentDescription
IXxxClient interfacePublic contract for DI and testing
XxxClient implementationConcrete HTTP client using IHttpClientFactory
XxxOptions classConfiguration via Options pattern
XxxServiceCollectionExtensionsAddXxx(...) extension method
XxxException (+ subtypes)Typed exceptions with diagnostic properties
Model classesRequest/response DTOs

NuGet packages to add:

<PackageReference Include="Microsoft.Extensions.Http" Version="*" />
<PackageReference Include="Microsoft.Extensions.Options" Version="*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="*" />
<!-- If resilience requested: -->
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="*" />

Always use the latest stable, compatible with target framework version. Always use skill 'nuget-manager' for managing NuGet packages and package versions.

Step 8: Document the Code

After generating all source files, invoke the csharp-docs skill to add XML documentation comments to all public types and members.

Step 9: Write Tests

After documentation is complete, invoke the tester skill to generate unit and integration tests for the library.

Key Design Principles

  • Interface-first: Every public service class must have a corresponding interface.
  • Options pattern: Configuration always via IOptions<XxxOptions>, never constructor parameters for config values.
  • IHttpClientFactory: Never inject HttpClient directly; always use the named/typed factory pattern.
  • Typed exceptions: HTTP errors become typed exceptions with status code, reason, and response body properties.
  • Nullable: Follow the project's nullable settings (see Step 2).
  • No static state: All state via DI; no singleton anti-patterns.

Additional Resources

When not to use it

  • When the user does not want to create a .NET SDK
  • When the input is not C# classes or API documentation
  • When the goal is not to follow Microsoft's library design guidelines

Limitations

  • Requires input to be C# classes or API documentation
  • Follows Microsoft's library design guidelines
  • Requires `csharp-docs` and `tester` skills for full workflow

How it compares

This skill automates the creation of a production-ready .NET SDK library with standard design patterns and documentation, significantly reducing manual effort and ensuring consistency compared to hand-coding.

Compared to similar skills

dotnet-sdk-builder side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
dotnet-sdk-builder (this skill)03moNo flagsAdvanced
csharp-developer432moNo flagsAdvanced
csharp-pro93moNo flagsIntermediate
dotnet-backend-patterns74moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

csharp-developer

zenobi-us

Expert C# developer specializing in modern .NET development, ASP.NET Core, and cloud-native applications. Masters C# 12 features, Blazor, and cross-platform development with emphasis on performance and clean architecture.

43151

csharp-pro

sickn33

Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.

953

dotnet-backend-patterns

wshobson

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.

722

azure-servicebus-dotnet

microsoft

Azure Service Bus SDK for .NET. Enterprise messaging with queues, topics, subscriptions, and sessions. Use for reliable message delivery, pub/sub patterns, dead letter handling, and background processing. Triggers: "Service Bus", "ServiceBusClient", "ServiceBusSender", "ServiceBusReceiver", "ServiceBusProcessor", "message queue", "pub/sub .NET", "dead letter queue".

316

update-roslyn-version

dotnet

Guide for updating the Roslyn language server version in the vscode-csharp repository. Use this when asked to update Roslyn, bump the Roslyn version, or upgrade the language server version.

211

azure-ai-openai-dotnet

microsoft

Azure OpenAI SDK for .NET. Client library for Azure OpenAI and OpenAI services. Use for chat completions, embeddings, image generation, audio transcription, and assistants. Triggers: "Azure OpenAI", "AzureOpenAIClient", "ChatClient", "chat completions .NET", "GPT-4", "embeddings", "DALL-E", "Whisper", "OpenAI .NET".

13

Search skills

Search the agent skills registry