Add rebuild guidance to Aspire skill for per-resource code changes#15598
Open
davidfowl wants to merge 6 commits intorelease/13.2from
Open
Add rebuild guidance to Aspire skill for per-resource code changes#15598davidfowl wants to merge 6 commits intorelease/13.2from
davidfowl wants to merge 6 commits intorelease/13.2from
Conversation
Update the skill content to teach agents when to restart the AppHost vs rebuild a single resource vs do nothing: - AppHost code changed → aspire start (full restart) - Compiled resource changed (C#, Go, etc.) → aspire resource <name> rebuild - Interpreted resource (JS, Python) → no action (file watchers handle it) Add 'aspire resource <resource> rebuild' to the CLI command reference table and reinforce the rule in Important rules section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15598Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15598" |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Aspire agent skill content to guide when to restart the AppHost versus rebuilding a single resource, aiming to prevent unnecessary full-stack restarts for per-resource code changes.
Changes:
- Adds
aspire resource <resource> rebuildto the skill’s CLI command reference table. - Adds an “Applying code changes” decision table (AppHost vs compiled resource vs interpreted resource).
- Reinforces the guidance in the “Important rules” section.
Comments suppressed due to low confidence (2)
src/Aspire.Cli/Agents/CommonAgentApplicators.cs:210
- The guidance implies
aspire resource <name> rebuildapplies to any “compiled resource (C#, Go, Java, etc.)”, but therebuildcommand is only added forProjectResource(a .NET project) and is explicitly described as rebuilding the project (it runsdotnet build). Consider narrowing this row to “.NET project resource (.csproj)” or phrasing it as “If the resource exposes arebuildcommand inaspire describe, use it; otherwise restart the resource.”
| AppHost project (`apphost.cs`/`apphost.ts`) | `aspire start` | Resource graph changed; full restart required |
| Compiled resource (C#, Go, Java, etc.) | `aspire resource <name> rebuild` | Rebuilds and restarts only that resource |
| Interpreted resource (JavaScript, Python) | Nothing — file watchers handle it | Hot reload picks up changes automatically |
src/Aspire.Cli/Agents/CommonAgentApplicators.cs:243
- This rule says to use
aspire resource <name> rebuildfor “individual compiled resources”, butrebuildis not a general-purpose command—it’s only present for certain resource types (e.g., .NET project resources) and won’t exist for many compiled services (containers, non-.NET, etc.). Consider rewording to “For individual .NET project resources, useaspire resource <name> rebuildwhen available; otherwise use the resource’srestartcommand.”
- **Only restart the AppHost when AppHost code changes.** For individual compiled resources, use `aspire resource <name> rebuild` instead.
Acknowledge that not all JS/Python resources run in watch mode — suggest restarting the resource if no file watcher is configured. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agents can check which commands a resource supports before attempting rebuild, since it is only available on .NET project resources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Users report Copilot digging through NuGet package caches for XML doc files instead of using the built-in aspire docs search/get commands. Add an explicit rule telling agents to never search local package folders for Aspire documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use medium-freedom 'prefer X over Y' pattern instead of 'Do NOT' for documentation lookup guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JamesNK
approved these changes
Mar 26, 2026
Contributor
|
🎬 CLI E2E Test Recordings — 51 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23579274001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Improves the Aspire skill content to teach agents better workflows for applying code changes and finding documentation, based on real user feedback.
Changes
1. "Applying code changes" decision table
Agents were restarting the entire AppHost when only a single project changed. Added a decision tree:
aspire start(full restart)aspire resource <name> rebuild2. Documentation lookup guidance
Users reported Copilot digging through
~/.nuget/packagesXML doc files instead of using the built-inaspire docs searchcommand. Added a rule using the "prefer X over Y" pattern (medium freedom):We chose "prefer" over "Do NOT" following Claude skill best practices — the NuGet approach technically works, it's just a poor experience. A hard block ("never") would be appropriate only for operations that are truly dangerous or broken.
3. Command reference
Added
aspire resource <resource> rebuildto the CLI command table, scoped to .NET project resources. Addedaspire describe --format Jsonhint for agents to discover available commands per resource.Design choices
rebuildis only available onProjectResource(verified viaKnownResourceCommands.csandProjectResourceBuilderExtensions.cs)Checklist