Skip to content

Commit 2f9565d

Browse files
committed
feat: reorder skills flow and annotate QuickPicks with install status
1 parent 959080d commit 2f9565d

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

src/commands/configureAiTools.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,16 @@ async function createMcpConfig(
423423
mcpFilePath: string,
424424
createdFiles: string[]
425425
): Promise<void> {
426+
const rootKey = editor === "vscode" ? "servers" : "mcpServers";
427+
const configuredKeys = await readConfiguredMcpServerKeys(rootUri, mcpFilePath, rootKey);
428+
426429
const selected = await vscode.window.showQuickPick(
427-
MCP_SERVERS.map((s) => ({ label: s.label, description: s.description, picked: true })),
430+
MCP_SERVERS.map((s) => ({
431+
label: s.label,
432+
description: s.description,
433+
detail: configuredKeys.has(s.key) ? "✓ already configured" : "Not configured",
434+
picked: !configuredKeys.has(s.key),
435+
})),
428436
{ canPickMany: true, placeHolder: "Select MCP servers to configure" }
429437
);
430438
if (!selected || selected.length === 0) { return; }
@@ -434,8 +442,6 @@ async function createMcpConfig(
434442
.filter((s): s is McpServerDef => s !== undefined);
435443

436444
const mcpUri = vscode.Uri.joinPath(rootUri, mcpFilePath);
437-
const isVscode = editor === "vscode";
438-
const rootKey = isVscode ? "servers" : "mcpServers";
439445

440446
// Read and merge into existing config if present
441447
let config: Record<string, unknown> = {};
@@ -500,13 +506,7 @@ function registerConfigureAiTools(context: vscode.ExtensionContext): void {
500506
return;
501507
}
502508

503-
const pickedSkills = await vscode.window.showQuickPick(
504-
skills.map((s) => ({ label: s.name, description: s.description, picked: true })),
505-
{ canPickMany: true, placeHolder: "Select skills to install" }
506-
);
507-
if (!pickedSkills || pickedSkills.length === 0) { return; }
508-
509-
// IDE target — pre-select based on detected editor
509+
// IDE target first — needed to check install status before showing skills
510510
const editor = detectEditor();
511511
const ideOptions: vscode.QuickPickItem[] = [
512512
{ label: "Claude Code", description: "Install to .claude/skills/" },
@@ -530,6 +530,19 @@ function registerConfigureAiTools(context: vscode.ExtensionContext): void {
530530
});
531531
if (!ideTarget) { return; }
532532

533+
const installedDirNames = await readInstalledSkillDirNames(rootUri, ideTarget.label, skills);
534+
535+
const pickedSkills = await vscode.window.showQuickPick(
536+
skills.map((s) => ({
537+
label: s.name,
538+
description: s.description,
539+
detail: installedDirNames.has(s.dirName) ? "✓ installed" : "Not installed",
540+
picked: true,
541+
})),
542+
{ canPickMany: true, placeHolder: "Select skills to install" }
543+
);
544+
if (!pickedSkills || pickedSkills.length === 0) { return; }
545+
533546
for (const item of pickedSkills) {
534547
const skill = skills.find((s) => s.name === item.label);
535548
if (!skill) { continue; }

0 commit comments

Comments
 (0)