diff --git a/src/adapters/opencode.ts b/src/adapters/opencode.ts index 8fba259..8e0d95f 100644 --- a/src/adapters/opencode.ts +++ b/src/adapters/opencode.ts @@ -12,7 +12,7 @@ export async function injectOpenCode(projectRoot: string): Promise { const commandDir = join(projectRoot, COMMANDS_DIR); await mkdir(commandDir, { recursive: true }); - const commandPath = join(commandDir, `${stage}.md`); + const commandPath = join(commandDir, `rune-${stage}.md`); if (!existsSync(commandPath)) { await writeFile(commandPath, generateCommand(stage, hasChangeName)); } diff --git a/tests/adapters/opencode.test.ts b/tests/adapters/opencode.test.ts index 69d2cbe..69bff63 100644 --- a/tests/adapters/opencode.test.ts +++ b/tests/adapters/opencode.test.ts @@ -22,7 +22,7 @@ describe("injectOpenCode", () => { const skills = await readdir(join(TMP_DIR, ".opencode", "skills")); for (const stage of ["discuss", "plan", "build", "archive"]) { - expect(commands).toContain(`${stage}.md`); + expect(commands).toContain(`rune-${stage}.md`); expect(skills).toContain(`rune-${stage}.md`); } }); @@ -40,7 +40,7 @@ describe("injectOpenCode", () => { it("command 文件包含 skill 调用指令", async () => { await injectOpenCode(TMP_DIR); const content = await readFile( - join(TMP_DIR, ".opencode", "commands", "discuss.md"), + join(TMP_DIR, ".opencode", "commands", "rune-discuss.md"), "utf-8", ); expect(content).toContain("rune-discuss"); @@ -71,13 +71,13 @@ describe("injectOpenCode", () => { it("重复注入时不覆盖已存在的文件", async () => { await injectOpenCode(TMP_DIR); const originalContent = await readFile( - join(TMP_DIR, ".opencode", "commands", "discuss.md"), + join(TMP_DIR, ".opencode", "commands", "rune-discuss.md"), "utf-8", ); await injectOpenCode(TMP_DIR); const content = await readFile( - join(TMP_DIR, ".opencode", "commands", "discuss.md"), + join(TMP_DIR, ".opencode", "commands", "rune-discuss.md"), "utf-8", ); expect(content).toBe(originalContent);