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
This commit is contained in:
Derek Pearson 2026-03-22 06:13:50 -04:00
parent aa0822466e
commit b442a55bff
3 changed files with 9 additions and 5 deletions

View file

@ -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 */ }
}

View file

@ -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",

View file

@ -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) ────────────────────────────────────────────
{