Files
neondatabase__agent-skills/scripts/validate-skills.mjs
Andre Landgraf 7e7beeb74f ci: consolidate validation into shared validate.yml pipeline
Replace validate-plugins.yml with a single Validate workflow that runs
`npm run validate:ci` (validate:plugins && validate:skills), keeping this
repo's plugin-manifest checks. Add path filters and document the shared,
hardened CI shape plus the intentional per-repo differences with
neon-for-agent-platforms in AGENTS.md.
2026-07-14 22:05:09 -07:00

44 lines
1.1 KiB
JavaScript

#!/usr/bin/env node
import { spawnSync } from "node:child_process";
import { promises as fs } from "node:fs";
import path from "node:path";
import process from "node:process";
const repoRoot = process.cwd();
const skillsRoot = path.join(repoRoot, "skills");
const skillsRefBin = path.join(repoRoot, "node_modules", ".bin", "skills-ref");
async function main() {
let entries;
try {
entries = await fs.readdir(skillsRoot, { withFileTypes: true });
} catch (error) {
console.error(`Failed to read skills directory: ${error.message}`);
process.exit(1);
}
const skillDirs = entries
.filter((entry) => entry.isDirectory())
.map((entry) => path.join("skills", entry.name))
.sort((a, b) => a.localeCompare(b));
if (skillDirs.length === 0) {
console.error("No skill directories found under ./skills");
process.exit(1);
}
for (const skillDir of skillDirs) {
console.log(`Validating ${skillDir}`);
const result = spawnSync(skillsRefBin, ["validate", skillDir], {
stdio: "inherit",
});
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}
}
await main();