diff --git a/src/commands/init.ts b/src/commands/init.ts index 2aba298..6d4993a 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -1,8 +1,6 @@ import { existsSync } from "node:fs"; import { mkdir, writeFile } from "node:fs/promises"; import { join } from "node:path"; -import { stringify as stringifyYaml } from "yaml"; -import { defaultConfig } from "../defaults/config.ts"; import { CHANGES_DIR, ARCHIVE_DIR, RUNE_DIR, CONFIG_FILE } from "../types.ts"; import { injectOpenCode } from "../adapters/opencode.ts"; import { injectClaudeCode } from "../adapters/claude-code.ts"; @@ -29,8 +27,7 @@ export async function runInit( const configPath = join(runeDir, CONFIG_FILE); if (!existsSync(configPath)) { - const yaml = stringifyYaml(defaultConfig); - await writeFile(configPath, yaml, "utf-8"); + await writeFile(configPath, "stages: {}\n", "utf-8"); } for (const tool of tools) { diff --git a/tests/commands/init.test.ts b/tests/commands/init.test.ts index 1675300..c06d008 100644 --- a/tests/commands/init.test.ts +++ b/tests/commands/init.test.ts @@ -15,7 +15,7 @@ afterEach(async () => { }); describe("runInit", () => { - it("创建 .rune 目录和默认 config.yaml", async () => { + it("创建 .rune 目录和空 config.yaml", async () => { await runInit(TMP_DIR, ["opencode"]); expect(existsSync(join(TMP_DIR, ".rune"))).toBe(true); @@ -25,10 +25,7 @@ describe("runInit", () => { join(TMP_DIR, ".rune", "config.yaml"), "utf-8", ); - expect(content).toContain("discuss"); - expect(content).toContain("plan"); - expect(content).toContain("build"); - expect(content).toContain("archive"); + expect(content.trim()).toBe("stages: {}"); }); it("创建 .rune/changes 和 .rune/archive 目录", async () => {