docs: config.yaml 模板移除 {{change-name}},增加 metadata 说明和 create 阶段

This commit is contained in:
2026-06-10 13:08:47 +08:00
parent ed4da9b6a0
commit cb537b4f2a
2 changed files with 30 additions and 3 deletions

View File

@@ -11,10 +11,11 @@ import { parse as parseYaml } from "yaml";
const CONFIG_TEMPLATE = `# Rune 配置文件 const CONFIG_TEMPLATE = `# Rune 配置文件
# #
# 未配置的阶段将使用内置默认配置。 # 未配置的阶段将使用内置默认配置。
# 阶段顺序discuss -> plan -> build -> archive # 阶段顺序discuss -> create -> plan -> build -> archive
# #
# 可配置阶段: # 可配置阶段:
# discuss - 探索阶段:深度思考、调查代码库、对比方案 # discuss - 探索阶段:深度思考、调查代码库、对比方案
# create - 创建阶段:拟定变更名称并创建变更目录
# plan - 规划阶段:生成设计文档和任务清单 # plan - 规划阶段:生成设计文档和任务清单
# build - 构建阶段:按任务清单逐步实现 # build - 构建阶段:按任务清单逐步实现
# archive - 归档阶段:确认完成并归档变更 # archive - 归档阶段:确认完成并归档变更
@@ -32,12 +33,16 @@ const CONFIG_TEMPLATE = `# Rune 配置文件
# - name: design # - name: design
# prompt: 生成设计文档 # prompt: 生成设计文档
# template: | # template: |
# # {{change-name}} 设计文档 # # 设计文档
# - name: task # - name: task
# prompt: 生成任务清单 # prompt: 生成任务清单
# depend: [design] # depend: [design]
# template: | # template: |
# # {{change-name}} 任务清单 # # 任务清单
#
# metadata 说明:
# command - Rune CLI 执行命令(如 bunx @lanyuanxiaoyao/runeinit 时自动检测
# tracked - 是否启用任务追踪(默认 true开启时 plan.documents 必须包含 task 文档
`; `;
export const SUPPORTED_TOOLS: Record<string, (root: string, command?: string) => Promise<void>> = { export const SUPPORTED_TOOLS: Record<string, (root: string, command?: string) => Promise<void>> = {

View File

@@ -67,4 +67,26 @@ describe("runInit", () => {
expect(content).toContain("metadata:"); expect(content).toContain("metadata:");
expect(content).toContain("command:"); expect(content).toContain("command:");
}); });
it("config.yaml 模板不含 {{change-name}}", async () => {
await runInit(TMP_DIR, ["opencode"]);
const content = await readFile(join(TMP_DIR, ".rune", "config.yaml"), "utf-8");
expect(content).not.toContain("{{change-name}}");
});
it("config.yaml 模板包含 metadata 说明", async () => {
await runInit(TMP_DIR, ["opencode"]);
const content = await readFile(join(TMP_DIR, ".rune", "config.yaml"), "utf-8");
expect(content).toContain("metadata");
expect(content).toContain("tracked");
});
it("config.yaml 模板包含 create 阶段", async () => {
await runInit(TMP_DIR, ["opencode"]);
const content = await readFile(join(TMP_DIR, ".rune", "config.yaml"), "utf-8");
expect(content).toContain("create");
});
}); });