Agent skill

.NET Aspire Explicit Configuration

by Aaronontheweb in Aaronontheweb/dotnet-skills

Wires .NET Aspire AppHost resources into explicit environment-variable configuration, keeping application code free of Aspire client packages and service discovery.

MITAuto-check passedBackend & APIs

Install .NET Aspire Explicit Configuration

skills CLI
$ npx skills add Aaronontheweb/dotnet-skills --skill aspire-configuration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Aaronontheweb/dotnet-skills aspire-configuration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/aspire-configuration .claude/skills/aspire-configuration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
aspire-configuration
GitHub stars
1.2k
Used in
1 other repo
Token cost
~1.3k tokens
SKILL.md length
340 words
Files
1
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

Wires .NET Aspire AppHost resources into explicit environment-variable configuration, keeping application code free of Aspire client packages and service discovery.

  • Works in 3 steps: AppHost owns Aspire infrastructure… → Explicit configuration only → Production parity and transparency
  • Wiring a new AppHost resource into application configuration explicitly
  • SKILL.md covers When to Use This Skill, Core Principles, Configuration Flow and AppHost Patterns (Explicit…, plus 5 more sections
  • Needs MINIO_ROOT_PASSWORD

What it does

The skill's core rule is a one-way boundary: Aspire hosting packages and service discovery stay in the AppHost project, and application code only ever binds to IOptions<T> or Configuration, never referencing an Aspire client package directly. The AppHost is responsible for translating each resource, such as a database or blob storage connection, into explicit configuration keys through calls like WithEnvironment and WithReference, so every value it injects could also be set in production as a plain environment variable or config file without Aspire present at all.

Worked C# examples show an AppHost wiring a Postgres connection string and a blob storage resource into named configuration keys, and an API project reading those same keys through strongly typed options classes with no Aspire dependency. Feature toggles and test overrides follow the same pattern, driven through AppHost and test fixtures so dev, test and production configuration stay in parity rather than diverging behind implicit service discovery.

When your agent uses it

  • Wiring a new AppHost resource into application configuration explicitly
  • Removing an Aspire client or service-discovery dependency from application code
  • Setting up a feature toggle that behaves the same in dev, test and production

Example prompts

  • “Wire this new Redis resource in AppHost into explicit config keys for the API.”
  • “Remove the Aspire service-discovery package from this application project.”
  • “Add a feature toggle for disabling persistence in tests through AppHost config.”

Requirements

  • .NET with Aspire

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. AppHost owns Aspire infrastructure packages
  2. Explicit configuration only
  3. Production parity and transparency

What it can do on your machine

Read from SKILL.md and the folder at commit 46003af. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • MINIO_ROOT_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

.NET Aspire Explicit Configuration loads about 1.3k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 340 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Aaronontheweb/dotnet-skills at commit 46003af, republished under its MIT licence (© Aaronontheweb). 340 words, ~1,273 tokens.

Download SKILL.mdSave it as .claude/skills/aspire-configuration/SKILL.md (or your agent's skills folder).
name
aspire-configuration
description
Configure Aspire AppHost to emit explicit app config via environment variables; keep app code free of Aspire clients and service discovery.
user-invocable
false

Aspire Configuration

When to Use This Skill

Use this skill when:

  • Wiring AppHost resources to application configuration in Aspire-based repos
  • Ensuring production configuration is transparent and portable outside of Aspire
  • Avoiding Aspire client/service-discovery packages inside application code
  • Designing feature toggles for dev/test without changing app code paths

Core Principles

  1. AppHost owns Aspire infrastructure packages

    • Aspire Hosting packages belong in AppHost only.
    • App projects should not reference Aspire client/service-discovery packages.
  2. Explicit configuration only

    • AppHost must translate resource outputs into explicit config keys (env vars).
    • App code binds to IOptions<T> or Configuration only.
  3. Production parity and transparency

    • Every value injected by AppHost must be representable in production as env vars or config files without Aspire.
    • Avoid opaque service discovery and implicit configuration.

Configuration Flow

AppHost resource -> WithEnvironment(...) -> app config keys -> IOptions<T> in app

The AppHost is responsible for turning Aspire resources into explicit app settings. The application never consumes Aspire clients or service discovery directly.


AppHost Patterns (Explicit Mapping)

Example: Database + Blob Storage
csharp
// AppHost/Program.cs
var builder = DistributedApplication.CreateBuilder(args);

var postgres = builder.AddPostgres("postgres");
var db = postgres.AddDatabase("appdb");

var minio = builder.AddContainer("minio", "minio/minio")
    .WithArgs("server", "/data")
    .WithHttpEndpoint(targetPort: 9000, name: "http")
    .WithHttpEndpoint(targetPort: 9001, name: "console")
    .WithEnvironment("MINIO_ROOT_USER", "minioadmin")
    .WithEnvironment("MINIO_ROOT_PASSWORD", "minioadmin");

var api = builder.AddProject<Projects.MyApp_Api>("api")
    .WithReference(db, "Postgres")
    .WithEnvironment("BlobStorage__Enabled", "true")
    .WithEnvironment("BlobStorage__ServiceUrl", minio.GetEndpoint("http"))
    .WithEnvironment("BlobStorage__AccessKey", "minioadmin")
    .WithEnvironment("BlobStorage__SecretKey", "minioadmin")
    .WithEnvironment("BlobStorage__Bucket", "attachments")
    .WithEnvironment("BlobStorage__ForcePathStyle", "true");

builder.Build().Run();

Key points

  • WithReference(db, "Postgres") sets ConnectionStrings__Postgres explicitly.
  • Every external dependency is represented via explicit config keys.
  • The API project only reads Configuration values.

App Code Pattern (No Aspire Clients)

Application code binds to options and initializes SDKs directly. It never depends on Aspire client packages or service discovery.

csharp
// Api/Program.cs
builder.Services
    .AddOptions<BlobStorageOptions>()
    .BindConfiguration("BlobStorage")
    .ValidateDataAnnotations()
    .ValidateOnStart();

builder.Services.AddSingleton<IBlobStorageService>(sp =>
{
    var options = sp.GetRequiredService<IOptions<BlobStorageOptions>>().Value;
    return new S3BlobStorageService(options); // uses explicit options only
});

Do not add Aspire client packages (or AddServiceDiscovery) to the app. Those are orchestration concerns and should stay in AppHost.


Feature Toggles and Test Overrides

Keep toggles in config and drive them through AppHost and test fixtures. This maintains parity between dev/test and production configuration.

csharp
// AppHost: disable persistence in tests via config overrides
var config = builder.Configuration.GetSection("App")
    .Get<AppHostConfiguration>() ?? new AppHostConfiguration();

if (!config.UseVolumes)
{
    postgres.WithDataVolume(false);
}

api.WithEnvironment("BlobStorage__Enabled", config.EnableBlobStorage.ToString());

See skills/aspire/integration-testing/SKILL.md for patterns on passing configuration overrides into DistributedApplicationTestingBuilder.


Do / Don’t Checklist

Do

  • Map every Aspire resource output to explicit configuration keys
  • Use IOptions<T> with validation for all infrastructure settings
  • Keep AppHost as the only place that references Aspire hosting packages
  • Ensure any AppHost-injected value can be set in production env vars

Don’t

  • Reference Aspire client/service-discovery packages in application projects
  • Rely on opaque service discovery that cannot be mirrored in production
  • Hide configuration behind Aspire-only abstractions

  • skills/aspire/service-defaults/SKILL.md
  • skills/aspire/integration-testing/SKILL.md
  • skills/akka/aspire-configuration/SKILL.md

Resources

© Aaronontheweb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/aspire-configuration of Aaronontheweb/dotnet-skills.

Open the folder on GitHubat commit 46003af

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Aaronontheweb/dotnet-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

.NET Aspire Explicit Configuration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

.NET Aspire Explicit Configuration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
.NET Aspire Explicit Configuration this skillAaronontheweb/dotnet-skills1.2k1 repos~1.3kAutomated safety check: PassMIT
Generate Testability Wrappersmicrosoft/testfx1k2 repos~3.9kAutomated safety check: PassMIT
SDK Conventionsaws/aws-sdk-net147—~6.6kAutomated safety check: PassApache-2.0
Csharp Dotnetericrisco/rsc-harness180—~3.3kAutomated safety check: PassMIT
Validation Scopesatherio-danp/cde-dotnetcc109—~927Automated safety check: NotesNone
Nodejs Backend Patternsever-works/ever-works16218 repos~4kAutomated safety check: PassAGPL-3.0

Similar skills

  • Official

    DO NOT USE when the target already consumes an injected interface or built-in abstraction such as IFileSystem or TimeProvider, even if the request says "generate a wrapper"; no new wrapper is needed.

    1k GitHub starsUsed in 2 repos~3.9k tokens
    Backend & APIsAuto-check passed
  • SDK Conventions

    aws/aws-sdk-net

    Official

    The public-API contract SmithyDotNet-generated code must match against the shipping AWS SDK for .NET - what must match vs.

    147 GitHub stars~6.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Csharp Dotnet

    ericrisco/rsc-harness

    A skill your agent uses when writing, reviewing, testing, or shipping C / .NET code — ASP.NET Core APIs (minimal APIs vs controllers), EF Core data access, async correctness, solution layout in…

    180 GitHub stars~3.3k tokensUpdated today
    Backend & APIsAuto-check passed
  • Validation Scopes

    atherio-danp/cde-dotnetcc

    Place validation in the correct one of our three scopes in the .NET API — API contract (no DB), Application business via Kommand IValidator, or Domain invariants that throw.

    109 GitHub stars~927 tokensUpdated 2 mo ago
    Backend & APIsAuto-check: notes
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    162 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 1 repo~2k tokens
    Backend & APIsAuto-check passed

More from Aaronontheweb/dotnet-skills

All 35 skills in this repo
  • .NET Trimming and Native AOT

    Aaronontheweb/dotnet-skills

    Guides making .NET libraries trimming-safe and Native-AOT compatible: the MSBuild properties, trimming attributes, warning codes and a playbook of safe patterns.

    1.2k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Cscheck

    Aaronontheweb/dotnet-skills

    Write and simplify C property-based, model-based, and executable specification tests with CsCheck.

    1.2k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Akka.Hosting Actor Patterns

    Aaronontheweb/dotnet-skills

    Shows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production.

    1.2k GitHub starsUsed in 1 repo~5k tokens
    Auto-check passed
  • SDK Container Publishing

    Aaronontheweb/dotnet-skills

    Publish .NET services as container images with the built-in SDK tooling (dotnet publish /t:PublishContainer, Microsoft.NET.Build.Containers) - no Dockerfile required.

    1.2k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Akka.NET Best Practices

    Aaronontheweb/dotnet-skills

    Guidance for Akka.NET actor systems covering EventStream versus DistributedPubSub, supervision, Props versus DependencyResolver, work distribution and testable cluster code.

    1.2k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Akka.NET Management and Discovery

    Aaronontheweb/dotnet-skills

    Sets up Akka.Management and Cluster.Bootstrap so Akka.NET clusters form through service discovery on Kubernetes, Azure or config instead of static seed nodes.

    1.2k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed

Works with

Categories

Questions about .NET Aspire Explicit Configuration

What does .NET Aspire Explicit Configuration do?

Wires .NET Aspire AppHost resources into explicit environment-variable configuration, keeping application code free of Aspire client packages and service discovery. The skill's core rule is a one-way boundary: Aspire hosting packages and service discovery stay in the AppHost project, and application code only ever binds to IOptions<T> or Configuration, never referencing an Aspire client package directly. The AppHost is responsible for translating each resource, such as a database or blob storage connection, into explicit configuration keys through calls like WithEnvironment and WithReference, so every value it injects could also be set in production as a plain environment variable or config file without Aspire present at all.

When should I use .NET Aspire Explicit Configuration?

.NET Aspire Explicit Configuration fits situations like: wiring a new AppHost resource into application configuration explicitly; removing an Aspire client or service-discovery dependency from application code; setting up a feature toggle that behaves the same in dev, test and production.

How do I install .NET Aspire Explicit Configuration in Claude Code?

Run `npx skills add Aaronontheweb/dotnet-skills --skill aspire-configuration -a claude-code`. Or copy the skill folder (skills/aspire-configuration in Aaronontheweb/dotnet-skills) into .claude/skills/aspire-configuration in your project. Claude Code loads it when a task matches its description.

How do I install .NET Aspire Explicit Configuration in Codex?

Run `npx skills add Aaronontheweb/dotnet-skills --skill aspire-configuration -a codex`. Or copy the skill folder (skills/aspire-configuration in Aaronontheweb/dotnet-skills) into .agents/skills/aspire-configuration in your project. Codex loads it when a task matches its description.

Can I use .NET Aspire Explicit Configuration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Aaronontheweb/dotnet-skills --skill aspire-configuration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aspire-configuration, .gemini/skills/aspire-configuration, .github/skills/aspire-configuration and .opencode/skills/aspire-configuration in your project.

What does .NET Aspire Explicit Configuration need to run?

Going by SKILL.md and its folder, .NET Aspire Explicit Configuration needs credentials named MINIO_ROOT_PASSWORD. Our summary lists: .NET with Aspire.

Does .NET Aspire Explicit Configuration access the network?

SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is .NET Aspire Explicit Configuration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does .NET Aspire Explicit Configuration use?

.NET Aspire Explicit Configuration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does .NET Aspire Explicit Configuration use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to .NET Aspire Explicit Configuration?

Skills that share tags, products or a category with .NET Aspire Explicit Configuration: Generate Testability Wrappers (microsoft/testfx, 1k stars), SDK Conventions (aws/aws-sdk-net, 147 stars), Csharp Dotnet (ericrisco/rsc-harness, 180 stars) and Validation Scopes (atherio-danp/cde-dotnetcc, 109 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains .NET Aspire Explicit Configuration?

Aaronontheweb (a GitHub user) maintains it in Aaronontheweb/dotnet-skills, which has 1,206 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 10, 2026.

Source: Aaronontheweb/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.