aspire-service-defaults
Agent skill fromAaronontheweb/dotnet-skills
Create a shared ServiceDefaults project for Aspire applications. Centralizes OpenTelemetry, health checks, resilience, and service discovery configuration across all services.
How to install aspire-service-defaults
install aspire-service-defaults
# install the dotnet-skills pack with the skills CLI
npx skills add Aaronontheweb/dotnet-skills# or add only this skill to Claude Code: copy the folder
skills/aspire-service-defaults/
# into
~/.claude/skills/aspire-service-defaults/ (all projects)
.claude/skills/aspire-service-defaults/ (one project)
1# Aspire Service Defaults23## When to Use This Skill45Use this skill when:6- Building Aspire-based distributed applications7- Need consistent observability (logging, tracing, metrics) across services8- Want shared health check configuration9- Configuring HttpClient resilience and service discovery1011---1213## What is ServiceDefaults?1415ServiceDefaults is a shared project that provides common configuration for all services in an Aspire application:1617- **OpenTelemetry** - Logging, tracing, and metrics18- **Health Checks** - Readiness and liveness endpoints19- **Service Discovery** - Automatic service resolution20- **HTTP Resilience** - Retry and circuit breaker policies2122Every service references this project and calls `AddServiceDefaults()`.2324---2526## Project Structure2728```29src/30 MyApp.ServiceDefaults/31 Extensions.cs32 MyApp.ServiceDefaults.csproj33 MyApp.Api/34 Program.cs # Calls AddServiceDefaults()35 MyApp.Worker/36 Program.cs # Calls AddServiceDefaults()37 MyApp.AppHost/38 Program.cs39```4041---4243## ServiceDefaults Project4445### Project File4647```xml48<Project Sdk="Microsoft.NET.Sdk">49 <PropertyGroup>50 <TargetFramework>net9.0</TargetFramework>51 <IsAspireSharedProject>true</IsAspireSharedProject>52 </PropertyGroup>5354 <ItemGroup>55 <FrameworkReference Include="Microsoft.AspNetCore.App" />56 <PackageReference Include="Microsoft.Extensions.Http.Resilience" />57 <PackageReference Include="Microsoft.Extensions.ServiceDiscovery" />58…
Excerpt shown under the repository's MIT license.
