mirror of
https://github.com/neondatabase/agent-skills.git
synced 2026-09-14 19:07:52 +08:00
7e7beeb74f
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.
44 lines
1.1 KiB
JavaScript
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();
|