aspire-orchestration

Manages Aspire AppHost lifecycle and recovers from file locks, port conflicts, and orphaned processes.

Updated Jan 20, 2021
One-click install
npx skills add https://github.com/Stavanger-Brass-Band/sheetmusic-api --skill aspire-orchestration-stavanger-brass-band
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aspire-orchestration
Source: https://github.com/Stavanger-Brass-Band/sheetmusic-api/tree/main/.agents/skills/aspire-orchestration
Command: npx skills add https://github.com/Stavanger-Brass-Band/sheetmusic-api --skill aspire-orchestration-stavanger-brass-band

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI agents working in .NET Aspire projects frequently cause file locks (MSB3491, CS2012), port conflicts, and orphaned processes by using dotnet run or dotnet build against a running AppHost. This Skill enforces safe Aspire CLI workflows so agents start, wait on, inspect, and stop orchestrated apps without breaking the build or leaving stray processes. ## Core Features & Use Cases - Safe Lifecycle Management: Enforces aspire start / aspire stop / aspire wait instead of dotnet run, curl polling loops, or manual process kills. - File-Lock Recovery: Provides a deterministic recovery sequence (aspire stop first) for MSB3491 and CS2012 build errors caused by Aspire holding output assemblies. - Project Detection: Fingerprints C# AppHosts (Aspire.AppHost.Sdk), file-based AppHosts (apphost.cs), TypeScript AppHosts (apphost.ts), and aspire.config.json to confirm a workspace is Aspire-managed. - Use Case: An agent editing a .NET service while the AppHost runs hits "Cannot open ... for writing"; the Skill directs it to run aspire stop, rebuild, and restart rather than deleting bin//obj/ or declaring the project broken. ## Quick Start Ask the agent to start my Aspire app in the background and wait until the API resource is ready before running any requests against it.

Frequently Asked Questions about aspire-orchestration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I start an Aspire AppHost from an AI agent?▼

Use `aspire start` to run the AppHost in the background, never `dotnet run`, which bypasses orchestration, the dashboard, and resource management. In git worktrees, use `aspire start --isolated` to avoid port conflicts, and add `--non-interactive` for agent terminals.

How do I fix MSB3491 or CS2012 file lock errors in Aspire projects?▼

Run `aspire stop` first — Aspire is holding locks on the resource's output assemblies, so the project itself is healthy. Then rebuild or use `aspire resource <name> rebuild`, and never delete bin/obj, kill dotnet processes, or reboot.

Should I use aspire run or aspire start for automation?▼

Use `aspire start` for agents and automation because it runs detached in the background and returns control immediately. `aspire run` is foreground and interactive, intended for a human developer at a terminal watching the dashboard.

How do I detect whether a repository is an Aspire project?▼

Search for `Aspire.AppHost.Sdk` in .csproj files, an `apphost.cs` file with a `#:sdk Aspire.AppHost.Sdk` directive, or an `apphost.ts` file — all are definitive signals. `aspire.config.json`, a `.aspire/` directory, and `Aspire.ServiceDefaults` references are secondary indicators.

Why does aspire wait reject my resource name?▼

The `aspire wait` command expects the resource's `displayName`, not its `name` field, due to a known CLI issue. Run `aspire ps --format Json` and pass the `displayName` value to `aspire wait`.

When should I not restart the whole Aspire AppHost?▼

Avoid a full restart when only one resource's implementation changed — use `aspire resource <name> rebuild` or the framework's watch/HMR workflow instead. Restart the AppHost only when AppHost code, resource definitions, or integrations changed.