openspec-propose
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePropose a new change - create the change and generate all artifacts in one step.
I'll create a change with artifacts:
- proposal.md (what & why)
- design.md (how)
- tasks.md (implementation steps)
When ready to implement, run /opsx:apply
Input: The user's request should include a change name (kebab-case) OR a description of what they want to build.
Steps
-
If no clear input provided, ask what they want to buildUse the AskUserQuestion tool (open-ended, no preset options) to ask:"What change do you want to work on? Describe what you want to build or fix."From their description, derive a kebab-case name (e.g., "add user authentication" →).
add-user-authIMPORTANT: Do NOT proceed without understanding what the user wants to build. -
Create the change directorybash
openspec new change "<name>"This creates a scaffolded change atwithopenspec/changes/<name>/..openspec.yaml -
Get the artifact build orderbash
openspec status --change "<name>" --jsonParse the JSON to get:- : array of artifact IDs needed before implementation (e.g.,
applyRequires)["tasks"] - : list of all artifacts with their status and dependencies
artifacts
-
Create artifacts in sequence until apply-readyUse the TodoWrite tool to track progress through the artifacts.Loop through artifacts in dependency order (artifacts with no pending dependencies first):a. For each artifact that is(dependencies satisfied):
ready- Get instructions:
bash
openspec instructions <artifact-id> --change "<name>" --json - The instructions JSON includes:
- : Project background (constraints for you - do NOT include in output)
context - : Artifact-specific rules (constraints for you - do NOT include in output)
rules - : The structure to use for your output file
template - : Schema-specific guidance for this artifact type
instruction - : Where to write the artifact
outputPath - : Completed artifacts to read for context
dependencies
- Read any completed dependency files for context
- Create the artifact file using as the structure
template - Apply and
contextas constraints - but do NOT copy them into the filerules - Show brief progress: "Created <artifact-id>"
b. Continue until allartifacts are completeapplyRequires- After creating each artifact, re-run
openspec status --change "<name>" --json - Check if every artifact ID in has
applyRequiresin the artifacts arraystatus: "done" - Stop when all artifacts are done
applyRequires
c. If an artifact requires user input (unclear context):- Use AskUserQuestion tool to clarify
- Then continue with creation
- Get instructions:
-
Show final statusbash
openspec status --change "<name>"
Output
After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions
- What's ready: "All artifacts created! Ready for implementation."
- Prompt: "Run or ask me to implement to start working on the tasks."
/opsx:apply
Artifact Creation Guidelines
- Follow the field from
instructionfor each artifact typeopenspec instructions - The schema defines what each artifact should contain - follow it
- Read dependency artifacts for context before creating new ones
- Use as the structure for your output file - fill in its sections
template - IMPORTANT: and
contextare constraints for YOU, not content for the filerules- Do NOT copy ,
<context>,<rules>blocks into the artifact<project_context> - These guide what you write, but should never appear in the output
- Do NOT copy
Guardrails
- Create ALL artifacts needed for implementation (as defined by schema's )
apply.requires - Always read dependency artifacts before creating a new one
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
- If a change with that name already exists, ask if user wants to continue it or create a new one
- Verify each artifact file exists after writing before proceeding to next
提出新变更——一键创建变更并生成所有相关工件。
我将创建包含以下工件的变更:
- proposal.md(内容与目的)
- design.md(实现方式)
- tasks.md(实施步骤)
准备实施时,运行 /opsx:apply
输入:用户的请求需包含变更名称(kebab-case格式),或对想要构建内容的描述。
步骤
-
若未提供明确输入,询问用户想要构建的内容使用 AskUserQuestion 工具(开放式问题,无预设选项)询问:"你想要处理什么变更?描述一下你想要构建或修复的内容。"根据用户的描述,生成kebab-case格式的名称(例如:"add user authentication" →)。
add-user-auth重要提示:在未明确用户需求前,请勿继续操作。 -
创建变更目录bash
openspec new change "<name>"此命令会在路径下创建一个包含openspec/changes/<name>/文件的变更脚手架。.openspec.yaml -
获取工件构建顺序bash
openspec status --change "<name>" --json解析JSON结果以获取:- :实施前所需的工件ID数组(例如:
applyRequires)["tasks"] - :所有工件的列表,包含其状态和依赖关系
artifacts
-
按顺序创建工件直至可实施状态使用 TodoWrite 工具跟踪工件的创建进度。按照依赖顺序遍历工件(优先处理无未完成依赖的工件):a. 对于每个状态为(依赖已满足)的工件:
ready- 获取指令:
bash
openspec instructions <artifact-id> --change "<name>" --json - 指令JSON包含:
- :项目背景(约束条件,请勿写入输出文件)
context - :工件特定规则(约束条件,请勿写入输出文件)
rules - :输出文件需遵循的结构
template - :针对该工件类型的 schema 专属指导
instruction - :工件的写入路径
outputPath - :需读取以获取上下文的已完成工件
dependencies
- 读取所有已完成的依赖文件以获取上下文
- 以 为结构创建工件文件
template - 将 和
context作为约束条件,但请勿将其复制到文件中rules - 显示简要进度:"已创建 <artifact-id>"
b. 持续操作直至所有工件完成applyRequires- 创建每个工件后,重新运行
openspec status --change "<name>" --json - 检查 中的每个工件ID是否在 artifacts 数组中处于
applyRequires状态status: "done" - 当所有 工件完成后停止操作
applyRequires
c. 若工件需要用户输入(上下文不明确):- 使用 AskUserQuestion 工具进行澄清
- 然后继续创建工件
- 获取指令:
-
显示最终状态bash
openspec status --change "<name>"
输出
完成所有工件创建后,进行总结:
- 变更名称和位置
- 已创建工件的列表及简要描述
- 就绪状态:"所有工件已创建!准备好实施。"
- 提示:"运行 或让我开始实施任务。"
/opsx:apply
工件创建指南
- 遵循 返回的
openspec instructions字段中针对各工件类型的要求instruction - schema 定义了每个工件应包含的内容,请严格遵循
- 创建新工件前,先读取依赖工件以获取上下文
- 以 作为输出文件的结构,填充各部分内容
template - 重要提示:和
context是针对你的约束条件,而非文件内容rules- 请勿将 、
<context>、<rules>块复制到工件中<project_context> - 这些内容用于指导你的编写,但绝不能出现在输出文件中
- 请勿将
防护规则
- 创建实施所需的所有工件(由 schema 的 定义)
apply.requires - 创建新工件前务必读取依赖工件
- 若上下文严重不明确,请询问用户,但优先做出合理决策以保持进度
- 若同名变更已存在,询问用户是继续该变更还是创建新变更
- 继续下一步操作前,验证每个工件文件是否已成功写入