6aspec 2.0.0-dev.3 → 2.0.0-dev.30

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 (95) hide show
  1. package/.6aspec/rules/biz/code.md +122 -28
  2. package/.6aspec/rules/biz/code_implementation_sop.md +77 -0
  3. package/.6aspec/rules/brown/brown_archive_sop.md +17 -11
  4. package/.6aspec/rules/brown/brown_constitution.md +11 -0
  5. package/.6aspec/rules/brown/brown_continue_sop.md +10 -3
  6. package/.6aspec/rules/brown/brown_design_sop.md +285 -71
  7. package/.6aspec/rules/brown/brown_explore_sop.md +314 -0
  8. package/.6aspec/rules/brown/brown_ff_sop.md +31 -18
  9. package/.6aspec/rules/brown/brown_impact_sop.md +101 -45
  10. package/.6aspec/rules/brown/brown_implement_sop.md +127 -43
  11. package/.6aspec/rules/brown/brown_list_sop.md +12 -12
  12. package/.6aspec/rules/brown/brown_new_sop.md +63 -38
  13. package/.6aspec/rules/brown/brown_proposal_sop.md +286 -76
  14. package/.6aspec/rules/brown/brown_quick_sop.md +5 -5
  15. package/.6aspec/rules/brown/brown_review_sop.md +4 -4
  16. package/.6aspec/rules/brown/brown_rollback_sop.md +29 -19
  17. package/.6aspec/rules/brown/brown_specs_sop.md +412 -120
  18. package/.6aspec/rules/brown/brown_status_sop.md +13 -3
  19. package/.6aspec/rules/brown/brown_tasks_sop.md +212 -83
  20. package/.6aspec/rules/brown/brown_understand_sop.md +111 -40
  21. package/.6aspec/rules/brown/brown_update_sop.md +287 -0
  22. package/.6aspec/rules/brown/brown_verify_sop.md +138 -58
  23. package/.6aspec/rules/green/{6A_archive_sop.md → green_archive_sop.md} +3 -3
  24. package/.6aspec/rules/green/{6A_clarify_sop.md → green_clarify_sop.md} +1 -1
  25. package/.6aspec/rules/green/{6A_code_implementation_sop.md → green_code_implementation_sop.md} +18 -3
  26. package/.6aspec/rules/green/{6A_continue_sop.md → green_continue_sop.md} +3 -3
  27. package/.6aspec/rules/green/{6A_new_sop.md → green_new_sop.md} +90 -11
  28. package/.6aspec/rules/green/green_status_schema.md +4 -4
  29. package/.6aspec/rules/green/{6A_status_sop.md → green_status_sop.md} +3 -3
  30. package/.6aspec/rules/green/{6A_tasks_sop.md → green_tasks_sop.md} +1 -1
  31. package/.claude/commands/6aspec/brown/explore.md +11 -0
  32. package/.claude/commands/6aspec/brown/update.md +11 -0
  33. package/.claude/commands/6aspec/code.md +10 -0
  34. package/.claude/commands/6aspec/green/archive.md +1 -1
  35. package/.claude/commands/6aspec/green/clarify.md +2 -2
  36. package/.claude/commands/6aspec/green/continue.md +1 -1
  37. package/.claude/commands/6aspec/green/design.md +2 -2
  38. package/.claude/commands/6aspec/green/{execute-task.md → implement.md} +1 -1
  39. package/.claude/commands/6aspec/green/import-model-table.md +1 -1
  40. package/.claude/commands/6aspec/green/init.md +2 -2
  41. package/.claude/commands/6aspec/green/model.md +2 -2
  42. package/.claude/commands/6aspec/green/new.md +2 -2
  43. package/.claude/commands/6aspec/green/rollback.md +1 -1
  44. package/.claude/commands/6aspec/green/status.md +1 -1
  45. package/.claude/commands/6aspec/green/tasks.md +2 -2
  46. package/.claude/commands/6aspec/green/visual-logic.md +2 -2
  47. package/.claude/commands/opsx/apply.md +152 -0
  48. package/.claude/commands/opsx/archive.md +157 -0
  49. package/.claude/commands/opsx/bulk-archive.md +242 -0
  50. package/.claude/commands/opsx/continue.md +114 -0
  51. package/.claude/commands/opsx/explore.md +174 -0
  52. package/.claude/commands/opsx/ff.md +94 -0
  53. package/.claude/commands/opsx/new.md +69 -0
  54. package/.claude/commands/opsx/onboard.md +525 -0
  55. package/.claude/commands/opsx/sync.md +134 -0
  56. package/.claude/commands/opsx/verify.md +164 -0
  57. package/.claude/settings.local.json +21 -1
  58. package/.cursor/commands/6aspec/brown/explore.md +11 -0
  59. package/.cursor/commands/6aspec/brown/update.md +9 -0
  60. package/.cursor/commands/6aspec/code.md +8 -0
  61. package/.cursor/commands/6aspec/green/archive.md +1 -1
  62. package/.cursor/commands/6aspec/green/clarify.md +2 -2
  63. package/.cursor/commands/6aspec/green/continue.md +1 -1
  64. package/.cursor/commands/6aspec/green/design.md +2 -2
  65. package/.cursor/commands/6aspec/green/{execute-task.md → implement.md} +1 -1
  66. package/.cursor/commands/6aspec/green/import-model-table.md +1 -1
  67. package/.cursor/commands/6aspec/green/init.md +2 -2
  68. package/.cursor/commands/6aspec/green/model.md +2 -2
  69. package/.cursor/commands/6aspec/green/new.md +2 -2
  70. package/.cursor/commands/6aspec/green/rollback.md +1 -1
  71. package/.cursor/commands/6aspec/green/status.md +1 -1
  72. package/.cursor/commands/6aspec/green/tasks.md +2 -2
  73. package/.cursor/commands/6aspec/green/visual-logic.md +2 -2
  74. package/.cursor/commands/opsx-apply.md +152 -0
  75. package/.cursor/commands/opsx-archive.md +157 -0
  76. package/.cursor/commands/opsx-bulk-archive.md +242 -0
  77. package/.cursor/commands/opsx-continue.md +114 -0
  78. package/.cursor/commands/opsx-explore.md +174 -0
  79. package/.cursor/commands/opsx-ff.md +94 -0
  80. package/.cursor/commands/opsx-new.md +69 -0
  81. package/.cursor/commands/opsx-onboard.md +525 -0
  82. package/.cursor/commands/opsx-sync.md +134 -0
  83. package/.cursor/commands/opsx-verify.md +164 -0
  84. package/README.md +1 -1
  85. package/bin/6aspec +17 -1
  86. package/lib/cli.js +1 -1
  87. package/package.json +1 -1
  88. /package/.6aspec/rules/green/{6A_constitution.md → green_constitution.md} +0 -0
  89. /package/.6aspec/rules/green/{6A_design_sop.md → green_design_sop.md} +0 -0
  90. /package/.6aspec/rules/green/{6A_import_model_table_sop.md → green_import_model_table_sop.md} +0 -0
  91. /package/.6aspec/rules/green/{6A_init_event_list_sop.md → green_init_event_list_sop.md} +0 -0
  92. /package/.6aspec/rules/green/{6A_init_map_sop.md → green_init_map_sop.md} +0 -0
  93. /package/.6aspec/rules/green/{6A_model_sop.md → green_model_sop.md} +0 -0
  94. /package/.6aspec/rules/green/{6A_rollback_sop.md → green_rollback_sop.md} +0 -0
  95. /package/.6aspec/rules/green/{6A_visual_logic_sop.md → green_visual_logic_sop.md} +0 -0
@@ -11,28 +11,29 @@
11
11
  1. **选择需求并检查状态**
12
12
 
13
13
  - 读取 `6aspecdoc/brown/<name>/status.json`
14
- - 确认 `phases.implement` 为 "done"
15
14
  - 获取 `flowDepth`(流程深度)
16
- - 如果未完成 Phase 5,提示先运行 `/6aspec:brown:implement`
15
+ - 检查 `phases.implement` 状态:
16
+ - 如果为 "done" → 完整验证
17
+ - 如果为 "in_progress" → 增量验证
18
+ - 如果为 "pending" → 警告:"尚未开始实现,建议先运行 `/6aspec:brown:implement`",但仍可继续验证
17
19
 
18
20
  2. **读取验证基准文档**
19
21
 
20
- 根据流程深度读取不同的文档:
22
+ 统一的文档读取逻辑,根据文档是否存在自动适配:
21
23
 
22
- **轻量级流程**:
23
- - `artifacts/proposal.md` - 需求提案
24
+ **必读文档**(所有流程都有):
24
25
  - `artifacts/design.md` - 技术方案
25
- - `artifacts/tasks.md` - 任务列表
26
+ - `artifacts/tasks.md` 或 `artifacts/04-tasks-overview.md` - 任务列表
26
27
 
27
- **标准级流程**:
28
- - `artifacts/understanding.md` - 需求理解
29
- - `artifacts/impact-analysis.md` - 影响面分析
30
- - `artifacts/design.md` - 技术方案
31
- - `artifacts/tasks.md` - 任务列表
28
+ **可选文档**(根据存在性读取):
29
+ - `artifacts/understanding.md` - 需求理解(标准级/完整级)
30
+ - `artifacts/proposal.md` - 需求提案(轻量级)
31
+ - `artifacts/impact-analysis.md` - 影响面分析(标准级/完整级)
32
+ - `requirement.md` - 需求描述(快速通道)
32
33
 
33
- **完整级流程**:
34
- - 所有标准级文档
35
- - 加上非功能需求评估(在 impact-analysis.md 中)
34
+ **文档读取策略**:
35
+ - 尝试读取文档,如果不存在则跳过
36
+ - 验证报告中明确标注跳过的检查项
36
37
 
37
38
  3. **初始化验证报告结构**
38
39
 
@@ -60,15 +61,17 @@
60
61
  - 解析 checkbox:`- [ ]`(未完成)vs `- [x]`(已完成)
61
62
  - 统计完成率:X/Y 任务完成
62
63
  - 如果有未完成任务:
63
- - 添加 **CRITICAL** 问题:`Task incomplete: <task-id> - <description>`
64
+ - **增量验证**:添加 **INFO** 说明:`Incremental verification: X/Y tasks completed`
65
+ - **完整验证**:添加 **CRITICAL** 问题:`Task incomplete: <task-id> - <description>`
64
66
  - 建议:`Complete task or mark as done if already implemented`
65
67
 
66
68
  **4.2 影响面覆盖验证**(棕地特色)
67
69
 
68
- 仅适用于标准级/完整级流程:
70
+ 根据文档存在性自动适配:
69
71
 
70
- - 读取 `artifacts/impact-analysis.md`
71
- - 提取影响点列表:
72
+ - 尝试读取 `artifacts/impact-analysis.md`
73
+ - 如果文档不存在,跳过此检查,标注:`Skipped: no impact-analysis.md found`
74
+ - 如果文档存在,提取影响点列表:
72
75
  - 数据库表
73
76
  - 实体类
74
77
  - 服务类
@@ -85,9 +88,10 @@
85
88
 
86
89
  **5.1 需求实现映射**(借鉴 OpenSpec)
87
90
 
88
- - 提取需求关键点:
89
- - 轻量级:从 proposal.md 提取 What 部分
90
- - 标准级/完整级:从 understanding.md 提取需求描述
91
+ - 提取需求关键点(按优先级尝试):
92
+ - 优先:从 understanding.md 提取需求描述
93
+ - 其次:从 proposal.md 提取 What 部分
94
+ - 最后:从 requirement.md 提取需求描述
91
95
  - 对每个需求点:
92
96
  - 搜索代码库查找实现证据
93
97
  - 如果找到,记录文件路径和行号
@@ -98,10 +102,11 @@
98
102
 
99
103
  **5.2 业务规则验证**(棕地特色)
100
104
 
101
- 仅适用于标准级/完整级流程:
105
+ 根据文档存在性自动适配:
102
106
 
103
- - 读取 `artifacts/impact-analysis.md` 中的"业务规则确认"部分
104
- - 提取关键业务规则:
107
+ - 尝试读取 `artifacts/impact-analysis.md` 中的"业务规则确认"部分
108
+ - 如果文档不存在或无业务规则部分,跳过此检查,标注:`Skipped: no business rules found`
109
+ - 如果存在,提取关键业务规则:
105
110
  - 必填校验
106
111
  - 不可修改约束
107
112
  - 继承逻辑
@@ -129,7 +134,7 @@
129
134
 
130
135
  **6.1 设计遵循验证**(借鉴 OpenSpec)
131
136
 
132
- - 读取 `artifacts/design.md` 或 `artifacts/03-technical-design.md`
137
+ - 读取 `artifacts/design.md`
133
138
  - 提取关键设计决策:
134
139
  - 数据库变更方案
135
140
  - 代码实现方案
@@ -155,10 +160,11 @@
155
160
 
156
161
  **6.3 非功能需求符合验证**(棕地特色)
157
162
 
158
- 仅适用于完整级流程:
163
+ 根据文档存在性自动适配:
159
164
 
160
- - 读取 `artifacts/impact-analysis.md` 中的"非功能需求评估"部分
161
- - 验证四个维度:
165
+ - 尝试读取 `artifacts/impact-analysis.md` 中的"非功能需求评估"部分
166
+ - 如果文档不存在或无非功能需求部分,跳过此检查,标注:`Skipped: no non-functional requirements found`
167
+ - 如果存在,验证四个维度:
162
168
 
163
169
  **性能**:
164
170
  - 检查是否添加了必要的索引
@@ -192,7 +198,7 @@
192
198
 
193
199
  7. **生成验证报告**
194
200
 
195
- 创建 `6aspecdoc/brown/<name>/artifacts/verification-report.md`(标准级/完整级)或 `6aspecdoc/brown/<name>/artifacts/05-verification-report.md`(完整级):
201
+ 创建 `6aspecdoc/brown/<name>/artifacts/verification-report.md`:
196
202
 
197
203
  ```markdown
198
204
  # 验证报告:<name>
@@ -200,6 +206,8 @@
200
206
  > **需求**: <name>
201
207
  > **流程深度**: 轻量级/标准级/完整级
202
208
  > **验证时间**: <timestamp>
209
+ > **验证类型**: 🔄 增量验证 / ✅ 完整验证
210
+ > **任务进度**: X/Y 已完成 (Z%)
203
211
  > **验证状态**: ✅ 通过 / ⚠️ 有警告 / ❌ 有严重问题
204
212
 
205
213
  ## 验证概览
@@ -244,21 +252,46 @@
244
252
  - **位置**: ProjectApplicationService:123
245
253
  - **建议**: Consider using BusinessLogicException pattern like other services
246
254
 
255
+ ## 验证说明
256
+
257
+ 根据验证类型添加说明:
258
+
259
+ - 如果是增量验证:
260
+ ```
261
+ ⚠️ 这是增量验证(部分任务未完成)。建议在所有任务完成后重新验证。
262
+ ```
263
+
264
+ - 如果是完整验证:
265
+ ```
266
+ ✅ 这是完整验证(所有任务已完成)。
267
+ ```
268
+
247
269
  ## 最终评估
248
270
 
249
- 根据问题严重程度给出评估:
271
+ 根据问题严重程度和验证类型给出评估:
272
+
273
+ - 如果是增量验证:
274
+ ```
275
+ ⚠️ 这是增量验证,当前进度 X/Y 任务完成。
276
+
277
+ 已完成任务的验证结果:
278
+ - [结果摘要]
250
279
 
251
- - 如果有 CRITICAL 问题:
280
+ 未完成任务:
281
+ - [ ] TASK-XXX: <描述>
282
+ ```
283
+
284
+ - 如果是完整验证且有 CRITICAL 问题:
252
285
  ```
253
286
  ❌ 发现 X 个严重问题,必须修复后才能归档。
254
287
  ```
255
288
 
256
- - 如果只有 WARNING:
289
+ - 如果是完整验证且只有 WARNING:
257
290
  ```
258
291
  ⚠️ 没有严重问题,但有 Y 个警告需要考虑。可以归档,但建议修复警告。
259
292
  ```
260
293
 
261
- - 如果全部通过:
294
+ - 如果是完整验证且全部通过:
262
295
  ```
263
296
  ✅ 所有检查通过,可以归档。
264
297
  ```
@@ -276,19 +309,59 @@
276
309
 
277
310
  ## 下一步
278
311
 
279
- 根据验证结果给出建议:
280
- - 如果有 CRITICAL:修复严重问题后重新验证
281
- - 如果只有 WARNING:可以归档,但建议修复警告
282
- - 如果全部通过:运行 `/6aspec:brown:review` 进行实施后评估(完整级)或 `/6aspec:brown:archive` 归档
312
+ 根据验证类型和结果给出建议:
313
+
314
+ - 如果是增量验证:
315
+ ```
316
+ 1. 继续完成剩余任务
317
+ 2. 完成后重新运行 `/6aspec:brown:verify` 进行完整验证
318
+ ```
319
+
320
+ - 如果是完整验证且有 CRITICAL:
321
+ ```
322
+ 修复严重问题后重新验证
323
+ ```
324
+
325
+ - 如果是完整验证且只有 WARNING:
326
+ ```
327
+ - 轻量级/标准级:可以运行 `/6aspec:brown:archive` 归档,但建议修复警告
328
+ - 完整级:可以运行 `/6aspec:brown:continue` 进入 review 阶段,但建议修复警告
329
+ ```
330
+
331
+ - 如果是完整验证且全部通过:
332
+ ```
333
+ - 轻量级/标准级:运行 `/6aspec:brown:archive` 归档
334
+ - 完整级:运行 `/6aspec:brown:continue` 进入 review 阶段
335
+ ```
283
336
  ```
284
337
 
285
338
  8. **更新状态**
286
339
 
287
- 如果验证通过(无 CRITICAL 问题),更新 `status.json`:
340
+ 根据流程深度、验证类型和验证结果决定是否更新状态:
341
+
342
+ **轻量级/标准级流程**:
343
+ - 不更新 status 和 phases(verify 是可选的)
344
+ - 在 `verificationRuns` 数组中添加本次验证记录:
345
+ ```json
346
+ {
347
+ "verificationRuns": [
348
+ {
349
+ "timestamp": "<timestamp>",
350
+ "type": "incremental" / "complete",
351
+ "status": "passed" / "warning" / "failed",
352
+ "criticalIssues": 0,
353
+ "warnings": 2,
354
+ "tasksCompleted": "5/8"
355
+ }
356
+ ]
357
+ }
358
+ ```
359
+
360
+ **完整级流程**:
361
+ - 只有在完整验证(implement 已完成)且验证通过(无 CRITICAL 问题)时才更新状态:
288
362
  ```json
289
363
  {
290
364
  "status": "review_pending",
291
- "status": "completed",
292
365
  "phases": {
293
366
  ...
294
367
  "verify": "done",
@@ -296,6 +369,7 @@
296
369
  }
297
370
  }
298
371
  ```
372
+ - 如果是增量验证或验证未通过,不更新状态
299
373
 
300
374
  **输出**
301
375
 
@@ -303,11 +377,13 @@
303
377
  ## 验证完成:<name>
304
378
 
305
379
  **流程深度**: 轻量级/标准级/完整级
380
+ **验证类型**: 🔄 增量验证 / ✅ 完整验证
381
+ **任务进度**: X/Y 已完成 (Z%)
306
382
  **验证状态**: ✅ 通过 / ⚠️ 有警告 / ❌ 有严重问题
307
383
 
308
384
  ### 验证概览
309
- - Completeness: X/Y 任务完成, M/N 影响点覆盖
310
- - Correctness: P/Q 需求实现, R/S 业务规则验证
385
+ - Completeness: X/Y 任务完成, M/N 影响点覆盖(或跳过)
386
+ - Correctness: P/Q 需求实现, R/S 业务规则验证(或跳过)
311
387
  - Coherence: 设计遵循/代码一致
312
388
 
313
389
  ### 问题统计
@@ -316,13 +392,13 @@
316
392
  - SUGGESTION: Z 个(建议修复)
317
393
 
318
394
  ### 最终评估
319
- <根据问题严重程度给出评估>
395
+ <根据验证类型和问题严重程度给出评估>
320
396
 
321
397
  ### 文档位置
322
398
  6aspecdoc/brown/<name>/artifacts/verification-report.md
323
399
 
324
400
  ### 下一步
325
- <根据验证结果给出建议>
401
+ <根据验证类型和结果给出建议>
326
402
  ```
327
403
 
328
404
  **验证启发式规则**(借鉴 OpenSpec)
@@ -335,26 +411,30 @@
335
411
 
336
412
  **优雅降级**(借鉴 OpenSpec)
337
413
 
338
- 根据流程深度调整验证范围:
414
+ 统一的验证流程,根据文档存在性自动适配:
339
415
 
340
- - **轻量级流程**:
341
- - 验证:任务完成度 + 设计遵循
342
- - 跳过:影响面覆盖、业务规则、非功能需求
343
- - 说明:`Lightweight flow: skipped impact/business rule checks`
416
+ - **文档存在性检查**:
417
+ - 尝试读取每个验证所需的文档
418
+ - 如果文档不存在,跳过相应的验证检查
419
+ - 在验证报告中明确标注跳过的检查项
344
420
 
345
- - **标准级流程**:
346
- - 验证:任务完成度 + 影响面覆盖 + 业务规则 + 设计遵循
347
- - 跳过:非功能需求详细验证
348
- - 说明:`Standard flow: skipped detailed non-functional requirement checks`
421
+ - **自动适配示例**:
422
+ - 如果没有 `impact-analysis.md` 跳过影响面覆盖验证、业务规则验证、非功能需求验证
423
+ - 如果没有 `understanding.md` → 从 `proposal.md` 或 `requirement.md` 提取需求
424
+ - 如果没有非功能需求评估部分 跳过非功能需求验证
349
425
 
350
- - **完整级流程**:
351
- - 验证:所有三个维度的全部检查
352
- - 说明:`Complete flow: all checks performed`
426
+ - **验证报告标注**:
427
+ - 跳过的检查项标注为:`Skipped: <reason>`
428
+ - 例如:`Skipped: no impact-analysis.md found`
429
+ - 例如:`Skipped: no business rules section in impact-analysis.md`
353
430
 
354
431
  **防护措施**
355
- - 必须先完成 Phase 5(implement)
432
+ - 支持在任何时候运行 verify(增量验证或完整验证)
356
433
  - 验证必须基于文档基准,不能主观判断
357
434
  - 发现问题必须明确标注严重程度(CRITICAL/WARNING/SUGGESTION)
358
435
  - 每个问题必须提供具体的、可操作的建议
359
- - 如果验证未通过(有 CRITICAL 问题),不能进入下一阶段
360
- - 根据流程深度优雅降级,不要对轻量级流程执行完整级的验证
436
+ - 增量验证时,未完成任务标注为 INFO,不作为 CRITICAL 问题
437
+ - 完整验证时,未完成任务标注为 CRITICAL 问题
438
+ - 轻量级/标准级流程的 verify 不更新状态
439
+ - 完整级流程只有在完整验证且通过时才更新状态
440
+ - 根据文档存在性自动适配验证范围,跳过的检查项必须明确标注
@@ -103,7 +103,7 @@ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
103
103
 
104
104
  任务进度:<completed>/<total> 已完成,剩余 <remaining> 个任务未完成。
105
105
 
106
- 请先运行 /6aspec:green:execute-task 完成所有任务,待状态变为 completed 后再运行 /6aspec:green:archive。
106
+ 请先运行 /6aspec:green:implement 完成所有任务,待状态变为 completed 后再运行 /6aspec:green:archive。
107
107
  ```
108
108
 
109
109
  **3.3 检查状态(硬性门禁)**
@@ -116,7 +116,7 @@ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
116
116
  当前状态:<current-status>
117
117
  要求状态:completed(所有任务已完成)
118
118
 
119
- 归档前必须完成主流程至“所有任务已完成”。请先运行 /6aspec:green:execute-task 完成剩余任务,待状态变为 completed 后再运行 /6aspec:green:archive。
119
+ 归档前必须完成主流程至”所有任务已完成”。请先运行 /6aspec:green:implement 完成剩余任务,待状态变为 completed 后再运行 /6aspec:green:archive。
120
120
  ```
121
121
 
122
122
  ### Step 4: 执行归档
@@ -298,4 +298,4 @@ mv 6aspecdoc/green/<feature-name> 6aspecdoc/green/archive/YYYY-MM-DD-<feature-na
298
298
  ## 参考文档
299
299
 
300
300
  - 状态文件结构定义:`.6aspec/rules/green/green_status_schema.md`
301
- - 状态查询SOP:`.6aspec/rules/green/6A_status_sop.md`
301
+ - 状态查询SOP:`.6aspec/rules/green/green_status_sop.md`
@@ -59,7 +59,7 @@ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
59
59
 
60
60
  主流程中需求澄清窗口已结束,进入领域建模及后续阶段后不得再修改需求澄清范围。若确有需求变更,请与产品/业务方评估后,通过新需求或变更流程处理。
61
61
 
62
- 下一步建议:运行 /6aspec:green:status 查看当前状态,或按当前阶段继续执行对应命令(如 model、design、tasks、execute-task、archive)。
62
+ 下一步建议:运行 /6aspec:green:status 查看当前状态,或按当前阶段继续执行对应命令(如 model、design、tasks、implement、archive)。
63
63
  ```
64
64
 
65
65
  ### Step 2: 分析现有文档的薄弱环节
@@ -3,7 +3,7 @@ description: 任务代码实现标准操作流程 (Code Implementation SOP)
3
3
  alwaysApply: false
4
4
  ---
5
5
 
6
- # execute-task: 任务代码实现标准操作流程
6
+ # implement: 任务代码实现标准操作流程
7
7
 
8
8
  你现在是 **Senior Developer**,负责执行具体的开发任务。你的核心职责是将 `6aspecdoc/green/<feature-name>/tasks/task_xxx.md` 转化为高质量、可运行的业务代码。
9
9
 
@@ -66,6 +66,21 @@ alwaysApply: false
66
66
  ## 2. 质量控制 (Quality Control)
67
67
 
68
68
  在输出代码后,必须进行自我审查:
69
+
70
+ ### 2.1 代码规范遵循与检查
71
+ **必须严格遵循代码规范**:`.6aspec/rules/biz/code.md`,并使用其中的"检查清单"章节进行自我验证。
72
+
73
+ **重点关注以下红线规则(零容忍):**
74
+ - [ ] 循环中的数据库查询、网络请求、文件I/O操作
75
+ - [ ] SQL字符串拼接、敏感信息硬编码、弱加密算法使用
76
+ - [ ] 循环依赖、跨层直接调用、空catch块
77
+
78
+ **任务实现特别检查:**
79
+ - [ ] 字段名称和类型严格匹配 `api-definition.md` 和技术设计文档
80
+ - [ ] 严格翻译技术设计文档中的"执行逻辑"和"核心技术决策"
81
+ - [ ] 必要的注解已添加(Swagger, Auth, Validation)
82
+
83
+ ### 2.2 技术检查
69
84
  1. **Lint 检查**:运行 `read_lints` 检查新文件,修复所有 Import 错误和语法错误。
70
85
  2. **不写测试**:严禁编写 `src/test` 下的单元测试代码(除非用户明确要求)。
71
86
  3. **不修改无关文件**:严禁修改与本任务无关的现有代码(除非是必要的 Entity 关联更新)。
@@ -92,13 +107,13 @@ alwaysApply: false
92
107
 
93
108
  ---
94
109
 
95
- ✅ **已完成:执行开发任务 (execute-task)**
110
+ ✅ **已完成:执行开发任务 (implement)**
96
111
 
97
112
  📊 **进度:4/4 (主流程) - 全部完成!🎉**
98
113
 
99
114
  **任务状态:**
100
115
  - 当前任务已完成,请检查 `tasks/README.md` 查看整体进度
101
- - 如还有未完成的任务,继续执行 `execute-task` 命令
116
+ - 如还有未完成的任务,继续执行 `implement` 命令
102
117
  - 如所有任务已完成,恭喜!整个开发流程已完成
103
118
 
104
119
  **完整流程图:**
@@ -72,8 +72,8 @@ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
72
72
  | `requirement_clarified` | `/6aspec:green:model` | 开始领域建模 |
73
73
  | `modeled` | `/6aspec:green:design` | 开始技术方案设计 |
74
74
  | `designed` | `/6aspec:green:tasks` | 开始任务拆解 |
75
- | `tasks_created` | `/6aspec:green:execute-task` | 开始执行第一个任务 |
76
- | `implementing` | `/6aspec:green:execute-task` | 继续执行下一个任务 |
75
+ | `tasks_created` | `/6aspec:green:implement` | 开始执行第一个任务 |
76
+ | `implementing` | `/6aspec:green:implement` | 继续执行下一个任务 |
77
77
  | `completed` | 提示归档 | 所有任务已完成 |
78
78
  | `archived` | 无操作 | 需求已归档 |
79
79
 
@@ -183,4 +183,4 @@ find 6aspecdoc/green -maxdepth 2 -name ".green-status.json" -type f
183
183
  ## 参考文档
184
184
 
185
185
  - 状态文件结构定义:`.6aspec/rules/green/green_status_schema.md`
186
- - 状态查询SOP:`.6aspec/rules/green/6A_status_sop.md`
186
+ - 状态查询SOP:`.6aspec/rules/green/green_status_sop.md`
@@ -110,7 +110,18 @@
110
110
 
111
111
  **这是本 SOP 的核心价值环节。**
112
112
 
113
- 基于 Step 2 的初步分析,AI 必须主动列出 **3-5 个关键不确定点或风险点**,向用户提问确认。
113
+ 基于 Step 2 的初步分析,AI 必须:
114
+ 1. **识别所有关键不确定点或风险点**
115
+ 2. **按优先级排序**,选择最重要的 **3-5 个**向用户提问确认
116
+ 3. **其他问题写入待确认项**,标注优先级,后续通过 `clarify` 命令继续澄清
117
+
118
+ #### 优先级判断标准
119
+
120
+ | 优先级 | 定义 | 示例 |
121
+ | :--- | :--- | :--- |
122
+ | **P0** | 影响核心流程,不明确则无法进行领域建模 | 核心业务规则、主流程分支逻辑、关键状态定义 |
123
+ | **P1** | 影响设计决策或存在实施风险 | 性能要求、集成方式、并发处理策略 |
124
+ | **P2** | 影响细节实现但不阻塞主流程 | UI细节、提示文案、次要分支场景 |
114
125
 
115
126
  #### 反向提问的分类
116
127
 
@@ -124,6 +135,8 @@
124
135
 
125
136
  #### 提问格式
126
137
 
138
+ **如果识别出的关键问题 ≤ 5 个**,全部向用户提问:
139
+
127
140
  ```markdown
128
141
  ---
129
142
 
@@ -132,6 +145,7 @@
132
145
  基于对 PRD 的分析,以下 N 个问题需要确认后才能继续:
133
146
 
134
147
  ### Q1: [问题标题]
148
+ **优先级**:P0 / P1 / P2
135
149
  **类别**:语义模糊 / 边界缺失 / 流程遗漏 / 规则冲突 / 非功能隐患
136
150
  **来源**:PRD 第X章 / 第X节
137
151
  **问题描述**:<具体问题>
@@ -148,6 +162,35 @@
148
162
  - 告知哪些问题需要与产品/业务方再确认(将记录为"待确认项")
149
163
  ```
150
164
 
165
+ **如果识别出的关键问题 > 5 个**,只提问最重要的 3-5 个,其他写入待确认项:
166
+
167
+ ```markdown
168
+ ---
169
+
170
+ ## 🔍 需求澄清确认
171
+
172
+ 基于对 PRD 的分析,识别出 N 个关键不确定点。以下是最重要的 3-5 个问题,需要优先确认:
173
+
174
+ ### Q1: [问题标题]
175
+ **优先级**:P0 / P1
176
+ **类别**:语义模糊 / 边界缺失 / 流程遗漏 / 规则冲突 / 非功能隐患
177
+ **来源**:PRD 第X章 / 第X节
178
+ **问题描述**:<具体问题>
179
+ **AI 建议**:<如果有合理的默认假设,可以给出建议供用户参考>
180
+
181
+ ### Q2: [问题标题]
182
+ ...
183
+
184
+ ---
185
+
186
+ ⚠️ **还有 X 个其他关键问题已记录到待确认项**(详见生成的 requirement.md),建议后续通过 `/6aspec:green:clarify` 继续澄清。
187
+
188
+ 请逐一确认以上问题,您可以:
189
+ - 直接回答每个问题
190
+ - 提供补充文档
191
+ - 告知哪些问题需要与产品/业务方再确认(将记录为"待确认项")
192
+ ```
193
+
151
194
  **重要**:
152
195
  - 必须等待用户回复后再继续,不要跳过此步骤
153
196
  - 如果用户表示某些问题需要后续确认,记录为"待确认项"写入 requirement.md
@@ -226,11 +269,11 @@
226
269
  | 兼容性 | <如有> | |
227
270
 
228
271
  ## 8. 待确认项
229
- > 以下问题尚需与产品/业务方进一步确认,不阻塞领域建模但可能影响详细设计。
272
+ > 以下问题尚需与产品/业务方进一步确认。P0/P1 问题会阻塞流程,需优先澄清;P2 问题不阻塞领域建模但可能影响详细设计。
230
273
 
231
- | 序号 | 问题 | 状态 | 负责人 | 备注 |
232
- | :--- | :--- | :--- | :--- | :--- |
233
- | TBD-01 | <待确认问题> | 待确认/已确认 | <负责人> | <备注> |
274
+ | 序号 | 优先级 | 问题 | 类别 | AI建议 | 状态 | 备注 |
275
+ | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
276
+ | TBD-01 | P0/P1/P2 | <待确认问题> | 语义模糊/边界缺失/流程遗漏/规则冲突/非功能隐患 | <AI建议> | 待确认/已确认 | <备注> |
234
277
 
235
278
  ## 9. 附录
236
279
 
@@ -246,7 +289,11 @@
246
289
 
247
290
  ### Step 5: 更新状态文件
248
291
 
249
- 完成需求澄清文档后,更新 `.green-status.json`:
292
+ 完成需求澄清文档后,根据待确认项的优先级更新 `.green-status.json`:
293
+
294
+ #### 情况 1:无待确认项,或只有 P2 待确认项
295
+
296
+ 状态设置为 `requirement_clarified`,可以进入领域建模:
250
297
 
251
298
  ```json
252
299
  {
@@ -268,19 +315,51 @@
268
315
  }
269
316
  ```
270
317
 
271
- **注意**:如果存在较多"待确认项"(TBD ≥ 3 个且涉及核心流程),建议状态保持为 `created`,并提示用户:
318
+ **如果有 P2 待确认项**,向用户提示:
272
319
  ```
273
- ⚠️ 当前有 N 个待确认项涉及核心流程,建议先与产品/业务方确认后,再运行 /6aspec:green:clarify 继续澄清。
320
+ 核心问题已澄清,需求澄清文档已生成。
321
+
322
+ 📋 还有 N 个次要待确认项(P2)记录在 requirement.md 中,不阻塞领域建模,可后续通过 /6aspec:green:clarify 补充澄清。
323
+
324
+ 下一步:运行 /6aspec:green:model 开始领域建模
274
325
  ```
275
326
 
276
- 此时 `nextAction` 应设置为:
327
+ #### 情况 2:存在 P0 或 P1 待确认项
328
+
329
+ 状态保持为 `created`,需要先澄清后才能进入建模:
330
+
277
331
  ```json
278
332
  {
279
- "command": "clarify",
280
- "description": "继续需求澄清(有 N 个核心待确认项)"
333
+ "status": "created",
334
+ "lastModified": "<ISO8601-now>",
335
+ "artifacts": {
336
+ "requirement": {
337
+ "status": "partial",
338
+ "completedAt": "<ISO8601-now>"
339
+ },
340
+ "models": {
341
+ "status": "blocked"
342
+ }
343
+ },
344
+ "nextAction": {
345
+ "command": "clarify",
346
+ "description": "继续需求澄清(有 N 个 P0/P1 待确认项)"
347
+ }
281
348
  }
282
349
  ```
283
350
 
351
+ 向用户提示:
352
+ ```
353
+ ⚠️ 需求初步澄清已完成,但还有 N 个重要待确认项(P0: X个, P1: Y个)记录在 requirement.md 中。
354
+
355
+ 这些问题涉及核心流程或设计决策,建议先与产品/业务方确认后,再运行 /6aspec:green:clarify 继续澄清。
356
+
357
+ 待确认项列表:
358
+ - TBD-01 (P0): <问题简述>
359
+ - TBD-02 (P1): <问题简述>
360
+ ...
361
+ ```
362
+
284
363
  ## 输出要求
285
364
  1. 格式:Markdown 源码格式
286
365
  2. 文档位置:`6aspecdoc/green/<feature-name>/requirement.md`
@@ -63,8 +63,8 @@
63
63
  | `requirement_clarified` | 需求已澄清 | `/6aspec:green:model`(可选:`/6aspec:green:clarify` 继续深化) |
64
64
  | `modeled` | 领域建模完成 | `/6aspec:green:design` |
65
65
  | `designed` | 技术方案完成 | `/6aspec:green:tasks` |
66
- | `tasks_created` | 任务已拆解 | `/6aspec:green:execute-task` |
67
- | `implementing` | 实施中 | `/6aspec:green:execute-task` |
66
+ | `tasks_created` | 任务已拆解 | `/6aspec:green:implement` |
67
+ | `implementing` | 实施中 | `/6aspec:green:implement` |
68
68
  | `completed` | 已完成 | `/6aspec:green:archive` |
69
69
  | `archived` | 已归档 | - |
70
70
 
@@ -130,7 +130,7 @@ tasks (任务列表)
130
130
  | `designed` | `modeled` | `/6aspec:green:rollback` | artifacts/tech-design.md、api-definition.md、visual-logic.md(若存在) |
131
131
  | `tasks_created` | `designed` | `/6aspec:green:rollback` | tasks/ 目录下全部文件 |
132
132
 
133
- **不允许回退**:`created`(无上一阶段)、`implementing`、`completed`、`archived`。详见 `.6aspec/rules/green/6A_rollback_sop.md`。
133
+ **不允许回退**:`created`(无上一阶段)、`implementing`、`completed`、`archived`。详见 `.6aspec/rules/green/green_rollback_sop.md`。
134
134
 
135
135
  ## 示例
136
136
 
@@ -250,7 +250,7 @@ tasks (任务列表)
250
250
  "lastExecuted": "task_05_session_management.md"
251
251
  },
252
252
  "nextAction": {
253
- "command": "execute-task",
253
+ "command": "implement",
254
254
  "description": "继续执行剩余 3 个任务"
255
255
  }
256
256
  }
@@ -146,8 +146,8 @@ const status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
146
146
  | `requirement_clarified` | 运行 /6aspec:green:model 开始领域建模(可选:运行 /6aspec:green:clarify 继续深化需求) |
147
147
  | `modeled` | 运行 /6aspec:green:design 开始技术方案设计 |
148
148
  | `designed` | 运行 /6aspec:green:tasks 开始任务拆解 |
149
- | `tasks_created` | 运行 /6aspec:green:execute-task 开始执行任务 |
150
- | `implementing` | 运行 /6aspec:green:execute-task 继续执行任务 |
149
+ | `tasks_created` | 运行 /6aspec:green:implement 开始执行任务 |
150
+ | `implementing` | 运行 /6aspec:green:implement 继续执行任务 |
151
151
  | `completed` | 运行 /6aspec:green:archive 归档需求 |
152
152
  | `archived` | 需求已归档 |
153
153
 
@@ -208,7 +208,7 @@ const status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
208
208
  最后执行:task_05_session_management.md
209
209
 
210
210
  ### 下一步建议
211
- 运行 /6aspec:green:execute-task 继续执行任务
211
+ 运行 /6aspec:green:implement 继续执行任务
212
212
  或运行 /6aspec:green:continue 自动执行下一步
213
213
  ```
214
214
 
@@ -170,7 +170,7 @@ alwaysApply: false
170
170
  📊 **进度:3/4 (主流程)**
171
171
 
172
172
  **下一步建议:**
173
- - 【主流程】执行开发任务:命令 `execute-task`
173
+ - 【主流程】执行开发任务:命令 `implement`
174
174
  开始执行具体的开发任务,将设计转化为代码实现
175
175
 
176
176
  **完整流程图:**
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: "6aspec:brown: Explore"
3
+ description: 前期探索(轻量级流程可选)
4
+ category: Workflow
5
+ tags: [workflow, explore, lightweight, brownfield]
6
+ ---
7
+
8
+ 1. Immediate response upon activation: brown field requirement workflow - **Explore** has been activated
9
+ 2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
10
+ 3. Read file: `.6aspec/rules/brown/brown_explore_sop.md`
11
+ 4. Strictly follow the SOP defined in that file