Files
oh-my-opencode/packages/omo-codex/plugin/test/sync-skills.test.mjs
T
2026-05-28 13:58:12 +09:00

40 lines
1.0 KiB
JavaScript

import assert from "node:assert/strict";
import { readdir, readFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
const root = dirname(dirname(fileURLToPath(import.meta.url)));
const expectedSkills = [
"ai-slop-remover",
"comment-checker",
"debugging",
"frontend-ui-ux",
"lsp",
"programming",
"refactor",
"remove-ai-slops",
"review-work",
"rules",
"ultragoal",
];
test("#given synced aggregate Codex skills #when inspected #then component and shared skills are present", async () => {
// given
const skillsRoot = join(root, "skills");
// when
const skillNames = (await readdir(skillsRoot, { withFileTypes: true }))
.filter((entry) => entry.isDirectory())
.map((entry) => entry.name)
.sort();
// then
assert.deepEqual(skillNames, expectedSkills);
for (const skillName of expectedSkills) {
const content = await readFile(join(skillsRoot, skillName, "SKILL.md"), "utf8");
assert.match(content, /^---\n/);
}
});