@jspg-ai/coding-bb 0.0.3-beta.6 → 0.0.3-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cbb/dev-standards/rules/cbb-ai-behavior.md +1 -1
- package/cbb/lib/install/claude-code.js +1 -3
- package/cbb/lib/install/codebuddy.js +0 -2
- package/cbb/lib/install/init.js +115 -85
- package/cbb/lib/install/opencode.js +1 -5
- package/cbb/lib/install/qoder.js +1 -3
- package/cbb/lib/install/trae.js +0 -2
- package/cbb/lib/openspec/index.js +337 -554
- package/cbb/lib/superpowers/index.js +246 -265
- package/cbb/lib/utils/tar.js +92 -0
- package/cbb/lib/utils/upstream.js +90 -0
- package/cbb/worktrees/skills/cbb-worktree-close/SKILL.md +31 -22
- package/cbb/worktrees/skills/cbb-worktree-init/SKILL.md +21 -22
- package/cbb/worktrees/skills/cbb-worktree-push/SKILL.md +66 -30
- package/config/openspec/schemas/spec-driven/schema.yaml +21 -30
- package/config/openspec/schemas/spec-driven/templates/design.md +0 -18
- package/config/openspec/schemas/spec-driven/templates/proposal.md +4 -3
- package/config/upstream-mirrors.json +12 -0
- package/config/workspace-agents.sample.md +6 -6
- package/openspec/.version +2 -3
- package/openspec/commands/apply.md +189 -175
- package/openspec/commands/archive.md +237 -216
- package/openspec/commands/bulk-archive.md +355 -327
- package/openspec/commands/continue.md +116 -105
- package/openspec/commands/explore.md +230 -199
- package/openspec/commands/ff.md +115 -104
- package/openspec/commands/new.md +74 -63
- package/openspec/commands/onboard.md +557 -548
- package/openspec/commands/propose.md +161 -150
- package/openspec/commands/sync.md +277 -249
- package/openspec/commands/update.md +92 -80
- package/openspec/commands/verify.md +175 -162
- package/openspec/skills/openspec-apply-change/SKILL.md +20 -5
- package/openspec/skills/openspec-archive-change/SKILL.md +30 -8
- package/openspec/skills/openspec-bulk-archive-change/SKILL.md +36 -6
- package/openspec/skills/openspec-continue-change/SKILL.md +14 -2
- package/openspec/skills/openspec-explore/SKILL.md +21 -9
- package/openspec/skills/openspec-ff-change/SKILL.md +14 -2
- package/openspec/skills/openspec-new-change/SKILL.md +13 -1
- package/openspec/skills/openspec-onboard/SKILL.md +49 -39
- package/openspec/skills/openspec-propose/SKILL.md +15 -3
- package/openspec/skills/openspec-sync-specs/SKILL.md +31 -2
- package/openspec/skills/openspec-update-change/SKILL.md +27 -14
- package/openspec/skills/openspec-verify-change/SKILL.md +17 -3
- package/package.json +1 -1
- package/superpowers/.version +4 -4
- package/superpowers/skills/brainstorming/SKILL.md +47 -12
- package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -213
- package/superpowers/skills/brainstorming/scripts/server.cjs +723 -723
- package/superpowers/skills/brainstorming/visual-companion.md +6 -6
- package/superpowers/skills/diagnosing-superpowers/SKILL.md +120 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
- package/superpowers/skills/diagnosing-superpowers/references/context-safety.md +22 -0
- package/superpowers/skills/diagnosing-superpowers/references/github-issues.md +47 -0
- package/superpowers/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
- package/superpowers/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
- package/superpowers/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
- package/superpowers/skills/diagnosing-superpowers/templates/case.md +64 -0
- package/superpowers/skills/diagnosing-superpowers/templates/issue.md +51 -0
- package/superpowers/skills/diagnosing-superpowers/templates/report.md +82 -0
- package/superpowers/skills/executing-plans/SKILL.md +350 -41
- package/superpowers/skills/executing-plans/scripts/task-done +52 -0
- package/superpowers/skills/executing-plans/scripts/task-start +28 -0
- package/superpowers/skills/requesting-code-review/SKILL.md +1 -1
- package/superpowers/skills/requesting-code-review/code-reviewer.md +17 -0
- package/superpowers/skills/subagent-driven-development/SKILL.md +18 -18
- package/superpowers/skills/subagent-driven-development/re-review-prompt.md +1 -1
- package/superpowers/skills/subagent-driven-development/scripts/review-package +53 -46
- package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +82 -40
- package/superpowers/skills/subagent-driven-development/scripts/task-brief +43 -41
- package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +2 -2
- package/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
- package/superpowers/skills/test-driven-development/SKILL.md +10 -0
- package/superpowers/skills/using-superpowers/SKILL.md +2 -0
- package/superpowers/skills/using-superpowers/references/claude-code-tools.md +29 -0
- package/superpowers/skills/using-superpowers/references/muse-tools.md +35 -0
- package/superpowers/skills/writing-plans/SKILL.md +30 -9
- package/superpowers/skills/writing-skills/SKILL.md +4 -2
- package/superpowers/skills/writing-skills/graphviz-conventions.dot +171 -171
- package/cbb/worktrees/commands/worktree-close.md +0 -63
- package/cbb/worktrees/commands/worktree-init.md +0 -50
- package/cbb/worktrees/commands/worktree-push.md +0 -42
|
@@ -17,15 +17,15 @@ artifacts:
|
|
|
17
17
|
2. 拿到用户输入后,整理并复述目标,**让用户确认**理解是否正确。未确认前禁止进入下一阶段。
|
|
18
18
|
3. 信息不足或目标模糊时,继续追问,直到目标清晰无歧义。
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### 阶段二:收集参考材料(需求确认后,代码扫描前)
|
|
21
21
|
|
|
22
|
-
1.
|
|
23
|
-
2.
|
|
24
|
-
3.
|
|
22
|
+
1. 用 AskUserQuestion 询问用户:除 PRD 外还有哪些参考材料(设计文档、WIKI 链接、历史方案等)?
|
|
23
|
+
2. 用户指认了文档/目录:定向阅读所指范围。指认到目录级时,可浏览该目录内的文件名并阅读相关文档;目录之外的内容与全库 glob 搜索仍然禁止。
|
|
24
|
+
3. 无参考材料:记录"暂无参考文档",直接进入阶段三,禁止凭空编造背景信息。
|
|
25
25
|
|
|
26
|
-
### 阶段三:扫描代码(带着确认后的目标 +
|
|
26
|
+
### 阶段三:扫描代码(带着确认后的目标 + 参考材料去扫)
|
|
27
27
|
|
|
28
|
-
1.
|
|
28
|
+
1. 以阶段一确认的目标和阶段二收集的参考材料为上下文,扫描代码库。
|
|
29
29
|
2. 只扫与本次需求相关的入口类/方法、已有实现、依赖链。**禁止无目标的全库扫描**。
|
|
30
30
|
3. 扫描结果应直接支撑「四、代码改动清单」的编写。
|
|
31
31
|
|
|
@@ -37,7 +37,7 @@ artifacts:
|
|
|
37
37
|
- **禁止推测**:需求细节必须来自上述三阶段的产出;信息不足时回退到对应阶段补充
|
|
38
38
|
- **来源标注**:一、为什么 / 二、变更简述 / 三、变更清单 / 四、代码改动清单 / 五、影响 中每一条断言后附来源,示例:
|
|
39
39
|
- "(来自 PRD §3.2)"
|
|
40
|
-
- "
|
|
40
|
+
- "(文档: docs/design/auth-flow.md)"
|
|
41
41
|
- "(代码: com.x.user.facade.UserFacade#resetPassword)"
|
|
42
42
|
- **存疑必问,禁止猜测**:撰写过程中遇到以下情况,必须暂停并用 AskUserQuestion 让用户决策,禁止自行假设后继续:
|
|
43
43
|
- 需求逻辑不合理或自相矛盾
|
|
@@ -45,18 +45,17 @@ artifacts:
|
|
|
45
45
|
- 存在潜在风险(资损、性能、兼容性、安全)
|
|
46
46
|
- 多种可行方案各有取舍
|
|
47
47
|
每次向用户确认后,将决策逐条记录到「六、决策记录」表格中。
|
|
48
|
-
- **知识库引用**还应一并带到 design.md 的"知识库参考"章节
|
|
49
48
|
|
|
50
49
|
章节(顺序:动机 → 变更简述 → 能力契约 → 代码入口 → 影响 → 决策记录;每章带中文数字序号):
|
|
51
50
|
- **一、为什么**(必选):1-3 句话说清问题或机会。要解决什么?为什么是现在?
|
|
52
|
-
- **二、变更简述**(必选):1-
|
|
51
|
+
- **二、变更简述**(必选):1-3 句话最精简易读地描述本需求要做的事情。破坏性变更(接口不兼容、数据结构破坏等)在句尾标注 **BREAKING**
|
|
53
52
|
- **三、变更清单**(必选):能力维度的变更盘点(新增 / 修改 / 删除)。每个能力对应 `openspec/specs/<name>/spec.md`。identifier 与中文名解耦
|
|
54
53
|
- **identifier 与展示名解耦**:identifier 列(`能力名` / `现有 spec 名` / `已废弃 spec 名`)填英文 kebab-case(用于 path / CLI / 跨引用),新增一列 `中文名` 填人类阅读用名
|
|
55
54
|
- **新增能力**:每个对应一份新建 `specs/<name>/spec.md`
|
|
56
|
-
- **修改能力**:每个对应一份 delta spec
|
|
55
|
+
- **修改能力**:每个对应一份 delta spec 文件。仅限 spec 级行为变化——纯实现细节重构不算,避免生成无意义 delta
|
|
57
56
|
- **删除能力**:整段能力下线。spec 文件保留并写 `## REMOVED Requirements` 段,避免后续误用
|
|
58
57
|
- **四、代码改动清单**(必选):每个代码入口一行。
|
|
59
|
-
- **必须基于实际扫代码 +
|
|
58
|
+
- **必须基于实际扫代码 + 读参考文档得出,禁止凭 PRD 直接推测**
|
|
60
59
|
- 字段:应用 / 变更类型 / 代码入口类型 / 代码入口 / 所属能力 / 变更简述 / 备注
|
|
61
60
|
- 后端 代码入口类型 仅允许:rpc / rest / mq / job / sql / config / constant / enum
|
|
62
61
|
- 前端 代码入口类型 固定为 `前端`;代码入口列允许 `文件路径 —— 简短描述` 自然语言
|
|
@@ -67,7 +66,14 @@ artifacts:
|
|
|
67
66
|
- **五、影响**(必选):列出受影响的代码、接口、依赖、上下游系统。**复杂影响分析**(灰度步骤、回滚方案、跨团队协作)进入 § design 阶段
|
|
68
67
|
- **六、决策记录**(必选):撰写过程中向用户确认过的每个决策点,逐条填入表格。字段:序号 / 决策点 / 用户决策 / 影响。无决策则填一行"无"
|
|
69
68
|
|
|
70
|
-
重要:变更清单章节是 proposal 与 spec 阶段的契约核心。动笔前先研究现有 spec
|
|
69
|
+
重要:变更清单章节是 proposal 与 spec 阶段的契约核心。动笔前先研究现有 spec,禁止凭空起名:
|
|
70
|
+
1. `openspec list --specs` 拉取项目能力清单
|
|
71
|
+
2. 对疑似相关的 spec 先用 `openspec show "<spec-id>" --type spec --json --no-scenarios` 概览(返回能力用途与需求文本,不拉全文)
|
|
72
|
+
3. 决定增改前,对相关 spec 全文阅读:`openspec show "<spec-id>" --type spec`(含 scenarios)
|
|
73
|
+
4. 修改能力必须复用 `openspec/specs/` 下已有能力的准确路径,禁止引入近似重复名
|
|
74
|
+
每列出的能力都对应一份 spec 文件。
|
|
75
|
+
|
|
76
|
+
零能力变更的处理:若本次变更不涉及任何能力(纯重构、工具、文档、纯基础设施改动),变更清单三个子表留空,并在 change 的 `.openspec.yaml` 中设置 `skip_specs: true` —— `openspec validate` 会拒绝零 delta 的 change,该标记是唯一出口。禁止为通过校验编造能力或需求。
|
|
71
77
|
|
|
72
78
|
保持简洁(1-2 页)。专注"为什么"而非"怎么做"——实现细节归 design.md。
|
|
73
79
|
|
|
@@ -105,23 +111,9 @@ artifacts:
|
|
|
105
111
|
instruction: |
|
|
106
112
|
Create the design document that explains HOW to implement the change.
|
|
107
113
|
|
|
108
|
-
**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
2. Navigate from INDEX.md → relevant domain index → sub-domain → knowledge chunks
|
|
112
|
-
3. Collect all knowledge documents relevant to this change's design sections
|
|
113
|
-
4. Fill the "知识库参考" section in the template with: knowledge point name, full file path, corresponding design section
|
|
114
|
-
5. If a design section has no matching knowledge base coverage, note it as "知识库暂无覆盖,建议补充"
|
|
115
|
-
|
|
116
|
-
Knowledge-to-design-section mapping reference:
|
|
117
|
-
- 需求背景 → business domain indexes (myb-*-domain/)
|
|
118
|
-
- 架构设计 → application indexes (project/<app>/)
|
|
119
|
-
- 领域模型设计 → domain indexes (myb-*-domain/)
|
|
120
|
-
- 核心流程设计 → domain knowledge chunks
|
|
121
|
-
- 数据库模型 → application indexes + domain knowledge
|
|
122
|
-
- MQ设计 → domain knowledge chunks
|
|
123
|
-
- 稳定性设计 → tech-asset/tech-gray/
|
|
124
|
-
- 防资损设计 → domain knowledge chunks
|
|
114
|
+
**Reference documents:**
|
|
115
|
+
Build on the reference documents gathered during the proposal phase (see its source annotations, e.g. "(文档: …)").
|
|
116
|
+
If the design needs additional documents, ask the user to designate them (targeted reading only, no repo-wide globbing).
|
|
125
117
|
|
|
126
118
|
When to include design.md (create only if any apply):
|
|
127
119
|
- Cross-cutting change (multiple services/modules) or new architectural pattern
|
|
@@ -130,7 +122,6 @@ artifacts:
|
|
|
130
122
|
- Ambiguity that benefits from technical decisions before coding
|
|
131
123
|
|
|
132
124
|
Sections (follow design.md template):
|
|
133
|
-
- **知识库参考**(必选):列出本次设计参考的知识库文档路径及对应章节
|
|
134
125
|
- **需求或项目背景**(必选):问题/目标、PRD/DMPT链接
|
|
135
126
|
- **Checklist事项**(必选):逐项检查技术风险(新接口、改接口、新枚举、新依赖、新表/MQ、sentinel、敏感数据、SQL、历史兼容、Redis、验签)
|
|
136
127
|
- **功能拆解**(必选):按模块拆分功能点,标注变更类型和FTAPI
|
|
@@ -12,24 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
## 零、知识库参考(必选)
|
|
16
|
-
|
|
17
|
-
<!-- AI理解要点:此章节记录本次设计参考了哪些知识库文档,确保设计基于已有知识而非凭空构思。
|
|
18
|
-
通过知识库索引(INDEX.md)逐级定位后,列出实际读取的知识文档路径。 -->
|
|
19
|
-
|
|
20
|
-
| 序号 | 参考知识点 | 知识库路径 | 对应设计章节 | 备注 |
|
|
21
|
-
| ---- | ---------- | ---------- | ------------ | ---- |
|
|
22
|
-
| 1 | <!-- 知识点名称 --> | <!-- 从INDEX.md逐级定位的完整路径 --> | <!-- 架构设计/领域模型/... --> | <!-- 参考了什么 --> |
|
|
23
|
-
|
|
24
|
-
<!-- 知识库导航方式:
|
|
25
|
-
1. 从知识库根索引 INDEX.md 出发
|
|
26
|
-
2. 按业务域/技术域逐级定位到具体知识文档
|
|
27
|
-
3. 将实际读取的文档路径填入上表
|
|
28
|
-
4. 如果某章节无对应知识库文档,在备注中标注"知识库暂无覆盖,建议补充"
|
|
29
|
-
-->
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
15
|
## 一、需求或项目背景(必选)
|
|
34
16
|
|
|
35
17
|
<!-- AI理解要点:此章节提供需求的上下文信息,帮助理解业务背景和目标 -->
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- 说明这次变更的动机。要解决什么问题?为什么是现在? -->
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 二、变更简述
|
|
6
6
|
|
|
7
|
-
<!-- 1-3
|
|
7
|
+
<!-- 1-3 句话最精简易读地描述本需求要做的事情。破坏性变更(接口不兼容、数据结构破坏等)在句尾标注 **BREAKING**。 -->
|
|
8
8
|
|
|
9
9
|
## 三、变更清单
|
|
10
10
|
|
|
11
11
|
<!-- 能力维度的变更盘点(新增 / 修改 / 删除)。每个能力对应 `openspec/specs/<name>/spec.md`。
|
|
12
12
|
表格同时承载"能力本身的静态信息(identifier / 中文名 / 简述)"和"本次变更对它的动作"。
|
|
13
13
|
第四章"代码改动清单"是落到代码层的具体改动点。两章通过 identifier 字段双向关联。
|
|
14
|
-
**identifier 与展示名解耦**:identifier 列填英文 kebab-case(用于 path / CLI / 跨引用);`中文名` 列填人类阅读用名,可与 identifier 不同。
|
|
14
|
+
**identifier 与展示名解耦**:identifier 列填英文 kebab-case(用于 path / CLI / 跨引用);`中文名` 列填人类阅读用名,可与 identifier 不同。
|
|
15
|
+
零能力变更:三章全部留空(纯重构 / 工具 / 文档 / 纯基础设施),并在 change 的 `.openspec.yaml` 设 `skip_specs: true` —— `openspec validate` 拒绝零 delta 的 change,该标记是唯一出口;禁止为通过校验编造能力。 -->
|
|
15
16
|
|
|
16
17
|
### 新增能力
|
|
17
18
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
1. **本目录不做需求开发**。本目录(业务空间主分支)只负责组织与调度;需求开发的**写操作**都在 `.worktrees/worktree-<需求名>/` 隔离目录内进行,**AI 会话仍停在空间根**(worktree 内不装 AI 配置)。
|
|
9
9
|
2. **AI 配置安装在空间根**:编码规范、OpenSpec 命令、worktree 管理技能都装在本目录(`cbb setup` / `cbb update` 安装);worktree 内**不安装** AI 配置,AI 会话始终以空间根为基础。
|
|
10
|
-
3. **接到新需求先建 worktree
|
|
10
|
+
3. **接到新需求先建 worktree**:使用 `/cbb-worktree-init <需求名>`(skill 形态,各工具写法见文末),或直接自然语言说"为 <需求名> 创建工作空间"。它会为 `workspace-config.json` 中的全量关联应用同步创建同名 worktree。
|
|
11
11
|
4. **开发命令在本会话执行,写操作指向 worktree**:需求提案 / 实现 / 验证 / 归档(`/opsx:propose` → `/opsx:apply` → `/opsx:verify` → `/opsx:archive`)在空间根会话执行;但所有产生写操作的命令(git commit / openspec / 构建 / 测试 / 文件修改)必须以 `.worktrees/worktree-<需求名>/`(或其应用子目录)为工作目录(显式 `cd` 或绝对路径);**禁止在空间根(主分支)执行写操作**。
|
|
12
12
|
5. **关联应用增减只改配置**:编辑 `workspace-config.json` 的 `apps` 数组(`name` / `repo` / `side` / `desc`),然后用同一需求名重跑 worktree 初始化即幂等补齐;不要手工 `git clone` 应用仓库。
|
|
13
13
|
6. **不要绕过 worktree 直接修改 `.codespace/` 或本目录的代码**。`.codespace/` 是工具维护的基准代码,不是开发区。
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
| `.codespace/` | 各关联应用的基准代码(每个应用一个子目录) | `cbb setup` 与 worktree 流程自动 clone / fetch;**勿手动编辑**;已 gitignore,不提交 |
|
|
21
21
|
| `.worktrees/` | 需求隔离开发区(每个需求一个 `worktree-<需求名>/` 目录) | worktree 命令自动创建 / 清理;不提交(首次执行 worktree 流程时自动加入 .gitignore) |
|
|
22
22
|
| `openspec/` | OpenSpec 工作流配置(`config.yaml` + `schemas/`) | 由 cbb 安装;需求变更产物(`openspec/changes/` 等)在**需求工作树内**生成,随需求分支提交 |
|
|
23
|
-
| `.claude/` `.qoder/` `.opencode/` `.codebuddy/` `.trae/` | AI 工具适配目录:编码规范规则、OpenSpec 命令、worktree
|
|
24
|
-
| `.cbb/` | cbb
|
|
23
|
+
| `.claude/` `.qoder/` `.opencode/` `.codebuddy/` `.trae/` | AI 工具适配目录:编码规范规则、OpenSpec 命令、worktree 管理技能(skill 形态) | 由 cbb 按 setup 时选择的工具安装;已 gitignore,不提交,勿手动改 |
|
|
24
|
+
| `.cbb/` | cbb 安装清单与状态(`.managed-by-cbb`、`.last-tools`) | 由 cbb 管理;**勿手动编辑** |
|
|
25
25
|
|
|
26
26
|
## 典型流程
|
|
27
27
|
|
|
28
28
|
```
|
|
29
|
-
|
|
29
|
+
本目录:对 AI 说"为 <需求名> 创建工作空间"(或 /cbb-worktree-init <需求名>)
|
|
30
30
|
→ 继续在当前会话开发:写操作命令以 .worktrees/worktree-<需求名>/ 为工作目录
|
|
31
31
|
(/opsx:propose → /opsx:apply → /opsx:verify → /opsx:archive)
|
|
32
|
-
→ /cbb
|
|
32
|
+
→ 说"提交并推送"(或 /cbb-worktree-push)→ 合并后说"关闭工作空间"(或 /cbb-worktree-close)
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
>
|
|
35
|
+
> worktree 管理三件套(init / close / push)以 **skill 形态**分发:既能被 AI 在对话中按意图**自动触发**,也能用斜杠命令手动指定(`/cbb-worktree-init` 等,各工具一致)。OpenSpec 命令为 `/opsx:propose`(opencode 扁平化为 `/opsx-propose`)。
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
package/openspec/.version
CHANGED
|
@@ -4,179 +4,193 @@ description: Implement tasks from an OpenSpec change (Experimental)
|
|
|
4
4
|
category: Workflow
|
|
5
5
|
tags: [workflow, artifacts, experimental]
|
|
6
6
|
---
|
|
7
|
-
Implement tasks from an OpenSpec change.
|
|
8
|
-
|
|
9
|
-
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
|
10
|
-
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- `
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
**Output
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
##
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
-
|
|
7
|
+
Implement tasks from an OpenSpec change.
|
|
8
|
+
|
|
9
|
+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
|
10
|
+
|
|
11
|
+
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
|
|
12
|
+
|
|
13
|
+
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
|
|
14
|
+
|
|
15
|
+
Otherwise, with no root, what happens next depends on how this workflow was reached:
|
|
16
|
+
|
|
17
|
+
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
|
|
18
|
+
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
|
|
19
|
+
|
|
20
|
+
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
|
|
21
|
+
|
|
22
|
+
**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
23
|
+
|
|
24
|
+
**Steps**
|
|
25
|
+
|
|
26
|
+
1. **Select the change**
|
|
27
|
+
|
|
28
|
+
If a name is provided, use it. Otherwise:
|
|
29
|
+
- Infer from conversation context if the user mentioned a change
|
|
30
|
+
- Auto-select if only one active change exists
|
|
31
|
+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
|
32
|
+
|
|
33
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
|
34
|
+
|
|
35
|
+
2. **Check status to understand the schema**
|
|
36
|
+
```bash
|
|
37
|
+
openspec status --change "<name>" --json
|
|
38
|
+
```
|
|
39
|
+
Parse the JSON to understand:
|
|
40
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
41
|
+
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
|
|
42
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
43
|
+
|
|
44
|
+
3. **Get apply instructions**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
openspec instructions apply --change "<name>" --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This returns:
|
|
51
|
+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
52
|
+
- Progress (total, complete, remaining)
|
|
53
|
+
- Task list with status
|
|
54
|
+
- Dynamic instruction based on current state
|
|
55
|
+
- Optional `context`: current required project instruction input from the selected root
|
|
56
|
+
- Optional `operationGuidance`: current advisory guidance for apply
|
|
57
|
+
- `missingArtifacts` (when present): required artifact ids with no output
|
|
58
|
+
|
|
59
|
+
**Handle states:**
|
|
60
|
+
- If `state: "blocked"`: show the message and pause implementation.
|
|
61
|
+
- If `missingArtifacts` is non-empty: suggest using `/opsx:continue` to create them.
|
|
62
|
+
- Otherwise, follow the CLI instruction to create or repair the schema-configured tracking file from existing planning artifacts. Do not assume another artifact is ready or start implementation while blocked.
|
|
63
|
+
- If `state: "all_done"`: congratulate, suggest archive
|
|
64
|
+
- Otherwise: proceed to implementation
|
|
65
|
+
|
|
66
|
+
Treat `context` as a required prompt-level input. Read and consider it, and
|
|
67
|
+
apply relevant project facts, conventions, and constraints while implementing.
|
|
68
|
+
Treat `operationGuidance` as optional additive advice. Read and consider every
|
|
69
|
+
entry, and follow entries that are applicable and compatible with the built-in
|
|
70
|
+
workflow.
|
|
71
|
+
|
|
72
|
+
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
|
|
73
|
+
progress, `contextFiles`, and the built-in `instruction`. They are not
|
|
74
|
+
evidence of task completion, do not replace the built-in instruction, and do
|
|
75
|
+
not permit bypassing a blocked state. If context conflicts with the built-in
|
|
76
|
+
instruction, an explicit user choice, or a CLI-controlled value, report the
|
|
77
|
+
conflict and preserve the controlling value. If guidance is inapplicable or
|
|
78
|
+
conflicts with those controlling inputs, do not follow it and explain why.
|
|
79
|
+
These are prompt-level behavior contracts, not enforceable checks.
|
|
80
|
+
|
|
81
|
+
4. **Read context files**
|
|
82
|
+
|
|
83
|
+
Read every file path listed under `contextFiles` from the apply instructions output.
|
|
84
|
+
The files depend on the schema being used:
|
|
85
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
86
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
87
|
+
|
|
88
|
+
Do not copy `context` or `operationGuidance` verbatim into implementation
|
|
89
|
+
files or planning artifacts unless the user separately asks for that content.
|
|
90
|
+
|
|
91
|
+
5. **Show current progress**
|
|
92
|
+
|
|
93
|
+
Display:
|
|
94
|
+
- Schema being used
|
|
95
|
+
- Progress: "N/M tasks complete"
|
|
96
|
+
- Remaining tasks overview
|
|
97
|
+
- Dynamic instruction from CLI
|
|
98
|
+
|
|
99
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
100
|
+
|
|
101
|
+
For each pending task:
|
|
102
|
+
- Show which task is being worked on
|
|
103
|
+
- Make the code changes required
|
|
104
|
+
- Keep changes minimal and focused
|
|
105
|
+
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
|
106
|
+
- Continue to next task
|
|
107
|
+
|
|
108
|
+
**Pause if:**
|
|
109
|
+
- Task is unclear → ask for clarification
|
|
110
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
111
|
+
- A task needs work beyond what the spec and tasks describe, or you are tempted to drop, narrow, defer, or accept exceptions to specified behavior to make it fit → surface the added scope and ask; do not absorb it silently
|
|
112
|
+
- Error or blocker encountered → report and wait for guidance
|
|
113
|
+
- User interrupts
|
|
114
|
+
|
|
115
|
+
7. **On completion or pause, show status**
|
|
116
|
+
|
|
117
|
+
Display:
|
|
118
|
+
- Tasks completed this session
|
|
119
|
+
- Overall progress: "N/M tasks complete"
|
|
120
|
+
- If all done: suggest archive
|
|
121
|
+
- If paused: explain why and wait for guidance
|
|
122
|
+
|
|
123
|
+
**Output During Implementation**
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
127
|
+
|
|
128
|
+
Working on task 3/7: <task description>
|
|
129
|
+
[...implementation happening...]
|
|
130
|
+
✓ Task complete
|
|
131
|
+
|
|
132
|
+
Working on task 4/7: <task description>
|
|
133
|
+
[...implementation happening...]
|
|
134
|
+
✓ Task complete
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Output On Completion**
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
## Implementation Complete
|
|
141
|
+
|
|
142
|
+
**Change:** <change-name>
|
|
143
|
+
**Schema:** <schema-name>
|
|
144
|
+
**Progress:** 7/7 tasks complete ✓
|
|
145
|
+
|
|
146
|
+
### Completed This Session
|
|
147
|
+
- [x] Task 1
|
|
148
|
+
- [x] Task 2
|
|
149
|
+
...
|
|
150
|
+
|
|
151
|
+
All tasks complete! You can archive this change with `/opsx:archive`.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Output On Pause (Issue Encountered)**
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
## Implementation Paused
|
|
158
|
+
|
|
159
|
+
**Change:** <change-name>
|
|
160
|
+
**Schema:** <schema-name>
|
|
161
|
+
**Progress:** 4/7 tasks complete
|
|
162
|
+
|
|
163
|
+
### Issue Encountered
|
|
164
|
+
<description of the issue>
|
|
165
|
+
|
|
166
|
+
**Options:**
|
|
167
|
+
1. <option 1>
|
|
168
|
+
2. <option 2>
|
|
169
|
+
3. Other approach
|
|
170
|
+
|
|
171
|
+
What would you like to do?
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Guardrails**
|
|
175
|
+
- Keep going through tasks until done or blocked
|
|
176
|
+
- Always read context files before starting (from the apply instructions output)
|
|
177
|
+
- If task is ambiguous, pause and ask before implementing
|
|
178
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
179
|
+
- Keep code changes minimal and scoped to each task
|
|
180
|
+
- Update task checkbox immediately after completing each task
|
|
181
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
182
|
+
- When a task needs work beyond what the spec describes, surface the added scope and pause - never silently narrow, defer, or simplify away specified behavior
|
|
183
|
+
- Only mark a task `- [x]` when its specified behavior is fully implemented, not when it is partially done or deferred
|
|
184
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
185
|
+
- Do not use context or operation guidance as proof that a task is complete
|
|
186
|
+
- Apply relevant project context; report conflicts with controlling workflow inputs
|
|
187
|
+
- Consider every guidance entry; explain any inapplicable or conflicting advice
|
|
188
|
+
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
|
|
189
|
+
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
|
|
190
|
+
|
|
191
|
+
**Fluid Workflow Integration**
|
|
192
|
+
|
|
193
|
+
This skill supports the "actions on a change" model:
|
|
194
|
+
|
|
195
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
182
196
|
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|