From dotnet-claude-kit
Orchestrates .NET services with Aspire: AppHost configuration, service defaults, Postgres/Redis/RabbitMQ integrations, service discovery, and dashboard for local development.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dotnet-claude-kit:aspireThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
1. **Aspire is for orchestration, not deployment** — Aspire manages your local development experience: starting services, databases, and message brokers together. Production deployment is a separate concern.
ServiceDefaults project configures OpenTelemetry, health checks, and resilience for all services in one place.// AppHost/Program.cs
var builder = DistributedApplication.CreateBuilder(args);
// Infrastructure resources
var postgres = builder.AddPostgres("postgres")
.WithPgAdmin()
.AddDatabase("myappdb");
var redis = builder.AddRedis("redis")
.WithRedisInsight();
var rabbitmq = builder.AddRabbitMQ("messaging")
.WithManagementPlugin();
// Application projects
var api = builder.AddProject<Projects.MyApp_Api>("api")
.WithReference(postgres)
.WithReference(redis)
.WithReference(rabbitmq)
.WithExternalHttpEndpoints();
var worker = builder.AddProject<Projects.MyApp_Worker>("worker")
.WithReference(postgres)
.WithReference(rabbitmq);
builder.Build().Run();
// ServiceDefaults/Extensions.cs — Standard Aspire service defaults
// Configures OpenTelemetry (metrics + tracing), health checks, service discovery, and resilience
public static class Extensions
{
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder)
{
builder.ConfigureOpenTelemetry();
builder.AddDefaultHealthChecks();
builder.Services.AddServiceDiscovery();
builder.Services.ConfigureHttpClientDefaults(http =>
{
http.AddStandardResilienceHandler();
http.AddServiceDiscovery();
});
return builder;
}
// ConfigureOpenTelemetry: adds logging, metrics (ASP.NET, HttpClient, Runtime),
// tracing (ASP.NET, HttpClient, EF Core), and OTLP exporter if configured
// AddDefaultHealthChecks: adds a "self" liveness check tagged ["live"]
}
// MyApp.Api/Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.AddServiceDefaults();
// Add Aspire integrations
builder.AddNpgsqlDbContext<AppDbContext>("myappdb");
builder.AddRedisDistributedCache("redis");
var app = builder.Build();
app.MapDefaultEndpoints(); // health check endpoints
app.Run();
// AppHost — configure service references
var orderApi = builder.AddProject<Projects.OrderApi>("order-api");
var paymentApi = builder.AddProject<Projects.PaymentApi>("payment-api")
.WithReference(orderApi); // paymentApi can discover orderApi
// In PaymentApi — use service discovery
builder.Services.AddHttpClient<OrderClient>(client =>
{
client.BaseAddress = new Uri("https+http://order-api");
});
MyApp.slnx
├── MyApp.AppHost/ # Aspire orchestrator
│ └── Program.cs
├── MyApp.ServiceDefaults/ # Shared service configuration
│ └── Extensions.cs
├── src/
│ ├── MyApp.Api/ # Web API project
│ └── MyApp.Worker/ # Background worker
└── tests/
└── MyApp.Api.Tests/
// BAD — Aspire AppHost is not a production deployment tool
// Don't try to deploy the AppHost to Kubernetes
// GOOD — Use Aspire for local dev, deploy with Docker/K8s/Azure separately
// BAD — hardcoding connection strings defeats Aspire's purpose
builder.Services.AddDbContext<AppDbContext>(o =>
o.UseNpgsql("Host=localhost;Database=myapp;..."));
// GOOD — use Aspire integration (connection string injected automatically)
builder.AddNpgsqlDbContext<AppDbContext>("myappdb");
// BAD — manually configuring each service
builder.Services.AddOpenTelemetry()...
builder.Services.AddHealthChecks()...
// GOOD — use shared service defaults
builder.AddServiceDefaults();
| Scenario | Recommendation |
|---|---|
| Local dev with multiple services | Aspire AppHost |
| Single-project local dev | dotnet run is fine, Aspire optional |
| Shared service configuration | ServiceDefaults project |
| Database for local dev | Aspire AddPostgres() / AddSqlServer() |
| Service discovery | Aspire's built-in service discovery |
| Production deployment | Docker / Kubernetes / Azure Container Apps |
| Observability in local dev | Aspire dashboard (auto-configured) |
npx claudepluginhub trossitec/dotnet-claude-kit --plugin dotnet-claude-kitGuides .NET Aspire setup for cloud-native orchestration: AppHost configuration, service defaults, resource wiring, service discovery, and the Aspire dashboard.
Orchestrates cloud-native .NET distributed apps with Aspire AppHost, integrates components like Postgres/Redis/RabbitMQ, adds telemetry, service discovery, and health checks.
Using .NET Aspire. AppHost orchestration, service discovery, components, dashboard, health checks.