Tooluck logoTooluck
SKILL.md

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)

skills/aspire-service-defaults/SKILL.md

MITFull file
1# Aspire Service Defaults
2
3## When to Use This Skill
4
5Use this skill when:
6- Building Aspire-based distributed applications
7- Need consistent observability (logging, tracing, metrics) across services
8- Want shared health check configuration
9- Configuring HttpClient resilience and service discovery
10
11---
12
13## What is ServiceDefaults?
14
15ServiceDefaults is a shared project that provides common configuration for all services in an Aspire application:
16
17- **OpenTelemetry** - Logging, tracing, and metrics
18- **Health Checks** - Readiness and liveness endpoints
19- **Service Discovery** - Automatic service resolution
20- **HTTP Resilience** - Retry and circuit breaker policies
21
22Every service references this project and calls `AddServiceDefaults()`.
23
24---
25
26## Project Structure
27
28```
29src/
30 MyApp.ServiceDefaults/
31 Extensions.cs
32 MyApp.ServiceDefaults.csproj
33 MyApp.Api/
34 Program.cs # Calls AddServiceDefaults()
35 MyApp.Worker/
36 Program.cs # Calls AddServiceDefaults()
37 MyApp.AppHost/
38 Program.cs
39```
40
41---
42
43## ServiceDefaults Project
44
45### Project File
46
47```xml
48<Project Sdk="Microsoft.NET.Sdk">
49 <PropertyGroup>
50 <TargetFramework>net9.0</TargetFramework>
51 <IsAspireSharedProject>true</IsAspireSharedProject>
52 </PropertyGroup>
53
54 <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.

More skills in dotnet-skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates