fix(builtin-skills): document Codex tool mapping
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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 <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user