From 9a9ff8674e25f937a8cfc3f289f6324032f1c760 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 27 May 2026 00:32:12 +0900 Subject: [PATCH] fix(builtin-skills): document Codex tool mapping --- bun.lock | 44 +++++++++---------- .../builtin-commands/commands.test.ts | 24 ++++++++++ .../builtin-commands/templates/refactor.ts | 16 +++++++ .../templates/remove-ai-slops.ts | 16 +++++++ src/features/builtin-skills/skills.test.ts | 16 ++++++- .../builtin-skills/skills/review-work.ts | 16 +++++++ 6 files changed, 109 insertions(+), 23 deletions(-) diff --git a/bun.lock b/bun.lock index 838bfa2e1..5cc2586ed 100644 --- a/bun.lock +++ b/bun.lock @@ -42,17 +42,17 @@ "zod": "^4.4.3", }, "optionalDependencies": { - "oh-my-opencode-darwin-arm64": "4.5.0", - "oh-my-opencode-darwin-x64": "4.5.0", - "oh-my-opencode-darwin-x64-baseline": "4.5.0", - "oh-my-opencode-linux-arm64": "4.5.0", - "oh-my-opencode-linux-arm64-musl": "4.5.0", - "oh-my-opencode-linux-x64": "4.5.0", - "oh-my-opencode-linux-x64-baseline": "4.5.0", - "oh-my-opencode-linux-x64-musl": "4.5.0", - "oh-my-opencode-linux-x64-musl-baseline": "4.5.0", - "oh-my-opencode-windows-x64": "4.5.0", - "oh-my-opencode-windows-x64-baseline": "4.5.0", + "oh-my-opencode-darwin-arm64": "4.5.1", + "oh-my-opencode-darwin-x64": "4.5.1", + "oh-my-opencode-darwin-x64-baseline": "4.5.1", + "oh-my-opencode-linux-arm64": "4.5.1", + "oh-my-opencode-linux-arm64-musl": "4.5.1", + "oh-my-opencode-linux-x64": "4.5.1", + "oh-my-opencode-linux-x64-baseline": "4.5.1", + "oh-my-opencode-linux-x64-musl": "4.5.1", + "oh-my-opencode-linux-x64-musl-baseline": "4.5.1", + "oh-my-opencode-windows-x64": "4.5.1", + "oh-my-opencode-windows-x64-baseline": "4.5.1", }, "peerDependencies": { "zod": "^4.0.0", @@ -410,27 +410,27 @@ "object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="], - "oh-my-opencode-darwin-arm64": ["oh-my-opencode-darwin-arm64@4.5.0", "", { "os": "darwin", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-jMGHduiNLcunFOHCFs4s3h3QUF6melta+El5bRy13CfI59lxiHIyBhfESWnWrDWo0bLvMT79ptwM4oMtOH/O9A=="], + "oh-my-opencode-darwin-arm64": ["oh-my-opencode-darwin-arm64@4.5.1", "", { "os": "darwin", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-eBpVUGaj4f8CrpETV3j5Uw184QUfSzr8skhTeCemygH8THnbbEQC5lj3KfpeDFD+iWyvG6dKXFgfD80dbFn/qg=="], - "oh-my-opencode-darwin-x64": ["oh-my-opencode-darwin-x64@4.5.0", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-0e7lZ/Q1Y+1ueEjAAKCJ6DoWG/L3lKyfe7tu+6gnMKP8yRVAKnqVKptcb0eizTkFwszS6LMXaZxXRxzDUM00+w=="], + "oh-my-opencode-darwin-x64": ["oh-my-opencode-darwin-x64@4.5.1", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-/78kDxNiK4UxyNqm0sUWUvBkjlqT1b/XQ7acsR76wWxvcT/rMHOcYhbJCC9tmlfGsgiRj9mrUQQ4GyZ4AUflGQ=="], - "oh-my-opencode-darwin-x64-baseline": ["oh-my-opencode-darwin-x64-baseline@4.5.0", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-OFXm5KtNvS0hmNTku/bh+9jgTWJXCPHeo9apYBCSp+WjoJaWNQgei96kVeEGX9lrTR0YqBpU5I9iJQtLOSfrYA=="], + "oh-my-opencode-darwin-x64-baseline": ["oh-my-opencode-darwin-x64-baseline@4.5.1", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-H40//7oWAAE4/dos5bdaLvu1dZX22DIX8u8KfJnY7/bN/+bYO5WSXu7ANakEebkzVBBHqsMfK5G6GgdvEEcolg=="], - "oh-my-opencode-linux-arm64": ["oh-my-opencode-linux-arm64@4.5.0", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-7IUXBHIeMESfiFK9tdMmloFy01ZxxTB83sqDSfzrC496O76pGpP6L0HZ2U0qliGp4Ug0niH3E0adXsAeDtj/Yg=="], + "oh-my-opencode-linux-arm64": ["oh-my-opencode-linux-arm64@4.5.1", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-kY2z28+FXEzanYbAJNp6FuxLpr7A1nHywZMU8mQBeGT7evySHojBeAUcrCKAj+nswZkecebwTI+4Q+EfWCKwvQ=="], - "oh-my-opencode-linux-arm64-musl": ["oh-my-opencode-linux-arm64-musl@4.5.0", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-pdNy9We2Z646LLQ0Q62BIuGMoJwLKBFXTQx94TtMgars7wCjgkJg6I/c21qvlSwILh7eUKwk57rhQUvOouBIug=="], + "oh-my-opencode-linux-arm64-musl": ["oh-my-opencode-linux-arm64-musl@4.5.1", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-xHjRCECGzE4ZxlalBGAmptOal8+zY26RBcY0KSK81tZRs0NElEq4Oj+3tsWZXLHrdMeZJ+s2Z04//VpaQrgePA=="], - "oh-my-opencode-linux-x64": ["oh-my-opencode-linux-x64@4.5.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-UsbVr8OmE/eRk0AHgMOTCU12p/HMRzPEy89A71Fq1Qco3tJ+NiIqaaHs90CkHSFggTs+aaQedi8Mu9lOExa9Pg=="], + "oh-my-opencode-linux-x64": ["oh-my-opencode-linux-x64@4.5.1", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-yNBVPT/v/QaAffmEOy8r4jyih0ebGC3E3pD3aZ7YSGJ6c4xbZCMCiSftCDE0XyDT7wSr/0HUzFOVvn+EfLkbzQ=="], - "oh-my-opencode-linux-x64-baseline": ["oh-my-opencode-linux-x64-baseline@4.5.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-h/WiF/PysX8IR6hYsyavMwSSkFyOewB/bOS0jvQCxJ/9X/q4ybdaNyZA8ASPBUhHCkvxZ9LVanvgc6VkcT499Q=="], + "oh-my-opencode-linux-x64-baseline": ["oh-my-opencode-linux-x64-baseline@4.5.1", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-/zUu9Lwl3pj9LgP5v1AKsJeOio3ikSaI7WUCAGcnomuGmG0Lbn5RzaWVGxf6kVMOneBzAyQ3sKUde630TI4fzA=="], - "oh-my-opencode-linux-x64-musl": ["oh-my-opencode-linux-x64-musl@4.5.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-OkE2i6BK9fv9LQsLxFwbtstGZZijd30k/7Hr1fNuC3jDQysu2OtXwKFc73WrmKyRE5f75ME1VOXoTyk4mjGPhg=="], + "oh-my-opencode-linux-x64-musl": ["oh-my-opencode-linux-x64-musl@4.5.1", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-MxyxOZENSouJLinvNFK06eSRNIG4dq5Nh3Zct+dI48aveS/kn7IIDvUTlx5mgCFvGhMygtq/UYgT7n29GKAmpw=="], - "oh-my-opencode-linux-x64-musl-baseline": ["oh-my-opencode-linux-x64-musl-baseline@4.5.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-Lmd9ytyVrGJFGJw7/9QGqSpy9aksZrVtCA4cpIGPxiPKaQC5d8ABEQXx+MPe49+xp7XMGv97T879eQmsnHkr6g=="], + "oh-my-opencode-linux-x64-musl-baseline": ["oh-my-opencode-linux-x64-musl-baseline@4.5.1", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-g0gZUb9RAil2LH6QddDvhhEJGBa8w3NzFDBnfEJKRWnZwIs5Z0T4nfDtxvEDCUHXZ5q25DX/jdwTzgggIXiqlw=="], - "oh-my-opencode-windows-x64": ["oh-my-opencode-windows-x64@4.5.0", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-XOLHHHb03Jz464K0/JaflfXT6bS+dIegVAgKs6jtBKRazYvWMo1G6y9qds/adHyt3K0GTmPGCNwM0xWfhnHZKw=="], + "oh-my-opencode-windows-x64": ["oh-my-opencode-windows-x64@4.5.1", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-JSQduUCWqHac9Sh78pqEPA3K7NCJt0TX4klUOOQbUKlbw1RIjKCh2i9zy7iW5oUGyH7vxXWWvaACSEUIaDD8HA=="], - "oh-my-opencode-windows-x64-baseline": ["oh-my-opencode-windows-x64-baseline@4.5.0", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-Hr22TnP7gQ9ORgi5+2CT/VgvkyO7gPNOffXnqzCzt+TW6WCU58sqQnPcUvuGmbB0P+C+IWYPYpJhOcxAq38oxQ=="], + "oh-my-opencode-windows-x64-baseline": ["oh-my-opencode-windows-x64-baseline@4.5.1", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-0u6GeWC9wUeC90dhyHw5W4DSlhAey6P4GRmWcNjnR0nStGnXlca3TOgpJHKEBZdt8tS2tosk9OfGeTZ+la+vZQ=="], "on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="], diff --git a/src/features/builtin-commands/commands.test.ts b/src/features/builtin-commands/commands.test.ts index f54aa9f83..45a32ddb4 100644 --- a/src/features/builtin-commands/commands.test.ts +++ b/src/features/builtin-commands/commands.test.ts @@ -173,6 +173,18 @@ describe("loadBuiltinCommands - remove-ai-slops", () => { }) describe("REMOVE_AI_SLOPS_TEMPLATE", () => { + test("should explain Codex tool compatibility before OpenCode orchestration examples", () => { + //#given - the slash command template can be surfaced in Codex-compatible harnesses + + //#when + const compatibilityIndex = REMOVE_AI_SLOPS_TEMPLATE.indexOf("## Codex Harness Tool Compatibility") + const opencodeExampleIndex = REMOVE_AI_SLOPS_TEMPLATE.search(/\b(?:background_output|team_[a-z_]+|task)\s*\(/) + + //#then + expect(compatibilityIndex >= 0).toBe(true) + expect(compatibilityIndex < opencodeExampleIndex).toBe(true) + }) + test("should include phase structure", () => { //#given - the template string @@ -273,6 +285,18 @@ describe("loadBuiltinCommands - team mode gating for remove-ai-slops", () => { }) describe("REFACTOR_TEMPLATE", () => { + test("should explain Codex tool compatibility before OpenCode orchestration examples", () => { + //#given - the slash command template can be surfaced in Codex-compatible harnesses + + //#when + const compatibilityIndex = REFACTOR_TEMPLATE.indexOf("## Codex Harness Tool Compatibility") + const opencodeExampleIndex = REFACTOR_TEMPLATE.search(/\b(?:call_omo_agent|background_output|team_[a-z_]+|task)\s*\(/) + + //#then + expect(compatibilityIndex >= 0).toBe(true) + expect(compatibilityIndex < opencodeExampleIndex).toBe(true) + }) + test("should not contain team mode content in the base template", () => { //#given - the base template string, which is used when team mode is disabled diff --git a/src/features/builtin-commands/templates/refactor.ts b/src/features/builtin-commands/templates/refactor.ts index 0307060e3..b115e5916 100644 --- a/src/features/builtin-commands/templates/refactor.ts +++ b/src/features/builtin-commands/templates/refactor.ts @@ -1,5 +1,21 @@ export const REFACTOR_TEMPLATE = `# Intelligent Refactor Command +## Codex Harness Tool Compatibility + +This command includes examples for the OpenCode harness. In Codex, do not call OpenCode-only tools such as \`call_omo_agent(...)\`, \`task(...)\`, \`background_output(...)\`, or \`team_*(...)\` literally. Translate those examples to Codex native tools: + +| OpenCode example | Codex tool to use | +| --- | --- | +| \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent(agent_type="explorer", task_name="...", message="...")\` | +| \`call_omo_agent(subagent_type="librarian", ...)\` | \`spawn_agent(agent_type="librarian", task_name="...", message="...")\` | +| \`task(subagent_type="plan", ...)\` | \`spawn_agent(agent_type="plan", task_name="...", message="...")\` | +| \`task(subagent_type="oracle", ...)\` | \`spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")\` | +| \`task(category="...", ...)\` | \`spawn_agent(agent_type="worker", task_name="...", message="...")\` | +| \`background_output(task_id="...")\` | \`wait_agent(...)\` to wait for subagent completion and mailbox updates | +| \`team_*(...)\` | Use Codex native subagents plus \`send_message\`, \`followup_task\`, \`wait_agent\`, and \`close_agent\` | + +When translating \`load_skills=[...]\`, include the requested skill names in the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins. + ## Usage \`\`\` /refactor [--scope=] [--strategy=] diff --git a/src/features/builtin-commands/templates/remove-ai-slops.ts b/src/features/builtin-commands/templates/remove-ai-slops.ts index a78d35fa9..3807e06d2 100644 --- a/src/features/builtin-commands/templates/remove-ai-slops.ts +++ b/src/features/builtin-commands/templates/remove-ai-slops.ts @@ -1,5 +1,21 @@ export const REMOVE_AI_SLOPS_TEMPLATE = `# Remove AI Slops Command +## Codex Harness Tool Compatibility + +This command includes examples for the OpenCode harness. In Codex, do not call OpenCode-only tools such as \`call_omo_agent(...)\`, \`task(...)\`, \`background_output(...)\`, or \`team_*(...)\` literally. Translate those examples to Codex native tools: + +| OpenCode example | Codex tool to use | +| --- | --- | +| \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent(agent_type="explorer", task_name="...", message="...")\` | +| \`call_omo_agent(subagent_type="librarian", ...)\` | \`spawn_agent(agent_type="librarian", task_name="...", message="...")\` | +| \`task(subagent_type="plan", ...)\` | \`spawn_agent(agent_type="plan", task_name="...", message="...")\` | +| \`task(subagent_type="oracle", ...)\` | \`spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")\` | +| \`task(category="...", ...)\` | \`spawn_agent(agent_type="worker", task_name="...", message="...")\` | +| \`background_output(task_id="...")\` | \`wait_agent(...)\` to wait for subagent completion and mailbox updates | +| \`team_*(...)\` | Use Codex native subagents plus \`send_message\`, \`followup_task\`, \`wait_agent\`, and \`close_agent\` | + +When translating \`load_skills=[...]\`, include the requested skill names in the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins. + ## What this command does Analyzes all files changed in the current branch (compared to parent commit), removes AI-generated code smells in parallel, then critically reviews the changes to ensure safety and behavior preservation. Fixes any issues found during review. diff --git a/src/features/builtin-skills/skills.test.ts b/src/features/builtin-skills/skills.test.ts index 525978e03..5b17c6319 100644 --- a/src/features/builtin-skills/skills.test.ts +++ b/src/features/builtin-skills/skills.test.ts @@ -12,7 +12,7 @@ describe("createBuiltinSkills", () => { const browserSkill = skills.find((s) => s.name === "playwright") expect(browserSkill).toBeDefined() expect(browserSkill!.description).toContain("browser") - expect(browserSkill!.mcpConfig).toHaveProperty("playwright") + expect(browserSkill!.mcpConfig?.playwright).toBeDefined() }) test("returns playwright skill when browserProvider is 'playwright'", () => { @@ -188,6 +188,20 @@ describe("createBuiltinSkills", () => { expect(reviewWork!.template).toContain("Context Mining") }) + test("review-work skill explains Codex tool compatibility before OpenCode orchestration examples", () => { + // #given + const skills = createBuiltinSkills() + + // #when + const reviewWork = skills.find((s) => s.name === "review-work") + const compatibilityIndex = reviewWork!.template.indexOf("## Codex Harness Tool Compatibility") + const opencodeExampleIndex = reviewWork!.template.search(/\b(?:background_output|team_[a-z_]+|task)\s*\(/) + + // #then + expect(compatibilityIndex >= 0).toBe(true) + expect(compatibilityIndex < opencodeExampleIndex).toBe(true) + }) + test("ai-slop-remover skill has correct structure", () => { // #given - default options diff --git a/src/features/builtin-skills/skills/review-work.ts b/src/features/builtin-skills/skills/review-work.ts index 608929ab5..f3ef9c860 100644 --- a/src/features/builtin-skills/skills/review-work.ts +++ b/src/features/builtin-skills/skills/review-work.ts @@ -6,6 +6,22 @@ export const reviewWorkSkill: BuiltinSkill = { "Post-implementation review orchestrator. Launches 5 parallel background sub-agents: Oracle (goal/constraint verification), Oracle (code quality), Oracle (security), unspecified-high (hands-on QA execution), unspecified-high (context mining from GitHub/git/Slack/Notion). All must pass for review to pass. MUST USE after completing any significant implementation work. Triggers: 'review work', 'review my work', 'review changes', 'QA my work', 'verify implementation', 'check my work', 'validate changes', 'post-implementation review'.", template: `# Review Work - 5-Agent Parallel Review Orchestrator +## Codex Harness Tool Compatibility + +This skill includes examples for the OpenCode harness. In Codex, do not call OpenCode-only tools such as \`call_omo_agent(...)\`, \`task(...)\`, \`background_output(...)\`, or \`team_*(...)\` literally. Translate those examples to Codex native tools: + +| OpenCode example | Codex tool to use | +| --- | --- | +| \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent(agent_type="explorer", task_name="...", message="...")\` | +| \`call_omo_agent(subagent_type="librarian", ...)\` | \`spawn_agent(agent_type="librarian", task_name="...", message="...")\` | +| \`task(subagent_type="plan", ...)\` | \`spawn_agent(agent_type="plan", task_name="...", message="...")\` | +| \`task(subagent_type="oracle", ...)\` | \`spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")\` | +| \`task(category="...", ...)\` | \`spawn_agent(agent_type="worker", task_name="...", message="...")\` | +| \`background_output(task_id="...")\` | \`wait_agent(...)\` to wait for subagent completion and mailbox updates | +| \`team_*(...)\` | Use Codex native subagents plus \`send_message\`, \`followup_task\`, \`wait_agent\`, and \`close_agent\` | + +When translating \`load_skills=[...]\`, include the requested skill names in the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins. + Launch 5 specialized sub-agents in parallel to review completed implementation work from every angle. All 5 must pass for the review to pass. If even ONE fails, the review fails. The 5 agents cover complementary concerns - together they form a comprehensive review that no single reviewer could match: