6aspec 2.0.0-dev.14 → 2.0.0-dev.17
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/.6aspec/rules/brown/brown_archive_sop.md +5 -8
- package/.6aspec/rules/brown/brown_continue_sop.md +3 -0
- package/.6aspec/rules/brown/brown_design_sop.md +111 -21
- package/.6aspec/rules/brown/brown_ff_sop.md +20 -10
- package/.6aspec/rules/brown/brown_impact_sop.md +79 -16
- package/.6aspec/rules/brown/brown_implement_sop.md +3 -3
- package/.6aspec/rules/brown/brown_list_sop.md +12 -12
- package/.6aspec/rules/brown/brown_new_sop.md +26 -18
- package/.6aspec/rules/brown/brown_proposal_sop.md +111 -31
- package/.6aspec/rules/brown/brown_quick_sop.md +2 -5
- package/.6aspec/rules/brown/brown_review_sop.md +4 -4
- package/.6aspec/rules/brown/brown_rollback_sop.md +21 -11
- package/.6aspec/rules/brown/brown_specs_sop.md +134 -23
- package/.6aspec/rules/brown/brown_status_sop.md +15 -5
- package/.6aspec/rules/brown/brown_tasks_sop.md +3 -3
- package/.6aspec/rules/brown/brown_understand_sop.md +76 -14
- package/.6aspec/rules/brown/brown_verify_sop.md +1 -1
- package/.claude/commands/opsx/apply.md +152 -0
- package/.claude/commands/opsx/archive.md +157 -0
- package/.claude/commands/opsx/bulk-archive.md +242 -0
- package/.claude/commands/opsx/continue.md +114 -0
- package/.claude/commands/opsx/explore.md +174 -0
- package/.claude/commands/opsx/ff.md +94 -0
- package/.claude/commands/opsx/new.md +69 -0
- package/.claude/commands/opsx/onboard.md +525 -0
- package/.claude/commands/opsx/sync.md +134 -0
- package/.claude/commands/opsx/verify.md +164 -0
- package/.cursor/commands/opsx-apply.md +152 -0
- package/.cursor/commands/opsx-archive.md +157 -0
- package/.cursor/commands/opsx-bulk-archive.md +242 -0
- package/.cursor/commands/opsx-continue.md +114 -0
- package/.cursor/commands/opsx-explore.md +174 -0
- package/.cursor/commands/opsx-ff.md +94 -0
- package/.cursor/commands/opsx-new.md +69 -0
- package/.cursor/commands/opsx-onboard.md +525 -0
- package/.cursor/commands/opsx-sync.md +134 -0
- package/.cursor/commands/opsx-verify.md +164 -0
- package/package.json +1 -1
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
# 棕地需求 - Specs SOP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
需求规格定义
|
|
4
4
|
|
|
5
5
|
**输入**:`/6aspec:brown:specs` 后可选需求名称。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**适用流程**:轻量级、标准级、完整级
|
|
8
8
|
|
|
9
9
|
**步骤**
|
|
10
10
|
|
|
11
11
|
1. **选择需求并检查状态**
|
|
12
12
|
|
|
13
13
|
- 读取 `6aspecdoc/brown/<name>/status.json`
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- 如果是 "lightweight",提示应该使用 `/6aspec:brown:proposal`
|
|
14
|
+
- 根据 `flowDepth` 检查前置阶段:
|
|
15
|
+
- **轻量级**:确认 `phases.proposal` 为 "done",如果未完成提示先运行 `/6aspec:brown:proposal`
|
|
16
|
+
- **标准级/完整级**:确认 `phases.understand` 为 "done",如果未完成提示先运行 `/6aspec:brown:understand`
|
|
18
17
|
|
|
19
18
|
2. **读取前置文档**
|
|
20
19
|
|
|
20
|
+
根据 `flowDepth` 读取不同的前置文档:
|
|
21
|
+
|
|
22
|
+
**轻量级流程**:
|
|
23
|
+
- `6aspecdoc/brown/<name>/requirement.md`
|
|
24
|
+
- `6aspecdoc/brown/<name>/artifacts/proposal.md`
|
|
25
|
+
|
|
26
|
+
**标准级/完整级流程**:
|
|
21
27
|
- `6aspecdoc/brown/<name>/requirement.md`
|
|
22
|
-
- `6aspecdoc/brown/<name>/artifacts/
|
|
28
|
+
- `6aspecdoc/brown/<name>/artifacts/proposal.md`
|
|
29
|
+
- `6aspecdoc/brown/<name>/artifacts/understanding.md`
|
|
23
30
|
|
|
24
|
-
3.
|
|
31
|
+
3. **读取问题答案(仅标准级/完整级)**
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
如果是标准级或完整级流程,从 understanding.md 中读取"待明确问题清单"及用户的答案:
|
|
27
34
|
|
|
28
35
|
- 检查问题清单中哪些问题已经有答案(标记为具体值而非"[待确认]")
|
|
29
36
|
- 如果有未回答的问题,提示用户这些问题需要明确,但不阻塞 specs 阶段
|
|
@@ -79,12 +86,13 @@ Phase 1.5: 需求规格定义
|
|
|
79
86
|
|
|
80
87
|
8. **创建需求规格文档**
|
|
81
88
|
|
|
82
|
-
创建 `6aspecdoc/brown/<name>/artifacts/
|
|
89
|
+
创建 `6aspecdoc/brown/<name>/artifacts/specs.md`:
|
|
83
90
|
```markdown
|
|
84
|
-
#
|
|
91
|
+
# 需求规格定义
|
|
85
92
|
|
|
86
93
|
> **需求**: <name>
|
|
87
|
-
>
|
|
94
|
+
> **流程**: <flowDepth>
|
|
95
|
+
> **阶段**: Specs
|
|
88
96
|
> **状态**: ✅ 已完成
|
|
89
97
|
> **完成时间**: <timestamp>
|
|
90
98
|
|
|
@@ -165,32 +173,132 @@ Phase 1.5: 需求规格定义
|
|
|
165
173
|
|
|
166
174
|
## 6. 下一步
|
|
167
175
|
|
|
168
|
-
|
|
176
|
+
- 轻量级流程:运行 `/6aspec:brown:design` 进行技术方案设计
|
|
177
|
+
- 标准级/完整级流程:运行 `/6aspec:brown:impact` 进行影响面分析
|
|
169
178
|
```
|
|
170
179
|
|
|
171
180
|
9. **更新状态**
|
|
172
181
|
|
|
173
182
|
更新 `6aspecdoc/brown/<name>/status.json`:
|
|
183
|
+
|
|
184
|
+
**轻量级流程**:
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"status": "design_pending",
|
|
188
|
+
"flowDepth": "lightweight",
|
|
189
|
+
"phases": {
|
|
190
|
+
"proposal": "done",
|
|
191
|
+
"specs": "done",
|
|
192
|
+
"design": "pending",
|
|
193
|
+
"tasks": "blocked",
|
|
194
|
+
"implement": "blocked"
|
|
195
|
+
},
|
|
196
|
+
"artifacts": ["proposal.md", "specs.md"]
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**标准级流程**:
|
|
174
201
|
```json
|
|
175
202
|
{
|
|
176
203
|
"status": "impact_pending",
|
|
204
|
+
"flowDepth": "standard",
|
|
177
205
|
"phases": {
|
|
206
|
+
"proposal": "done",
|
|
178
207
|
"understand": "done",
|
|
179
208
|
"specs": "done",
|
|
180
209
|
"impact": "pending",
|
|
181
|
-
|
|
210
|
+
"design": "blocked",
|
|
211
|
+
"tasks": "blocked",
|
|
212
|
+
"implement": "blocked"
|
|
182
213
|
},
|
|
183
|
-
"artifacts": ["
|
|
214
|
+
"artifacts": ["proposal.md", "understanding.md", "specs.md"]
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**完整级流程**:
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"status": "impact_pending",
|
|
222
|
+
"flowDepth": "complete",
|
|
223
|
+
"phases": {
|
|
224
|
+
"proposal": "done",
|
|
225
|
+
"understand": "done",
|
|
226
|
+
"specs": "done",
|
|
227
|
+
"impact": "pending",
|
|
228
|
+
"design": "blocked",
|
|
229
|
+
"tasks": "blocked",
|
|
230
|
+
"implement": "blocked",
|
|
231
|
+
"verify": "blocked",
|
|
232
|
+
"review": "blocked"
|
|
233
|
+
},
|
|
234
|
+
"artifacts": ["proposal.md", "understanding.md", "specs.md"]
|
|
184
235
|
}
|
|
185
236
|
```
|
|
186
237
|
|
|
187
238
|
**输出**
|
|
188
239
|
|
|
240
|
+
根据 `flowDepth` 显示不同的输出信息:
|
|
241
|
+
|
|
242
|
+
**轻量级流程**:
|
|
243
|
+
```
|
|
244
|
+
## Specs 完成:<name>
|
|
245
|
+
|
|
246
|
+
**流程**: 轻量级
|
|
247
|
+
**进度**: 2/5 阶段完成
|
|
248
|
+
|
|
249
|
+
### 需求概要
|
|
250
|
+
- 功能需求:<数量> 个
|
|
251
|
+
- 非功能需求:<数量> 个
|
|
252
|
+
- 验收标准:<数量> 个
|
|
253
|
+
|
|
254
|
+
### 核心功能
|
|
255
|
+
<列出 2-3 个核心功能需求>
|
|
256
|
+
|
|
257
|
+
### 关键约束
|
|
258
|
+
<列出 1-2 个关键约束>
|
|
259
|
+
|
|
260
|
+
### 文档位置
|
|
261
|
+
6aspecdoc/brown/<name>/artifacts/specs.md
|
|
262
|
+
|
|
263
|
+
### 下一步
|
|
264
|
+
- 直接回复补充或修正需求规格 → 我会更新本阶段文档(specs.md)
|
|
265
|
+
- 运行 `/6aspec:brown:design` → 进入技术方案设计阶段
|
|
266
|
+
- 运行 `/6aspec:brown:continue` → 自动进入下一阶段
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**标准级流程**:
|
|
270
|
+
```
|
|
271
|
+
## Specs 完成:<name>
|
|
272
|
+
|
|
273
|
+
**流程**: 标准级
|
|
274
|
+
**进度**: 3/7 阶段完成
|
|
275
|
+
|
|
276
|
+
### 需求概要
|
|
277
|
+
- 功能需求:<数量> 个
|
|
278
|
+
- 非功能需求:<数量> 个
|
|
279
|
+
- 验收标准:<数量> 个
|
|
280
|
+
|
|
281
|
+
### 核心功能
|
|
282
|
+
<列出 2-3 个核心功能需求>
|
|
283
|
+
|
|
284
|
+
### 关键约束
|
|
285
|
+
<列出 1-2 个关键约束>
|
|
286
|
+
|
|
287
|
+
### 文档位置
|
|
288
|
+
6aspecdoc/brown/<name>/artifacts/specs.md
|
|
289
|
+
|
|
290
|
+
### 下一步
|
|
291
|
+
- 直接回复补充或修正需求规格 → 我会更新本阶段文档(specs.md)
|
|
292
|
+
- 运行 `/6aspec:brown:impact` → 进入影响面分析阶段
|
|
293
|
+
- 运行 `/6aspec:brown:continue` → 自动进入下一阶段
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**完整级流程**:
|
|
189
297
|
```
|
|
190
|
-
##
|
|
298
|
+
## Specs 完成:<name>
|
|
191
299
|
|
|
192
|
-
|
|
193
|
-
**进度**:
|
|
300
|
+
**流程**: 完整级
|
|
301
|
+
**进度**: 3/9 阶段完成
|
|
194
302
|
|
|
195
303
|
### 需求概要
|
|
196
304
|
- 功能需求:<数量> 个
|
|
@@ -204,10 +312,10 @@ Phase 1.5: 需求规格定义
|
|
|
204
312
|
<列出 1-2 个关键约束>
|
|
205
313
|
|
|
206
314
|
### 文档位置
|
|
207
|
-
6aspecdoc/brown/<name>/artifacts/
|
|
315
|
+
6aspecdoc/brown/<name>/artifacts/specs.md
|
|
208
316
|
|
|
209
317
|
### 下一步
|
|
210
|
-
- 直接回复补充或修正需求规格 → 我会更新本阶段文档(
|
|
318
|
+
- 直接回复补充或修正需求规格 → 我会更新本阶段文档(specs.md)
|
|
211
319
|
- 运行 `/6aspec:brown:impact` → 进入影响面分析阶段
|
|
212
320
|
- 运行 `/6aspec:brown:continue` → 自动进入下一阶段
|
|
213
321
|
```
|
|
@@ -215,14 +323,17 @@ Phase 1.5: 需求规格定义
|
|
|
215
323
|
**用户补充信息时的处理**
|
|
216
324
|
|
|
217
325
|
当用户补充需求细节、修正功能需求时(未使用阶段命令):
|
|
218
|
-
1. 将用户的补充整合到 `
|
|
326
|
+
1. 将用户的补充整合到 `specs.md` 的对应章节(功能需求、非功能需求、验收标准等)
|
|
219
327
|
2. 展示变更摘要
|
|
220
328
|
3. 再次提示:可以继续补充,或通过命令进入下一阶段
|
|
221
329
|
4. **禁止**:不得自动进入下一阶段
|
|
222
330
|
|
|
223
331
|
**防护措施**
|
|
224
|
-
-
|
|
225
|
-
-
|
|
332
|
+
- 适用于所有流程(轻量级、标准级、完整级)
|
|
333
|
+
- 根据flowDepth检查不同的前置阶段:
|
|
334
|
+
- 轻量级:必须先完成proposal阶段
|
|
335
|
+
- 标准级/完整级:必须先完成understand阶段
|
|
226
336
|
- 功能需求必须从用户视角描述,避免技术实现细节
|
|
227
337
|
- 验收标准必须具体、可验证
|
|
228
338
|
- 需求问题的答案应该体现在功能需求定义中,而不是单独列出
|
|
339
|
+
- specs的详细程度保持一致,不区分流程深度
|
|
@@ -31,27 +31,32 @@
|
|
|
31
31
|
|
|
32
32
|
### 阶段进度
|
|
33
33
|
|
|
34
|
-
**轻量级流程(
|
|
34
|
+
**轻量级流程(5阶段)**:
|
|
35
35
|
| 阶段 | 状态 | 完成时间 |
|
|
36
36
|
|------|------|----------|
|
|
37
37
|
| Proposal | ✅ 已完成 / 🔄 进行中 / 📋 待开始 / 🔒 阻塞 | <timestamp> |
|
|
38
|
+
| Specs | ... | ... |
|
|
38
39
|
| Design | ... | ... |
|
|
39
40
|
| Tasks | ... | ... |
|
|
40
41
|
| Implement | ... | ... |
|
|
41
42
|
|
|
42
|
-
**标准级流程(
|
|
43
|
+
**标准级流程(7阶段)**:
|
|
43
44
|
| 阶段 | 状态 | 完成时间 |
|
|
44
45
|
|------|------|----------|
|
|
45
|
-
|
|
|
46
|
+
| Proposal | ✅ 已完成 / 🔄 进行中 / 📋 待开始 / 🔒 阻塞 | <timestamp> |
|
|
47
|
+
| Understand | ... | ... |
|
|
48
|
+
| Specs | ... | ... |
|
|
46
49
|
| Impact | ... | ... |
|
|
47
50
|
| Design | ... | ... |
|
|
48
51
|
| Tasks | ... | ... |
|
|
49
52
|
| Implement | ... | ... |
|
|
50
53
|
|
|
51
|
-
**完整级流程(
|
|
54
|
+
**完整级流程(9阶段)**:
|
|
52
55
|
| 阶段 | 状态 | 完成时间 |
|
|
53
56
|
|------|------|----------|
|
|
54
|
-
|
|
|
57
|
+
| Proposal | ✅ 已完成 / 🔄 进行中 / 📋 待开始 / 🔒 阻塞 | <timestamp> |
|
|
58
|
+
| Understand | ... | ... |
|
|
59
|
+
| Specs | ... | ... |
|
|
55
60
|
| Impact | ... | ... |
|
|
56
61
|
| Design | ... | ... |
|
|
57
62
|
| Tasks | ... | ... |
|
|
@@ -70,17 +75,22 @@
|
|
|
70
75
|
|
|
71
76
|
**轻量级**:
|
|
72
77
|
- [ ] proposal.md
|
|
78
|
+
- [ ] specs.md
|
|
73
79
|
- [ ] design.md
|
|
74
80
|
- [ ] tasks.md
|
|
75
81
|
|
|
76
82
|
**标准级**:
|
|
83
|
+
- [ ] proposal.md
|
|
77
84
|
- [ ] understanding.md
|
|
85
|
+
- [ ] specs.md
|
|
78
86
|
- [ ] impact-analysis.md
|
|
79
87
|
- [ ] design.md
|
|
80
88
|
- [ ] tasks.md
|
|
81
89
|
|
|
82
90
|
**完整级**:
|
|
91
|
+
- [ ] proposal.md
|
|
83
92
|
- [ ] understanding.md
|
|
93
|
+
- [ ] specs.md
|
|
84
94
|
- [ ] impact-analysis.md
|
|
85
95
|
- [ ] design.md
|
|
86
96
|
- [ ] tasks.md
|
|
@@ -14,9 +14,9 @@ Phase 4: 任务拆解与排期
|
|
|
14
14
|
|
|
15
15
|
2. **读取前置文档**
|
|
16
16
|
|
|
17
|
-
- `6aspecdoc/brown/<name>/artifacts/
|
|
18
|
-
- `6aspecdoc/brown/<name>/artifacts/
|
|
19
|
-
- `6aspecdoc/brown/<name>/artifacts/
|
|
17
|
+
- `6aspecdoc/brown/<name>/artifacts/understanding.md`
|
|
18
|
+
- `6aspecdoc/brown/<name>/artifacts/impact-analysis.md`
|
|
19
|
+
- `6aspecdoc/brown/<name>/artifacts/design.md`
|
|
20
20
|
|
|
21
21
|
3. **原子任务拆解**
|
|
22
22
|
|
|
@@ -17,9 +17,12 @@ Phase 1: 需求理解与现状分析
|
|
|
17
17
|
2. **检查状态**
|
|
18
18
|
|
|
19
19
|
读取 `6aspecdoc/brown/<name>/status.json`:
|
|
20
|
+
- 确认流程深度为 "standard" 或 "complete"
|
|
21
|
+
- 如果是 "lightweight",提示轻量级流程不需要understand阶段,应该直接运行 `/6aspec:brown:specs`
|
|
22
|
+
- 确认 `phases.proposal` 为 "done"
|
|
23
|
+
- 如果proposal未完成,提示先运行 `/6aspec:brown:proposal`
|
|
20
24
|
- 如果 `phases.understand` 不是 "pending",提示已完成或跳过
|
|
21
|
-
-
|
|
22
|
-
- P2 需求提示使用 `/6aspec:brown:quick`
|
|
25
|
+
- 如果是简单需求,提示考虑使用 `/6aspec:brown:quick` 快速通道
|
|
23
26
|
|
|
24
27
|
3. **读取需求描述**
|
|
25
28
|
|
|
@@ -78,12 +81,13 @@ Phase 1: 需求理解与现状分析
|
|
|
78
81
|
|
|
79
82
|
6. **创建分析文档**
|
|
80
83
|
|
|
81
|
-
创建 `6aspecdoc/brown/<name>/artifacts/
|
|
84
|
+
创建 `6aspecdoc/brown/<name>/artifacts/understanding.md`:
|
|
82
85
|
```markdown
|
|
83
|
-
#
|
|
86
|
+
# 需求理解与现状分析
|
|
84
87
|
|
|
85
88
|
> **需求**: <name>
|
|
86
|
-
>
|
|
89
|
+
> **流程**: <flowDepth>
|
|
90
|
+
> **阶段**: Understand
|
|
87
91
|
> **状态**: ✅ 已完成
|
|
88
92
|
> **完成时间**: <timestamp>
|
|
89
93
|
|
|
@@ -147,16 +151,42 @@ Phase 1: 需求理解与现状分析
|
|
|
147
151
|
7. **更新状态**
|
|
148
152
|
|
|
149
153
|
更新 `6aspecdoc/brown/<name>/status.json`:
|
|
154
|
+
|
|
155
|
+
**标准级流程**:
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"status": "specs_pending",
|
|
159
|
+
"flowDepth": "standard",
|
|
160
|
+
"phases": {
|
|
161
|
+
"proposal": "done",
|
|
162
|
+
"understand": "done",
|
|
163
|
+
"specs": "pending",
|
|
164
|
+
"impact": "blocked",
|
|
165
|
+
"design": "blocked",
|
|
166
|
+
"tasks": "blocked",
|
|
167
|
+
"implement": "blocked"
|
|
168
|
+
},
|
|
169
|
+
"artifacts": ["proposal.md", "understanding.md"]
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**完整级流程**:
|
|
150
174
|
```json
|
|
151
175
|
{
|
|
152
176
|
"status": "specs_pending",
|
|
177
|
+
"flowDepth": "complete",
|
|
153
178
|
"phases": {
|
|
179
|
+
"proposal": "done",
|
|
154
180
|
"understand": "done",
|
|
155
181
|
"specs": "pending",
|
|
156
182
|
"impact": "blocked",
|
|
157
|
-
|
|
183
|
+
"design": "blocked",
|
|
184
|
+
"tasks": "blocked",
|
|
185
|
+
"implement": "blocked",
|
|
186
|
+
"verify": "blocked",
|
|
187
|
+
"review": "blocked"
|
|
158
188
|
},
|
|
159
|
-
"artifacts": ["
|
|
189
|
+
"artifacts": ["proposal.md", "understanding.md"]
|
|
160
190
|
}
|
|
161
191
|
```
|
|
162
192
|
|
|
@@ -164,12 +194,42 @@ Phase 1: 需求理解与现状分析
|
|
|
164
194
|
|
|
165
195
|
**输出**
|
|
166
196
|
|
|
167
|
-
|
|
197
|
+
根据 `flowDepth` 显示不同的输出信息:
|
|
198
|
+
|
|
199
|
+
**标准级流程**:
|
|
200
|
+
```
|
|
201
|
+
## Understand 完成:<name>
|
|
202
|
+
|
|
203
|
+
**流程**: 标准级
|
|
204
|
+
**进度**: 2/7 阶段完成
|
|
205
|
+
|
|
206
|
+
### 分析结果
|
|
207
|
+
- 相关实体类:<数量>
|
|
208
|
+
- 相关服务类:<数量>
|
|
209
|
+
- 数据库表:<数量>
|
|
210
|
+
- 待明确问题:<数量>
|
|
211
|
+
|
|
212
|
+
### 关键发现
|
|
213
|
+
<列出 2-3 个关键发现>
|
|
214
|
+
|
|
215
|
+
### 待明确问题(重要)
|
|
216
|
+
<列出最重要的 3-5 个问题>
|
|
217
|
+
|
|
218
|
+
### 文档位置
|
|
219
|
+
6aspecdoc/brown/<name>/artifacts/understanding.md
|
|
220
|
+
|
|
221
|
+
### 下一步
|
|
222
|
+
- 直接回答上述待明确问题 → 我会更新本阶段文档(understanding.md)中的问题答案
|
|
223
|
+
- 运行 `/6aspec:brown:specs` → 进入需求规格定义阶段
|
|
224
|
+
- 运行 `/6aspec:brown:continue` → 自动进入下一阶段
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**完整级流程**:
|
|
168
228
|
```
|
|
169
|
-
##
|
|
229
|
+
## Understand 完成:<name>
|
|
170
230
|
|
|
171
|
-
|
|
172
|
-
**进度**:
|
|
231
|
+
**流程**: 完整级
|
|
232
|
+
**进度**: 2/9 阶段完成
|
|
173
233
|
|
|
174
234
|
### 分析结果
|
|
175
235
|
- 相关实体类:<数量>
|
|
@@ -184,10 +244,10 @@ Phase 1: 需求理解与现状分析
|
|
|
184
244
|
<列出最重要的 3-5 个问题>
|
|
185
245
|
|
|
186
246
|
### 文档位置
|
|
187
|
-
6aspecdoc/brown/<name>/artifacts/
|
|
247
|
+
6aspecdoc/brown/<name>/artifacts/understanding.md
|
|
188
248
|
|
|
189
249
|
### 下一步
|
|
190
|
-
- 直接回答上述待明确问题 → 我会更新本阶段文档(
|
|
250
|
+
- 直接回答上述待明确问题 → 我会更新本阶段文档(understanding.md)中的问题答案
|
|
191
251
|
- 运行 `/6aspec:brown:specs` → 进入需求规格定义阶段
|
|
192
252
|
- 运行 `/6aspec:brown:continue` → 自动进入下一阶段
|
|
193
253
|
```
|
|
@@ -195,13 +255,15 @@ Phase 1: 需求理解与现状分析
|
|
|
195
255
|
**用户补充信息时的处理**
|
|
196
256
|
|
|
197
257
|
当用户回答待明确问题或补充需求信息时(未使用阶段命令):
|
|
198
|
-
1. 将用户的回答整合到 `
|
|
258
|
+
1. 将用户的回答整合到 `understanding.md` 中对应的问题项(将"[待确认]"替换为实际答案)
|
|
199
259
|
2. 如果回答引发新的发现或问题,同步更新文档的相关章节
|
|
200
260
|
3. 展示变更摘要(更新了哪些问题的答案、新增了哪些发现)
|
|
201
261
|
4. 再次提示:可以继续补充,或通过命令进入下一阶段
|
|
202
262
|
5. **禁止**:不得自动进入下一阶段
|
|
203
263
|
|
|
204
264
|
**防护措施**
|
|
265
|
+
- 只适用于标准级和完整级流程
|
|
266
|
+
- 必须先完成proposal阶段
|
|
205
267
|
- 必须先读取需求描述再开始分析
|
|
206
268
|
- 如果找不到相关代码,询问用户提供更多关键词
|
|
207
269
|
- 如果分析不充分,不要强行生成文档,而是询问用户
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "OPSX: Apply"
|
|
3
|
+
description: Implement tasks from an OpenSpec change (Experimental)
|
|
4
|
+
category: Workflow
|
|
5
|
+
tags: [workflow, artifacts, experimental]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Implement tasks from an OpenSpec change.
|
|
9
|
+
|
|
10
|
+
**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.
|
|
11
|
+
|
|
12
|
+
**Steps**
|
|
13
|
+
|
|
14
|
+
1. **Select the change**
|
|
15
|
+
|
|
16
|
+
If a name is provided, use it. Otherwise:
|
|
17
|
+
- Infer from conversation context if the user mentioned a change
|
|
18
|
+
- Auto-select if only one active change exists
|
|
19
|
+
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
|
|
20
|
+
|
|
21
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
|
22
|
+
|
|
23
|
+
2. **Check status to understand the schema**
|
|
24
|
+
```bash
|
|
25
|
+
openspec status --change "<name>" --json
|
|
26
|
+
```
|
|
27
|
+
Parse the JSON to understand:
|
|
28
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
29
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
30
|
+
|
|
31
|
+
3. **Get apply instructions**
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
openspec instructions apply --change "<name>" --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This returns:
|
|
38
|
+
- Context file paths (varies by schema)
|
|
39
|
+
- Progress (total, complete, remaining)
|
|
40
|
+
- Task list with status
|
|
41
|
+
- Dynamic instruction based on current state
|
|
42
|
+
|
|
43
|
+
**Handle states:**
|
|
44
|
+
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
|
|
45
|
+
- If `state: "all_done"`: congratulate, suggest archive
|
|
46
|
+
- Otherwise: proceed to implementation
|
|
47
|
+
|
|
48
|
+
4. **Read context files**
|
|
49
|
+
|
|
50
|
+
Read the files listed in `contextFiles` from the apply instructions output.
|
|
51
|
+
The files depend on the schema being used:
|
|
52
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
53
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
54
|
+
|
|
55
|
+
5. **Show current progress**
|
|
56
|
+
|
|
57
|
+
Display:
|
|
58
|
+
- Schema being used
|
|
59
|
+
- Progress: "N/M tasks complete"
|
|
60
|
+
- Remaining tasks overview
|
|
61
|
+
- Dynamic instruction from CLI
|
|
62
|
+
|
|
63
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
64
|
+
|
|
65
|
+
For each pending task:
|
|
66
|
+
- Show which task is being worked on
|
|
67
|
+
- Make the code changes required
|
|
68
|
+
- Keep changes minimal and focused
|
|
69
|
+
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
|
70
|
+
- Continue to next task
|
|
71
|
+
|
|
72
|
+
**Pause if:**
|
|
73
|
+
- Task is unclear → ask for clarification
|
|
74
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
75
|
+
- Error or blocker encountered → report and wait for guidance
|
|
76
|
+
- User interrupts
|
|
77
|
+
|
|
78
|
+
7. **On completion or pause, show status**
|
|
79
|
+
|
|
80
|
+
Display:
|
|
81
|
+
- Tasks completed this session
|
|
82
|
+
- Overall progress: "N/M tasks complete"
|
|
83
|
+
- If all done: suggest archive
|
|
84
|
+
- If paused: explain why and wait for guidance
|
|
85
|
+
|
|
86
|
+
**Output During Implementation**
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
90
|
+
|
|
91
|
+
Working on task 3/7: <task description>
|
|
92
|
+
[...implementation happening...]
|
|
93
|
+
✓ Task complete
|
|
94
|
+
|
|
95
|
+
Working on task 4/7: <task description>
|
|
96
|
+
[...implementation happening...]
|
|
97
|
+
✓ Task complete
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Output On Completion**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
## Implementation Complete
|
|
104
|
+
|
|
105
|
+
**Change:** <change-name>
|
|
106
|
+
**Schema:** <schema-name>
|
|
107
|
+
**Progress:** 7/7 tasks complete ✓
|
|
108
|
+
|
|
109
|
+
### Completed This Session
|
|
110
|
+
- [x] Task 1
|
|
111
|
+
- [x] Task 2
|
|
112
|
+
...
|
|
113
|
+
|
|
114
|
+
All tasks complete! You can archive this change with `/opsx:archive`.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Output On Pause (Issue Encountered)**
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
## Implementation Paused
|
|
121
|
+
|
|
122
|
+
**Change:** <change-name>
|
|
123
|
+
**Schema:** <schema-name>
|
|
124
|
+
**Progress:** 4/7 tasks complete
|
|
125
|
+
|
|
126
|
+
### Issue Encountered
|
|
127
|
+
<description of the issue>
|
|
128
|
+
|
|
129
|
+
**Options:**
|
|
130
|
+
1. <option 1>
|
|
131
|
+
2. <option 2>
|
|
132
|
+
3. Other approach
|
|
133
|
+
|
|
134
|
+
What would you like to do?
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Guardrails**
|
|
138
|
+
- Keep going through tasks until done or blocked
|
|
139
|
+
- Always read context files before starting (from the apply instructions output)
|
|
140
|
+
- If task is ambiguous, pause and ask before implementing
|
|
141
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
142
|
+
- Keep code changes minimal and scoped to each task
|
|
143
|
+
- Update task checkbox immediately after completing each task
|
|
144
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
145
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
146
|
+
|
|
147
|
+
**Fluid Workflow Integration**
|
|
148
|
+
|
|
149
|
+
This skill supports the "actions on a change" model:
|
|
150
|
+
|
|
151
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
152
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|