Skip to content

Commit 15f04ba

Browse files
committed
feat: Add Aspire skill and reference documentation for orchestration, CLI, agent integration, and deployment pipelines
1 parent 9b99a4a commit 15f04ba

9 files changed

Lines changed: 293 additions & 0 deletions

File tree

.github/skills/aspire/SKILL.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: aspire
3+
description: Use for any request involving Aspire orchestration, AppHost (C# or TypeScript), Aspire CLI, agent integration, MCP server, or distributed app workflows. Always trigger when the user mentions Aspire, AppHost, MCP, agent setup, distributed orchestration, or asks about multi-service, multi-language, or cloud-native .NET/TypeScript solutions—even if not named explicitly.
4+
---
5+
6+
# Aspire Skill
7+
8+
This skill enables AI coding agents to:
9+
- Create, manage, and orchestrate distributed applications using Aspire (C# or TypeScript AppHost)
10+
- Use the Aspire CLI for project creation, orchestration, logs, and resource management
11+
- Integrate with agent workflows (skill files, MCP server, Playwright, etc.)
12+
- Support both .NET and TypeScript/Node.js stacks
13+
14+
## Reference Structure
15+
- [CLI Reference](./references/cli.md)
16+
- [Agent Integration](./references/agent.md)
17+
- [TypeScript AppHost](./references/typescript-apphost.md)
18+
- [Pipelines](./references/pipelines.md)
19+
- [Health Checks](./references/health-checks.md)
20+
- [Resource Model](./references/resource-model.md)
21+
- [Resource Hierarchies](./references/resource-hierarchies.md)
22+
- [Resource API Patterns](./references/resource-api-patterns.md)
23+
24+
## Usage Patterns
25+
- Start/stop AppHost, view resource status, logs, and traces
26+
- Add integrations, search docs, automate workflows
27+
- Configure agent environments with `aspire agent init`
28+
29+
## For More
30+
- See reference files above for details, commands, and examples
31+
- For latest docs, always consult https://aspire.dev and Microsoft Learn
32+
33+
## Example Prompts
34+
- "Create a new Aspire solution with a TypeScript AppHost and set up agent integration."
35+
- "Show me how to start the AppHost and view logs using the Aspire CLI."
36+
- "How do I migrate from AGENTS.md to the new skill file for agents?"
37+
- "Add a Redis cache to my Aspire app and update the agent config."
38+
39+
---
40+
41+
For advanced CLI usage, troubleshooting, and multi-language orchestration, see the reference files in `./references/` and the official Aspire documentation.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Aspire Agent Integration
2+
3+
## Why Aspire for Agents
4+
- Agents get the same visibility as developers: resource data, logs, traces
5+
- MCP server and CLI expose all runtime info
6+
- Skill file (`aspire agent init`) teaches agents CLI patterns and workflows
7+
- Agent-native CLI: All commands are non-interactive, support `--format Json`, and are designed for automation and agent workflows
8+
- **Detached mode (`--detach`)**: Agents (and users) can run the AppHost in the background using `aspire run --detach` or `aspire start`. This frees up the terminal and enables parallel, non-blocking workflows. Use `aspire ps` to list running apphosts and `aspire stop` to terminate them. Detached mode is ideal for agent-driven automation, CI, and multi-app scenarios.
9+
- Agents can also use isolated mode (`--isolated`) for parallel, conflict-free runs, and wait for resource health.
10+
11+
## MCP Setup
12+
1. Run `aspire agent init` in your project directory
13+
2. Select:
14+
- Aspire skill file (recommended)
15+
- Playwright CLI (for browser automation)
16+
- Aspire MCP server (for runtime access)
17+
3. Use `aspire agent mcp` to start the MCP server for agent communication
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Aspire CLI Reference
2+
3+
## Installation & Upgrade
4+
- Install: `curl -sSL https://aspire.dev/install.sh | bash`
5+
- Upgrade: `aspire update --self`
6+
- Validate: `aspire --version`
7+
- Docs: https://aspire.dev/get-started/install-cli/
8+
9+
## Key CLI Enhancements (13.2+)
10+
- **Language-aware templates:** `aspire new` and `aspire init` support C#, TypeScript, Python, and multi-language setups.
11+
- **Detached/background mode:** `aspire run --detach` or `aspire start` runs the AppHost in the background. Use `aspire ps` to list, `aspire stop` to stop.
12+
- **Isolated mode:** `--isolated` flag runs parallel apphosts with isolated ports/secrets for agent/CI/test workflows.
13+
- **Resource commands:** Unified `aspire resource <name> <command>` (start/stop/restart/rebuild) for fine-grained control.
14+
- **Resource monitoring:** `aspire describe` and `aspire describe --follow` stream resource state and config.
15+
- **Environment diagnostics:** `aspire doctor` checks certs, containers, SDKs, agent config, and more.
16+
- **Fuzzy search for integrations:** `aspire add` supports fuzzy search for packages.
17+
- **Secrets/certs management:** `aspire certs` and `aspire secret` for dev certs and user secrets (no .NET CLI needed).
18+
- **Wait/export:** `aspire wait` blocks until resource is healthy; `aspire export` captures telemetry and config.
19+
- **Agent integration:** `aspire agent init` sets up agent skill files and MCP; `aspire agent mcp` starts the MCP server.
20+
- **Docs from CLI:** `aspire docs list|search|get` brings official docs into the terminal (supports `--format Json`).
21+
- **Unified config:** `aspire.config.json` replaces legacy config files; auto-migrates on first run.
22+
- **Option standardization:** `-v` for version, `--format` for output, `--log-level`/`-l` for log filtering.
23+
- **Other:** `aspire run --no-build`, improved JSON output, better error/logging, and multi-language support.
24+
25+
## Agent-Friendly Features
26+
- All commands support `--format Json` for structured output
27+
- Non-interactive and automation-ready
28+
- CLI exposes all dashboard/apphost data for scripts, editors, and agents
29+
- See: https://aspire.dev/get-started/ai-coding-agents/
30+
31+
## More
32+
- Full CLI docs: https://aspire.dev/reference/cli/overview/
33+
- Troubleshooting: https://aspire.dev/get-started/troubleshooting/
34+
- What's new: https://aspire.dev/whats-new/aspire-13-2/#%EF%B8%8F-cli-enhancements
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Aspire Health Checks Reference
2+
3+
See the official documentation for full details: [Aspire Health Checks](https://aspire.dev/fundamentals/health-checks/)
4+
5+
Health checks in Aspire provide observability into the health and readiness of application resources. They enable proactive monitoring and automated recovery.
6+
7+
- Configure health checks for services, databases, and external dependencies.
8+
- Integrate health checks with orchestration and deployment pipelines.
9+
- Use health check endpoints for liveness and readiness probes.
10+
11+
For configuration options and patterns, refer to the official docs above.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Aspire Pipelines Reference
2+
3+
## Overview
4+
Aspire uses a pipeline-based deployment system that enables extensible, composable deployment workflows. Pipelines break deployment into discrete, well-defined steps that can be optimized for performance and reliability while maintaining clear visibility into the deployment process.
5+
6+
### Why pipelines matter
7+
- **Intelligent concurrency:** Independent operations run in parallel, maximizing resource utilization and minimizing total deployment time.
8+
- **Granular control:** Each step can be executed, monitored, and retried independently with specific error reporting and targeted recovery capabilities.
9+
- **Smart dependency management:** Steps wait only for their actual dependencies, ensuring optimal execution order while maintaining correctness.
10+
- **Comprehensive observability:** Real-time progress reporting at both step and sub-task levels provides clear visibility into deployment operations.
11+
- **Flexible execution:** Run complete deployments or selective step execution based on your specific needs.
12+
13+
### Core capabilities
14+
- **Extend deployments:** Add custom deployment steps for specific resources or scenarios.
15+
- **Control execution order:** Declare dependencies between steps to ensure proper sequencing.
16+
- **Run selective steps:** Execute only specific steps and their dependencies for faster iterations.
17+
- **Parallelize operations:** Independent steps can run concurrently for improved performance.
18+
- **State persistence:** Cache deployment state and parameters across multiple deployment runs.
19+
- **Intelligent granularity:** Balance between fine-grained control and deployment efficiency.
20+
21+
## Core Concepts
22+
23+
### Pipeline Steps
24+
A pipeline step represents a discrete unit of work in the application pipeline. Each step encapsulates a specific aspect of the deployment process, making the overall operation more manageable and debuggable.
25+
26+
Each step has:
27+
- **Name:** A unique identifier for the step
28+
- **Action:** The work to be performed during deployment
29+
- **Dependencies:** Other steps that must complete before this step runs
30+
- **Resource context:** Access to the application’s resource model and configuration
31+
32+
#### Example pipeline steps
33+
**Infrastructure steps (can run in parallel):**
34+
- `provision-cosmosdb`: Provision the CosmosDB database
35+
- `provision-storage`: Provision Azure Storage account
36+
- `provision-aca-env`: Provision Azure Container Apps environment
37+
- `provision-container-registry`: Set up the container image registry
38+
39+
**Build steps (can run in parallel):**
40+
- `build-apiservice`: Build container image for the API service
41+
- `build-webfrontend`: Build container image for the frontend
42+
43+
**Deployment steps (depend on builds and infrastructure):**
44+
- `push-apiservice`: Push API service image to registry
45+
- `push-webfrontend`: Push frontend image to registry
46+
- `deploy-apiservice`: Deploy API service to compute platform
47+
- `deploy-webfrontend`: Deploy frontend to compute platform
48+
49+
### Step Execution Phases
50+
The pipeline system operates through three distinct phases:
51+
1. **Registration phase:** Steps are collected from resource annotations and pipeline API calls.
52+
2. **Resolution phase:** The system validates dependencies, calculates execution order, and identifies concurrency opportunities.
53+
3. **Execution phase:** Steps run according to the resolved plan, with parallel execution, dependency waiting, progress reporting, and error isolation.
54+
55+
### Dependency Management
56+
Dependencies in Aspire pipelines are explicit and purpose-driven. Steps declare their relationships using:
57+
- `PipelineStep.DependsOn`: This step must run after another step completes successfully
58+
- `PipelineStep.RequiredBy`: Another step must run after this step (inverse dependency declaration)
59+
60+
The pipeline system validates dependencies to ensure:
61+
- No circular dependencies
62+
- All references exist
63+
- Logical consistency
64+
65+
### Optimal Granularity Design
66+
Resource-level granularity: Each infrastructure resource is provisioned as a separate step, enabling precise error reporting, targeted retry, progress transparency, and flexible recovery.
67+
Operation-level organization: Related operations are grouped logically while maintaining independence (e.g., build, push, deploy).
68+
69+
## Well-known Steps
70+
71+
### Entry Point Steps
72+
- `WellKnownSteps.Deploy`: Orchestrates the complete deployment process.
73+
- `WellKnownSteps.Publish`: Generates deployment artifacts without executing the actual deployment.
74+
- `WellKnownSteps.Build`: Builds container images for compute resources.
75+
- `WellKnownSteps.Push`: Pushes container images to registries.
76+
77+
### Prerequisite Steps
78+
- `WellKnownSteps.BuildPrereq`: Pre-requisites for building (dependency resolution, environment setup).
79+
- `WellKnownSteps.DeployPrereqs`: Pre-requisites for deployment (authentication, environment validation).
80+
- `WellKnownSteps.PublishPrereqs`: Pre-requisites for publishing (build environment setup).
81+
- `WellKnownSteps.PushPrereq`: Pre-requisites for pushing images (registry authentication).
82+
83+
### Resource-contributed Steps
84+
Resources can contribute their own pipeline steps through annotations. For example, a static site resource might contribute steps for building, configuring storage permissions, uploading files, and configuring a CDN.
85+
86+
### Application-specific Steps
87+
Applications can add custom steps directly through the pipeline API for scenarios like database migrations, smoke tests, configuration updates, and notification workflows.
88+
89+
## Execution Control
90+
91+
### Running Specific Steps
92+
The `aspire do` command allows you to execute individual steps and their dependencies, providing fine-grained control over the deployment process. Use cases include incremental deployments, troubleshooting, development workflows, and selective operations.
93+
94+
### Parallel Execution and Performance Optimization
95+
The pipeline system maximizes deployment performance through intelligent parallel execution, resource grouping, critical path optimization, and resource-aware scheduling. It provides robust failure handling, error isolation, and comprehensive logging for efficient debugging and recovery.
96+
97+
---
98+
For more, see the official Aspire documentation for pipelines.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Aspire Resource API Patterns Reference
2+
3+
See the official documentation for full details: [Aspire Resource API Patterns](https://aspire.dev/architecture/resource-api-patterns/)
4+
5+
Resource API patterns in Aspire guide the design and implementation of APIs for resources managed by the orchestration platform.
6+
7+
- Standardizes resource interaction and management.
8+
- Promotes consistency and reusability across services.
9+
- Supports automation and integration with external systems.
10+
11+
For design patterns and implementation details, refer to the official docs above.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Aspire Resource Hierarchies Reference
2+
3+
See the official documentation for full details: [Aspire Resource Hierarchies](https://aspire.dev/architecture/resource-hierarchies/)
4+
5+
Resource hierarchies in Aspire describe the relationships and dependencies between resources in a distributed application.
6+
7+
- Parent-child relationships define orchestration and lifecycle.
8+
- Enables dependency management and startup ordering.
9+
- Supports grouping and logical organization of resources.
10+
11+
For patterns and best practices, refer to the official docs above.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Aspire Resource Model Reference
2+
3+
See the official documentation for full details: [Aspire Resource Model](https://aspire.dev/architecture/resource-model/)
4+
5+
The Aspire resource model defines how application components and infrastructure are represented, managed, and orchestrated.
6+
7+
- Resources represent services, databases, caches, and other components.
8+
- Resources can be composed, configured, and orchestrated declaratively.
9+
- Supports extensibility for custom resource types.
10+
11+
For modeling guidance and examples, refer to the official docs above.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
# Aspire AppHost: C# and TypeScript
3+
4+
Aspire supports both **C#** and **TypeScript** AppHosts for orchestrating distributed applications. Both are first-class options—choose based on your stack:
5+
6+
- **C# AppHost**: For .NET/C#-centric solutions
7+
- **TypeScript AppHost**: For Node.js/React/JS-centric solutions
8+
9+
See official docs:
10+
- [C# AppHost Quickstart](https://aspire.dev/get-started/first-app/)
11+
- [TypeScript AppHost Quickstart](https://aspire.dev/get-started/first-app-typescript-apphost/)
12+
13+
---
14+
15+
## Create a New Aspire App
16+
17+
| Language | Command Example |
18+
|--------------|---------------------------------------------------------------------------------|
19+
| **C#** | `aspire new aspire-starter -n aspire-app -o aspire-app` |
20+
| **TypeScript** | `aspire new aspire-ts-starter -n aspire-app -o aspire-app` |
21+
22+
Both commands prompt to configure AI agent environments (select 'y'). Each generates a solution with API, frontend, and AppHost in the respective language.
23+
24+
---
25+
26+
## AppHost Example
27+
28+
### C#
29+
```csharp
30+
var builder = DistributedApplication.CreateBuilder(args);
31+
var api = builder.AddProject("api", "./api/Api.csproj").WithHttpEndpoint(env: "PORT");
32+
var frontend = builder.AddProject("frontend", "./frontend/Frontend.csproj").WithReference(api).WaitFor(api);
33+
builder.Build().Run();
34+
```
35+
36+
### TypeScript
37+
```typescript
38+
import { createBuilder } from './.modules/aspire.js';
39+
const builder = await createBuilder();
40+
const app = await builder.addNodeApp("app", "./api", "src/index.ts").withHttpEndpoint({ env: "PORT" }).withExternalHttpEndpoints();
41+
const frontend = await builder.addViteApp("frontend", "./frontend").withReference(app).waitFor(app);
42+
await app.publishWithContainerFiles(frontend, "./static");
43+
await builder.build().run();
44+
```
45+
46+
---
47+
48+
## Run the App
49+
50+
```bash
51+
cd ./aspire-app
52+
aspire run
53+
# Dashboard URL appears in terminal
54+
```
55+
56+
---
57+
58+
**Note:** Aspire treats C# and TypeScript AppHosts as equal options. Use the one that best fits your technology stack.
59+

0 commit comments

Comments
 (0)