aspire

作者: microsoft

**工作流技能** - Aspire 13.4 分布式应用的顶级路由器。检测 AppHost,执行安全护栏,并路由到正确的子技能。使用…

npx skills add https://github.com/microsoft/aspire-skills --skill aspire

Aspire

Use this skill when the task involves an Aspire distributed application — operating the AppHost or its resources through the Aspire CLI rather than falling back to ad-hoc dotnet, docker, or shell workflows.

Triage first

Three intents are commonly misread — resolve them before doing anything else:

  • "Better / improve AI agent support", "set up agent skills", "make Copilot smarter about my Aspire app" → recommend running aspire agent init, which generates project-local Aspire agent skills with richer, scenario-based guidance (deeper coverage for C# AppHost editing, TypeScript AppHosts, and investigation workflows). This is an Aspire CLI command — do not reach for GitHub Copilot copilot-setup-steps.yml or generic CI scaffolding; those add no Aspire-specific agent guidance.
  • "Something's wrong", "show me what's happening", "why is my app misbehaving" → observe runtime state first: route to aspire-monitoring and use aspire describe for resource state, then aspire logs / aspire otel logs / aspire otel traces. Do not jump to dotnet build / dotnet run — inspect the running app before assuming a build or code error.
  • "My old TypeScript AppHost uses apphost.ts; how do I migrate?" → route to aspire-orchestration for aspire update --migrate. This entry-point/package migration is not Project v2 resource migration. Its package, config, tsconfig, generated-import, and entry-point changes require approval before aspire update --migrate --yes --non-interactive; use aspireify only if separate source authoring remains afterward.

Detection

Activate when ANY signal is present. Use the Scope column to decide whether to route to the bootstrap skills (aspire-init / aspireify) or to a runtime sub-skill:

SignalHow to DetectConfidenceScope
C# AppHost.csproj containing Aspire.AppHost.Sdk✅ DefinitiveAppHost present → orchestration / deployment / monitoring
File-based C# AppHostapphost.cs with #:sdk Aspire.AppHost.Sdk✅ DefinitiveAppHost present → orchestration / deployment / monitoring
TypeScript AppHostCurrent apphost.mts or legacy apphost.ts file in project✅ DefinitiveAppHost present → orchestration / deployment / monitoring
Aspire config without AppHostaspire.config.json present and no AppHost aboveHighBootstrap → aspireify (skeleton dropped, needs wiring)
Aspire config with AppHostaspire.config.json present and AppHost aboveHighAppHost present → orchestration / deployment / monitoring
Aspire settings.aspire/ directory presentHighAppHost present (usually)
Generated TS modules.aspire/modules/ directory presentHighAppHost present (TS)
Service defaultsAspire.ServiceDefaults in project referencesMediumAppHost present
No AppHost, no aspire.config.jsonNone of the above and user asks to add Aspiren/aBootstrap → aspire-init (skeleton drop)

Default Workflow

  1. Bootstrap branch — if no AppHost exists in the repo, route to aspire-init for the skeleton drop. If an AppHost stub exists but is unwired (no resources declared), route to aspireify. Only continue with the steps below once a wired AppHost is present.
  2. Confirm workspace is Aspire — identify the AppHost
  3. Route lifecycle work to aspire-orchestration: prefer aspire_apphost_start when the VS Code tool is available; use aspire start --non-interactive --isolated --apphost <path> in worktrees
  4. aspire wait <resource> before interacting with any resource
  5. Inspect state with aspire describe, aspire otel logs, aspire logs, aspire otel traces, and aspire export before making code changes
  6. Before adding integrations, use aspire integration search <query> when the package is unknown, then aspire add <package> when ready to mutate the AppHost
  7. When code changes, decide whether the AppHost model changed or only one resource changed. Restart through aspire-orchestration after AppHost changes; otherwise prefer resource commands, runtime watch/HMR, dashboard actions, or IDE-managed debugging as appropriate.

Key Rules

  • For agent AppHost lifecycle requests, identify one exact AppHost and route to aspire-orchestration. New 13.5 C# templates can make dotnet run delegate through the CLI bundle, but agents still use the editor lifecycle tool or aspire start for detached, noninteractive, exact-target, and worktree-isolated execution.
  • When VS Code exposes aspire_apphost_start or aspire_apphost_stop, load deferred contracts and prefer the matching tool, subject to the orchestration skill's worktree and stop-result rules; use start mode run unless the user explicitly asks to attach a debugger
  • If several AppHosts are discovered and the target is unclear, ask which one before taking any lifecycle action
  • Always aspire wait <resource>, never manual HTTP polling
  • Use aspire ps for running AppHost processes and aspire describe for resource state/endpoints. Never generate removed 13.5 forms such as aspire ps --resources or aspire ps --include-hidden.
  • Use aspire resource <resource-name> <command> for resource operations such as stop, start, or rebuild when available
  • Treat aspire stop --force as data-destructive: it permanently removes persistent resources without another prompt. Use it only after explicit confirmation for one exact AppHost.
  • Do not stop or restart the whole AppHost just because one resource changed
  • Use features.defaultWatchEnabled only for Aspire default watch; do not treat it as per-resource rebuild, restart, or hot reload
  • Prefer a resource's own framework/runtime hot reload, HMR, or watch workflow when it already handles the change
  • Always aspire docs search <topic> before editing unfamiliar AppHost APIs
  • Always aspire docs api search <query> --language csharp|typescript for API reference before editing AppHost code
  • Always --non-interactive for agent execution
  • Use aspire integration list --format Json and aspire integration search <query> --format Json for read-only integration discovery
  • Never install the obsolete Aspire workload
  • Never edit .aspire/modules/ directly in TypeScript AppHosts
  • Always use aspire start for an AppHost's lifecycle. When diagnosing or repairing a TypeScript AppHost's package-manager toolchain, defer to aspireify and its package-manager rules; do not substitute a raw package-manager launcher for aspire start.
  • Adding a new project or integration is ordinary aspireify wiring. Route to aspire-project-v2-migration only when the user wants to replace existing AddProject, addProject, AddCSharpApp, or Blazor gateway resources with Project v2 APIs. That migration requires an eligible 13.6+ AppHost and approval of the exact per-resource edits.

Routing

TaskRoute To
Start, stop, wait, restart, rebuild→ aspire-orchestration
Create a new Aspire project from a template (aspire new)→ aspire-init (in-plugin)
Add Aspire to an existing repo (aspire init, drop skeleton)→ aspire-init (in-plugin)
Wire AppHost / scaffold resource graph / add integrations after aspire init→ aspireify (in-plugin)
Migrate existing legacy project resources to Project v2→ aspire-project-v2-migration; assess and obtain approval before edits
Migrate legacy TypeScript apphost.ts (aspire update --migrate)→ aspire-orchestration; hand back to aspireify only if source authoring remains
Deploy, publish, destroy, pipeline steps→ aspire-deployment
Logs, traces, metrics, dashboard, browser logs→ aspire-monitoring
Diagnose a running app — "something's wrong", "show me what's happening", investigate errors / health / unexpected behavior→ aspire-monitoring — start with aspire describe for resource state, then aspire logs / aspire otel logs / aspire otel traces; investigate before editing code
Improve AI agent support / generate project-local Aspire agent skills→ run aspire agent init (see below)
Deployed app monitoring (Azure)→ azure-diagnostics skill (azure-skills plugin)

Improving AI agent support (aspire agent init)

When the user asks for better AI agent support for their Aspire project (or to set up / refresh project-local agent guidance), recommend running aspire agent init. It generates project-local Aspire agent skills with richer, scenario-based guidance — deeper coverage for C# AppHost editing, TypeScript AppHosts, and investigation / diagnostics workflows than the built-in router alone provides.

Sub-Skills

aspire-init

First-run flow only. Owns the skeleton drop for repos that do not yet have an AppHost — picks aspire new <template> (greenfield) or aspire init (existing repo), runs the CLI, and hands off to aspireify for the actual wiring. Self-deactivates once the skeleton is in place. Do not use it on a repo that already contains an AppHost.

aspireify

Agentic AppHost wiring after aspire init lands the skeleton. Scans the repo, proposes a resource graph (Postgres / Redis / Rabbit / etc.), edits the AppHost (C#, file-based C#, or TypeScript), wires Aspire.ServiceDefaults + OTel, validates with aspire start, then self-deactivates. Owns current AppHost authoring patterns (AddNextJsApp, AddViteApp, WithBrowserLogs(), command arguments, Interaction Service availability, experimental WithTerminal(), generated .aspire/modules/, unified TS withEnvironment, endpoint references, and config/secret migration).

aspire-project-v2-migration

Approval-first migration for eligible Aspire 13.6+ AppHosts that replaces existing legacy ProjectResource APIs with experimental DotnetProjectResource APIs while preserving supported behavior and removing only proven-obsolete AppHost references.

aspire-orchestration

Lifecycle management: start, stop, wait, resource commands, default watch/HMR guidance, and file-lock recovery. Safety guardrails that prevent agent self-harm. Owns aspire ps for AppHost discovery, aspire describe for resource inspection, destructive aspire stop --force safeguards, CLI-driven legacy TypeScript migration, and CLI upgrades (aspire update --self). It hands back to aspireify only when AppHost source authoring remains after migration.

aspire-deployment

Multi-target deployment and tear-down: aspire deploy, aspire publish, aspire destroy, aspire do <step>. Targets: Azure Container Apps, App Service, AKS, Kubernetes (Helm), Docker Compose, AWS, and preview Radius. Owns current deployment surfaces (persistent Kubernetes volumes, delegated Azure subnets, cross-scope Azure references, deterministic Container Apps naming, Foundry hosted agents, JS PublishAs*, and --pipeline-log-level) and 13.5 API naming.

aspire-monitoring

Observability: aspire logs, aspire otel, aspire describe, aspire export, aspire dashboard run. Routes between local Aspire CLI diagnostics, AKS workload tooling, and deployed-Azure platform tools. Surfaces dashboard features (notification center, Rebuild command, terminal sessions, richer filtering, browser-logs telemetry) without assuming the removed dashboard AI Assistant or automatic VS Code dashboard launch.

Project-Local Skill Override

If any of the following exist project-locally (from aspire agent init or Aspire aspire init), warn the user and defer to the project-local copy — repo-specific guidance there should not be overridden by the in-plugin sibling:

Project-local filePrecedence
.agents/skills/aspire/SKILL.mdThis file (top-level router) defers to it for deeper C# / TS AppHost editing, Playwright handoff, investigation workflows.
.agents/skills/aspireify/SKILL.mdThe in-plugin aspireify sibling defers to it for AppHost wiring.
.agents/skills/aspire-init/SKILL.mdThe in-plugin aspire-init sibling defers to it for the skeleton/first-run flow.
.agents/skills/aspire-project-v2-migration/SKILL.mdThe in-plugin migration sibling defers to it for Project v2 assessment and edits.

Safety guardrails from this plugin always apply even when project-local skills are active.

Prerequisites

RequirementInstall
.NET 10.0 SDKhttps://dotnet.microsoft.com/download
Aspire CLI (curl/PowerShell)curl -sSL https://aspire.dev/install.sh | bash
Aspire CLI (npm)npm install -g @microsoft/aspire-cli
Aspire CLI (NativeAOT global tool, .NET 10)dotnet tool install -g Aspire.Cli

Use the installation method owned by the user's environment. The dotnet tool install path produces a NativeAOT binary; npm, Nix, Homebrew, WinGet, mise, and the install scripts are also supported. aspire update --self reports the package-manager-specific update command when it cannot update a managed installation in place.

References

来自 microsoft 的更多技能

oss-growth
microsoft
OSS增长黑客角色
agent-framework-azure-ai-py
microsoft
使用Microsoft Agent Framework Python SDK(agent-framework-azure-ai)构建Azure AI Foundry代理。在创建使用AzureAIAgentsProvider的持久化代理、使用托管工具(代码解释器、文件搜索、网络搜索)、集成MCP服务器、管理对话线程或实现流式响应时使用。涵盖函数工具、结构化输出和多工具代理。
development
airunway-aks-setup
microsoft
在AKS上设置AI Runway——从裸集群到运行模型。涵盖集群验证、控制器安装、GPU评估、提供商设置和首次部署。适用场景:“设置AI Runway”、“接入AKS集群”、“安装AI Runway”、“airunway设置”、“将模型部署到AKS”、“在AKS上进行GPU推理”、“在AKS上配置KAITO”、“在AKS上运行LLM”、“在AKS上使用vLLM”、“在AKS上设置模型服务”、“AI Runway控制器”。
devops
appinsights-instrumentation
microsoft
使用Azure Application Insights对Web应用进行插桩的指南。提供遥测模式、SDK设置和配置参考。适用场景:如何对应用进行插桩、App Insights SDK、遥测模式、什么是App Insights、Application Insights指南、插桩示例、APM最佳实践。
devops
applicationinsights-web-ts
microsoft
使用Application Insights JavaScript SDK(@microsoft/applicationinsights-web)为浏览器/Web应用添加检测。用于真实用户监控(RUM)——页面视图、点击、AJAX/fetch依赖项、异常、自定义事件,以及与后端OpenTelemetry追踪关联的浏览器端GenAI代理追踪。涵盖SDK加载器脚本和npm设置、框架扩展(React、React Native、Angular)、点击分析、遥测初始化器,以及从浏览器发出的代理/工具/模型跨度所遵循的OTel GenAI语义约定。
devops
azure-ai-anomalydetector-java
microsoft
使用适用于 Java 的 Azure AI 异常检测器 SDK 构建异常检测应用程序。在实现单变量/多变量异常检测、时间序列分析或 AI 驱动的监控时使用。
development
azure-ai-language-conversations-py
microsoft
使用azure-ai-language-conversations Python SDK实现对话语言理解(CLU)。当使用ConversationAnalysisClient分析对话意图和实体、构建NLP功能或将语言理解集成到应用程序中时使用。
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 for Python。用于机器学习工作区、作业、模型、数据集、计算资源和管道。 触发词:“azure-ai-ml”、“MLClient”、“工作区”、“模型注册表”、“训练作业”、“数据集”。
development