Files
oh-my-opencode/packages/omo-codex/plugin/test/sync-skills.test.mjs
T
YeonGyu-Kim 8c6e8e4986 refactor(omo-codex): rename ultragoal component to ulw-loop
Fully rename the ultragoal component to ulw-loop so the identifier
matches the ulw-loop skill it powers. Renames the component directory,
nested skill, TS identifiers (UlwLoop / ULW_LOOP_* / ulwLoop*), the
omo ulw-loop CLI subcommand, the .omo/ulw-loop state directory, the
OMO_ULW_LOOP_STEER directive token, and the @code-yeongyu/codex-ulw-loop
package. Also threads Atlas-style right-sized parallel worker delegation
and a Prometheus-style QA + maximum-parallelism plan into the ulw-loop
skill, with a critical post-subagent QA gate.

Updates aggregate wiring (plugin package components, hooks.json,
sync-skills), the install-codex agent-link test fixture, and user docs.
2026-05-29 12:38:22 +09:00

97 lines
3.3 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",
"init-deep",
"lsp",
"planing-prometheustic",
"programming",
"refactor",
"remove-ai-slops",
"review-work",
"rules",
"start-work",
"ulw-loop",
];
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/);
}
});
test("#given synced ulw-loop skill #when Codex hint metadata is inspected #then ulw-loop surfaces the ulw-loop alias", async () => {
// given
const skillRoot = join(root, "skills", "ulw-loop");
// when
const skill = await readFile(join(skillRoot, "SKILL.md"), "utf8");
const interfaceMetadata = await readFile(join(skillRoot, "agents", "openai.yaml"), "utf8");
// then
assert.match(skill, /^---\nname: ulw-loop\n/m);
assert.match(skill, /Goal-like loop that uses ultrawork mode to decompose work into systematic, evidence-bound steps\./);
assert.match(interfaceMetadata, /display_name: "ulw loop"/);
assert.doesNotMatch(interfaceMetadata, /ulw-loop \/ ulw-loop/);
assert.match(interfaceMetadata, /short_description: "Goal-like ultrawork loop for systematic decomposition"/);
assert.match(interfaceMetadata, /default_prompt: "Use \$ulw-loop/);
});
test("#given synced ulw-loop skill #when Codex hint metadata is inspected #then ulw-loop remains discoverable as an alias", async () => {
// given
const skillRoot = join(root, "skills", "ulw-loop");
// when
const interfaceMetadata = await readFile(join(skillRoot, "agents", "openai.yaml"), "utf8");
// then
assert.match(interfaceMetadata, /search_terms:/);
assert.match(interfaceMetadata, /- "ulw-loop"/);
});
test("#given synced aggregate Codex skills #when they contain OpenCode orchestration examples #then Codex tool compatibility guidance is injected", async () => {
// given
const skillsRoot = join(root, "skills");
const opencodeOnlyToolPattern = /\b(?:call_omo_agent|background_output|team_[a-z_]+|task)\s*\(/;
// when
const skillNames = (await readdir(skillsRoot, { withFileTypes: true }))
.filter((entry) => entry.isDirectory())
.map((entry) => entry.name)
.sort();
// then
for (const skillName of skillNames) {
const content = await readFile(join(skillsRoot, skillName, "SKILL.md"), "utf8");
if (!opencodeOnlyToolPattern.test(content)) continue;
const compatibilityIndex = content.indexOf("## Codex Harness Tool Compatibility");
assert.notEqual(compatibilityIndex, -1, `${skillName} is missing Codex compatibility guidance`);
assert.ok(
compatibilityIndex < content.search(opencodeOnlyToolPattern),
`${skillName} must explain Codex tool translation before OpenCode-only examples`,
);
}
});