Skip to content

[VS Code] Preselect the CLI-default Aspire skills and agent assets during project creation #19629

Description

@adamint

The VS Code extension should show the same default selections as the CLI when aspire new or aspire init reaches the skill-location and skill Quick Picks. Users can still deselect them, but the default experience should be opt-out instead of opt-in.

Investigation

The CLI already owns and computes the correct defaults in AgentInitCommand; we do not need a second defaults API or a copied list in the extension.

Today AgentInitCommand passes those choices through IInteractionService.PromptForSelectionsAsync(..., preSelected: ...):

  • .agents/skills is the default skill location.
  • Bundle-sourced Aspire skills that apply to the detected AppHost language are selected by default.
  • aspire new excludes the one-time aspireify setup skill because the template already created the AppHost.
  • aspire init includes aspireify because wiring the existing applications is the natural follow-up.
  • CLI-defined skills such as playwright-cli and dotnet-inspect remain opt-in.
  • MCP configuration remains intentionally opt-in.

The values are lost only on the VS Code path: ExtensionInteractionService.PromptForSelectionsAsync explicitly drops preSelected before calling IExtensionBackchannel.PromptForSelectionsAsync. The extension endpoint then receives only string[] choices and calls showQuickPick with no picked items.

Implementation

  1. Extend IExtensionBackchannel.PromptForSelectionsAsync and ExtensionBackchannel.PromptForSelectionsAsync to accept the CLI-computed preSelected values, format them with the same formatter as the choices, and send them as an optional trailing promptForSelections RPC argument.
  2. Forward preSelected from ExtensionInteractionService.PromptForSelectionsAsync instead of dropping it.
  3. Update extension/src/server/interactionService.ts so promptForSelections accepts an optional preselected-label array, creates QuickPickItem values with picked: true where appropriate, and maps the selected items back to their labels.
  4. Keep the RPC addition backwards compatible: an older CLI omits the optional argument, while an older extension ignores the extra trailing JavaScript argument. No capability gate should be necessary.

Tests

  • Add CLI coverage in ExtensionInteractionServiceTests/TestExtensionBackchannel proving formatted preselected values cross the backchannel.
  • Add extension interaction-service coverage proving default items are picked, non-default items are not, deselection is honored, and calls from an older CLI without the new argument still work.
  • Add focused VS Code E2E coverage for the aspire new flow if the E2E Quick Pick helper can reliably inspect selected state; the existing fixture creation suppresses agent init, so this needs a purpose-built interaction flow rather than the current setup fixture.

Acceptance criteria

  • VS Code presents the same defaults as the equivalent terminal CLI flow for both aspire new and aspire init.
  • Users can deselect any default or select an opt-in item.
  • The extension contains no hardcoded skill names or default list.
  • Older CLI versions continue to work with the updated extension.

cc Ella Hathaway (@ellahathaway)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions