npx skills add https://github.com/ai-feier/skills --skill openspec-propose提出新变更 - 一步创建变更并生成所有工件。
我将创建一个包含工件的变更:
准备实施时,运行 /opsx-apply
输入:用户的请求应包含一个变更名称(kebab-case)或对其想要构建内容的描述。
步骤
使用 AskUserQuestion 工具(开放式,无预设选项)询问:
"您想要处理什么变更?描述您想要构建或修复的内容。"
根据他们的描述,推导出 kebab-case 名称(例如,"add user authentication" → add-user-auth)。
重要提示:在未理解用户想要构建什么之前,不要继续。
创建变更目录
openspec new change "<name>"
这将在 openspec/changes/<name>/ 处创建一个带有 .openspec.yaml 的脚手架变更。
Propose a new change - create the change and generate all artifacts in one step.
I'll create a change with artifacts:
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
Use 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-auth).
IMPORTANT : Do NOT proceed without understanding what the user wants to build.
Create the change directory
openspec new change "<name>"
This creates a scaffolded change at openspec/changes/<name>/ with .
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
获取工件构建顺序
openspec status --change "<name>" --json
解析 JSON 以获取:
* `applyRequires`:实施前所需的工件 ID 数组(例如 `["tasks"]`)
* `artifacts`:所有工件的列表及其状态和依赖关系
4. 按顺序创建工件,直到达到可实施状态
使用 TodoWrite 工具 来跟踪工件的处理进度。
按依赖顺序循环处理工件(先处理没有待处理依赖项的工件):
a. 对于每个状态为 ready(依赖项已满足)的工件:
* 获取指令:
openspec instructions <artifact-id> --change "<name>" --json
* 指令 JSON 包含:
* `context`:项目背景(给您的约束 - **不要**包含在输出中)
* `rules`:特定工件的规则(给您的约束 - **不要**包含在输出中)
* `template`:用于输出文件的结构
* `instruction`:针对此工件类型的模式特定指导
* `outputPath`:写入工件的位置
* `dependencies`:为获取上下文而需读取的已完成工件
* 读取任何已完成的依赖文件以获取上下文
* 使用 `template` 作为结构创建工件文件
* 应用 `context` 和 `rules` 作为约束 - 但**不要**将它们复制到文件中
* 显示简要进度:"已创建 "
b. 继续直到所有 applyRequires 中的工件都完成
* 创建每个工件后,重新运行 `openspec status --change "<name>" --json`
* 检查 `artifacts` 数组中,`applyRequires` 里的每个工件 ID 是否都处于 `status: "done"`
* 当所有 `applyRequires` 工件都完成时停止
c. 如果某个工件需要用户输入(上下文不明确):
* 使用 **AskUserQuestion 工具** 来澄清
* 然后继续创建
5. 显示最终状态
openspec status --change "<name>"
输出
完成所有工件后,总结:
/opsx-apply 或要求我实施以开始处理任务。"工件创建指南
openspec instructions 中每个工件类型的 instruction 字段template 作为输出文件的结构 - 填写其各个部分context 和 rules 是给您的约束,不是文件的内容
<context>、<rules>、<project_context> 块复制到工件中防护措施
apply.requires 定义)每周安装数
1
仓库
首次出现
1 天前
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
.openspec.yamlGet the artifact build order
openspec status --change "<name>" --json
Parse the JSON to get:
* `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
* `artifacts`: list of all artifacts with their status and dependencies
4. Create artifacts in sequence until apply-ready
Use 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 isready (dependencies satisfied):
* Get instructions:
openspec instructions <artifact-id> --change "<name>" --json
* The instructions JSON includes:
* `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 file
* `instruction`: Schema-specific guidance for this artifact type
* `outputPath`: Where to write the artifact
* `dependencies`: Completed artifacts to read for context
* Read any completed dependency files for context
* Create the artifact file using `template` as the structure
* Apply `context` and `rules` as constraints - but do NOT copy them into the file
* Show brief progress: "Created "
b. Continue until allapplyRequires artifacts are complete
* After creating each artifact, re-run `openspec status --change "<name>" --json`
* Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
* Stop when all `applyRequires` artifacts are done
c. If an artifact requires user input (unclear context):
* Use **AskUserQuestion tool** to clarify
* Then continue with creation
5. Show final status
openspec status --change "<name>"
Output
After completing all artifacts, summarize:
/opsx-apply or ask me to implement to start working on the tasks."Artifact Creation Guidelines
instruction field from openspec instructions for each artifact typetemplate as the structure for your output file - fill in its sectionscontext and rules are constraints for YOU, not content for the file
<context>, <rules>, <project_context> blocks into the artifactGuardrails
apply.requires)Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
150,000 周安装