Agent skill

Maui Aspire

by davidortinau in davidortinau/maui-skills

Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services.

MITAuto-check passedMobile

Install Maui Aspire

skills CLI
$ npx skills add davidortinau/maui-skills --skill maui-aspire -a claude-code

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

GitHub CLI
$ gh skill install davidortinau/maui-skills maui-aspire --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/davidortinau/maui-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/maui-skills/skills/maui-aspire .claude/skills/maui-aspire && 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
maui-aspire
GitHub stars
175
Token cost
~1.3k tokens
SKILL.md length
399 words
Files
2 (incl. references)
Skills in repo
41
Repo updated
First seen
Licence
MIT

At a glance

Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services.

  • Works in 6 steps: ❌ Don't add MAUI to the AppHost → ❌ Don't use Aspire service discovery… → ⚠️ Android emulator can't reach localhost → …
  • : MAUI with Aspire
  • SKILL.md covers Key Differences from Other…, Common Gotchas, Blazor Hybrid Caveat and Aspire Service Defaults Don't…, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Maui Aspire is an agent skill from davidortinau/maui-skills. Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services. Covers AppHost configuration, service discovery for mobile clients, HttpClient DI setup, Entra ID authentication with MSAL.NET for calling protected APIs, development workflow (Aspire dashboard + MAUI debugging), Blazor Hybrid considerations, and platform-specific networking for Android emulators and iOS simulators. USE FOR: "MAUI with Aspire", "Aspire service discovery", "AppHost MAUI", "Aspire backend", "MAUI Aspire networking", "mobile…

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/aspire-api.md`).

It sits in Mobile, covering Cross-platform mobile apps. It works with Blazor, Android, .NET and Microsoft Entra ID. The repository describes itself as: .NET MAUI skills for GitHub Copilot and Claude Code. The licence is MIT.

When your agent uses it

  • : MAUI with Aspire
  • Aspire service discovery
  • MAUI Aspire networking
  • Aspire dashboard MAUI

Example prompts

  • “MAUI with Aspire”
  • “Aspire service discovery”
  • “AppHost MAUI”
  • “/maui-aspire”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. ❌ Don't add MAUI to the AppHost
  2. ❌ Don't use Aspire service discovery URIs in MAUI
  3. ⚠️ Android emulator can't reach localhost
  4. ⚠️ Android emulator doesn't trust .NET dev certificates
  5. ⚠️ Auth is public client, not confidential
  6. ⚠️ Aspire requires .NET 10+

What it can do on your machine

Read from SKILL.md and the folder at commit 79bb4bf. 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

    No URLs in SKILL.md.

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

Context cost

Maui Aspire loads about 1.3k tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 183 tokens; SKILL.md has 399 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~183
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.9k

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 davidortinau/maui-skills at commit 79bb4bf, republished under its MIT licence (© davidortinau). 399 words, ~1,277 tokens.

Download SKILL.mdSave it as .claude/skills/maui-aspire/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
maui-aspire
description
Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services. Covers AppHost configuration, service discovery for mobile clients, HttpClient DI setup, Entra ID authentication with MSAL.NET for calling protected APIs, development workflow (Aspire dashboard + MAUI debugging), Blazor Hybrid considerations, and platform-specific networking for Android emulators and iOS simulators. USE FOR: "MAUI with Aspire", "Aspire service discovery", "AppHost MAUI", "Aspire backend", "MAUI Aspire networking", "mobile Aspire", "Aspire dashboard MAUI". DO NOT USE FOR: standalone REST API calls without Aspire (use maui-rest-api), authentication without Aspire (use maui-authentication), or Aspire-only projects without MAUI.

.NET MAUI with .NET Aspire

Key Differences from Other Aspire Clients

MAUI apps are NOT orchestrated by the AppHost — they run on devices/simulators and connect over the network. This changes everything:

  • ❌ Cannot use Aspire service discovery URIs (https+http://apiservice)
  • ❌ Cannot be added with .WithReference() in the AppHost
  • ❌ Cannot use AddServiceDefaults() (not an ASP.NET Core host)
  • ✅ Must use real network-reachable endpoints
  • ✅ Must use MSAL.NET (public client) — not OIDC (confidential client)

Common Gotchas

1. ❌ Don't add MAUI to the AppHost
csharp
// ❌ MAUI doesn't implement IServiceMetadata — this will fail
builder.AddProject<Projects.MyMauiApp>("mauiapp");

// ✅ Only add backend services to the AppHost
var apiService = builder.AddProject<Projects.MyApp_ApiService>("apiservice");
2. ❌ Don't use Aspire service discovery URIs in MAUI
csharp
// ❌ This only resolves inside the Aspire AppHost orchestration
client.BaseAddress = new Uri("https+http://apiservice");

// ✅ Use real endpoints
client.BaseAddress = new Uri("https://localhost:7001");
3. ⚠️ Android emulator can't reach localhost

The Android emulator has its own network stack. localhost points to the emulator itself, not the host machine.

csharp
// ❌ Fails silently on Android emulator
client.BaseAddress = new Uri("https://localhost:7001");

// ✅ Use 10.0.2.2 for host loopback on Android emulator
#if ANDROID && DEBUG
    client.BaseAddress = new Uri("https://10.0.2.2:7001");
#else
    client.BaseAddress = new Uri("https://localhost:7001");
#endif
4. ⚠️ Android emulator doesn't trust .NET dev certificates

The emulator won't trust your HTTPS dev cert. During local development:

csharp
// ⚠️ Development only — never ship this
#if ANDROID && DEBUG
builder.Services.AddHttpClient<IWeatherApiClient, WeatherApiClient>(client =>
{
    client.BaseAddress = new Uri("https://10.0.2.2:7001");
})
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
{
    ServerCertificateCustomValidationCallback = (_, _, _, _) => true
});
#endif
5. ⚠️ Auth is public client, not confidential

MAUI uses PublicClientApplication (MSAL.NET). The Entra Aspire auth skill (entra-id-aspire-authentication) is for the API/Blazor Server side only. For the MAUI side, use the maui-authentication skill.

6. ⚠️ Aspire requires .NET 10+

Ensure your MAUI project also targets net10.0-* TFMs to match the Aspire backend.

Blazor Hybrid Caveat

In MAUI Blazor Hybrid apps calling Aspire services, authentication happens at the MAUI layer (MSAL.NET), not in the Blazor WebView. Don't use AddMicrosoftIdentityWebApp or server-side OIDC patterns in the MAUI app.

Aspire Service Defaults Don't Apply

MAUI projects should not use AddServiceDefaults() because:

  • MAUI apps are not ASP.NET Core hosts
  • OpenTelemetry for mobile has different requirements
  • Health check endpoints don't apply to client apps

For telemetry correlation, configure OpenTelemetry separately using System.Diagnostics APIs.

Show full SKILL.md (144 more words)Show less

Development Workflow Decision

ScenarioWhat to do
Debugging API issuesUse the Aspire dashboard at https://localhost:17178
Debugging MAUI + APIRun Aspire AppHost in one terminal, MAUI in another
VS: simultaneous debugOpen two VS instances — one per project
VS CodeTwo terminals, or Aspire extension + MAUI extension

Platform Networking Quick Reference

Platformlocalhost works?HTTPS dev cert trusted?Special config needed?
iOS Simulator✅ Yes✅ Yes (macOS keychain)ATS exception for HTTP
Android Emulator❌ Use 10.0.2.2❌ NoNetwork security config
Mac Catalyst✅ Yes✅ YesNone
Windows✅ Yes✅ YesNone

Checklist

  • MAUI project is NOT added to AppHost with AddProject
  • API base URL uses real endpoints, not https+http:// URIs
  • Android: uses 10.0.2.2 instead of localhost
  • Android: SSL bypass or HTTP config for local dev only
  • Auth uses MSAL.NET PublicClientApplication, not confidential client
  • MAUI and Aspire both target net10.0-*
  • AddServiceDefaults() is NOT called in the MAUI project

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

Files

SKILL.md and 1 other file (references) in plugins/maui-skills/skills/maui-aspire of davidortinau/maui-skills.

  • SKILL.md
  • references/aspire-api.md

Open the folder on GitHubat commit 79bb4bf

Compare with similar skills

Maui Aspire 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.

Maui Aspire compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Maui Aspire this skilldavidortinau/maui-skills175—~1.3kAutomated safety check: PassMIT
Maui AI DebuggingRedth/Maui.Gtk101—~4.1kAutomated safety check: PassMIT
Maui Safe Areadotnet/skills5.6k1 repos~3.2kAutomated safety check: PassMIT
MAUI Integration Test Runnerdotnet/maui23k—~2.1kAutomated safety check: PassMIT
MAUI Device Test Runnerdotnet/maui23k—~3.3kAutomated safety check: PassMIT
Engine Whats Newflutter/flutter180k—~978Automated safety check: PassBSD-3-Clause

Similar skills

  • Maui AI Debugging

    Redth/Maui.Gtk

    End-to-end workflow for building, deploying, inspecting, and debugging .NET MAUI and MAUI Blazor Hybrid apps as an AI agent.

    101 GitHub stars~4.1k tokensUpdated 5 mo ago
    MobileAuto-check passed
  • Maui Safe Area

    dotnet/skills

    Official

    .NET MAUI safe area and edge-to-edge layout guidance for .NET 10+.

    5.6k GitHub starsUsed in 1 repo~3.2k tokens
    MobileAuto-check passed
  • Official

    Builds and packs .NET MAUI, installs the local workloads and runs integration tests for templates, samples and end-to-end scenarios by category.

    23k GitHub stars~2.1k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Official

    Builds and runs .NET MAUI device tests locally on iOS simulators, MacCatalyst, Android emulators or Windows, with optional category filtering.

    23k GitHub stars~3.3k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    180k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • Rnn Codebase

    wix/react-native-navigation

    Official

    Navigate and work with the react-native-navigation (RNN) codebase.

    13k GitHub stars~2k tokensUpdated 5 days ago
    MobileAuto-check passed

More from davidortinau/maui-skills

All 41 skills in this repo
  • Maui Hot Reload Diagnostics

    davidortinau/maui-skills

    Diagnose and troubleshoot .NET MAUI Hot Reload issues (C Hot Reload, XAML Hot Reload, Blazor Hybrid).

    175 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Accessibility

    davidortinau/maui-skills

    Guide for making .NET MAUI apps accessible — screen reader support via SemanticProperties, heading levels, AutomationProperties visibility control, programmatic focus and announcements, and…

    175 GitHub stars~974 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Animations

    davidortinau/maui-skills

    .NET MAUI view animations, custom animations, easing functions, rotation, scale, translation, and fade effects.

    175 GitHub stars~911 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui App Icons Splash

    davidortinau/maui-skills

    .NET MAUI app icon configuration, splash screen setup, SVG to PNG conversion at build time, composed/adaptive icons, and platform-specific icon and splash screen requirements for Android, iOS, Mac…

    175 GitHub stars~995 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui App Lifecycle

    davidortinau/maui-skills

    .NET MAUI app lifecycle guidance covering the four app states (not running, running, deactivated, stopped), cross-platform Window lifecycle events, backgrounding and resume behaviour…

    175 GitHub stars~947 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Authentication

    davidortinau/maui-skills

    Add authentication to .NET MAUI apps. An agent skill from davidortinau/maui-skills.

    175 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Maui Aspire

What does Maui Aspire do?

Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services. Maui Aspire is an agent skill from davidortinau/maui-skills.NET Aspire-hosted backend services.

When should I use Maui Aspire?

Maui Aspire fits situations like: : MAUI with Aspire; aspire service discovery; MAUI Aspire networking; aspire dashboard MAUI.

How do I install Maui Aspire in Claude Code?

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

How do I install Maui Aspire in Codex?

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

Can I use Maui Aspire 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 davidortinau/maui-skills --skill maui-aspire -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/maui-aspire, .gemini/skills/maui-aspire, .github/skills/maui-aspire and .opencode/skills/maui-aspire in your project.

What does Maui Aspire need to run?

SKILL.md names no scripts, command-line tools or credentials: Maui Aspire is instructions for the agent only.

Does Maui Aspire access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Maui Aspire 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 Maui Aspire use?

Maui Aspire 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 Maui Aspire 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. Its references folder adds about 2.6k tokens, read only when the agent opens those files.

What are the alternatives to Maui Aspire?

Skills that share tags, products or a category with Maui Aspire: Maui AI Debugging (Redth/Maui.Gtk, 101 stars), Maui Safe Area (dotnet/skills, 5.6k stars), MAUI Integration Test Runner (dotnet/maui, 23k stars) and MAUI Device Test Runner (dotnet/maui, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Maui Aspire?

davidortinau (a GitHub user) maintains it in davidortinau/maui-skills, which has 175 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on July 6, 2026.

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