6a-spec-install 1.0.8-dev.2 → 1.0.8-dev.4

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.
Files changed (36) hide show
  1. package/.6aspec/rules/green/6A_archive_sop.md +15 -15
  2. package/.6aspec/rules/green/6A_clarify_sop.md +18 -9
  3. package/.6aspec/rules/green/6A_code_implementation_sop.md +6 -6
  4. package/.6aspec/rules/green/6A_continue_sop.md +5 -5
  5. package/.6aspec/rules/green/6A_design_sop.md +12 -12
  6. package/.6aspec/rules/green/6A_import_model_table_sop.md +2 -2
  7. package/.6aspec/rules/green/6A_model_sop.md +6 -6
  8. package/.6aspec/rules/green/6A_new_sop.md +7 -7
  9. package/.6aspec/rules/green/6A_rollback_sop.md +198 -0
  10. package/.6aspec/rules/green/6A_status_sop.md +7 -7
  11. package/.6aspec/rules/green/6A_tasks_sop.md +8 -8
  12. package/.6aspec/rules/green/6A_visual_logic_sop.md +4 -4
  13. package/.6aspec/rules/green/green_status_schema.md +27 -14
  14. package/.claude/commands/6aspec/green/rollback.md +8 -0
  15. package/.cursor/commands/6aspec/green/rollback.md +9 -0
  16. package/package.json +1 -1
  17. package/.claude/commands/opsx/apply.md +0 -152
  18. package/.claude/commands/opsx/archive.md +0 -157
  19. package/.claude/commands/opsx/bulk-archive.md +0 -242
  20. package/.claude/commands/opsx/continue.md +0 -114
  21. package/.claude/commands/opsx/explore.md +0 -174
  22. package/.claude/commands/opsx/ff.md +0 -94
  23. package/.claude/commands/opsx/new.md +0 -69
  24. package/.claude/commands/opsx/onboard.md +0 -525
  25. package/.claude/commands/opsx/sync.md +0 -134
  26. package/.claude/commands/opsx/verify.md +0 -164
  27. package/.claude/skills/openspec-apply-change/SKILL.md +0 -156
  28. package/.claude/skills/openspec-archive-change/SKILL.md +0 -114
  29. package/.claude/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  30. package/.claude/skills/openspec-continue-change/SKILL.md +0 -118
  31. package/.claude/skills/openspec-explore/SKILL.md +0 -290
  32. package/.claude/skills/openspec-ff-change/SKILL.md +0 -101
  33. package/.claude/skills/openspec-new-change/SKILL.md +0 -74
  34. package/.claude/skills/openspec-onboard/SKILL.md +0 -529
  35. package/.claude/skills/openspec-sync-specs/SKILL.md +0 -138
  36. package/.claude/skills/openspec-verify-change/SKILL.md +0 -168
@@ -16,7 +16,7 @@
16
16
 
17
17
  **1.1 检查是否在需求目录下**
18
18
 
19
- 检查当前工作目录是否在 `6aspec/green/<feature-name>/` 下:
19
+ 检查当前工作目录是否在 `6aspecdoc/green/<feature-name>/` 下:
20
20
 
21
21
  ```bash
22
22
  pwd
@@ -27,7 +27,7 @@ pwd
27
27
  **1.2 如果不在需求目录下,列出所有可归档的需求**
28
28
 
29
29
  ```bash
30
- find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
30
+ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
31
31
  ```
32
32
 
33
33
  读取每个状态文件,筛选出状态为 `completed` 的需求。
@@ -50,7 +50,7 @@ find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
50
50
 
51
51
  ### Step 2: 读取状态文件
52
52
 
53
- 读取 `6aspec/green/<feature-name>/.green-status.json` 文件。
53
+ 读取 `6aspecdoc/green/<feature-name>/.green-status.json` 文件。
54
54
 
55
55
  如果文件不存在或格式错误,输出错误信息并退出。
56
56
 
@@ -126,7 +126,7 @@ find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
126
126
  如果归档目录不存在,创建它:
127
127
 
128
128
  ```bash
129
- mkdir -p 6aspec/green/archive
129
+ mkdir -p 6aspecdoc/green/archive
130
130
  ```
131
131
 
132
132
  **4.2 生成归档目标名称**
@@ -142,7 +142,7 @@ mkdir -p 6aspec/green/archive
142
142
  检查归档目标目录是否已存在:
143
143
 
144
144
  ```bash
145
- ls -d 6aspec/green/archive/YYYY-MM-DD-<feature-name> 2>/dev/null
145
+ ls -d 6aspecdoc/green/archive/YYYY-MM-DD-<feature-name> 2>/dev/null
146
146
  ```
147
147
 
148
148
  如果已存在,输出错误并停止:
@@ -150,7 +150,7 @@ ls -d 6aspec/green/archive/YYYY-MM-DD-<feature-name> 2>/dev/null
150
150
  ```
151
151
  ❌ 归档失败
152
152
 
153
- 目标目录已存在:6aspec/green/archive/YYYY-MM-DD-<feature-name>
153
+ 目标目录已存在:6aspecdoc/green/archive/YYYY-MM-DD-<feature-name>
154
154
 
155
155
  可能的原因:
156
156
  1. 今天已经归档过同名需求
@@ -167,7 +167,7 @@ ls -d 6aspec/green/archive/YYYY-MM-DD-<feature-name> 2>/dev/null
167
167
  将需求目录移动到归档位置:
168
168
 
169
169
  ```bash
170
- mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
170
+ mv 6aspecdoc/green/<feature-name> 6aspecdoc/green/archive/YYYY-MM-DD-<feature-name>
171
171
  ```
172
172
 
173
173
  **4.5 更新状态文件**
@@ -184,7 +184,7 @@ mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
184
184
  写回状态文件:
185
185
 
186
186
  ```bash
187
- # 更新 6aspec/green/archive/YYYY-MM-DD-<feature-name>/.green-status.json
187
+ # 更新 6aspecdoc/green/archive/YYYY-MM-DD-<feature-name>/.green-status.json
188
188
  ```
189
189
 
190
190
  ### Step 5: 显示归档摘要
@@ -195,7 +195,7 @@ mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
195
195
  ✅ 归档完成
196
196
 
197
197
  需求:<feature-name>
198
- 归档位置:6aspec/green/archive/YYYY-MM-DD-<feature-name>/
198
+ 归档位置:6aspecdoc/green/archive/YYYY-MM-DD-<feature-name>/
199
199
  归档时间:<current-timestamp>
200
200
 
201
201
  工件完成情况:
@@ -216,7 +216,7 @@ mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
216
216
  ✅ 归档完成(带警告)
217
217
 
218
218
  需求:<feature-name>
219
- 归档位置:6aspec/green/archive/YYYY-MM-DD-<feature-name>/
219
+ 归档位置:6aspecdoc/green/archive/YYYY-MM-DD-<feature-name>/
220
220
  归档时间:<current-timestamp>
221
221
 
222
222
  ⚠️ 警告:
@@ -233,7 +233,7 @@ mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
233
233
  ```
234
234
  错误:未找到状态文件
235
235
 
236
- 路径:6aspec/green/<feature-name>/.green-status.json
236
+ 路径:6aspecdoc/green/<feature-name>/.green-status.json
237
237
 
238
238
  无法归档没有状态文件的需求。
239
239
 
@@ -247,7 +247,7 @@ mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
247
247
  ```
248
248
  错误:归档目标已存在
249
249
 
250
- 目标:6aspec/green/archive/YYYY-MM-DD-<feature-name>/
250
+ 目标:6aspecdoc/green/archive/YYYY-MM-DD-<feature-name>/
251
251
 
252
252
  建议:
253
253
  1. 重命名现有归档目录
@@ -260,8 +260,8 @@ mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
260
260
  ```
261
261
  错误:无法移动需求目录
262
262
 
263
- 源:6aspec/green/<feature-name>
264
- 目标:6aspec/green/archive/YYYY-MM-DD-<feature-name>
263
+ 源:6aspecdoc/green/<feature-name>
264
+ 目标:6aspecdoc/green/archive/YYYY-MM-DD-<feature-name>
265
265
 
266
266
  错误信息:<error-message>
267
267
 
@@ -279,7 +279,7 @@ mv 6aspec/green/<feature-name> 6aspec/green/archive/YYYY-MM-DD-<feature-name>
279
279
  ## 归档后的目录结构
280
280
 
281
281
  ```
282
- 6aspec/green/
282
+ 6aspecdoc/green/
283
283
  ├── archive/
284
284
  │ ├── 2026-02-15-feature-a/
285
285
  │ │ ├── .green-status.json
@@ -19,6 +19,7 @@
19
19
  ## 前置条件
20
20
  - 已通过 `/6aspec:green:new` 创建了需求目录和初始 `requirement.md`
21
21
  - 状态文件 `.green-status.json` 存在
22
+ - **阶段限制**:需求澄清(clarify)仅允许在 **new 之后、领域建模(model)之前** 执行。进入领域建模及后续阶段后,不得再执行需求澄清。
22
23
 
23
24
  ## 输入要求
24
25
  - **自动读取**:现有的 `requirement.md` 和 `.green-status.json`
@@ -33,25 +34,32 @@
33
34
  检查当前活跃的需求:
34
35
 
35
36
  ```bash
36
- find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
37
+ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
37
38
  ```
38
39
 
39
40
  如果有多个需求,使用 **AskUserQuestion** 让用户选择要澄清的需求。
40
41
 
41
42
  **1.2 读取状态文件和需求文档**
42
43
 
43
- - 读取 `6aspec/green/<feature-name>/.green-status.json`
44
- - 读取 `6aspec/green/<feature-name>/requirement.md`
44
+ - 读取 `6aspecdoc/green/<feature-name>/.green-status.json`
45
+ - 读取 `6aspecdoc/green/<feature-name>/requirement.md`
45
46
 
46
- **1.3 状态检查**
47
+ **1.3 阶段门禁(必须通过,否则拒绝执行)**
47
48
 
48
- 允许的状态:`created` `requirement_clarified`
49
+ 需求澄清仅允许在 **new 之后、model 之前** 执行。读取状态文件后,检查 `status`:
50
+
51
+ - **允许执行**:仅当 `status` 为 **`created`** 或 **`requirement_clarified`** 时,允许继续执行本 SOP。
52
+ - **拒绝执行**:若 `status` 为 **`modeled`**、**`designed`**、**`tasks_created`**、**`implementing`**、**`completed`**、**`archived`** 中任一,则**立即停止**,不得进行任何需求文档修改或澄清对话,并输出:
49
53
 
50
- 如果状态不符合,输出:
51
54
  ```
52
- ⚠️ 当前状态为 <status>,通常在 "created" 或 "requirement_clarified" 阶段执行 clarify
55
+ 不允许执行需求澄清 (clarify)
56
+
57
+ 当前状态:<status>
58
+ 允许执行 clarify 的阶段:仅限 created 或 requirement_clarified(即 new 之后、领域建模 model 之前)。
59
+
60
+ 主流程中需求澄清窗口已结束,进入领域建模及后续阶段后不得再修改需求澄清范围。若确有需求变更,请与产品/业务方评估后,通过新需求或变更流程处理。
53
61
 
54
- 是否继续?(在后续阶段执行 clarify 会更新需求文档但不会回退状态)
62
+ 下一步建议:运行 /6aspec:green:status 查看当前状态,或按当前阶段继续执行对应命令(如 model、design、tasks、execute-task、archive)。
55
63
  ```
56
64
 
57
65
  ### Step 2: 分析现有文档的薄弱环节
@@ -179,11 +187,12 @@ find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
179
187
 
180
188
  ## 输出要求
181
189
  1. 格式:Markdown 源码格式
182
- 2. 文档位置:`6aspec/green/<feature-name>/requirement.md`(原地更新)
190
+ 2. 文档位置:`6aspecdoc/green/<feature-name>/requirement.md`(原地更新)
183
191
  3. 必须保留已有内容,仅做增量更新
184
192
  4. 更新后检查文档格式是否符合 `new` SOP 中的模板规范
185
193
 
186
194
  ## 注意
195
+ - **阶段限制**:仅当状态为 `created` 或 `requirement_clarified` 时可执行;进入 `modeled` 及之后阶段后**禁止**执行 clarify,直接拒绝并提示。
187
196
  - **不可覆盖**:绝不可覆盖用户之前已确认的结论,只能追加新信息
188
197
  - **递进深入**:每一轮 clarify 的问题应该比上一轮更深入、更具体
189
198
  - **适时收敛**:如果评估所有维度都是 🟢,应主动建议用户进入下一步(领域建模),而不是无限制地继续澄清
@@ -5,14 +5,14 @@ alwaysApply: false
5
5
 
6
6
  # execute-task: 任务代码实现标准操作流程
7
7
 
8
- 你现在是 **Senior Developer**,负责执行具体的开发任务。你的核心职责是将 `6aspec/green/<feature-name>/tasks/task_xxx.md` 转化为高质量、可运行的业务代码。
8
+ 你现在是 **Senior Developer**,负责执行具体的开发任务。你的核心职责是将 `6aspecdoc/green/<feature-name>/tasks/task_xxx.md` 转化为高质量、可运行的业务代码。
9
9
 
10
10
  ## 前置条件(依赖门禁,必须首先执行)
11
11
 
12
12
  在执行任务代码实现前,**必须**先完成依赖检查,不通过则**立即停止**并提示,不得继续:
13
13
 
14
- 1. **确定当前需求**:根据用户指定的任务文件路径(如 `6aspec/green/<feature-name>/tasks/task-xxx.md`)确定 feature-name;若用户未指定任务文件,则根据当前工作目录或让用户选择需求。
15
- 2. **读取状态文件**:读取 `6aspec/green/<feature-name>/.green-status.json`。若文件不存在,停止并提示先运行 `/6aspec:green:new` 创建需求。
14
+ 1. **确定当前需求**:根据用户指定的任务文件路径(如 `6aspecdoc/green/<feature-name>/tasks/task-xxx.md`)确定 feature-name;若用户未指定任务文件,则根据当前工作目录或让用户选择需求。
15
+ 2. **读取状态文件**:读取 `6aspecdoc/green/<feature-name>/.green-status.json`。若文件不存在,停止并提示先运行 `/6aspec:green:new` 创建需求。
16
16
  3. **检查上一流程已完成**:
17
17
  - 若 `status` 不是 `tasks_created` 且不是 `implementing`,停止并提示:
18
18
  ```
@@ -24,7 +24,7 @@ alwaysApply: false
24
24
  请先完成任务拆解:运行 /6aspec:green:tasks,并确保生成 tasks/ 下的任务文件及 README.md,且状态已更新为 tasks_created。
25
25
  ```
26
26
  - 若 `artifacts.tasks.status` 不是 `done`,停止并提示先运行 `/6aspec:green:tasks` 完成任务拆解。
27
- 4. **检查任务目录存在**:若 `6aspec/green/<feature-name>/tasks/` 下无任务文件或无 `README.md`,停止并提示先完成 `/6aspec:green:tasks`。
27
+ 4. **检查任务目录存在**:若 `6aspecdoc/green/<feature-name>/tasks/` 下无任务文件或无 `README.md`,停止并提示先完成 `/6aspec:green:tasks`。
28
28
 
29
29
  **只有以上检查全部通过后,才允许继续执行本 SOP 的编码步骤。**
30
30
 
@@ -34,8 +34,8 @@ alwaysApply: false
34
34
 
35
35
  1. **加载任务上下文**:读取用户指定的 `task-xxx.md` 文件。
36
36
  2. **加载设计上下文**:
37
- * 必须寻找并读取该任务所属功能的 **技术设计主文档** (`tech-design.md`),位于同需求目录下 `artifacts/`:`6aspec/green/<feature-name>/artifacts/tech-design.md`。
38
- * 必须读取 **API 定义文档** (`api-definition.md`)(如果是 API 任务),位于 `6aspec/green/<feature-name>/artifacts/api-definition.md`。
37
+ * 必须寻找并读取该任务所属功能的 **技术设计主文档** (`tech-design.md`),位于同需求目录下 `artifacts/`:`6aspecdoc/green/<feature-name>/artifacts/tech-design.md`。
38
+ * 必须读取 **API 定义文档** (`api-definition.md`)(如果是 API 任务),位于 `6aspecdoc/green/<feature-name>/artifacts/api-definition.md`。
39
39
  * *Rationale*: 任务文件中只包含摘要,核心逻辑和 JSON 结构都在技术设计文档中,不读技术设计文档必写错。
40
40
  3. **加载规范上下文**:
41
41
  * 读取任务文件中指定的“规则文件”(如 `api_rule.md`)。
@@ -15,7 +15,7 @@
15
15
 
16
16
  **1.1 检查是否在需求目录下**
17
17
 
18
- 检查当前工作目录是否在 `6aspec/green/<feature-name>/` 下:
18
+ 检查当前工作目录是否在 `6aspecdoc/green/<feature-name>/` 下:
19
19
 
20
20
  ```bash
21
21
  pwd
@@ -26,7 +26,7 @@ pwd
26
26
  **1.2 如果不在需求目录下,列出所有活跃需求**
27
27
 
28
28
  ```bash
29
- find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
29
+ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
30
30
  ```
31
31
 
32
32
  如果找到多个需求,使用 **AskUserQuestion** 让用户选择要继续的需求。
@@ -47,13 +47,13 @@ find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
47
47
 
48
48
  ### Step 2: 读取状态文件
49
49
 
50
- 读取 `6aspec/green/<feature-name>/.green-status.json` 文件:
50
+ 读取 `6aspecdoc/green/<feature-name>/.green-status.json` 文件:
51
51
 
52
52
  如果文件不存在,说明这是一个旧的需求目录(在状态管理机制之前创建的),输出:
53
53
  ```
54
54
  错误:未找到状态文件
55
55
 
56
- 路径:6aspec/green/<feature-name>/.green-status.json
56
+ 路径:6aspecdoc/green/<feature-name>/.green-status.json
57
57
 
58
58
  这个需求目录可能是在状态管理机制之前创建的。
59
59
 
@@ -153,7 +153,7 @@ find 6aspec/green -maxdepth 2 -name ".green-status.json" -type f
153
153
  ```
154
154
  错误:状态文件格式错误
155
155
 
156
- 路径:6aspec/green/<feature-name>/.green-status.json
156
+ 路径:6aspecdoc/green/<feature-name>/.green-status.json
157
157
 
158
158
  错误信息:<parse-error>
159
159
 
@@ -18,8 +18,8 @@ alwaysApply: false
18
18
 
19
19
  1. **主动检索 (Active Retrieval)**:
20
20
  * 不要被动等待。当用户给出功能名称时,优先使用工具(`file_search` 或 `read_file`)尝试读取以下关键文件:
21
- * `6aspec/green/<feature-name>/requirement.md`(需求澄清文档,由 new 生成,**设计时的需求依据**)
22
- * `6aspec/green/<feature-name>/artifacts/domain-model.md`(领域模型)
21
+ * `6aspecdoc/green/<feature-name>/requirement.md`(需求澄清文档,由 new 生成,**设计时的需求依据**)
22
+ * `6aspecdoc/green/<feature-name>/artifacts/domain-model.md`(领域模型)
23
23
  * `./.6aspec/biz/functional-capability-Map.md` (能力地图)
24
24
  * `./.6aspec/biz/event-list.md` (事件清单,如涉及事件)
25
25
  * 只有当无法读取这些文件时,才请求用户提供。
@@ -55,8 +55,8 @@ alwaysApply: false
55
55
 
56
56
  在执行技术方案设计前,**必须**先完成依赖检查,不通过则**立即停止**并提示,不得继续:
57
57
 
58
- 1. **确定当前需求**:根据当前工作目录或用户 @ 的文件,确定 `6aspec/green/<feature-name>/`;若有多个需求则让用户选择。
59
- 2. **读取状态文件**:读取 `6aspec/green/<feature-name>/.green-status.json`。若文件不存在,停止并提示先运行 `/6aspec:green:new` 创建需求。
58
+ 1. **确定当前需求**:根据当前工作目录或用户 @ 的文件,确定 `6aspecdoc/green/<feature-name>/`;若有多个需求则让用户选择。
59
+ 2. **读取状态文件**:读取 `6aspecdoc/green/<feature-name>/.green-status.json`。若文件不存在,停止并提示先运行 `/6aspec:green:new` 创建需求。
60
60
  3. **检查上一流程已完成**:
61
61
  - 若 `status` 不是 `modeled`,停止并提示:
62
62
  ```
@@ -68,7 +68,7 @@ alwaysApply: false
68
68
  请先完成领域建模:运行 /6aspec:green:model,并确保生成 artifacts/domain-model.md 且状态已更新为 modeled。
69
69
  ```
70
70
  - 若 `artifacts.models.status` 不是 `done`,停止并提示先运行 `/6aspec:green:model` 完成领域建模。
71
- 4. **检查 domain-model.md 存在**:若 `6aspec/green/<feature-name>/artifacts/domain-model.md` 不存在,停止并提示先完成领域建模。
71
+ 4. **检查 domain-model.md 存在**:若 `6aspecdoc/green/<feature-name>/artifacts/domain-model.md` 不存在,停止并提示先完成领域建模。
72
72
 
73
73
  **只有以上检查全部通过后,才允许继续执行本 SOP 的设计步骤。**
74
74
 
@@ -77,8 +77,8 @@ alwaysApply: false
77
77
  按主流程,需求已在 new 阶段澄清并产出 `requirement.md`,design 阶段**以 requirement.md + 领域模型**为输入,无需原始 PRD。
78
78
 
79
79
  你需要确保拥有以下输入(优先尝试主动读取):
80
- - **必需输入 1**:需求澄清文档 `requirement.md`(由 `/6aspec:green:new` 生成,位于 `6aspec/green/<feature-name>/requirement.md`)。设计时的功能范围、业务规则、Scope 以该文档为准。
81
- - **必需输入 2**:数据模型设计文档 `6aspec/green/<feature-name>/artifacts/domain-model.md`
80
+ - **必需输入 1**:需求澄清文档 `requirement.md`(由 `/6aspec:green:new` 生成,位于 `6aspecdoc/green/<feature-name>/requirement.md`)。设计时的功能范围、业务规则、Scope 以该文档为准。
81
+ - **必需输入 2**:数据模型设计文档 `6aspecdoc/green/<feature-name>/artifacts/domain-model.md`
82
82
  - **参考文档**:`./.6aspec/biz/functional-capability-Map.md`(能力地图)、`./.6aspec/biz/event-list.md`(事件清单,涉及事件时)
83
83
 
84
84
  **可选**:若用户额外提供原始 PRD,仅作补充参考,不得与 requirement.md 已确认内容冲突;有冲突时以 requirement.md 为准。
@@ -86,8 +86,8 @@ alwaysApply: false
86
86
  ## 第一阶段:需求完备性检查(Gatekeeping,必须先做)
87
87
  **请在 `<thinking>` 块中执行此步骤。**
88
88
  请逐项核对并输出结论(Y/N):
89
- - [ ] **需求文档存在**:`6aspec/green/<feature-name>/requirement.md` 是否存在且可读?(设计依据以该文档为准)
90
- - [ ] **模型文档存在**:`6aspec/green/<feature-name>/artifacts/domain-model.md` 是否存在?
89
+ - [ ] **需求文档存在**:`6aspecdoc/green/<feature-name>/requirement.md` 是否存在且可读?(设计依据以该文档为准)
90
+ - [ ] **模型文档存在**:`6aspecdoc/green/<feature-name>/artifacts/domain-model.md` 是否存在?
91
91
  - [ ] **数据闭环**:新功能涉及字段是否都能落在模型中?
92
92
  - [ ] **外部依赖**:是否需要调用其他模块 Facade?(参考能力地图)
93
93
  - [ ] **异常覆盖**:失败、超时、并发、幂等等关键逻辑是否明确?
@@ -182,17 +182,17 @@ alwaysApply: false
182
182
 
183
183
  ## 输出要求(硬性)
184
184
  1. **格式**:Markdown 源码,使用代码块包裹。
185
- 2. **位置**:`6aspec/green/<feature-name>/artifacts/`(feature-name 使用 kebab-case 命名,如:user-authentication)
185
+ 2. **位置**:`6aspecdoc/green/<feature-name>/artifacts/`(feature-name 使用 kebab-case 命名,如:user-authentication)
186
186
  3. **交付物格式**:
187
187
  请严格按照以下格式在一次回复中输出两个代码块:
188
188
 
189
189
  这里是技术设计文档:
190
- ```markdown:6aspec/green/<feature-name>/artifacts/tech-design.md
190
+ ```markdown:6aspecdoc/green/<feature-name>/artifacts/tech-design.md
191
191
  (技术设计文档内容...)
192
192
  ```
193
193
 
194
194
  这里是 API 详细定义:
195
- ```markdown:6aspec/green/<feature-name>/artifacts/api-definition.md
195
+ ```markdown:6aspecdoc/green/<feature-name>/artifacts/api-definition.md
196
196
  (API 定义内容,包含详细 JSON 结构...)
197
197
  ```
198
198
  4. **解耦**:不包含具体项目包路径,用逻辑层(service/repository/facade)描述
@@ -85,13 +85,13 @@ python .cursor/script/create_entities_from_markdown.py {markdown_file_path} -a {
85
85
 
86
86
  ## 示例对话
87
87
 
88
- **User:** `import-model-table 6aspec/green/xxx/artifacts/domain-model.md 890601`
88
+ **User:** `import-model-table 6aspecdoc/green/xxx/artifacts/domain-model.md 890601`
89
89
 
90
90
  **Assistant:**
91
91
  1. 解析 Application: `8906`
92
92
  2. 搜索 GUID: 在 `data/metadata/_metadata/8906/` 中搜索 `890601`...
93
93
  3. 找到 GUID: `12345678-1234-1234-1234-1234567890ab`
94
- 4. 执行命令: `python .6aspec/script/create_entities_from_markdown.py 6aspec/green/xxx/artifacts/domain-model.md -a 8906 -g 12345678-1234-1234-1234-1234567890ab`
94
+ 4. 执行命令: `python .6aspec/script/create_entities_from_markdown.py 6aspecdoc/green/xxx/artifacts/domain-model.md -a 8906 -g 12345678-1234-1234-1234-1234567890ab`
95
95
  5. 反馈结果。
96
96
 
97
97
  ## 流程完成提示 (Workflow Progress)
@@ -27,8 +27,8 @@ alwaysApply: false
27
27
 
28
28
  在执行领域建模前,**必须**先完成依赖检查,不通过则**立即停止**并提示,不得继续:
29
29
 
30
- 1. **确定当前需求**:根据当前工作目录或用户 @ 的文件,确定 `6aspec/green/<feature-name>/`;若有多个需求则让用户选择。
31
- 2. **读取状态文件**:读取 `6aspec/green/<feature-name>/.green-status.json`。若文件不存在,说明尚未通过 `new` 创建该需求,停止并提示:
30
+ 1. **确定当前需求**:根据当前工作目录或用户 @ 的文件,确定 `6aspecdoc/green/<feature-name>/`;若有多个需求则让用户选择。
31
+ 2. **读取状态文件**:读取 `6aspecdoc/green/<feature-name>/.green-status.json`。若文件不存在,说明尚未通过 `new` 创建该需求,停止并提示:
32
32
  ```
33
33
  ❌ 未通过依赖检查,无法执行领域建模
34
34
 
@@ -54,7 +54,7 @@ alwaysApply: false
54
54
 
55
55
  请先运行 /6aspec:green:new 或 /6aspec:green:clarify 完成 requirement.md 后再执行 model。
56
56
  ```
57
- 4. **检查 requirement.md 存在**:若 `6aspec/green/<feature-name>/requirement.md` 不存在或为空,停止并提示先完成需求澄清。
57
+ 4. **检查 requirement.md 存在**:若 `6aspecdoc/green/<feature-name>/requirement.md` 不存在或为空,停止并提示先完成需求澄清。
58
58
 
59
59
  5. **检查项目已初始化(可选但推荐)**:若 `./.6aspec/biz/functional-capability-Map.md` 不存在,提示:
60
60
  ```
@@ -66,7 +66,7 @@ alwaysApply: false
66
66
  **只有第 1~4 项检查全部通过后,才允许继续执行本 SOP 的建模步骤。**
67
67
 
68
68
  ## 输入要求
69
- - **首选输入**:需求澄清文档 `requirement.md`(由 `/6aspec:green:new` 生成,位于 `6aspec/green/<feature-name>/requirement.md`)
69
+ - **首选输入**:需求澄清文档 `requirement.md`(由 `/6aspec:green:new` 生成,位于 `6aspecdoc/green/<feature-name>/requirement.md`)
70
70
  - **备选输入**:如果尚未执行 `new` 命令,可直接使用 PRD(产品需求文档)或功能需求描述
71
71
  - **可选输入**:已确认的领域边界与核心实体语义(可以是markdown文档)
72
72
  - **系统自带知识库**:
@@ -175,8 +175,8 @@ alwaysApply: false
175
175
 
176
176
  ## 输出要求:
177
177
  1. 格式:Markdown 源码格式
178
- 2. 文档位置:`6aspec/green/<feature-name>/artifacts/` 目录(feature-name 使用 kebab-case 命名,如:user-authentication)
179
- 3. 文档命名:`domain-model.md`(完整路径:`6aspec/green/<feature-name>/artifacts/domain-model.md`)
178
+ 2. 文档位置:`6aspecdoc/green/<feature-name>/artifacts/` 目录(feature-name 使用 kebab-case 命名,如:user-authentication)
179
+ 3. 文档命名:`domain-model.md`(完整路径:`6aspecdoc/green/<feature-name>/artifacts/domain-model.md`)
180
180
  4. 请务必检查下第三步的输出是否满足格式要求
181
181
 
182
182
  ## 注意
@@ -25,7 +25,7 @@
25
25
 
26
26
  **1.0 前置检查(避免与 clarify 混淆)**
27
27
 
28
- - 若当前工作目录已在 `6aspec/green/<某需求名>/` 下,或用户 @ 的文件位于某需求目录内,则**先提示**:
28
+ - 若当前工作目录已在 `6aspecdoc/green/<某需求名>/` 下,或用户 @ 的文件位于某需求目录内,则**先提示**:
29
29
  ```
30
30
  当前处于需求目录「<需求名>」内。如需对本需求继续澄清,请使用 /6aspec:green:clarify;
31
31
  如需新建另一个需求,请切换到项目根目录后再次执行 /6aspec:green:new。
@@ -49,7 +49,7 @@
49
49
  **1.2 创建目录结构**
50
50
 
51
51
  ```
52
- 6aspec/green/<feature-name>/
52
+ 6aspecdoc/green/<feature-name>/
53
53
  ├── .green-status.json # 状态文件
54
54
  ├── requirement.md # 需求澄清文档(本步骤生成)
55
55
  ├── artifacts/ # 存放 model、design、visual-logic 生成的文档
@@ -69,19 +69,19 @@
69
69
  "artifacts": {
70
70
  "requirement": {
71
71
  "status": "pending",
72
- "path": "6aspec/green/<feature-name>/requirement.md"
72
+ "path": "6aspecdoc/green/<feature-name>/requirement.md"
73
73
  },
74
74
  "models": {
75
75
  "status": "blocked",
76
- "path": "6aspec/green/<feature-name>/artifacts/"
76
+ "path": "6aspecdoc/green/<feature-name>/artifacts/"
77
77
  },
78
78
  "design": {
79
79
  "status": "blocked",
80
- "path": "6aspec/green/<feature-name>/artifacts/"
80
+ "path": "6aspecdoc/green/<feature-name>/artifacts/"
81
81
  },
82
82
  "tasks": {
83
83
  "status": "blocked",
84
- "path": "6aspec/green/<feature-name>/tasks/"
84
+ "path": "6aspecdoc/green/<feature-name>/tasks/"
85
85
  }
86
86
  },
87
87
  "tasks": {
@@ -283,7 +283,7 @@
283
283
 
284
284
  ## 输出要求
285
285
  1. 格式:Markdown 源码格式
286
- 2. 文档位置:`6aspec/green/<feature-name>/requirement.md`
286
+ 2. 文档位置:`6aspecdoc/green/<feature-name>/requirement.md`
287
287
  3. 文档命名:`requirement.md`
288
288
  4. 必须包含"待确认项"章节(即使为空)
289
289
 
@@ -0,0 +1,198 @@
1
+ # rollback: 流程回退标准操作流程 (Rollback SOP)
2
+
3
+ ## 目标
4
+ 将当前需求回退**一个阶段**,并删除该阶段生成的工件,以便重新执行上一阶段或修正后重做本阶段。仅允许单步回退,且**必须获得用户明确确认后**才执行删除与状态更新。
5
+
6
+ ## 规则
7
+ 1. **单步回退**:每次只能回退一个阶段,不允许跨多阶段回退
8
+ 2. **先提示后执行**:必须先列出将删除的文件并提示用户,**只有在用户给出明确确认指令后**才允许执行删除和状态更新
9
+ 3. **禁止从实现阶段回退**:状态为 `implementing`、`completed`、`archived` 时不允许回退;`created` 无上一阶段,也不允许
10
+
11
+ ## 允许回退的状态与目标
12
+
13
+ | 当前状态 | 回退后状态 | 将删除的工件 |
14
+ |----------|------------|--------------|
15
+ | `requirement_clarified` | `created` | `6aspecdoc/green/<feature-name>/requirement.md` |
16
+ | `modeled` | `requirement_clarified` | `6aspecdoc/green/<feature-name>/artifacts/domain-model.md` |
17
+ | `designed` | `modeled` | `6aspecdoc/green/<feature-name>/artifacts/tech-design.md`、`api-definition.md`;若存在则一并删除 `artifacts/visual-logic.md` |
18
+ | `tasks_created` | `designed` | `6aspecdoc/green/<feature-name>/tasks/` 目录下全部文件(含 `README.md` 及所有 `task-*.md`) |
19
+
20
+ ## 执行步骤
21
+
22
+ ### Step 1: 确定需求并读取状态
23
+
24
+ 1. **确定当前需求**:根据当前工作目录或用户 @ 的文件,确定 `6aspecdoc/green/<feature-name>/`;若有多个需求则让用户选择。
25
+ 2. **读取状态文件**:读取 `6aspecdoc/green/<feature-name>/.green-status.json`。若文件不存在,停止并提示先运行 `/6aspec:green:new`。
26
+ 3. **阶段门禁**:检查 `status`:
27
+ - **允许回退**:仅当 `status` 为 `requirement_clarified`、`modeled`、`designed`、`tasks_created` 之一时继续。
28
+ - **拒绝回退**:若为 `created`、`implementing`、`completed`、`archived`,则停止并输出:
29
+
30
+ ```
31
+ ❌ 不允许执行回退 (rollback)
32
+
33
+ 当前状态:<status>
34
+
35
+ 允许回退的阶段:仅限 requirement_clarified、modeled、designed、tasks_created。
36
+ created(无上一阶段)、implementing(已进入代码实现)、completed、archived 不允许回退。
37
+
38
+ 若已进入实现阶段且需求有变更,建议通过修改需求/设计文档并补充任务处理,或新建需求。
39
+ ```
40
+
41
+ ### Step 2: 列出回退影响并请求用户明确确认
42
+
43
+ 根据当前状态,输出**回退影响说明**,并**禁止在未得到用户明确确认前执行任何删除或写状态文件操作**。
44
+
45
+ 输出格式(必须包含以下内容):
46
+
47
+ ```markdown
48
+ ## 回退影响说明
49
+
50
+ - **当前状态**:<current-status>
51
+ - **回退后状态**:<target-status>
52
+ - **回退后下一步**:需重新执行 <command>(<描述>)
53
+
54
+ ### 即将删除的文件(执行回退后将不可恢复)
55
+
56
+ <按下面表格根据当前状态填写>
57
+
58
+ | 路径 | 说明 |
59
+ |------|------|
60
+ | <path1> | <说明> |
61
+ | <path2> | <说明> |
62
+
63
+ ### 状态文件更新
64
+
65
+ - `.green-status.json` 中 `status` 将更新为 `<target-status>`
66
+ - 当前阶段对应工件的 `status` 将置为 pending/blocked
67
+
68
+ ---
69
+
70
+ ⚠️ **请确认后再执行回退**
71
+
72
+ 回退将**永久删除**上述文件,且不可通过本命令恢复。
73
+
74
+ 请明确回复以下之一后,我才会执行删除与状态更新:
75
+ - **「确认回退」**
76
+ - **「执行回退」**
77
+
78
+ 若不需要回退,请直接说明取消。
79
+ ```
80
+
81
+ **根据当前状态填写的删除清单:**
82
+
83
+ - **requirement_clarified → created**
84
+ | 路径 | 说明 |
85
+ |------|------|
86
+ | `6aspecdoc/green/<feature-name>/requirement.md` | 需求澄清文档 |
87
+
88
+ - **modeled → requirement_clarified**
89
+ | 路径 | 说明 |
90
+ |------|------|
91
+ | `6aspecdoc/green/<feature-name>/artifacts/domain-model.md` | 领域模型文档 |
92
+
93
+ - **designed → modeled**
94
+ | 路径 | 说明 |
95
+ |------|------|
96
+ | `6aspecdoc/green/<feature-name>/artifacts/tech-design.md` | 技术设计文档 |
97
+ | `6aspecdoc/green/<feature-name>/artifacts/api-definition.md` | API 定义文档 |
98
+ | `6aspecdoc/green/<feature-name>/artifacts/visual-logic.md` | 可视化逻辑图(若存在) |
99
+
100
+ - **tasks_created → designed**
101
+ | 路径 | 说明 |
102
+ |------|------|
103
+ | `6aspecdoc/green/<feature-name>/tasks/` 下全部文件 | 任务列表及 README 等 |
104
+
105
+ ### Step 3: 等待用户明确确认
106
+
107
+ - **仅当**用户回复中包含「确认回退」或「执行回退」的**明确意图**时,才继续执行 Step 4。
108
+ - 若用户回复取消、或仅表达犹豫(如「再想想」),则**不执行**回退,并回复已取消。
109
+ - 若用户未明确确认,则**不得**执行任何文件删除或状态文件写入。
110
+
111
+ ### Step 4: 执行回退(仅在用户已明确确认后)
112
+
113
+ 4.1 **删除工件文件**
114
+ 按 Step 2 中列出的路径执行删除(若某路径不存在则跳过,不报错)。
115
+
116
+ 4.2 **更新 `.green-status.json`**
117
+ 按当前回退类型更新状态与工件状态(见下表),并更新 `lastModified`、`nextAction`。
118
+
119
+ **requirement_clarified → created**
120
+
121
+ ```json
122
+ {
123
+ "status": "created",
124
+ "lastModified": "<ISO8601-now>",
125
+ "artifacts": {
126
+ "requirement": { "status": "pending", "path": "..." },
127
+ "models": { "status": "blocked", "path": "..." },
128
+ "design": { "status": "blocked", "path": "..." },
129
+ "tasks": { "status": "blocked", "path": "..." }
130
+ },
131
+ "nextAction": { "command": "new", "description": "完成需求澄清" }
132
+ }
133
+ ```
134
+
135
+ **modeled → requirement_clarified**
136
+
137
+ ```json
138
+ {
139
+ "status": "requirement_clarified",
140
+ "lastModified": "<ISO8601-now>",
141
+ "artifacts": {
142
+ "models": { "status": "ready", "path": "..." },
143
+ "design": { "status": "blocked", "path": "..." },
144
+ "tasks": { "status": "blocked", "path": "..." }
145
+ },
146
+ "nextAction": { "command": "model", "description": "开始领域建模" }
147
+ }
148
+ ```
149
+
150
+ **designed → modeled**
151
+
152
+ ```json
153
+ {
154
+ "status": "modeled",
155
+ "lastModified": "<ISO8601-now>",
156
+ "artifacts": {
157
+ "design": { "status": "blocked", "path": "..." },
158
+ "tasks": { "status": "blocked", "path": "..." }
159
+ },
160
+ "tasks": { "total": 0, "completed": 0, "remaining": 0 },
161
+ "nextAction": { "command": "design", "description": "开始技术方案设计" }
162
+ }
163
+ ```
164
+
165
+ **tasks_created → designed**
166
+
167
+ ```json
168
+ {
169
+ "status": "designed",
170
+ "lastModified": "<ISO8601-now>",
171
+ "artifacts": {
172
+ "tasks": { "status": "blocked", "path": "..." }
173
+ },
174
+ "tasks": { "total": 0, "completed": 0, "remaining": 0 },
175
+ "nextAction": { "command": "tasks", "description": "开始任务拆解" }
176
+ }
177
+ ```
178
+
179
+ ### Step 5: 输出回退结果
180
+
181
+ ```
182
+ ✅ 回退已执行
183
+
184
+ 需求:<feature-name>
185
+ 回退前状态:<previous-status>
186
+ 当前状态:<new-status>
187
+ 已删除:<列出已删除的路径>
188
+
189
+ 下一步:请运行 /6aspec:green:<command> 重新执行该阶段(或先修改需求/设计后再执行)。
190
+ ```
191
+
192
+ ## 注意
193
+ - **严禁在未获得用户明确确认前**执行 Step 4 的删除或状态更新。
194
+ - 删除为永久操作,不提供撤销;用户确认前务必确保其理解将删除的内容。
195
+ - 仅支持单步回退;需回退多步时,请多次执行 rollback。
196
+
197
+ ## 参考
198
+ - 状态定义:`.6aspec/rules/green/green_status_schema.md`