Repository navigation
[release/17.0] Remove static Aspire skill copies during aspire agent init - #22277
Conversation
## Description Older Aspire CLIs copied Aspire skills into project and user-profile skill folders such as `.agents/skills/aspire`. Configured skill sources (the `microsoft/aspire-skills` plugin for Copilot and Claude Code, or the OpenCode catalog) replace those copies, but the copies go stale and nothing removes them. On main, `aspire doctor` and `aspire agent init` only tell users to delete them by hand, and many users do not notice. This PR lets `aspire agent init` remove them: - After init configures the Aspire skill sources, it lists the copies that the plugin now replaces at the selected scope and asks whether to delete them. The prompt defaults to No. See **When `aspire agent init` deletes copies** below for the exact rules. - A new `--remove-skill-copies` option answers the prompt ahead of time: `--remove-skill-copies` deletes the copies and `--remove-skill-copies=false` keeps them. Omitting it asks in an interactive terminal and keeps the copies in non-interactive runs, so nothing is deleted unless the user opts in. - After the existing `🤖 Configured sources in ...` line, init reports the result on one line: `📁 Removed copied Aspire skills in ...` or `📁 Kept copied Aspire skills in ...`. - If `--remove-skill-copies` is passed but the plugin does not replace the copies at the selected scope (for example, the default source is disabled), init keeps them and explains why in a dim note. - The option and behavior also apply to `aspire init`, `aspire new`, and `aspire mcp init`, which chain into agent init. - Detection only looks where older CLIs wrote copies (their `--skill-location` choices): `.agents/skills`, `.claude/skills`, `.github/skills`, and `.opencode/skill` in each directory from the current directory up to the workspace root, and `~/.agents/skills`. It does not read agent-specific settings such as `CLAUDE_CONFIG_DIR` or OpenCode `skills.paths`, so it never inspects files the CLI did not write. - `AspireSkillsCheck` (`aspire-skill-sources`) now warns in the Environment category instead of AppHost. It reports both user-level copies and copies in the workspace that doctor runs in. The fix points to `aspire agent init`, and the details list each copy with the agents that read it, so users know which agents and scope to select. Relates to #19726 ### Before and after Example workspace: ```text repo/ aspire.config.json {"skillSources":{"default":{}}} .agents/skills/aspire/SKILL.md .agents/skills/aspire-deployment/SKILL.md .agents/skills/my-team-skill/SKILL.md .claude/skills/aspire/SKILL.md .github/skills/aspire-init/SKILL.md ~/.agents/skills/aspire/SKILL.md ~/.agents/skills/aspire-deployment/SKILL.md ``` #### `aspire doctor` Before: ```text AppHost 🚨 Local Aspire skill files may override plugin skills Delete these files, then run 'aspire agent init --skills aspire'. Files: .agents/skills/aspire/SKILL.md .claude/skills/aspire/SKILL.md ~/.agents/skills/aspire/SKILL.md ``` After: ```text Environment 🚨 Found static copies of Aspire skills. Run 'aspire agent init' to configure skill sources and remove these copies. Details: .agents/skills/aspire (copilot, opencode) .claude/skills/aspire (claude) ~/.agents/skills/aspire (copilot, opencode) ``` With `--format json`, the copies are in `details` and there is no `files` field: ```json { "category": "environment", "name": "aspire-skill-sources", "status": "warning", "message": "Found static copies of Aspire skills.", "fix": "Run 'aspire agent init' to configure skill sources and remove these copies.", "details": ".agents/skills/aspire (copilot, opencode)\n.claude/skills/aspire (claude)\n~/.agents/skills/aspire (copilot, opencode)" } ``` #### `aspire agent init --help` The same option appears in `aspire init --help`, `aspire new --help`, and `aspire mcp init --help`. ```text --remove-skill-copies Remove copied Aspire skills when the Aspire skills plugin replaces them at the selected scope. Defaults to false ``` #### `aspire agent init` Before, at either scope, init shows this warning before the skills prompt, then configures sources and leaves the copies in place: ```text 🚨 Local Aspire skill files may override plugin skills .agents/skills/aspire/SKILL.md .claude/skills/aspire/SKILL.md ~/.agents/skills/aspire/SKILL.md ``` After, selecting only GitHub Copilot and choosing **Project** for `Where should skills and tools be installed?`, then answering `y`: ```text 🚨 Found copied Aspire skills that the Aspire skills plugin now provides: .agents/skills/aspire .agents/skills/aspire-deployment .github/skills/aspire-init Delete 3 copied skill folders? [y/N]: y 🤖 Configured sources in .github/copilot/settings.json (GitHub Copilot) 📁 Removed copied Aspire skills in .agents/skills/aspire, .agents/skills/aspire-deployment, .github/skills/aspire-init ``` Answering `n`, or pressing Enter, shows the same warning and prompt, then keeps all three folders: ```text Delete 3 copied skill folders? [y/N]: N 🤖 Configured sources in .github/copilot/settings.json (GitHub Copilot) 📁 Kept copied Aspire skills in .agents/skills/aspire, .agents/skills/aspire-deployment, .github/skills/aspire-init ``` `.claude/skills/aspire` is not listed because Claude Code was not selected, and the `~/.agents/skills` copies are not listed because the scope is Project. With `--remove-skill-copies`, there is no warning or prompt and the copies are deleted: ```text 🤖 Configured sources in .github/copilot/settings.json (GitHub Copilot) 📁 Removed copied Aspire skills in .agents/skills/aspire, .agents/skills/aspire-deployment, .github/skills/aspire-init ``` With `--remove-skill-copies=false`, or in a non-interactive run without the option, there is no warning or prompt and the copies are kept: ```text 🤖 Configured sources in .github/copilot/settings.json (GitHub Copilot) 📁 Kept copied Aspire skills in .agents/skills/aspire, .agents/skills/aspire-deployment, .github/skills/aspire-init ``` With `--remove-skill-copies` when `aspire.config.json` disables the default source, the plugin does not replace the copies, so init keeps them and adds a dim note: ```text 📁 Kept copied Aspire skills in .agents/skills/aspire, .agents/skills/aspire-deployment, .github/skills/aspire-init Copies are only removed when the Aspire skills plugin is configured and enabled at the selected scope for every selected agent. ``` Choosing **Global** behaves the same way for `~/.agents/skills/aspire` and `~/.agents/skills/aspire-deployment`, with `~/.copilot/settings.json` in the `Configured sources` line. In every case `my-team-skill` is kept, and the default source is registered for each selected agent (for example `.github/copilot/settings.json` gains the `aspire@aspire-skills` plugin). ### When `aspire agent init` deletes copies Init deletes copies only when the user opts in, either by passing `--remove-skill-copies` or by answering `y` at the prompt. It considers copies in the same run, right after it configures skill sources, and only when all of these are true: - The `aspire` skill is selected. It is selected by default. - Every skill source registration succeeded, and for each selected agent the configuration init saved, or already found unchanged, at the selected scope registers the default `microsoft/aspire-skills` source: the `aspire@aspire-skills` plugin in `enabledPlugins` for Copilot and Claude Code, or its skill catalog for OpenCode. A registration that only exists at another scope (for example a user-level plugin during a Project run, or an inline `OPENCODE_CONFIG_CONTENT` catalog) does not count, so a committed project never loses its copies without a committed replacement. Other configured sources do not count either, because they do not replace the copied Aspire skills. - The merged settings for that scope still enable the plugin. A higher-precedence file, such as `.github/copilot/settings.local.json`, `.claude/settings.local.json`, or managed settings, that sets `aspire@aspire-skills` to `false` keeps the copies. - The copy is in the chosen scope. Project scope checks each directory from the current directory up to the workspace root, and Global scope checks `~/.agents/skills`. - A selected agent reads the folder: `.agents/skills` (Copilot, OpenCode), `.claude/skills` (Claude Code), `.github/skills` (Copilot), `.opencode/skill` (OpenCode), or `~/.agents/skills` (Copilot, OpenCode). A Copilot-only run keeps `.claude/skills/aspire`. - The folder is named like a skill older CLIs copied: `aspire`, `aspire-deployment`, `aspire-init`, `aspire-monitoring`, `aspire-orchestration`, `aspire-project-v2-migration`, or `aspireify`. Other skills are untouched. Init checks the settings, not the agent's plugin cache. The agent downloads the plugin the next time it starts. A copy reached through a linked folder below the workspace or user profile is reported as an error and kept, since the link target may be shared. If a delete fails, init reports it, still deletes the other copies, and exits with an error. `aspire doctor` keeps listing any copies that remain. ### Validation - `dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.AgentInitCommandTests" --filter-class "*.AgentInitClientSelectionTests" --filter-class "*.AspireSkillsCheckTests" --filter-class "*.DoctorCommandTests" --filter-class "*.LocalAspireSkillsTests" --filter-class "*.InitCommandTests" --filter-class "*.NewCommandTests" --filter-class "*.McpInitCommandTests" --filter-class "*.SkillSourceTests" --filter-class "*.OpenCodeAgentClientTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"`: passed (666 total, 665 succeeded, 1 skipped, 0 failed). The skipped test needs symbolic link privileges. New tests cover `--remove-skill-copies` (true, false, and omitted in interactive and non-interactive runs), the option on `aspire init` and `aspire new`, the dim note when the plugin does not replace the copies, registrations that only exist at another scope, unchanged registrations at the selected scope, and a higher-precedence `false` override. - `dotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj`: succeeded. The updated `AgentCommandTests` and `DoctorCommandTests` E2E scenarios were not run locally because they need Docker. - Manual testing with a locally built CLI in a real terminal: created copies in a project and in the user profile, then ran `aspire agent init` at Project scope answering `y` and `n`. The interactive output above is from those runs. Earlier manual runs covered Copilot, Claude Code, and OpenCode, registrations at only the other scope, and `aspire doctor` listing the copies that remain. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: Copilot App <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22277Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22277" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The removal check can delete existing guidance when default marketplace and plugin names point to a custom repository, without establishing an Aspire replacement; it must verify the saved and effective sources and add regression coverage.
1 open issue
2 files not reviewed
src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
What changed in this PR
Backports #22080 to release/17.0, adding opt-in cleanup of copied Aspire skills as the CLI moves to agent-managed plugins and catalogs.
Changes:
- Adds
--remove-skill-copiesand interactive confirmation to agent initialization and chained commands. - Restricts cleanup by scope, selected agents, replacement registration, and linked-folder safeguards.
- Updates doctor guidance, localized resources, and tests for detection and cleanup behavior.
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Utils/AspireSkillsCheckTests.cs | Tests workspace and user-level diagnostics. |
| tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_Help_ShowsFileBasedOption.verified.txt | Includes the cleanup option in help. |
| tests/Aspire.Cli.Tests/Snapshots/DoctorCommandTests.DoctorCommand_Json_IncludesStaticSkillsGuidance.verified.json | Updates structured diagnostic output. |
| tests/Aspire.Cli.Tests/Snapshots/DoctorCommandTests.DoctorCommand_HumanReadable_IncludesStaticSkillsGuidance.verified.txt | Updates human-readable diagnostic output. |
| tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs | Tests cleanup option forwarding. |
| tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs | Tests opt-in cleanup through init. |
| tests/Aspire.Cli.Tests/Commands/AgentInitCommandTests.cs | Covers cleanup decisions, safeguards, and failures. |
| tests/Aspire.Cli.Tests/Commands/AgentInitClientSelectionTests.cs | Updates selection and cleanup expectations. |
| tests/Aspire.Cli.Tests/Agents/LocalAspireSkillsTests.cs | Tests legacy directory discovery and scope. |
| tests/Aspire.Cli.EndToEnd.Tests/DoctorCommandTests.cs | Updates terminal and JSON assertions. |
| tests/Aspire.Cli.EndToEnd.Tests/AgentCommandTests.cs | Exercises interactive cleanup confirmation. |
| src/Aspire.Cli/Utils/EnvironmentChecker/EnvironmentCheckResult.cs | Removes the separate files field. |
| src/Aspire.Cli/Utils/EnvironmentChecker/AspireSkillsCheck.cs | Reports copies and readers under Environment. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.zh-Hant.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.zh-Hans.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.tr.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ru.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.pt-BR.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.pl.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ko.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ja.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.it.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.fr.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.es.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.de.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.cs.xlf | Synchronizes doctor localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.zh-Hant.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.zh-Hans.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.tr.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.ru.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.pt-BR.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.pl.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.ko.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.ja.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.it.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.fr.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.es.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.de.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/xlf/AgentCommandStrings.cs.xlf | Adds cleanup localization resources. |
| src/Aspire.Cli/Resources/DoctorCommandStrings.resx | Revises detection and remediation messages. |
| src/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs | Aligns doctor resource accessors. |
| src/Aspire.Cli/Resources/AgentCommandStrings.resx | Defines cleanup prompts and result messages. |
| src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs | Exposes cleanup resource strings. |
| src/Aspire.Cli/Commands/NewCommand.cs | Forwards cleanup choice to agent init. |
| src/Aspire.Cli/Commands/McpInitCommand.cs | Exposes the cleanup option. |
| src/Aspire.Cli/Commands/InitCommand.cs | Forwards cleanup choice to agent init. |
| src/Aspire.Cli/Commands/DoctorCommand.cs | Removes separate file-list rendering. |
| src/Aspire.Cli/Commands/AgentInitCommand.cs | Implements confirmation, cleanup guards, and reporting. |
| src/Aspire.Cli/Agents/OpenCode/OpenCodeAgentClient.cs | Removes client-specific copy discovery. |
| src/Aspire.Cli/Agents/IAgentClient.cs | Removes the local-discovery interface member. |
| src/Aspire.Cli/Agents/Copilot/CopilotAgentClient.cs | Removes client-specific copy discovery. |
| src/Aspire.Cli/Agents/ClaudeCode/ClaudeCodeAgentClient.cs | Removes client-specific copy discovery. |
| src/Aspire.Cli/Agents/AspireSkills/LocalAspireSkills.cs | Centralizes legacy copy locations and reader mappings. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the opt-in legacy skill cleanup backport.
No open issues 🎉
1 resolved since last review
2 files not reviewed
src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The tests still reference a removed resource property, preventing compilation, and three empty-warning assertions conflict with the source explanation and trust warning still emitted.
2 open issues
2 files not reviewed
src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
Review effort: Balanced
Keep the source explanation and trust warning expectations from #22271 and drop the obsolete local skill copy warning removed by #22080. Co-authored-by: Copilot App <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the opt-in legacy skill-copy cleanup backport.
No open issues 🎉
2 resolved since last review
2 files not reviewed
src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
Review effort: Balanced
| foreach (var directory in directories) | ||
| // Older CLIs left no ownership stamp, so the directory name is the only signal. | ||
| var path = Path.GetFullPath(Path.Combine(skillsDirectory, name)); | ||
| if (Directory.Exists(path)) |
There was a problem hiding this comment.
I wonder what else can we do here to avoid the case where the skill was a user-authored one where name clashed, as for now we are just deleting their skills in this particular case. It may be the best thing we can do anyway, but just something to think about.
There was a problem hiding this comment.
Good question. I'm honestly not sure it's worth fixing. Older copies have no ownership marker, so the folder name is all we have. We could technically compare files against hashes from every skills release, but older CLIs never checked for custom changes either: updating the skills just overwrote whatever was in these folders. So deleting here doesn't add much risk compared to what users already had, and it still only happens after the prompt or an explicit --remove-skill-copies.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
…pies List each copied skill folder's files and warn that deletion includes user changes, both when prompting and when --remove-skill-copies is passed. Report plugin configuration before the deletion warning and summarize deletions with a count. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The recursive preview follows directory symlinks and junctions, potentially traversing shared checkouts and causing excessive output and long delays before confirmation.
1 open issue
2 files not reviewed
src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
Review effort: Balanced
Recursive enumeration follows directory symlinks and junctions, so a link inside a copied skill folder made the preview list its target's files even though deletion removes only the link. Co-authored-by: Copilot App <[email protected]>
Tests selector3 / 101 PR test projects · 4 PR jobs, from 53 changed files. Selected PR test projects (3 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🔧 🔧 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed for a linked-directory preview edge case that can enumerate external files before link validation, causing excessive output and delays before confirmation.
No open issues 🎉
1 resolved since last review
2 files not reviewed
src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
ada71fb
into
release/17.0
|
✅ No documentation update needed. excluded → base_branch_is_release, title_release_prefix. This is a manual backport of #22080 to release/17.0 (title prefixed |


Description
Manual backport of #22080
Older Aspire CLIs copied Aspire skills into project and user-profile skill folders such as
.agents/skills/aspire. The configured Aspire plugin or OpenCode catalog replaces those copies. For Copilot and Claude Code, a configured fork can serve as the replacement when it retains theaspire@aspire-skillsidentity, but the copies go stale and nothing removes them. On main,aspire doctorandaspire agent initonly tell users to delete them by hand, and many users do not notice.This PR lets
aspire agent initremove them:aspire agent initdeletes copies below for the exact rules.--remove-skill-copiesoption answers the prompt ahead of time:--remove-skill-copiesdeletes the copies and--remove-skill-copies=falsekeeps them. Omitting it asks in an interactive terminal and keeps the copies in non-interactive runs, so nothing is deleted unless the user opts in.🤖 Configured sources in ...line, init reports the result on one line:📁 Removed copied Aspire skills in ...or📁 Kept copied Aspire skills in ....--remove-skill-copiesis passed but the plugin does not replace the copies at the selected scope (for example, the default source is disabled), init keeps them and explains why in a dim note.aspire init,aspire new, andaspire mcp init, which chain into agent init.--skill-locationchoices):.agents/skills,.claude/skills,.github/skills, and.opencode/skillin each directory from the current directory up to the workspace root, and~/.agents/skills. It does not read agent-specific settings such asCLAUDE_CONFIG_DIRor OpenCodeskills.paths, so it never inspects files the CLI did not write.AspireSkillsCheck(aspire-skill-sources) now warns in the Environment category instead of AppHost. It reports both user-level copies and copies in the workspace that doctor runs in. The fix points toaspire agent init, and the details list each copy with the agents that read it, so users know which agents and scope to select.Relates to #19726
Before and after
Example workspace:
aspire doctorBefore:
After:
With
--format json, the copies are indetailsand there is nofilesfield:{ "category": "environment", "name": "aspire-skill-sources", "status": "warning", "message": "Found static copies of Aspire skills.", "fix": "Run 'aspire agent init' to configure skill sources and remove these copies.", "details": ".agents/skills/aspire (copilot, opencode)\n.claude/skills/aspire (claude)\n~/.agents/skills/aspire (copilot, opencode)" }aspire agent init --helpThe same option appears in
aspire init --help,aspire new --help, andaspire mcp init --help.aspire agent initBefore, at either scope, init shows this warning before the skills prompt, then configures sources and leaves the copies in place:
After, selecting only GitHub Copilot and choosing Project for
Where should skills and tools be installed?, then answeringy:Answering
n, or pressing Enter, shows the same warning and prompt, then keeps all three folders:.claude/skills/aspireis not listed because Claude Code was not selected, and the~/.agents/skillscopies are not listed because the scope is Project.With
--remove-skill-copies, there is no warning or prompt and the copies are deleted:With
--remove-skill-copies=false, or in a non-interactive run without the option, there is no warning or prompt and the copies are kept:With
--remove-skill-copieswhenaspire.config.jsondisables the default source, the plugin does not replace the copies, so init keeps them and adds a dim note:Choosing Global behaves the same way for
~/.agents/skills/aspireand~/.agents/skills/aspire-deployment, with~/.copilot/settings.jsonin theConfigured sourcesline.In every case
my-team-skillis kept, and the default source is registered for each selected agent (for example.github/copilot/settings.jsongains theaspire@aspire-skillsplugin).When
aspire agent initdeletes copiesInit deletes copies only when the user opts in, either by passing
--remove-skill-copiesor by answeringyat the prompt. It considers copies in the same run, right after it configures skill sources, and only when all of these are true:aspireskill is selected. It is selected by default.aspire@aspire-skillsplugin inenabledPluginsfor Copilot and Claude Code, or the built-in Aspire catalog for OpenCode. For Copilot and Claude Code, the plugin identity is what matters, so a configured fork or repository override retainingaspire@aspire-skillscounts as a replacement. A registration that only exists at another scope (for example a user-level plugin during a Project run, or an inlineOPENCODE_CONFIG_CONTENTcatalog) does not count, so a committed project never loses its copies without a committed replacement. Additional unrelated plugins and catalogs do not count..github/copilot/settings.local.json,.claude/settings.local.json, or managed settings, that setsaspire@aspire-skillstofalsekeeps the copies.~/.agents/skills..agents/skills(Copilot, OpenCode),.claude/skills(Claude Code),.github/skills(Copilot),.opencode/skill(OpenCode), or~/.agents/skills(Copilot, OpenCode). A Copilot-only run keeps.claude/skills/aspire.aspire,aspire-deployment,aspire-init,aspire-monitoring,aspire-orchestration,aspire-project-v2-migration, oraspireify. Other skills are untouched.Init checks the settings, not the agent's plugin cache. The agent downloads the plugin the next time it starts. A copy reached through a linked folder below the workspace or user profile is reported as an error and kept, since the link target may be shared. If a delete fails, init reports it, still deletes the other copies, and exits with an error.
aspire doctorkeeps listing any copies that remain.Validation
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.AgentInitCommandTests" --filter-class "*.AgentInitClientSelectionTests" --filter-class "*.AspireSkillsCheckTests" --filter-class "*.DoctorCommandTests" --filter-class "*.LocalAspireSkillsTests" --filter-class "*.InitCommandTests" --filter-class "*.NewCommandTests" --filter-class "*.McpInitCommandTests" --filter-class "*.SkillSourceTests" --filter-class "*.OpenCodeAgentClientTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": passed (666 total, 665 succeeded, 1 skipped, 0 failed). The skipped test needs symbolic link privileges. New tests cover--remove-skill-copies(true, false, and omitted in interactive and non-interactive runs), the option onaspire initandaspire new, the dim note when the plugin does not replace the copies, registrations that only exist at another scope, unchanged registrations at the selected scope, and a higher-precedencefalseoverride.dotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj: succeeded. The updatedAgentCommandTestsandDoctorCommandTestsE2E scenarios were not run locally because they need Docker.aspire agent initat Project scope answeringyandn. The interactive output above is from those runs. Earlier manual runs covered Copilot, Claude Code, and OpenCode, registrations at only the other scope, andaspire doctorlisting the copies that remain.Checklist
<remarks />and<code />elements on your triple slash comments?- [ ] Yes
- [ ] No
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?