Tooluck logoTooluck
SKILL.md

aspire-configuration

Agent skill fromAaronontheweb/dotnet-skills

Configure Aspire AppHost to emit explicit app config via environment variables; keep app code free of Aspire clients and service discovery.

How to install aspire-configuration

install aspire-configuration
# 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-configuration/

# into

~/.claude/skills/aspire-configuration/ (all projects)

.claude/skills/aspire-configuration/ (one project)

skills/aspire-configuration/SKILL.md

MITFull file
1# Aspire Configuration
2
3## When to Use This Skill
4
5Use this skill when:
6- Wiring AppHost resources to application configuration in Aspire-based repos
7- Ensuring production configuration is transparent and portable outside of Aspire
8- Avoiding Aspire client/service-discovery packages inside application code
9- Designing feature toggles for dev/test without changing app code paths
10
11---
12
13## Core Principles
14
151. **AppHost owns Aspire infrastructure packages**
16 - Aspire Hosting packages belong in AppHost only.
17 - App projects should not reference Aspire client/service-discovery packages.
18
192. **Explicit configuration only**
20 - AppHost must translate resource outputs into explicit config keys (env vars).
21 - App code binds to `IOptions<T>` or `Configuration` only.
22
233. **Production parity and transparency**
24 - Every value injected by AppHost must be representable in production as env vars
25 or config files without Aspire.
26 - Avoid opaque service discovery and implicit configuration.
27
28---
29
30## Configuration Flow
31
32```
33AppHost resource -> WithEnvironment(...) -> app config keys -> IOptions<T> in app
34```
35
36The AppHost is responsible for turning Aspire resources into explicit app settings.
37The application never consumes Aspire clients or service discovery directly.
38
39---
40
41## AppHost Patterns (Explicit Mapping)
42
43### Example: Database + Blob Storage
44
45```csharp
46// AppHost/Program.cs
47var builder = DistributedApplication.CreateBuilder(args);
48…

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