.codebuddy/commands/opsx/ff.md
快速完成产出物创建 - 生成开始实现所需的一切。
输入:/opsx:ff 之后的参数是变更名称(kebab-case),或用户想要构建内容的描述。
步骤
如果没有提供输入,询问他们想要构建什么
使用 AskUserQuestion tool(开放式,无预设选项)询问:
"您想要处理什么变更?请描述您想要构建或修复的内容。"
根据他们的描述,推导出一个 kebab-case 名称(例如:"add user authentication" → add-user-auth)。
重要提示:在不了解用户想要构建什么的情况下,请勿继续。
创建变更目录
openspec-cn new change "<name>"
这将在 openspec/changes/<name>/ 创建一个脚手架变更。
获取产出物构建顺序
openspec-cn status --change "<name>" --json
解析 JSON 以获取:
applyRequires: 实现前所需的产出物 ID 数组(例如:["tasks"])artifacts: 所有产出物及其状态和依赖项的列表按顺序创建产出物直到准备好应用
使用 TodoWrite tool 跟踪产出物的进度。
按依赖顺序循环遍历产出物(没有待处理依赖项的产出物优先):
a. 对于每个 ready(依赖项已满足)的产出物:
openspec-cn instructions <artifact-id> --change "<name>" --json
context: Project background (constraints for you - do NOT include in output)rules: Artifact-specific rules (constraints for you - do NOT include in output)template: The structure to use for your output fileinstruction: Schema-specific guidance for this artifact typeoutputPath: Where to write the artifactdependencies: Completed artifacts to read for contexttemplate as the structurecontext and rules as constraints - but do NOT copy them into the fileb. 继续直到所有 applyRequires 产出物完成
openspec-cn status --change "<name>" --jsonapplyRequires 中的每个产出物 ID 在 artifacts 数组中是否具有 status: "done"applyRequires 产出物完成时停止c. 如果产出物需要用户输入(上下文不清楚):
显示最终状态
openspec-cn status --change "<name>"
输出
完成所有产出物后,总结:
/opsx:apply 以开始实现。"产出物创建指南
openspec-cn instructions 中的 instruction 字段template 作为起点,根据上下文填写护栏
apply.requires 定义)