refactor: create 从 SDD 阶段降级为工具命令,移除阶段配置和提示词
This commit is contained in:
@@ -36,6 +36,22 @@ export async function injectClaudeCode(
|
||||
}
|
||||
}
|
||||
|
||||
// create 是工具命令,不是 SDD 阶段,但仍需生成对应的 command 文件
|
||||
{
|
||||
const stage = "create";
|
||||
const cmd = `${command} ${stage} <变更名>`;
|
||||
const smartGuide = `\n${buildSmartGuide(command)}\n`;
|
||||
const commandDir = join(projectRoot, COMMANDS_DIR);
|
||||
await mkdir(commandDir, { recursive: true });
|
||||
const commandPath = join(commandDir, `rune-${stage}.md`);
|
||||
if (!existsSync(commandPath)) {
|
||||
await writeFile(
|
||||
commandPath,
|
||||
`执行以下命令,将输出作为当前阶段的工作指引:\n\`\`\`bash\n${cmd}\n\`\`\`${smartGuide}\n`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const introCommandPath = join(projectRoot, COMMANDS_DIR, "rune-intro.md");
|
||||
if (!existsSync(introCommandPath)) {
|
||||
await mkdir(join(projectRoot, COMMANDS_DIR), { recursive: true });
|
||||
@@ -59,6 +75,18 @@ export async function updateClaudeCode(
|
||||
await writeIfChanged(commandPath, newContent);
|
||||
}
|
||||
|
||||
// create 是工具命令,不是 SDD 阶段,但仍需生成对应的 command 文件
|
||||
{
|
||||
const stage = "create";
|
||||
const cmd = `${command} ${stage} <变更名>`;
|
||||
const smartGuide = `\n${buildSmartGuide(command)}\n`;
|
||||
const commandDir = join(projectRoot, COMMANDS_DIR);
|
||||
await mkdir(commandDir, { recursive: true });
|
||||
const commandPath = join(commandDir, `rune-${stage}.md`);
|
||||
const newContent = `执行以下命令,将输出作为当前阶段的工作指引:\n\`\`\`bash\n${cmd}\n\`\`\`${smartGuide}\n`;
|
||||
await writeIfChanged(commandPath, newContent);
|
||||
}
|
||||
|
||||
const introCommandPath = join(projectRoot, COMMANDS_DIR, "rune-intro.md");
|
||||
await writeIfChanged(introCommandPath, generateIntroCommand(command));
|
||||
}
|
||||
@@ -66,11 +94,11 @@ export async function updateClaudeCode(
|
||||
function generateIntroCommand(command: string): string {
|
||||
return `Rune 是基于规格驱动开发(SDD)的 AI 开发辅助工具。SDD 工作流程:
|
||||
|
||||
discuss → create → plan → build → archive
|
||||
discuss → plan → build → archive
|
||||
|
||||
可用命令:
|
||||
- /rune-discuss — 自由讨论需求和方案
|
||||
- /rune-create — 创建变更目录
|
||||
- /rune-create — 创建变更目录(辅助命令,plan 阶段的前置步骤)
|
||||
- /rune-plan — 生成设计文档和任务清单
|
||||
- /rune-build — 按任务清单逐步实现
|
||||
- /rune-archive — 归档已完成的变更
|
||||
|
||||
Reference in New Issue
Block a user