6aspec 2.0.0-dev.9 → 3.0.0-dev.10

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 (141) hide show
  1. package/.6aspec/rules/biz/code.md +126 -28
  2. package/.6aspec/rules/biz/code_implementation_sop.md +77 -0
  3. package/.6aspec/rules/brown/brown_analyze_sop.md +294 -0
  4. package/.6aspec/rules/brown/brown_archive_sop.md +44 -78
  5. package/.6aspec/rules/brown/brown_constitution.md +11 -0
  6. package/.6aspec/rules/brown/brown_continue_sop.md +7 -16
  7. package/.6aspec/rules/brown/brown_design_sop.md +210 -95
  8. package/.6aspec/rules/brown/brown_explore_sop.md +314 -0
  9. package/.6aspec/rules/brown/brown_ff_sop.md +27 -64
  10. package/.6aspec/rules/brown/brown_impact_sop.md +101 -45
  11. package/.6aspec/rules/brown/brown_implement_sop.md +91 -58
  12. package/.6aspec/rules/brown/brown_list_sop.md +12 -12
  13. package/.6aspec/rules/brown/brown_new_sop.md +64 -81
  14. package/.6aspec/rules/brown/brown_proposal_sop.md +243 -76
  15. package/.6aspec/rules/brown/brown_quick_sop.md +6 -6
  16. package/.6aspec/rules/brown/brown_review_sop.md +4 -4
  17. package/.6aspec/rules/brown/brown_rollback_sop.md +29 -51
  18. package/.6aspec/rules/brown/brown_specs_sop.md +364 -120
  19. package/.6aspec/rules/brown/brown_status_sop.md +16 -32
  20. package/.6aspec/rules/brown/brown_tasks_sop.md +194 -87
  21. package/.6aspec/rules/brown/brown_understand_sop.md +97 -23
  22. package/.6aspec/rules/brown/brown_update_sop.md +278 -0
  23. package/.6aspec/rules/brown/brown_verify_sop.md +71 -309
  24. package/.6aspec/rules/brown/subagents/implementer.md +73 -0
  25. package/.6aspec/rules/brown/subagents/spec-compliance-reviewer.md +103 -0
  26. package/.6aspec/rules/common/code-reviewer-agent.md +118 -0
  27. package/.6aspec/rules/green/{6A_archive_sop.md → green_archive_sop.md} +3 -3
  28. package/.6aspec/rules/green/{6A_clarify_sop.md → green_clarify_sop.md} +1 -1
  29. package/.6aspec/rules/green/{6A_code_implementation_sop.md → green_code_implementation_sop.md} +18 -3
  30. package/.6aspec/rules/green/{6A_continue_sop.md → green_continue_sop.md} +3 -3
  31. package/.6aspec/rules/green/{6A_new_sop.md → green_new_sop.md} +90 -11
  32. package/.6aspec/rules/green/green_status_schema.md +4 -4
  33. package/.6aspec/rules/green/{6A_status_sop.md → green_status_sop.md} +3 -3
  34. package/.6aspec/rules/green/{6A_tasks_sop.md → green_tasks_sop.md} +1 -1
  35. package/.agents/skills/6aspec-brown-analyze/SKILL.md +10 -0
  36. package/.agents/skills/6aspec-brown-archive/SKILL.md +10 -0
  37. package/.agents/skills/6aspec-brown-continue/SKILL.md +10 -0
  38. package/.agents/skills/6aspec-brown-design/SKILL.md +10 -0
  39. package/.agents/skills/6aspec-brown-explore/SKILL.md +10 -0
  40. package/.agents/skills/6aspec-brown-ff/SKILL.md +10 -0
  41. package/.agents/skills/6aspec-brown-implement/SKILL.md +10 -0
  42. package/.agents/skills/6aspec-brown-list/SKILL.md +10 -0
  43. package/.agents/skills/6aspec-brown-new/SKILL.md +10 -0
  44. package/.agents/skills/6aspec-brown-proposal/SKILL.md +10 -0
  45. package/.agents/skills/6aspec-brown-quick/SKILL.md +10 -0
  46. package/.agents/skills/6aspec-brown-review/SKILL.md +10 -0
  47. package/.agents/skills/6aspec-brown-rollback/SKILL.md +10 -0
  48. package/.agents/skills/6aspec-brown-specs/SKILL.md +10 -0
  49. package/.agents/skills/6aspec-brown-status/SKILL.md +10 -0
  50. package/.agents/skills/6aspec-brown-tasks/SKILL.md +10 -0
  51. package/.agents/skills/6aspec-brown-update/SKILL.md +10 -0
  52. package/.agents/skills/6aspec-brown-verify/SKILL.md +10 -0
  53. package/.claude/agents/6aspec-brown-implementer.md +7 -0
  54. package/.claude/agents/6aspec-brown-spec-compliance-reviewer.md +7 -0
  55. package/.claude/agents/6aspec-code-reviewer.md +7 -0
  56. package/.claude/commands/6aspec/brown/{impact.md → analyze.md} +11 -11
  57. package/.claude/commands/6aspec/brown/archive.md +11 -11
  58. package/.claude/commands/6aspec/brown/continue.md +11 -11
  59. package/.claude/commands/6aspec/brown/design.md +11 -11
  60. package/.claude/commands/6aspec/brown/{understand.md → explore.md} +11 -11
  61. package/.claude/commands/6aspec/brown/ff.md +11 -11
  62. package/.claude/commands/6aspec/brown/implement.md +11 -11
  63. package/.claude/commands/6aspec/brown/list.md +11 -11
  64. package/.claude/commands/6aspec/brown/new.md +11 -11
  65. package/.claude/commands/6aspec/brown/proposal.md +11 -11
  66. package/.claude/commands/6aspec/brown/quick.md +11 -11
  67. package/.claude/commands/6aspec/brown/review.md +11 -11
  68. package/.claude/commands/6aspec/brown/specs.md +1 -1
  69. package/.claude/commands/6aspec/brown/status.md +11 -11
  70. package/.claude/commands/6aspec/brown/tasks.md +11 -11
  71. package/.claude/commands/6aspec/brown/update.md +11 -0
  72. package/.claude/commands/6aspec/brown/verify.md +11 -11
  73. package/.claude/commands/6aspec/code.md +10 -0
  74. package/.claude/commands/6aspec/green/archive.md +1 -1
  75. package/.claude/commands/6aspec/green/clarify.md +2 -2
  76. package/.claude/commands/6aspec/green/continue.md +1 -1
  77. package/.claude/commands/6aspec/green/design.md +2 -2
  78. package/.claude/commands/6aspec/green/{execute-task.md → implement.md} +1 -1
  79. package/.claude/commands/6aspec/green/import-model-table.md +1 -1
  80. package/.claude/commands/6aspec/green/init.md +2 -2
  81. package/.claude/commands/6aspec/green/model.md +2 -2
  82. package/.claude/commands/6aspec/green/new.md +2 -2
  83. package/.claude/commands/6aspec/green/rollback.md +1 -1
  84. package/.claude/commands/6aspec/green/status.md +1 -1
  85. package/.claude/commands/6aspec/green/tasks.md +2 -2
  86. package/.claude/commands/6aspec/green/visual-logic.md +2 -2
  87. package/.claude/commands/6aspec/review.md +56 -0
  88. package/.codex/agents/6aspec-brown-implementer.md +7 -0
  89. package/.codex/agents/6aspec-brown-spec-compliance-reviewer.md +7 -0
  90. package/.codex/agents/6aspec-code-reviewer.md +7 -0
  91. package/.cursor/agents/6aspec-brown-implementer.md +7 -0
  92. package/.cursor/agents/6aspec-brown-spec-compliance-reviewer.md +8 -0
  93. package/.cursor/agents/6aspec-code-reviewer.md +8 -0
  94. package/.cursor/commands/6aspec-brown-analyze.md +9 -0
  95. package/.cursor/commands/{6aspec/brown/design.md → 6aspec-brown-design.md} +1 -1
  96. package/.cursor/commands/6aspec-brown-explore.md +11 -0
  97. package/.cursor/commands/{6aspec/brown/quick.md → 6aspec-brown-quick.md} +1 -1
  98. package/.cursor/commands/{6aspec/brown/review.md → 6aspec-brown-review.md} +1 -1
  99. package/.cursor/commands/{6aspec/brown/specs.md → 6aspec-brown-specs.md} +1 -1
  100. package/.cursor/commands/{6aspec/brown/tasks.md → 6aspec-brown-tasks.md} +1 -1
  101. package/.cursor/commands/6aspec-brown-update.md +9 -0
  102. package/.cursor/commands/6aspec-code.md +8 -0
  103. package/.cursor/commands/{6aspec/green/archive.md → 6aspec-green-archive.md} +1 -1
  104. package/.cursor/commands/{6aspec/green/clarify.md → 6aspec-green-clarify.md} +2 -2
  105. package/.cursor/commands/{6aspec/green/continue.md → 6aspec-green-continue.md} +1 -1
  106. package/.cursor/commands/{6aspec/green/design.md → 6aspec-green-design.md} +2 -2
  107. package/.cursor/commands/{6aspec/green/execute-task.md → 6aspec-green-implement.md} +1 -1
  108. package/.cursor/commands/{6aspec/green/import-model-table.md → 6aspec-green-import-model-table.md} +1 -1
  109. package/.cursor/commands/{6aspec/green/init.md → 6aspec-green-init.md} +2 -2
  110. package/.cursor/commands/{6aspec/green/model.md → 6aspec-green-model.md} +2 -2
  111. package/.cursor/commands/{6aspec/green/new.md → 6aspec-green-new.md} +2 -2
  112. package/.cursor/commands/{6aspec/green/rollback.md → 6aspec-green-rollback.md} +1 -1
  113. package/.cursor/commands/{6aspec/green/status.md → 6aspec-green-status.md} +1 -1
  114. package/.cursor/commands/{6aspec/green/tasks.md → 6aspec-green-tasks.md} +2 -2
  115. package/.cursor/commands/{6aspec/green/visual-logic.md → 6aspec-green-visual-logic.md} +2 -2
  116. package/.cursor/commands/6aspec-review.md +56 -0
  117. package/README.md +1 -1
  118. package/lib/cli.js +49 -13
  119. package/lib/installer.js +93 -25
  120. package/package.json +3 -1
  121. package/.claude/settings.local.json +0 -8
  122. package/.cursor/commands/6aspec/brown/impact.md +0 -9
  123. package/.cursor/commands/6aspec/brown/understand.md +0 -9
  124. /package/.6aspec/rules/green/{6A_constitution.md → green_constitution.md} +0 -0
  125. /package/.6aspec/rules/green/{6A_design_sop.md → green_design_sop.md} +0 -0
  126. /package/.6aspec/rules/green/{6A_import_model_table_sop.md → green_import_model_table_sop.md} +0 -0
  127. /package/.6aspec/rules/green/{6A_init_event_list_sop.md → green_init_event_list_sop.md} +0 -0
  128. /package/.6aspec/rules/green/{6A_init_map_sop.md → green_init_map_sop.md} +0 -0
  129. /package/.6aspec/rules/green/{6A_model_sop.md → green_model_sop.md} +0 -0
  130. /package/.6aspec/rules/green/{6A_rollback_sop.md → green_rollback_sop.md} +0 -0
  131. /package/.6aspec/rules/green/{6A_visual_logic_sop.md → green_visual_logic_sop.md} +0 -0
  132. /package/.cursor/commands/{6aspec/brown/archive.md → 6aspec-brown-archive.md} +0 -0
  133. /package/.cursor/commands/{6aspec/brown/continue.md → 6aspec-brown-continue.md} +0 -0
  134. /package/.cursor/commands/{6aspec/brown/ff.md → 6aspec-brown-ff.md} +0 -0
  135. /package/.cursor/commands/{6aspec/brown/implement.md → 6aspec-brown-implement.md} +0 -0
  136. /package/.cursor/commands/{6aspec/brown/list.md → 6aspec-brown-list.md} +0 -0
  137. /package/.cursor/commands/{6aspec/brown/new.md → 6aspec-brown-new.md} +0 -0
  138. /package/.cursor/commands/{6aspec/brown/proposal.md → 6aspec-brown-proposal.md} +0 -0
  139. /package/.cursor/commands/{6aspec/brown/rollback.md → 6aspec-brown-rollback.md} +0 -0
  140. /package/.cursor/commands/{6aspec/brown/status.md → 6aspec-brown-status.md} +0 -0
  141. /package/.cursor/commands/{6aspec/brown/verify.md → 6aspec-brown-verify.md} +0 -0
@@ -24,41 +24,32 @@
24
24
  ```
25
25
  ## 需求状态:<name>
26
26
 
27
- **流程深度**: 轻量级/标准级/完整级/快速通道
27
+ **流程深度**: 轻量级/标准级/快速通道
28
28
  **当前状态**: <状态描述>
29
29
  **创建时间**: <timestamp>
30
30
  **最后修改**: <timestamp>
31
31
 
32
32
  ### 阶段进度
33
33
 
34
- **轻量级流程(4阶段)**:
34
+ **轻量级流程(5阶段)**:
35
35
  | 阶段 | 状态 | 完成时间 |
36
36
  |------|------|----------|
37
37
  | Proposal | ✅ 已完成 / 🔄 进行中 / 📋 待开始 / 🔒 阻塞 | <timestamp> |
38
+ | Specs | ... | ... |
38
39
  | Design | ... | ... |
39
40
  | Tasks | ... | ... |
40
41
  | Implement | ... | ... |
41
42
 
42
- **标准级流程(5阶段)**:
43
+ **标准级流程(6阶段)**:
43
44
  | 阶段 | 状态 | 完成时间 |
44
45
  |------|------|----------|
45
- | Understand | ✅ 已完成 / 🔄 进行中 / 📋 待开始 / 🔒 阻塞 | <timestamp> |
46
- | Impact | ... | ... |
46
+ | Analyze | ✅ 已完成 / 🔄 进行中 / 📋 待开始 / 🔒 阻塞 | <timestamp> |
47
+ | Proposal | ... | ... |
48
+ | Specs | ... | ... |
47
49
  | Design | ... | ... |
48
50
  | Tasks | ... | ... |
49
51
  | Implement | ... | ... |
50
52
 
51
- **完整级流程(7阶段)**:
52
- | 阶段 | 状态 | 完成时间 |
53
- |------|------|----------|
54
- | Understand | ✅ 已完成 / 🔄 进行中 / 📋 待开始 / 🔒 阻塞 | <timestamp> |
55
- | Impact | ... | ... |
56
- | Design | ... | ... |
57
- | Tasks | ... | ... |
58
- | Implement | ... | ... |
59
- | Verify | ... | ... |
60
- | Review | ... | ... |
61
-
62
53
  ### 任务进度(如果已拆解)
63
54
 
64
55
  - 总任务数:<数量>
@@ -70,22 +61,16 @@
70
61
 
71
62
  **轻量级**:
72
63
  - [ ] proposal.md
64
+ - [ ] specs.md
73
65
  - [ ] design.md
74
- - [ ] tasks.md
66
+ - [ ] tasks-overview.md
75
67
 
76
68
  **标准级**:
77
- - [ ] understanding.md
78
- - [ ] impact-analysis.md
79
- - [ ] design.md
80
- - [ ] tasks.md
81
-
82
- **完整级**:
83
- - [ ] understanding.md
84
- - [ ] impact-analysis.md
69
+ - [ ] analysis.md
70
+ - [ ] proposal.md
71
+ - [ ] specs.md
85
72
  - [ ] design.md
86
- - [ ] tasks.md
87
- - [ ] verification-report.md
88
- - [ ] post-implementation-review.md
73
+ - [ ] tasks-overview.md
89
74
 
90
75
  ### 下一步
91
76
 
@@ -100,14 +85,14 @@
100
85
 
101
86
  | 需求 | 流程深度 | 当前阶段 | 进度 | 最后修改 |
102
87
  |------|----------|----------|------|----------|
103
- | <name-1> | 标准级 | Impact | 2/5 | 2小时前 |
104
- | <name-2> | 轻量级 | Design | 1/4 | 1天前 |
88
+ | <name-1> | 标准级 | Design | 3/6 | 2小时前 |
89
+ | <name-2> | 轻量级 | Design | 2/5 | 1天前 |
105
90
 
106
91
  ### 已完成的需求
107
92
 
108
93
  | 需求 | 流程深度 | 完成时间 |
109
94
  |------|----------|----------|
110
- | <name-3> | 完整级 | 3天前 |
95
+ | <name-3> | 标准级 | 3天前 |
111
96
 
112
97
  ### 统计
113
98
 
@@ -120,7 +105,6 @@
120
105
 
121
106
  - 轻量级:<数量>
122
107
  - 标准级:<数量>
123
- - 完整级:<数量>
124
108
  - 快速通道:<数量>
125
109
  ```
126
110
 
@@ -2,140 +2,209 @@
2
2
 
3
3
  Phase 4: 任务拆解与排期
4
4
 
5
+ > **阶段定位**:Tasks 的目标是把 `design.md` 的技术蓝图落成“可执行的原子任务”。
6
+ > - **里程碑(Milestone)**:用于组织任务与依赖关系、前置暴露风险(集成/迁移/兼容等)。里程碑不是任务。
7
+ > - **任务(TASK)**:原子可交付单元;可独立完成;输入/输出明确;验收标准清晰;建议工作量 0.5-3 人日。
8
+ > - **边界承接**:
9
+ > - API/回调/事件的**具体出入参字段清单**在 Tasks 阶段落地(Design 只写契约语义要点)。
10
+ > - **修改存量表**的 ALTER/索引/脚本/校验 SQL 在 Tasks 阶段落地(Design 只写语义与迁移策略)。
11
+ > - **新增表**若 Design 已给 DDL,Tasks 负责把 DDL/脚本落实为可执行变更与回滚方案。
12
+
5
13
  **输入**:`/6aspec:brown:tasks` 后可选需求名称。
6
14
 
7
- **步骤**
15
+ ---
16
+
17
+ ## 步骤
8
18
 
9
19
  1. **选择需求并检查状态**
10
20
 
11
21
  - 读取 `6aspecdoc/brown/<name>/status.json`
12
22
  - 确认 `phases.design` 为 "done"
13
- - 如果未完成 Phase 3,提示先运行 `/6aspec:brown:design`
23
+ - 若未完成 Design,提示先运行 `/6aspec:brown:design`
14
24
 
15
25
  2. **读取前置文档**
16
26
 
17
- - `6aspecdoc/brown/<name>/artifacts/01-understanding.md`
18
- - `6aspecdoc/brown/<name>/artifacts/02-impact-analysis.md`
19
- - `6aspecdoc/brown/<name>/artifacts/03-technical-design.md`
27
+ 根据 `flowDepth` 读取不同的前置文档:
28
+
29
+ **轻量级流程**:
30
+ - `6aspecdoc/brown/<name>/artifacts/proposal.md`
31
+ - `6aspecdoc/brown/<name>/artifacts/specs.md`
32
+ - `6aspecdoc/brown/<name>/artifacts/design.md`
33
+ - `6aspecdoc/brown/<name>/explore-summary.md` - 探索摘要(如果存在)
34
+
35
+ **标准级/完整级流程**:
36
+ - `6aspecdoc/brown/<name>/artifacts/proposal.md`
37
+ - `6aspecdoc/brown/<name>/artifacts/analysis.md`
38
+ - `6aspecdoc/brown/<name>/artifacts/specs.md`
39
+ - `6aspecdoc/brown/<name>/artifacts/design.md`
40
+
41
+ 3. **锁定文件结构**
20
42
 
21
- 3. **原子任务拆解**
43
+ 在拆任务之前,先基于 `design.md` 列出本次变更涉及的所有文件:
22
44
 
23
- 按以下维度拆解任务:
45
+ - **新增文件**:完整类路径(如 `com/xxx/service/DeviceMeterRoomService.java`)
46
+ - **修改文件**:完整类路径 + 受影响的方法/区域
47
+ - **脚本/配置**:迁移脚本、DDL 文件等
48
+
49
+ 这一步锁定分解边界,后续每个 TASK 的"涉及文件"直接引用此处的路径,不再模糊描述。
50
+
51
+ 4. **原子任务拆解(以里程碑组织)**
52
+
53
+ 先基于 `design.md` 梳理里程碑,再在每个里程碑下拆成原子任务。
24
54
 
25
55
  **拆解原则**:
26
- - 可以独立完成
27
- - 有明确的输入和输出
28
- - 有清晰的验收标准
29
- - 预估工作量在 0.5-3 人日
56
+ - 可以独立完成(必要依赖明确)
57
+ - 有明确的输入与输出
58
+ - 有清晰的验收标准(可对齐 Specs 的 AC / Scenarios)
59
+ - 预估工作量在 0.5-3 人日(超过则继续拆分)
30
60
 
31
- **拆解维度**:
32
- - 按技术层次:数据层业务层表现层测试
61
+ **拆解维度**(可组合使用):
62
+ - 按交付里程碑:契约与集成数据变更迁移/兼容/回滚核心链路
33
63
  - 按功能模块:模块A → 模块B → 模块C
34
64
  - 按依赖关系:前置任务 → 核心任务 → 后置任务
65
+ - 按横切能力:Integration / Migration / Compatibility / Observability / Security
35
66
 
36
- 4. **任务命名**
67
+ 5. **任务命名与元信息**
37
68
 
38
69
  使用规范:`TASK-<序号>-<简短描述>`
39
70
 
40
71
  示例:
41
- - TASK-001-database-fields
42
- - TASK-002-entity-classes
43
- - TASK-003-domain-service-logic
72
+ - `TASK-001-contract-and-idempotency`
73
+ - `TASK-010-db-migration-scripts`
74
+ - `TASK-020-external-callback-handler`
44
75
 
45
- 5. **创建任务文档**
76
+ 每个任务必须标注:
77
+ - 所属里程碑
78
+ - 涉及能力标签(DB/BE/FE/QA/Integration/Migration/Observability)
79
+
80
+ 6. **创建任务文档(TASK-*.md)**
46
81
 
47
82
  为每个任务创建 `6aspecdoc/brown/<name>/tasks/TASK-<序号>.md`:
83
+
48
84
  ```markdown
49
85
  # TASK-<序号>: <任务名称>
50
86
 
51
87
  > **任务ID**: TASK-<序号>
88
+ > **所属里程碑**: <M0/M1/...>
89
+ > **涉及能力**: DB / BE / FE / QA / Integration / Migration / Observability
52
90
  > **状态**: 📋 待开始
53
91
  > **优先级**: 🔴 P0 / 🟡 P1
54
- > **预估工作量**: X人日
92
+ > **预估工作量**: X 人日
55
93
  > **负责人**: 待分配
56
94
 
57
95
  ## 任务概述
58
- ### 任务描述
59
- ### 目标
60
- ### 涉及文件
96
+ - **任务描述**:<一句话说明要交付什么>
97
+ - **目标**:<完成后可验证的目标>
61
98
 
62
99
  ## 依赖关系
63
- ### 前置依赖
64
- ### 后置任务
100
+ - **前置依赖**:<TASK-xxx>
101
+ - **后置任务**:<TASK-yyy>
102
+
103
+ ## 涉及文件
104
+ - **修改**:`<完整类路径>`(受影响方法:`<methodName>`)
105
+ - **新增**:`<完整类路径>`
106
+ - **脚本/配置**:`<文件路径>`
65
107
 
66
108
  ## 输入
109
+ - specs.md:<引用相关 Capability/Requirement/AC/Scenario>
110
+ - design.md:<引用相关模块/边界/接口入口规范/集成/迁移策略>
111
+
67
112
  ## 输出
68
- ## 详细步骤
113
+ - <代码/脚本/配置/文档/验证产物>
114
+
115
+ ## 实现步骤
116
+ 1. <具体操作,到类/方法级>
117
+ 2. <具体操作>
118
+ 3. ...
119
+ 4. **测试**:若项目有测试框架,补充/修改对应单元测试,覆盖 specs.md 中关联的 AC/Scenario;若无测试框架则跳过此步骤
120
+
69
121
  ## 验收标准
122
+ - 与 Specs 对齐的 AC/Scenario 覆盖:<列出 ACx / Sx>
123
+ - 可观测性:<是否需要处理记录、trace、日志等可查证输出>
124
+
125
+ ## 契约与接口出入参(如适用)
126
+ > 用于落地 API/回调/事件的具体字段清单与口径(Design 不展开字段清单)。
127
+ - **接口/回调/事件名称**:<...>
128
+ - **请求字段**:<字段名/含义/必填/兼容策略>
129
+ - **响应字段**:<字段名/含义/必填/兼容策略>
130
+ - **错误语义**:<错误码/错误类型>
131
+ - **幂等语义**:<幂等键/重复请求处理规则>
132
+
133
+ ## 数据库变更(如适用)
134
+ - **新增表**:<若已有 DDL,注明复用;若需补充,写出最终 DDL 与回滚要点>
135
+ - **修改存量表**:<ALTER/索引/回滚脚本任务拆分点>
136
+ - **校验 SQL**:<关键校验点>
137
+
138
+ ## 迁移 / 兼容 / 回滚(如适用)
139
+ - **迁移/回填策略**:<步骤与边界>
140
+ - **兼容性策略**:<行为/数据/集成兼容>
141
+ - **灰度/开关验证**:<需要验证的开关点>
142
+ - **回滚策略**:<回滚影响与限制>
143
+
70
144
  ## 风险与注意事项
145
+ - <风险1>
146
+ - <风险2>
147
+
71
148
  ## 参考资料
149
+ - <链接或文件路径>
72
150
  ```
73
151
 
74
- 6. **创建任务总览**
152
+ 6. **创建任务总览(按里程碑)**
153
+
154
+ 创建 `6aspecdoc/brown/<name>/artifacts/tasks-overview.md`:
75
155
 
76
- 创建 `6aspecdoc/brown/<name>/artifacts/04-tasks-overview.md`:
77
156
  ```markdown
78
157
  # Phase 4: 任务拆解与排期
79
158
 
80
159
  > **需求**: <name>
81
- > **阶段**: Phase 4 - 任务拆解
160
+ > **阶段**: Phase 4 - Tasks
82
161
  > **状态**: ✅ 已完成
83
162
  > **完成时间**: <timestamp>
84
163
 
85
- ## 任务列表
164
+ ## 里程碑与任务列表
86
165
 
87
- ### 阶段 1: 数据层
88
- - [ ] TASK-001: 数据库字段配置
89
- - [ ] TASK-002: 实体类字段添加
166
+ ### M0: 契约与集成准备(Integration/Contract)
167
+ - [ ] [TASK-001: 对齐回调/事件幂等语义与处理记录(含验收点)](../tasks/TASK-001.md)
168
+ - [ ] [TASK-002: 外部系统集成联调前置(认证/失败语义/对账点)](../tasks/TASK-002.md)
90
169
 
91
- ### 阶段 2: 业务层
92
- - [ ] TASK-003: 领域服务逻辑实现
93
- - [ ] TASK-004: 应用服务逻辑实现
170
+ ### M1: 数据变更准备(DB Change)
171
+ - [ ] [TASK-010: 新增表 DDL 落地与回滚方案(如适用)](../tasks/TASK-010.md)
172
+ - [ ] [TASK-011: 存量表 ALTER/索引/脚本任务拆分(如适用)](../tasks/TASK-011.md)
94
173
 
95
- ### 阶段 3: 表现层
96
- - [ ] TASK-005: API 接口更新
97
- - [ ] TASK-006: 前端 UI 开发
174
+ ### M2: 迁移 / 兼容 / 回滚(Migration/Compatibility)
175
+ - [ ] [TASK-020: 数据回填/迁移脚本与校验 SQL](../tasks/TASK-020.md)
176
+ - [ ] [TASK-021: 兼容策略与灰度/开关验证清单](../tasks/TASK-021.md)
98
177
 
99
- ### 阶段 4: 测试
100
- - [ ] TASK-007: 单元测试
101
- - [ ] TASK-008: 集成测试
178
+ ### M3: 核心链路实现(Core Flow)
179
+ - [ ] [TASK-030: 核心业务逻辑实现(对齐 AC/Scenario)](../tasks/TASK-030.md)
180
+ - [ ] [TASK-031: 定时任务/事件消费/回调处理实现(如适用)](../tasks/TASK-031.md)
102
181
 
103
- ## 依赖关系图
182
+ ## 依赖关系图(示例)
104
183
 
105
184
  ```mermaid
106
185
  graph TD
107
- TASK-001 --> TASK-002
108
- TASK-002 --> TASK-003
109
- TASK-003 --> TASK-004
110
- TASK-004 --> TASK-005
111
- TASK-005 --> TASK-006
112
- TASK-006 --> TASK-007
113
- TASK-007 --> TASK-008
186
+ TASK001 --> TASK010
187
+ TASK010 --> TASK020
188
+ TASK020 --> TASK030
114
189
  ```
115
190
 
116
191
  ## 工作量统计
117
192
 
118
- | 阶段 | 任务数 | 预估工时 |
193
+ | 里程碑 | 任务数 | 预估工时 |
119
194
  |------|--------|----------|
120
- | 数据层 | 2 | 1.5人日 |
121
- | 业务层 | 2 | 4人日 |
122
- | 表现层 | 2 | 5人日 |
123
- | 测试 | 2 | 4人日 |
124
- | **总计** | **8** | **14.5人日** |
125
-
126
- ## 关键里程碑
127
-
128
- - 里程碑 1: 数据层完成(TASK-001, TASK-002)
129
- - 里程碑 2: 业务层完成(TASK-003, TASK-004)
130
- - 里程碑 3: 表现层完成(TASK-005, TASK-006)
131
- - 里程碑 4: 测试完成(TASK-007, TASK-008)
195
+ | M0 | <n> | <x> 人日 |
196
+ | M1 | <n> | <x> 人日 |
197
+ | M2 | <n> | <x> 人日 |
198
+ | M3 | <n> | <x> 人日 |
199
+ | **总计** | **<n>** | **<x> 人日** |
132
200
 
133
201
  ## 风险清单
134
202
 
135
203
  | 风险 | 影响 | 应对措施 |
136
204
  |------|------|----------|
137
- | 历史数据迁移失败 | 高 | 提前备份,准备回滚方案 |
138
- | API 不兼容 | | 版本控制,灰度发布 |
205
+ | 历史数据迁移/回填失败 | 高 | 提前准备校验 SQL 与回滚方案;灰度验证 |
206
+ | 外部回调乱序/重复投递 | | 明确幂等键与业务语义;补齐处理记录与对账点 |
207
+ | 集成不兼容/调用方影响 | 中 | 明确兼容策略与灰度开关;联调用例覆盖 |
139
208
 
140
209
  ## 下一步
141
210
 
@@ -145,48 +214,81 @@ Phase 4: 任务拆解与排期
145
214
  7. **更新状态**
146
215
 
147
216
  更新 `6aspecdoc/brown/<name>/status.json`:
217
+
218
+ **轻量级流程**:
148
219
  ```json
149
220
  {
150
221
  "status": "implement_pending",
222
+ "flowDepth": "lightweight",
151
223
  "phases": {
152
- "understand": "done",
153
- "impact": "done",
224
+ "proposal": "done",
225
+ "specs": "done",
154
226
  "design": "done",
155
227
  "tasks": "done",
156
- "implement": "pending",
157
- ...
228
+ "implement": "pending"
158
229
  },
230
+ "artifacts": ["proposal.md", "specs.md", "design.md", "tasks-overview.md"],
159
231
  "tasks": {
160
- "total": 8,
232
+ "total": <N>,
161
233
  "completed": 0,
162
- "pending": 8
234
+ "pending": <N>
163
235
  }
164
236
  }
165
237
  ```
166
238
 
167
- **输出**
239
+ **标准级流程**:
240
+ ```json
241
+ {
242
+ "status": "implement_pending",
243
+ "flowDepth": "standard",
244
+ "phases": {
245
+ "analyze": "done",
246
+ "proposal": "done",
247
+ "specs": "done",
248
+ "design": "done",
249
+ "tasks": "done",
250
+ "implement": "pending"
251
+ },
252
+ "artifacts": ["analysis.md", "proposal.md", "specs.md", "design.md", "tasks-overview.md"],
253
+ "tasks": {
254
+ "total": <N>,
255
+ "completed": 0,
256
+ "pending": <N>
257
+ }
258
+ }
259
+ ```
260
+
261
+ 同时更新 `6aspecdoc/brown/<name>/requirement.md`:
262
+ - 更新"状态"字段为 `📋 Implement 待开始`
263
+ - 更新"最后修改"时间戳为 `<timestamp>`
264
+ - 更新"当前阶段"为 `Tasks - 任务拆解(已完成)`
265
+ - 更新"下一步操作"为 `运行 /6aspec:brown:implement 开始执行任务`
266
+ - 在"进度概览"中标记 Tasks 阶段为已完成 `[x]`
267
+
268
+ ---
269
+
270
+ ## 输出
168
271
 
169
272
  ```
170
273
  ## Phase 4 完成:任务拆解
171
274
 
172
275
  **需求**: <name>
173
- **进度**: 4/7 阶段完成
276
+ **进度**: <已完成阶段>/<总阶段>
174
277
 
175
278
  ### 任务统计
176
279
  - 总任务数:<数量>
177
280
  - 预估总工时:<工时>
178
281
 
179
- ### 任务分布
180
- - 数据层:<数量> 个任务
181
- - 业务层:<数量> 个任务
182
- - 表现层:<数量> 个任务
183
- - 测试:<数量> 个任务
184
-
185
- ### 关键里程碑
186
- <列出关键里程碑>
282
+ ### 里程碑分布
283
+ - M0 契约与集成准备:<数量> 个任务
284
+ - M1 数据变更准备:<数量> 个任务
285
+ - M2 迁移/兼容/回滚:<数量> 个任务
286
+ - M3 核心链路实现:<数量> 个任务
287
+ - M4 集成联调与可观测性:<数量> 个任务
288
+ - M5 发布准备:<数量> 个任务
187
289
 
188
290
  ### 文档位置
189
- - 6aspecdoc/brown/<name>/artifacts/04-tasks-overview.md
291
+ - 6aspecdoc/brown/<name>/artifacts/tasks-overview.md
190
292
  - 6aspecdoc/brown/<name>/tasks/TASK-*.md
191
293
 
192
294
  ### 下一步
@@ -194,9 +296,14 @@ Phase 4: 任务拆解与排期
194
296
  - 或运行 `/6aspec:brown:continue` 自动进入下一阶段
195
297
  ```
196
298
 
197
- **防护措施**
198
- - 必须先完成 Phase 3
199
- - 任务必须是原子的、可独立完成的
200
- - 任务依赖关系必须明确
201
- - 验收标准必须具体
202
- - 工作量评估要合理
299
+ ---
300
+
301
+ ## 防护措施
302
+
303
+ - 必须先完成 Design 阶段(`phases.design == done`)
304
+ - 任务必须是原子的、可独立完成的;工作量超过 3 人日必须继续拆分
305
+ - 每个任务必须有明确验收标准,并与 Specs 的 AC/Scenario 可追溯
306
+ - 必须覆盖横切能力:Integration / Migration / Compatibility(如设计中涉及)
307
+ - 需要对外/跨模块契约时:出入参字段清单、幂等语义、错误语义必须在对应任务中落地
308
+ - 涉及数据库变更时:改表 DDL/脚本/回滚/校验 SQL 必须作为任务交付物
309
+ - 用户补充信息时只更新文档,不得自动进入下一阶段