From b442a55bffbb81318d75f484713ac5e84c647be6 Mon Sep 17 00:00:00 2001 From: Derek Pearson Date: Sun, 22 Mar 2026 06:13:50 -0400 Subject: [PATCH] fix(skills): address QA round 2 - Add azure-pipelines.yml to PROJECT_FILES and Azure pack matchFiles - Add serverless.yaml variant to PROJECT_FILES and AWS pack matchFiles - Fix marker fd leak in migrateSkillsToEcosystemDir: wrap mkdirSync inside try/finally, remove marker on failure so migration retries --- src/resource-loader.ts | 9 +++++---- src/resources/extensions/gsd/detection.ts | 2 ++ src/resources/extensions/gsd/skill-catalog.ts | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/resource-loader.ts b/src/resource-loader.ts index d99cece1e..a56754121 100644 --- a/src/resource-loader.ts +++ b/src/resource-loader.ts @@ -448,10 +448,10 @@ function migrateSkillsToEcosystemDir(agentDir: string): void { return // marker already exists (another process won the race, or already migrated) } - const ecosystemDir = join(homedir(), '.agents', 'skills') - mkdirSync(ecosystemDir, { recursive: true }) - try { + const ecosystemDir = join(homedir(), '.agents', 'skills') + mkdirSync(ecosystemDir, { recursive: true }) + const entries = readdirSync(legacyDir, { withFileTypes: true }) let migrated = 0 for (const entry of entries) { @@ -495,7 +495,8 @@ function migrateSkillsToEcosystemDir(agentDir: string): void { // Write migration info to the marker try { writeFileSync(markerFd, `Migrated ${migrated} skill(s) to ${ecosystemDir} on ${new Date().toISOString()}\n`) } catch { /* non-fatal */ } } catch { - // can't read legacy dir — skip silently + // can't create ecosystem dir or read legacy dir — remove marker so we retry next launch + try { unlinkSync(markerPath) } catch { /* non-fatal */ } } finally { try { closeSync(markerFd) } catch { /* non-fatal */ } } diff --git a/src/resources/extensions/gsd/detection.ts b/src/resources/extensions/gsd/detection.ts index fbed6b89b..4d4f6b27c 100644 --- a/src/resources/extensions/gsd/detection.ts +++ b/src/resources/extensions/gsd/detection.ts @@ -97,6 +97,8 @@ export const PROJECT_FILES = [ "cdk.json", "samconfig.toml", "serverless.yml", + "serverless.yaml", + "azure-pipelines.yml", // React Native markers "metro.config.js", "metro.config.ts", diff --git a/src/resources/extensions/gsd/skill-catalog.ts b/src/resources/extensions/gsd/skill-catalog.ts index a7b14adde..3b5c162e5 100644 --- a/src/resources/extensions/gsd/skill-catalog.ts +++ b/src/resources/extensions/gsd/skill-catalog.ts @@ -254,13 +254,14 @@ export const SKILL_CATALOG: SkillPack[] = [ "azure-cost-optimization", "azure-diagnostics", ], + matchFiles: ["azure-pipelines.yml"], }, { label: "AWS", description: "AWS deployment, Lambda, and serverless patterns", repo: "awslabs/agent-plugins", skills: ["deploy", "aws-lambda", "aws-serverless-deployment"], - matchFiles: ["cdk.json", "samconfig.toml", "serverless.yml"], + matchFiles: ["cdk.json", "samconfig.toml", "serverless.yml", "serverless.yaml"], }, // ── Essential (all projects) ──────────────────────────────────────────── {