fix: CLI缺少参数友好提示、config.yaml注释模板、skill目录结构规范
This commit is contained in:
@@ -6,6 +6,37 @@ import { injectOpenCode } from "../adapters/opencode.ts";
|
||||
import { injectClaudeCode } from "../adapters/claude-code.ts";
|
||||
import { CommandError } from "../cli/errors.ts";
|
||||
|
||||
const CONFIG_TEMPLATE = `# Rune 配置文件
|
||||
#
|
||||
# 未配置的阶段将使用内置默认配置。
|
||||
# 阶段顺序:discuss -> plan -> build -> archive
|
||||
#
|
||||
# 可配置阶段:
|
||||
# discuss - 讨论阶段:自由讨论需求和架构
|
||||
# plan - 规划阶段:生成设计文档和任务清单
|
||||
# build - 构建阶段:按任务清单逐步实现
|
||||
# archive - 归档阶段:确认完成并归档变更
|
||||
#
|
||||
# 示例 - 自定义讨论阶段提示词:
|
||||
# stages:
|
||||
# discuss:
|
||||
# prompt: |
|
||||
# 你是一位资深软件架构师...
|
||||
#
|
||||
# 示例 - 自定义规划阶段的文档模板:
|
||||
# stages:
|
||||
# plan:
|
||||
# documents:
|
||||
# - name: design
|
||||
# prompt: 生成设计文档
|
||||
# template: |
|
||||
# # {{change-name}} 设计文档
|
||||
# - name: task
|
||||
# prompt: 生成任务清单
|
||||
# template: |
|
||||
# # {{change-name}} 任务清单
|
||||
`;
|
||||
|
||||
const SUPPORTED_TOOLS: Record<string, (root: string) => Promise<void>> = {
|
||||
opencode: injectOpenCode,
|
||||
"claude-code": injectClaudeCode,
|
||||
@@ -30,7 +61,7 @@ export async function runInit(
|
||||
|
||||
const configPath = join(runeDir, CONFIG_FILE);
|
||||
if (!existsSync(configPath)) {
|
||||
await writeFile(configPath, "stages: {}\n", "utf-8");
|
||||
await writeFile(configPath, CONFIG_TEMPLATE, "utf-8");
|
||||
}
|
||||
|
||||
for (const tool of tools) {
|
||||
|
||||
Reference in New Issue
Block a user