@zeyue0329/xiaoma-cli 1.0.47 → 1.0.49

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.
@@ -303,6 +303,7 @@ commands:
303
303
  - create-brownfield-story: 运行任务 brownfield-create-story.md
304
304
  - create-epic: 为现有项目项目创建模块 (任务 brownfield-create-epic)
305
305
  - create-prd: 使用模板 prd-tmpl.yaml 运行任务 create-doc.md
306
+ - create-prd-from-rag: 基于Analyst需求分析产出物生成PRD (任务 create-prd-from-rag.md,模板 prd-from-rag-tmpl.yaml)
306
307
  - create-story: 从需求创建用户故事 (任务 brownfield-create-story)
307
308
  - doc-out: 将完整文档输出到当前目标文件
308
309
  - shard-prd: 为提供的 prd.md 运行任务 shard-doc.md (如果未找到则询问)
@@ -320,11 +321,13 @@ dependencies:
320
321
  - correct-course.md
321
322
  - create-deep-research-prompt.md
322
323
  - create-doc.md
324
+ - create-prd-from-rag.md
323
325
  - execute-checklist.md
324
326
  - shard-doc.md
325
327
  templates:
326
328
  - brownfield-prd-tmpl.yaml
327
329
  - prd-tmpl.yaml
330
+ - prd-from-rag-tmpl.yaml
328
331
  ```
329
332
  ==================== END: .xiaoma-core/agents/pm.md ====================
330
333
 
@@ -417,6 +420,7 @@ commands:
417
420
  - create-brownfield-architecture: 使用 create-doc 和 brownfield-architecture-tmpl.yaml
418
421
  - create-front-end-architecture: 使用 create-doc 和 front-end-architecture-tmpl.yaml
419
422
  - create-full-stack-architecture: 使用 create-doc 和 fullstack-architecture-tmpl.yaml
423
+ - create-incremental-architecture: 基于知识库和PRD进行架构增量设计 (任务 create-incremental-architecture.md,模板 incremental-architecture-tmpl.yaml)
420
424
  - doc-out: 将完整文档输出到当前目标文件
421
425
  - document-project: 执行任务 document-project.md
422
426
  - execute-checklist {checklist}: 运行任务 execute-checklist (默认为->architect-checklist)
@@ -433,6 +437,7 @@ dependencies:
433
437
  tasks:
434
438
  - create-deep-research-prompt.md
435
439
  - create-doc.md
440
+ - create-incremental-architecture.md
436
441
  - document-project.md
437
442
  - execute-checklist.md
438
443
  - shard-doc.md
@@ -441,6 +446,7 @@ dependencies:
441
446
  - brownfield-architecture-tmpl.yaml
442
447
  - front-end-architecture-tmpl.yaml
443
448
  - fullstack-architecture-tmpl.yaml
449
+ - incremental-architecture-tmpl.yaml
444
450
  ```
445
451
  ==================== END: .xiaoma-core/agents/architect.md ====================
446
452
 
@@ -2948,12 +2954,12 @@ docs/rag/
2948
2954
 
2949
2955
  ## Purpose
2950
2956
 
2951
- 通过结合外部需求文档(req.txt)和知识库(RAG/MCP)进行深度需求分析,生成高质量的PRD文档。
2957
+ 通过结合外部需求文档(req.txt)和知识库(RAG/MCP)进行深度需求分析,输出结构化的需求分析报告,为后续PM智能体生成PRD提供完整输入。
2952
2958
 
2953
2959
  ## Workflow Overview
2954
2960
 
2955
2961
  ```
2956
- req.txt → 深度解析 → 问题生成 → 知识库查询 → 知识落地(docs/rag/) → 需求分析 → PRD生成
2962
+ req.txt → 深度解析 → 问题生成 → 知识库查询 → 知识落地(docs/rag/) → 需求分析报告
2957
2963
  ```
2958
2964
 
2959
2965
  ## 输出文件
@@ -2964,7 +2970,27 @@ req.txt → 深度解析 → 问题生成 → 知识库查询 → 知识落地(d
2964
2970
  | 问题生成 | 问题清单 | `docs/rag/_questions.md` |
2965
2971
  | 知识落地 | 知识索引 | `docs/rag/_index.md` |
2966
2972
  | 知识落地 | 分类知识 | `docs/rag/{category}/*.md` |
2967
- | PRD生成 | PRD文档 | `docs/prd.md` |
2973
+ | 需求分析 | 分析报告 | `docs/rag/_analysis-report.md` |
2974
+
2975
+ ## 职责边界
2976
+
2977
+ ```yaml
2978
+ 本任务职责:
2979
+ - 需求文档深度解析
2980
+ - 知识库问题生成与查询
2981
+ - 知识文档落地与组织
2982
+ - 需求分析报告生成
2983
+
2984
+ 不在本任务职责范围:
2985
+ - PRD文档生成(由PM智能体负责)
2986
+ - 用户故事编写(由SM智能体负责)
2987
+ - 任务拆解与排期(由SM智能体负责)
2988
+
2989
+ 下游交接:
2990
+ 交接对象: PM智能体
2991
+ 交接物: docs/rag/ 目录下的完整知识文档和分析报告
2992
+ 交接命令: "*create-prd docs/rag/"
2993
+ ```
2968
2994
 
2969
2995
  ---
2970
2996
 
@@ -3894,7 +3920,7 @@ docs/rag/
3894
3920
 
3895
3921
  ---
3896
3922
 
3897
- ## Phase 5: 需求分析与PRD生成
3923
+ ## Phase 5: 需求分析报告生成
3898
3924
 
3899
3925
  ### 5.1 分析输入整合
3900
3926
 
@@ -3915,8 +3941,8 @@ docs/rag/
3915
3941
  分析维度:
3916
3942
  功能分析:
3917
3943
  - 核心功能拆解
3918
- - 功能优先级排序
3919
- - 功能依赖关系
3944
+ - 功能优先级排序(P0/P1/P2)
3945
+ - 功能依赖关系图
3920
3946
 
3921
3947
  用户分析:
3922
3948
  - 用户角色定义
@@ -3926,7 +3952,7 @@ docs/rag/
3926
3952
  技术分析:
3927
3953
  - 技术可行性评估(基于技术架构和编码规范)
3928
3954
  - 与现有系统的兼容性(基于中间件和数据模型)
3929
- - 技术风险识别
3955
+ - 技术风险识别与评估
3930
3956
 
3931
3957
  业务分析:
3932
3958
  - 业务规则验证(基于业务知识)
@@ -3942,32 +3968,242 @@ docs/rag/
3942
3968
  - 现有能力 vs 需求能力
3943
3969
  - 需要新增/修改的功能
3944
3970
  - 需要新增/修改的数据
3971
+
3972
+ 风险分析:
3973
+ - 技术风险清单
3974
+ - 业务风险清单
3975
+ - 依赖风险清单
3976
+ - 风险缓解建议
3945
3977
  ```
3946
3978
 
3947
- ### 5.3 PRD生成流程
3979
+ ### 5.3 需求分析报告生成流程
3948
3980
 
3949
3981
  ```yaml
3950
- PRD生成:
3982
+ 报告生成:
3951
3983
  步骤1:
3952
3984
  动作: 整合所有知识输入
3953
3985
  输入: docs/rag/ 目录下的所有知识文件
3954
3986
  输出: 知识上下文汇总
3955
3987
 
3956
3988
  步骤2:
3957
- 动作: 执行需求分析(5.2维度)
3958
- 输出: 需求分析报告
3989
+ 动作: 执行多维度需求分析(5.2)
3990
+ 输出: 各维度分析结论
3959
3991
 
3960
3992
  步骤3:
3961
- 动作: 套用PRD模板(prd-tmpl.yaml)
3962
- 输出: PRD草稿
3993
+ 动作: 识别待澄清问题
3994
+ 输出: 待确认事项清单
3963
3995
 
3964
3996
  步骤4:
3965
- 动作: 启发式验证(advanced-elicitation)
3966
- 输出: 优化后的PRD
3997
+ 动作: 生成需求分析报告
3998
+ 输出: docs/rag/_analysis-report.md
3967
3999
 
3968
4000
  步骤5:
3969
- 动作: 输出最终PRD到指定位置
3970
- 输出: docs/prd.md
4001
+ 动作: 更新知识索引
4002
+ 输出: docs/rag/_index.md (更新)
4003
+ ```
4004
+
4005
+ ### 5.4 需求分析报告模板
4006
+
4007
+ 保存到 `docs/rag/_analysis-report.md`:
4008
+
4009
+ ```markdown
4010
+ # 需求分析报告
4011
+
4012
+ ## 元信息
4013
+ - 源需求文档: {req_file}
4014
+ - 分析时间: {timestamp}
4015
+ - 分析师: Analyst Agent
4016
+ - 报告版本: 1.0
4017
+
4018
+ ---
4019
+
4020
+ ## 1. 需求概述
4021
+
4022
+ ### 1.1 需求背景
4023
+ {基于req.txt提取的背景信息}
4024
+
4025
+ ### 1.2 核心目标
4026
+ {需求要达成的核心目标}
4027
+
4028
+ ### 1.3 范围边界
4029
+ - **包含**: {明确包含的内容}
4030
+ - **不包含**: {明确排除的内容}
4031
+
4032
+ ---
4033
+
4034
+ ## 2. 功能分析
4035
+
4036
+ ### 2.1 功能清单
4037
+
4038
+ | 序号 | 功能名称 | 优先级 | 描述 | 依赖功能 |
4039
+ |------|----------|--------|------|----------|
4040
+ | F001 | {功能名} | P0/P1/P2 | {描述} | {依赖} |
4041
+
4042
+ ### 2.2 功能依赖关系
4043
+
4044
+ ```mermaid
4045
+ graph TD
4046
+ F001 --> F002
4047
+ F002 --> F003
4048
+ ```
4049
+
4050
+ ### 2.3 功能优先级说明
4051
+ - **P0 (必须实现)**: {列表}
4052
+ - **P1 (重要)**: {列表}
4053
+ - **P2 (可选)**: {列表}
4054
+
4055
+ ---
4056
+
4057
+ ## 3. 用户分析
4058
+
4059
+ ### 3.1 用户角色
4060
+
4061
+ | 角色 | 描述 | 主要操作 | 权限级别 |
4062
+ |------|------|----------|----------|
4063
+ | {角色名} | {描述} | {操作列表} | {权限} |
4064
+
4065
+ ### 3.2 用户旅程
4066
+ {关键用户旅程描述}
4067
+
4068
+ ---
4069
+
4070
+ ## 4. 数据分析
4071
+
4072
+ ### 4.1 数据实体清单
4073
+
4074
+ | 实体名称 | 描述 | 核心属性 | 关联实体 |
4075
+ |----------|------|----------|----------|
4076
+ | {实体名} | {描述} | {属性} | {关联} |
4077
+
4078
+ ### 4.2 数据关系图
4079
+
4080
+ ```mermaid
4081
+ erDiagram
4082
+ EntityA ||--o{ EntityB : contains
4083
+ ```
4084
+
4085
+ ### 4.3 与现有数据模型的兼容性
4086
+ - **可复用**: {已有实体/表}
4087
+ - **需新增**: {新实体/表}
4088
+ - **需修改**: {需变更的实体/表}
4089
+
4090
+ ---
4091
+
4092
+ ## 5. 技术分析
4093
+
4094
+ ### 5.1 技术可行性评估
4095
+
4096
+ | 功能 | 可行性 | 依赖技术 | 风险等级 | 备注 |
4097
+ |------|--------|----------|----------|------|
4098
+ | {功能} | 高/中/低 | {技术} | 高/中/低 | {备注} |
4099
+
4100
+ ### 5.2 与现有系统兼容性
4101
+ - **架构兼容**: {评估结论}
4102
+ - **中间件兼容**: {评估结论}
4103
+ - **编码规范兼容**: {评估结论}
4104
+
4105
+ ### 5.3 技术实现建议
4106
+ {基于知识库获取的技术规范,给出实现建议}
4107
+
4108
+ ---
4109
+
4110
+ ## 6. 业务规则汇总
4111
+
4112
+ ### 6.1 核心业务规则
4113
+
4114
+ | 规则ID | 规则名称 | 规则描述 | 来源 |
4115
+ |--------|----------|----------|------|
4116
+ | BR001 | {名称} | {描述} | 知识库/需求文档 |
4117
+
4118
+ ### 6.2 业务流程
4119
+
4120
+ | 流程名称 | 触发条件 | 主要步骤 | 异常处理 |
4121
+ |----------|----------|----------|----------|
4122
+ | {流程名} | {条件} | {步骤} | {异常} |
4123
+
4124
+ ---
4125
+
4126
+ ## 7. 差距分析
4127
+
4128
+ ### 7.1 能力差距
4129
+
4130
+ | 需求能力 | 现有能力 | 差距 | 解决方案 |
4131
+ |----------|----------|------|----------|
4132
+ | {需求} | {现有} | {差距} | {方案} |
4133
+
4134
+ ### 7.2 新增/修改清单
4135
+ - **新增功能**: {列表}
4136
+ - **修改功能**: {列表}
4137
+ - **新增数据**: {列表}
4138
+ - **修改数据**: {列表}
4139
+
4140
+ ---
4141
+
4142
+ ## 8. 风险分析
4143
+
4144
+ ### 8.1 风险清单
4145
+
4146
+ | 风险ID | 风险类型 | 风险描述 | 可能性 | 影响 | 缓解措施 |
4147
+ |--------|----------|----------|--------|------|----------|
4148
+ | R001 | 技术/业务/依赖 | {描述} | 高/中/低 | 高/中/低 | {措施} |
4149
+
4150
+ ### 8.2 关键风险说明
4151
+ {高风险项的详细说明}
4152
+
4153
+ ---
4154
+
4155
+ ## 9. 待澄清事项
4156
+
4157
+ ### 9.1 业务待澄清
4158
+
4159
+ | 序号 | 问题 | 上下文 | 建议选项 |
4160
+ |------|------|--------|----------|
4161
+ | Q001 | {问题} | {上下文} | {选项A/B/C} |
4162
+
4163
+ ### 9.2 技术待澄清
4164
+
4165
+ | 序号 | 问题 | 上下文 | 建议选项 |
4166
+ |------|------|--------|----------|
4167
+ | Q001 | {问题} | {上下文} | {选项A/B/C} |
4168
+
4169
+ ---
4170
+
4171
+ ## 10. 知识库引用索引
4172
+
4173
+ | 知识文件 | 路径 | 主要内容 |
4174
+ |----------|------|----------|
4175
+ | {文件名} | docs/rag/{path} | {内容摘要} |
4176
+
4177
+ ---
4178
+
4179
+ ## 11. 下游交接清单
4180
+
4181
+ ### 11.1 交接给PM智能体的输入
4182
+
4183
+ ```yaml
4184
+ 交接物清单:
4185
+ 必读文件:
4186
+ - docs/rag/_analysis-report.md # 本报告
4187
+ - docs/rag/_requirement-parsing.yaml # 需求解析结果
4188
+
4189
+ 知识文件目录:
4190
+ - docs/rag/business/ # 业务知识
4191
+ - docs/rag/technical/ # 技术知识
4192
+ - docs/rag/constraints/ # 约束条件
4193
+
4194
+ 原始需求:
4195
+ - {req_file}
4196
+
4197
+ 建议后续动作:
4198
+ - PM智能体执行: "*create-prd docs/rag/"
4199
+ - 重点关注: 待澄清事项(第9节)
4200
+ - 风险跟踪: 风险清单(第8节)
4201
+ ```
4202
+
4203
+ ---
4204
+
4205
+ *报告生成时间: {timestamp}*
4206
+ *Analyst Agent - XiaoMa Framework*
3971
4207
  ```
3972
4208
 
3973
4209
  ---
@@ -3986,7 +4222,6 @@ PRD生成:
3986
4222
  参数:
3987
4223
  req_file: 需求文档路径 (默认: req.txt)
3988
4224
  rag_output: 知识输出路径 (默认: docs/rag/)
3989
- prd_output: PRD输出路径 (默认: docs/prd.md)
3990
4225
  skip_rag: 跳过知识库查询 (默认: false)
3991
4226
  interactive: 交互模式 (默认: true)
3992
4227
  ```
@@ -3996,8 +4231,8 @@ PRD生成:
3996
4231
  1. **解析阶段**: 展示需求解析结果,保存到 `docs/rag/_requirement-parsing.yaml`,请用户确认
3997
4232
  2. **提问阶段**: 展示问题清单,保存到 `docs/rag/_questions.md`,请用户确认或调整
3998
4233
  3. **查询阶段**: 依次查询知识库,将返回结果保存到 `docs/rag/` 对应子目录
3999
- 4. **分析阶段**: 展示分析结论,请用户确认
4000
- 5. **生成阶段**: 生成PRD草稿,启用启发式优化,输出到 `docs/prd.md`
4234
+ 4. **分析阶段**: 执行多维度需求分析,生成分析报告
4235
+ 5. **完成阶段**: 输出 `docs/rag/_analysis-report.md`,提示用户交接给PM智能体
4001
4236
 
4002
4237
  ### 相关命令
4003
4238
 
@@ -4005,11 +4240,34 @@ PRD生成:
4005
4240
  |------|------|
4006
4241
  | `*generate-rag-questions {req_file}` | 单独执行问题生成,保存到 `docs/rag/_questions.md` |
4007
4242
  | `*land-knowledge` | 将知识库返回内容保存到 `docs/rag/` 对应子目录 |
4008
- | `*create-prd-from-rag` | 基于 `docs/rag/` 知识生成PRD |
4243
+ | `*generate-analysis-report` | 基于 `docs/rag/` 知识生成需求分析报告 |
4009
4244
 
4010
4245
  ### YOLO模式
4011
4246
 
4012
4247
  通过 `*yolo` 命令切换YOLO模式,一次性完成所有步骤,跳过中间确认环节。
4248
+
4249
+ ---
4250
+
4251
+ ## 任务完成标志
4252
+
4253
+ ```yaml
4254
+ 完成条件:
4255
+ 必要输出:
4256
+ - docs/rag/_requirement-parsing.yaml # 需求解析结果
4257
+ - docs/rag/_questions.md # 问题清单
4258
+ - docs/rag/_index.md # 知识索引
4259
+ - docs/rag/_analysis-report.md # 需求分析报告
4260
+ - docs/rag/{category}/*.md # 分类知识文件
4261
+
4262
+ 完成提示: |
4263
+ ✅ 需求分析任务完成!
4264
+
4265
+ 📁 输出目录: docs/rag/
4266
+ 📋 分析报告: docs/rag/_analysis-report.md
4267
+
4268
+ 🔄 下一步: 请将分析结果交接给PM智能体
4269
+ 💡 执行命令: *create-prd docs/rag/
4270
+ ```
4013
4271
  ==================== END: .xiaoma-core/tasks/requirement-analysis-with-rag.md ====================
4014
4272
 
4015
4273
  ==================== START: .xiaoma-core/templates/brainstorming-output-tmpl.yaml ====================
@@ -7151,6 +7409,444 @@ The story creation is successful when:
7151
7409
  - **Implicit:** An annotated change-checklist (or the record of its completion) reflecting the discussions, findings, and decisions made during the process.
7152
7410
  ==================== END: .xiaoma-core/tasks/correct-course.md ====================
7153
7411
 
7412
+ ==================== START: .xiaoma-core/tasks/create-prd-from-rag.md ====================
7413
+ # 基于需求分析创建PRD任务
7414
+
7415
+ ## Purpose
7416
+
7417
+ 基于 Analyst 智能体的需求分析产出物(`docs/rag/` 目录),结合原始需求文档,生成高质量的 PRD 或 Epic 文档。本任务是 Analyst 智能体的下游任务,承接需求分析报告并转化为可执行的产品文档。
7418
+
7419
+ ## 上游交接物
7420
+
7421
+ ```yaml
7422
+ 必需输入:
7423
+ - docs/rag/_analysis-report.md # 需求分析报告(核心输入)
7424
+ - docs/rag/_requirement-parsing.yaml # 需求解析结果
7425
+ - req.txt # 原始需求文档
7426
+
7427
+ 可选输入:
7428
+ - docs/rag/_questions.md # 问题清单
7429
+ - docs/rag/_index.md # 知识索引
7430
+ - docs/rag/business/ # 业务知识
7431
+ - docs/rag/technical/ # 技术知识
7432
+ - docs/rag/constraints/ # 约束条件
7433
+ ```
7434
+
7435
+ ## Workflow Overview
7436
+
7437
+ ```
7438
+ Analyst产出物 → 输入验证 → 复杂度评估 → 文档类型选择 → 文档生成 → 质量检查
7439
+ ```
7440
+
7441
+ ---
7442
+
7443
+ ## Phase 1: 输入验证与上下文加载
7444
+
7445
+ ### 1.1 验证上游交接物
7446
+
7447
+ ```yaml
7448
+ 执行步骤:
7449
+ 步骤1_检查必需文件:
7450
+ 动作: 检查 docs/rag/ 目录是否存在以下文件
7451
+ 必需文件:
7452
+ - _analysis-report.md
7453
+ - _requirement-parsing.yaml
7454
+ 缺失处理: |
7455
+ 如果缺失必需文件,提示用户:
7456
+ "未找到需求分析报告。请先执行 Analyst 智能体的 *analyze-requirement 命令完成需求分析。"
7457
+
7458
+ 步骤2_加载分析报告:
7459
+ 动作: 读取并解析 _analysis-report.md
7460
+ 提取内容:
7461
+ - 需求概述(背景、目标、范围)
7462
+ - 功能分析(功能清单、优先级、依赖关系)
7463
+ - 用户分析(角色、旅程)
7464
+ - 数据分析(实体、关系)
7465
+ - 技术分析(可行性、兼容性)
7466
+ - 业务规则汇总
7467
+ - 差距分析
7468
+ - 风险分析
7469
+ - 待澄清事项
7470
+
7471
+ 步骤3_加载原始需求:
7472
+ 动作: 读取 req.txt 原始需求文档
7473
+ 目的: 确保不遗漏原始需求中的细节
7474
+
7475
+ 步骤4_加载知识上下文:
7476
+ 动作: 扫描 docs/rag/ 子目录,加载相关知识文件
7477
+ 加载顺序:
7478
+ - technical/architecture.md # 技术架构
7479
+ - technical/coding-standards/ # 编码规范
7480
+ - technical/data-model.md # 数据模型
7481
+ - business/ # 业务知识
7482
+ - constraints/ # 约束条件
7483
+ ```
7484
+
7485
+ ### 1.2 上下文整合
7486
+
7487
+ ```yaml
7488
+ 整合输出:
7489
+ 项目上下文:
7490
+ - 项目背景与目标
7491
+ - 技术栈与架构约束
7492
+ - 现有系统兼容性要求
7493
+
7494
+ 需求上下文:
7495
+ - 功能清单与优先级
7496
+ - 用户角色与权限
7497
+ - 数据实体与关系
7498
+ - 业务规则
7499
+
7500
+ 约束上下文:
7501
+ - 技术约束
7502
+ - 安全合规要求
7503
+ - 性能要求
7504
+
7505
+ 风险上下文:
7506
+ - 已识别风险
7507
+ - 待澄清事项
7508
+ ```
7509
+
7510
+ ---
7511
+
7512
+ ## Phase 2: 复杂度评估与文档类型选择
7513
+
7514
+ ### 2.1 复杂度评估矩阵
7515
+
7516
+ ```yaml
7517
+ 评估维度:
7518
+ 功能复杂度:
7519
+ 低: 功能点 <= 3,无复杂业务流程
7520
+ 中: 功能点 4-8,存在中等复杂度业务流程
7521
+ 高: 功能点 > 8,存在复杂业务流程或多系统集成
7522
+
7523
+ 技术复杂度:
7524
+ 低: 遵循现有模式,无架构变更
7525
+ 中: 部分新技术引入,小范围架构调整
7526
+ 高: 重大技术决策,架构级变更
7527
+
7528
+ 集成复杂度:
7529
+ 低: 单一系统,无外部集成
7530
+ 中: 2-3个系统集成
7531
+ 高: 多系统集成,复杂数据流
7532
+
7533
+ 风险等级:
7534
+ 低: 风险清单中无高风险项
7535
+ 中: 存在1-2个中等风险项
7536
+ 高: 存在高风险项或多个中等风险项
7537
+ ```
7538
+
7539
+ ### 2.2 文档类型选择规则
7540
+
7541
+ ```yaml
7542
+ 选择规则:
7543
+ 生成完整PRD:
7544
+ 条件:
7545
+ - 功能复杂度 >= 中 OR
7546
+ - 技术复杂度 >= 中 OR
7547
+ - 需要架构设计 OR
7548
+ - 涉及多个Epic
7549
+ 输出: docs/prd.md
7550
+ 模板: prd-from-rag-tmpl.yaml
7551
+
7552
+ 生成单Epic:
7553
+ 条件:
7554
+ - 功能复杂度 = 低
7555
+ - 技术复杂度 = 低
7556
+ - 可在1-3个Story内完成
7557
+ - 无重大架构变更
7558
+ 输出: docs/epic-{name}.md
7559
+ 模板: epic-from-rag-tmpl.yaml
7560
+
7561
+ 需要澄清:
7562
+ 条件:
7563
+ - 待澄清事项 > 5 OR
7564
+ - 存在阻塞性待澄清项
7565
+ 动作: 暂停生成,先与用户澄清关键问题
7566
+ ```
7567
+
7568
+ ### 2.3 交互确认
7569
+
7570
+ ```yaml
7571
+ 确认点:
7572
+ 展示内容:
7573
+ - 复杂度评估结果
7574
+ - 建议的文档类型
7575
+ - 预计的Epic/Story数量
7576
+ - 关键风险提示
7577
+
7578
+ 用户选项:
7579
+ - 确认并继续
7580
+ - 调整文档类型
7581
+ - 先澄清待定事项
7582
+ ```
7583
+
7584
+ ---
7585
+
7586
+ ## Phase 3: PRD文档生成
7587
+
7588
+ ### 3.1 PRD结构映射
7589
+
7590
+ 将分析报告内容映射到PRD结构:
7591
+
7592
+ ```yaml
7593
+ 映射规则:
7594
+ 目标与背景:
7595
+ 来源: 分析报告.需求概述
7596
+ 映射:
7597
+ - 需求背景 → PRD.背景上下文
7598
+ - 核心目标 → PRD.目标
7599
+ - 范围边界 → PRD.范围定义
7600
+
7601
+ 需求章节:
7602
+ 来源: 分析报告.功能分析 + 业务规则汇总
7603
+ 映射:
7604
+ - 功能清单 → PRD.功能性需求 (FR)
7605
+ - 业务规则 → PRD.功能性需求 (补充)
7606
+ - 技术分析.性能要求 → PRD.非功能性需求 (NFR)
7607
+ - 约束条件 → PRD.非功能性需求 (NFR)
7608
+
7609
+ UI设计目标:
7610
+ 来源: 分析报告.用户分析
7611
+ 映射:
7612
+ - 用户角色 → PRD.用户角色定义
7613
+ - 用户旅程 → PRD.关键交互范式
7614
+ - 功能清单中的UI相关项 → PRD.核心屏幕与视图
7615
+
7616
+ 技术假设:
7617
+ 来源: docs/rag/technical/ + 分析报告.技术分析
7618
+ 映射:
7619
+ - architecture.md → PRD.服务架构
7620
+ - coding-standards/ → PRD.编码规范约束
7621
+ - 技术可行性评估 → PRD.技术假设
7622
+
7623
+ Epic结构:
7624
+ 来源: 分析报告.功能分析
7625
+ 映射:
7626
+ - 功能清单(按优先级分组) → Epic列表
7627
+ - 功能依赖关系 → Story顺序
7628
+ - P0功能 → Epic 1 (核心功能)
7629
+ - P1功能 → Epic 2+ (增强功能)
7630
+
7631
+ 风险与待办:
7632
+ 来源: 分析报告.风险分析 + 待澄清事项
7633
+ 映射:
7634
+ - 风险清单 → PRD.风险评估
7635
+ - 待澄清事项 → PRD.开放问题
7636
+ ```
7637
+
7638
+ ### 3.2 Epic/Story 生成规则
7639
+
7640
+ ```yaml
7641
+ Epic生成规则:
7642
+ 分组策略:
7643
+ - 按功能模块分组
7644
+ - 每个Epic交付独立可测试的功能增量
7645
+ - Epic 1 优先包含P0功能
7646
+ - 后续Epic按优先级和依赖关系排列
7647
+
7648
+ Epic结构:
7649
+ - Epic标题
7650
+ - Epic目标 (2-3句话)
7651
+ - 包含的功能点
7652
+ - 技术实现要点(来自技术知识)
7653
+ - Story列表
7654
+
7655
+ Story生成规则:
7656
+ 拆分策略:
7657
+ - 每个Story是垂直切片
7658
+ - 单个AI Agent会话可完成(2-4小时工作量)
7659
+ - 明确的输入输出边界
7660
+
7661
+ Story结构:
7662
+ - Story标题
7663
+ - 用户故事格式 (As a... I want... So that...)
7664
+ - 验收标准 (基于分析报告中的业务规则)
7665
+ - 技术实现提示(来自技术知识)
7666
+ - 集成验证点(来自数据关系分析)
7667
+
7668
+ 排序规则:
7669
+ - 基础设施优先
7670
+ - 数据模型优先于业务逻辑
7671
+ - 核心流程优先于边缘场景
7672
+ - 遵循功能依赖关系图
7673
+ ```
7674
+
7675
+ ### 3.3 知识融合
7676
+
7677
+ ```yaml
7678
+ 知识融合点:
7679
+ 业务规则融合:
7680
+ 来源: docs/rag/business/rules-*.md
7681
+ 融合到: 验收标准、业务逻辑描述
7682
+
7683
+ 数据模型融合:
7684
+ 来源: docs/rag/technical/data-model.md
7685
+ 融合到: 数据实体定义、关联关系说明
7686
+
7687
+ 编码规范融合:
7688
+ 来源: docs/rag/technical/coding-standards/
7689
+ 融合到: 技术实现提示、代码示例引用
7690
+
7691
+ 中间件规范融合:
7692
+ 来源: docs/rag/technical/middleware/
7693
+ 融合到: 技术假设、实现约束
7694
+
7695
+ 安全要求融合:
7696
+ 来源: docs/rag/constraints/security.md
7697
+ 融合到: 非功能性需求、验收标准
7698
+ ```
7699
+
7700
+ ---
7701
+
7702
+ ## Phase 4: 质量检查与输出
7703
+
7704
+ ### 4.1 PRD质量检查清单
7705
+
7706
+ ```yaml
7707
+ 完整性检查:
7708
+ - [ ] 所有P0功能已覆盖
7709
+ - [ ] 所有P1功能已覆盖或标记为后续迭代
7710
+ - [ ] 所有已识别的业务规则已融入
7711
+ - [ ] 所有数据实体已定义
7712
+ - [ ] 所有用户角色已覆盖
7713
+
7714
+ 一致性检查:
7715
+ - [ ] 功能需求与分析报告一致
7716
+ - [ ] 技术假设与知识库一致
7717
+ - [ ] Epic/Story顺序符合依赖关系
7718
+ - [ ] 验收标准可测试
7719
+
7720
+ 可执行性检查:
7721
+ - [ ] 每个Story大小适合AI Agent执行
7722
+ - [ ] Story之间无循环依赖
7723
+ - [ ] 技术实现路径清晰
7724
+ - [ ] 风险缓解措施具体
7725
+
7726
+ 交接完整性检查:
7727
+ - [ ] 包含UX专家提示
7728
+ - [ ] 包含架构师提示
7729
+ - [ ] 待澄清事项已列出
7730
+ ```
7731
+
7732
+ ### 4.2 输出文件
7733
+
7734
+ ```yaml
7735
+ 主输出:
7736
+ PRD文档:
7737
+ 路径: docs/prd.md
7738
+ 格式: Markdown
7739
+
7740
+ 或 Epic文档:
7741
+ 路径: docs/epic-{name}.md
7742
+ 格式: Markdown
7743
+
7744
+ 辅助输出:
7745
+ 知识引用索引:
7746
+ 路径: docs/prd-knowledge-refs.md
7747
+ 内容: PRD中引用的知识文件清单
7748
+
7749
+ 待澄清事项:
7750
+ 路径: docs/prd-open-questions.md
7751
+ 内容: 需要进一步确认的问题
7752
+ ```
7753
+
7754
+ ---
7755
+
7756
+ ## Phase 5: 下游交接
7757
+
7758
+ ### 5.1 交接给UX专家
7759
+
7760
+ ```yaml
7761
+ UX专家交接:
7762
+ 必读文件:
7763
+ - docs/prd.md (UI设计目标章节)
7764
+ - docs/rag/_analysis-report.md (用户分析章节)
7765
+
7766
+ 关注点:
7767
+ - 用户角色与权限
7768
+ - 核心屏幕与视图
7769
+ - 关键用户旅程
7770
+ - 无障碍性要求
7771
+
7772
+ 建议命令: "*create-ux-design docs/prd.md"
7773
+ ```
7774
+
7775
+ ### 5.2 交接给架构师
7776
+
7777
+ ```yaml
7778
+ 架构师交接:
7779
+ 必读文件:
7780
+ - docs/prd.md (技术假设章节)
7781
+ - docs/rag/technical/ (技术知识目录)
7782
+ - docs/rag/_analysis-report.md (技术分析章节)
7783
+
7784
+ 关注点:
7785
+ - 技术栈与架构约束
7786
+ - 数据模型与关系
7787
+ - 集成点与接口
7788
+ - 性能与安全要求
7789
+
7790
+ 建议命令: "*create-architecture docs/prd.md"
7791
+ ```
7792
+
7793
+ ---
7794
+
7795
+ ## 使用说明
7796
+
7797
+ ### 激活命令
7798
+
7799
+ ```
7800
+ *create-prd-from-rag [rag_path]
7801
+ ```
7802
+
7803
+ ### 执行参数
7804
+
7805
+ ```yaml
7806
+ 参数:
7807
+ rag_path: RAG知识目录路径 (默认: docs/rag/)
7808
+ output_path: PRD输出路径 (默认: docs/prd.md)
7809
+ doc_type: 文档类型 (auto|prd|epic, 默认: auto)
7810
+ interactive: 交互模式 (默认: true)
7811
+ ```
7812
+
7813
+ ### 交互模式流程
7814
+
7815
+ 1. **验证阶段**: 检查上游交接物完整性
7816
+ 2. **评估阶段**: 展示复杂度评估结果,确认文档类型
7817
+ 3. **生成阶段**: 逐章节生成PRD,关键节点请求确认
7818
+ 4. **检查阶段**: 执行质量检查清单
7819
+ 5. **输出阶段**: 生成最终文档,提示下游交接
7820
+
7821
+ ### YOLO模式
7822
+
7823
+ 通过 `*yolo` 命令切换YOLO模式,一次性完成所有步骤,跳过中间确认环节。
7824
+
7825
+ ---
7826
+
7827
+ ## 任务完成标志
7828
+
7829
+ ```yaml
7830
+ 完成条件:
7831
+ 必要输出:
7832
+ - docs/prd.md 或 docs/epic-{name}.md
7833
+
7834
+ 完成提示: |
7835
+ ✅ PRD/Epic 文档生成完成!
7836
+
7837
+ 📄 输出文件: {output_path}
7838
+ 📊 Epic数量: {epic_count}
7839
+ 📝 Story数量: {story_count}
7840
+
7841
+ 🔄 下一步建议:
7842
+ - UX设计: *create-ux-design docs/prd.md
7843
+ - 架构设计: *create-architecture docs/prd.md
7844
+
7845
+ ⚠️ 待澄清事项: {open_questions_count} 项
7846
+ 请在开发前确认这些问题。
7847
+ ```
7848
+ ==================== END: .xiaoma-core/tasks/create-prd-from-rag.md ====================
7849
+
7154
7850
  ==================== START: .xiaoma-core/tasks/execute-checklist.md ====================
7155
7851
  <!-- Powered by XIAOMA™ Core -->
7156
7852
 
@@ -7715,52 +8411,465 @@ sections:
7715
8411
  - template: "IV3: {{performance_impact_verification}}"
7716
8412
  ==================== END: .xiaoma-core/templates/brownfield-prd-tmpl.yaml ====================
7717
8413
 
7718
- ==================== START: .xiaoma-core/checklists/change-checklist.md ====================
7719
- <!-- Powered by XiaoMa™ Core -->
7720
-
7721
- # Change Navigation Checklist
7722
-
7723
- **Purpose:** To systematically guide the selected Agent and user through the analysis and planning required when a significant change (pivot, tech issue, missing requirement, failed story) is identified during the BMad workflow.
7724
-
7725
- **Instructions:** Review each item with the user. Mark `[x]` for completed/confirmed, `[N/A]` if not applicable, or add notes for discussion points.
7726
-
7727
- [[LLM: INITIALIZATION INSTRUCTIONS - CHANGE NAVIGATION
8414
+ ==================== START: .xiaoma-core/templates/prd-from-rag-tmpl.yaml ====================
8415
+ template:
8416
+ id: prd-from-rag-template-v1
8417
+ name: 基于需求分析的PRD文档
8418
+ version: 1.0
8419
+ description: 基于Analyst智能体的需求分析产出物生成PRD
8420
+ output:
8421
+ format: markdown
8422
+ filename: docs/prd.md
8423
+ title: "{{project_name}} 产品需求文档 (PRD)"
7728
8424
 
7729
- Changes during development are inevitable, but how we handle them determines project success or failure.
8425
+ workflow:
8426
+ mode: interactive
8427
+ elicitation: advanced-elicitation
8428
+ upstream:
8429
+ agent: analyst
8430
+ required_files:
8431
+ - docs/rag/_analysis-report.md
8432
+ - docs/rag/_requirement-parsing.yaml
8433
+ optional_files:
8434
+ - docs/rag/_questions.md
8435
+ - docs/rag/_index.md
8436
+ - docs/rag/business/*
8437
+ - docs/rag/technical/*
8438
+ - docs/rag/constraints/*
7730
8439
 
7731
- Before proceeding, understand:
8440
+ sections:
8441
+ - id: input-validation
8442
+ title: 输入验证
8443
+ internal: true
8444
+ instruction: |
8445
+ 在开始生成PRD之前,执行以下验证:
7732
8446
 
7733
- 1. This checklist is for SIGNIFICANT changes that affect the project direction
7734
- 2. Minor adjustments within a story don't require this process
7735
- 3. The goal is to minimize wasted work while adapting to new realities
7736
- 4. User buy-in is critical - they must understand and approve changes
8447
+ 1. **检查必需文件**:
8448
+ - docs/rag/_analysis-report.md 是否存在
8449
+ - docs/rag/_requirement-parsing.yaml 是否存在
8450
+ - req.txt 原始需求文档是否存在
7737
8451
 
7738
- Required context:
8452
+ 2. **加载分析报告**:
8453
+ - 读取并解析 _analysis-report.md 的所有章节
8454
+ - 提取关键信息:功能清单、用户角色、数据实体、风险、待澄清事项
7739
8455
 
7740
- - The triggering story or issue
7741
- - Current project state (completed stories, current epic)
7742
- - Access to PRD, architecture, and other key documents
7743
- - Understanding of remaining work planned
8456
+ 3. **加载知识上下文**:
8457
+ - 扫描 docs/rag/technical/ 获取技术约束
8458
+ - 扫描 docs/rag/business/ 获取业务规则
8459
+ - 扫描 docs/rag/constraints/ 获取约束条件
7744
8460
 
7745
- APPROACH:
7746
- This is an interactive process with the user. Work through each section together, discussing implications and options. The user makes final decisions, but provide expert guidance on technical feasibility and impact.
8461
+ 如果缺少必需文件,提示:
8462
+ "⚠️ 未找到需求分析报告。请先执行 Analyst 智能体完成需求分析:*analyze-requirement req.txt"
7747
8463
 
7748
- REMEMBER: Changes are opportunities to improve, not failures. Handle them professionally and constructively.]]
8464
+ - id: complexity-assessment
8465
+ title: 复杂度评估
8466
+ instruction: |
8467
+ 基于分析报告内容,评估项目复杂度并推荐文档类型。
7749
8468
 
7750
- ---
8469
+ **评估维度**:
8470
+ 1. 功能复杂度:基于功能清单数量和依赖关系
8471
+ 2. 技术复杂度:基于技术可行性评估
8472
+ 3. 集成复杂度:基于数据关系和外部依赖
8473
+ 4. 风险等级:基于风险清单
7751
8474
 
7752
- ## 1. Understand the Trigger & Context
8475
+ **推荐文档类型**:
8476
+ - 完整PRD:复杂度 >= 中等,或涉及多个Epic
8477
+ - 单Epic:复杂度低,可在1-3个Story内完成
7753
8478
 
7754
- [[LLM: Start by fully understanding what went wrong and why. Don't jump to solutions yet. Ask probing questions:
8479
+ 展示评估结果并请用户确认文档类型。
8480
+ elicit: true
8481
+ sections:
8482
+ - id: assessment-result
8483
+ title: 评估结果
8484
+ type: table
8485
+ columns: [评估维度, 等级, 依据]
8486
+ - id: recommendation
8487
+ title: 推荐方案
8488
+ instruction: 基于评估结果给出文档类型推荐和理由
7755
8489
 
7756
- - What exactly happened that triggered this review?
7757
- - Is this a one-time issue or symptomatic of a larger problem?
7758
- - Could this have been anticipated earlier?
7759
- - What assumptions were incorrect?
8490
+ - id: goals-context
8491
+ title: 目标与背景
8492
+ instruction: |
8493
+ 从分析报告的"需求概述"章节提取内容,映射到PRD结构。
7760
8494
 
7761
- Be specific and factual, not blame-oriented.]]
8495
+ **映射规则**:
8496
+ - 分析报告.需求背景 → 背景上下文
8497
+ - 分析报告.核心目标 → 目标
8498
+ - 分析报告.范围边界 → 范围定义
7762
8499
 
7763
- - [ ] **Identify Triggering Story:** Clearly identify the story (or stories) that revealed the issue.
8500
+ 如果分析报告中信息不足,参考 req.txt 原始需求补充。
8501
+ sections:
8502
+ - id: goals
8503
+ title: 目标
8504
+ type: bullet-list
8505
+ instruction: |
8506
+ 从分析报告提取核心目标,转换为PRD目标格式。
8507
+ 每个目标应该是:
8508
+ - 可衡量的成果
8509
+ - 用户或业务价值
8510
+ - 与原始需求对应
8511
+ - id: background
8512
+ title: 背景上下文
8513
+ type: paragraphs
8514
+ instruction: |
8515
+ 综合以下来源生成背景描述:
8516
+ - 分析报告.需求背景
8517
+ - 分析报告.业务分析
8518
+ - 原始需求文档中的背景信息
8519
+ - id: scope
8520
+ title: 范围定义
8521
+ instruction: 从分析报告.范围边界提取,明确包含和不包含的内容
8522
+ sections:
8523
+ - id: in-scope
8524
+ title: 范围内
8525
+ type: bullet-list
8526
+ - id: out-of-scope
8527
+ title: 范围外
8528
+ type: bullet-list
8529
+ - id: changelog
8530
+ title: 变更日志
8531
+ type: table
8532
+ columns: [日期, 版本, 描述, 作者]
8533
+
8534
+ - id: requirements
8535
+ title: 需求
8536
+ instruction: |
8537
+ 从分析报告的"功能分析"和"业务规则汇总"章节提取需求。
8538
+
8539
+ **功能性需求来源**:
8540
+ - 分析报告.功能清单 → FR列表
8541
+ - 分析报告.业务规则 → FR补充说明
8542
+ - docs/rag/business/rules-*.md → 详细规则
8543
+
8544
+ **非功能性需求来源**:
8545
+ - 分析报告.技术分析.性能要求
8546
+ - docs/rag/constraints/security.md
8547
+ - docs/rag/constraints/performance.md
8548
+
8549
+ 确保每个需求都可追溯到分析报告或知识库文档。
8550
+ elicit: true
8551
+ sections:
8552
+ - id: functional
8553
+ title: 功能性需求
8554
+ type: numbered-list
8555
+ prefix: FR
8556
+ instruction: |
8557
+ 按优先级排列功能性需求:
8558
+ - P0功能优先列出
8559
+ - 每个FR包含:需求描述 + 来源标注
8560
+ - 复杂业务规则单独标注参考文档
8561
+
8562
+ 格式示例:
8563
+ FR1: [P0] 用户可以创建订单 (来源: 分析报告.功能清单.F001)
8564
+ examples:
8565
+ - "FR1: [P0] 系统支持用户通过手机号注册账户 (来源: _analysis-report.md#功能清单)"
8566
+ - "FR2: [P0] 订单状态流转遵循:待支付→已支付→已发货→已完成 (来源: business/rules-order.md)"
8567
+ - id: non-functional
8568
+ title: 非功能性需求
8569
+ type: numbered-list
8570
+ prefix: NFR
8571
+ instruction: |
8572
+ 从约束条件和技术分析中提取非功能性需求。
8573
+ 包括:性能、安全、可用性、兼容性等。
8574
+ examples:
8575
+ - "NFR1: 接口响应时间P99 < 500ms (来源: constraints/performance.md)"
8576
+ - "NFR2: 敏感数据传输必须使用HTTPS加密 (来源: constraints/security.md)"
8577
+
8578
+ - id: data-model
8579
+ title: 数据模型
8580
+ instruction: |
8581
+ 从分析报告的"数据分析"章节和技术知识中提取数据模型。
8582
+
8583
+ **来源**:
8584
+ - 分析报告.数据实体清单
8585
+ - 分析报告.数据关系图
8586
+ - docs/rag/technical/data-model.md
8587
+ sections:
8588
+ - id: entities
8589
+ title: 数据实体
8590
+ type: table
8591
+ columns: [实体名称, 描述, 核心属性, 来源]
8592
+ instruction: 列出所有数据实体及其核心属性
8593
+ - id: relationships
8594
+ title: 数据关系
8595
+ instruction: |
8596
+ 描述实体间的关系,使用Mermaid ER图表示。
8597
+ 从分析报告.数据关系图提取,补充详细说明。
8598
+ examples:
8599
+ - |
8600
+ ```mermaid
8601
+ erDiagram
8602
+ User ||--o{ Order : creates
8603
+ Order ||--|{ OrderItem : contains
8604
+ ```
8605
+
8606
+ - id: technical-constraints
8607
+ title: 技术约束
8608
+ instruction: |
8609
+ 整合技术知识库中的约束条件,指导后续架构设计。
8610
+
8611
+ **来源**:
8612
+ - docs/rag/technical/architecture.md
8613
+ - docs/rag/technical/tech-stack.md
8614
+ - docs/rag/technical/coding-standards/
8615
+ - docs/rag/technical/middleware/
8616
+ - 分析报告.技术分析.与现有系统兼容性
8617
+ elicit: true
8618
+ sections:
8619
+ - id: tech-stack
8620
+ title: 技术栈约束
8621
+ instruction: |
8622
+ 从技术知识库提取技术栈要求:
8623
+ - 后端框架和版本
8624
+ - 数据库类型和版本
8625
+ - 中间件要求
8626
+ template: |
8627
+ **后端**: {{backend_framework}}
8628
+ **数据库**: {{database}}
8629
+ **缓存**: {{cache}}
8630
+ **消息队列**: {{mq}}
8631
+ - id: architecture-constraints
8632
+ title: 架构约束
8633
+ instruction: 从 architecture.md 提取架构模式和约束
8634
+ - id: coding-standards
8635
+ title: 编码规范约束
8636
+ instruction: |
8637
+ 从 coding-standards/ 目录提取关键规范:
8638
+ - 命名规范
8639
+ - 分层规范
8640
+ - 异常处理规范
8641
+ - id: integration-constraints
8642
+ title: 集成约束
8643
+ instruction: 从分析报告.技术分析提取集成相关约束
8644
+
8645
+ - id: epic-list
8646
+ title: 模块列表
8647
+ instruction: |
8648
+ 基于分析报告的功能分析,规划Epic结构。
8649
+
8650
+ **规划原则**:
8651
+ - 按功能优先级分组:P0功能 → Epic 1
8652
+ - 遵循功能依赖关系
8653
+ - 每个Epic交付独立可测试的功能增量
8654
+
8655
+ **Epic分组策略**:
8656
+ 1. 从分析报告.功能清单提取所有功能
8657
+ 2. 按优先级排序:P0 > P1 > P2
8658
+ 3. 分析依赖关系,确定Epic边界
8659
+ 4. 每个Epic包含相关联的功能集
8660
+
8661
+ 展示Epic列表,请用户确认分组是否合理。
8662
+ elicit: true
8663
+ sections:
8664
+ - id: epic-overview
8665
+ title: Epic概览
8666
+ type: table
8667
+ columns: [Epic, 标题, 包含功能, 优先级, Story数量(预估)]
8668
+ instruction: 展示所有Epic的概览表格
8669
+
8670
+ - id: epic-details
8671
+ title: "Epic {{epic_number}}: {{epic_title}}"
8672
+ repeatable: true
8673
+ instruction: |
8674
+ 为每个Epic生成详细内容,包含所有Story和验收标准。
8675
+
8676
+ **Epic内容来源**:
8677
+ - 分析报告.功能清单 (对应功能)
8678
+ - 分析报告.业务规则 (相关规则)
8679
+ - docs/rag/business/ (详细业务知识)
8680
+ - docs/rag/technical/ (技术实现参考)
8681
+
8682
+ **Story生成规则**:
8683
+ - 每个Story是垂直切片
8684
+ - 单个AI Agent会话可完成(2-4小时)
8685
+ - 验收标准来源于分析报告中的业务规则
8686
+ - 包含技术实现提示(来自技术知识)
8687
+
8688
+ **Story排序**:
8689
+ - 遵循分析报告.功能依赖关系
8690
+ - 基础设施和数据模型优先
8691
+ - 核心流程优先于边缘场景
8692
+ elicit: true
8693
+ template: |
8694
+ **Epic目标**: {{epic_goal}}
8695
+
8696
+ **包含功能**:
8697
+ {{功能列表,来源于分析报告}}
8698
+
8699
+ **技术要点**:
8700
+ {{技术实现要点,来源于技术知识库}}
8701
+ sections:
8702
+ - id: story
8703
+ title: "Story {{epic_number}}.{{story_number}}: {{story_title}}"
8704
+ repeatable: true
8705
+ template: |
8706
+ 作为一名 {{user_type}},
8707
+ 我想要 {{action}},
8708
+ 以便 {{benefit}}。
8709
+ sections:
8710
+ - id: acceptance-criteria
8711
+ title: 验收标准
8712
+ type: numbered-list
8713
+ instruction: |
8714
+ 从以下来源生成验收标准:
8715
+ - 分析报告.业务规则 (对应规则)
8716
+ - docs/rag/business/rules-*.md (详细规则)
8717
+ - 分析报告.数据分析 (数据约束)
8718
+
8719
+ 每个标准必须:
8720
+ - 可测试、可验证
8721
+ - 明确无歧义
8722
+ - 包含边界条件
8723
+ item_template: "AC{{criterion_number}}: {{criteria}} (来源: {{source}})"
8724
+ - id: technical-hints
8725
+ title: 技术实现提示
8726
+ instruction: |
8727
+ 从技术知识库提取实现提示:
8728
+ - 相关编码规范
8729
+ - 中间件使用示例
8730
+ - 数据模型参考
8731
+ type: bullet-list
8732
+ - id: knowledge-refs
8733
+ title: 知识引用
8734
+ instruction: 列出Story实现时需要参考的知识文档
8735
+ type: bullet-list
8736
+
8737
+ - id: risks-and-open-items
8738
+ title: 风险与待澄清事项
8739
+ instruction: |
8740
+ 从分析报告直接提取风险和待澄清事项。
8741
+
8742
+ **来源**:
8743
+ - 分析报告.风险分析
8744
+ - 分析报告.待澄清事项
8745
+ sections:
8746
+ - id: risks
8747
+ title: 风险清单
8748
+ type: table
8749
+ columns: [风险ID, 风险描述, 等级, 缓解措施]
8750
+ instruction: 从分析报告.风险清单直接映射
8751
+ - id: open-questions
8752
+ title: 待澄清事项
8753
+ type: table
8754
+ columns: [序号, 问题, 上下文, 建议选项, 状态]
8755
+ instruction: |
8756
+ 从分析报告.待澄清事项提取。
8757
+ 标注状态:待确认/已确认/已关闭
8758
+ 在PRD评审时需要逐一确认这些问题。
8759
+
8760
+ - id: knowledge-index
8761
+ title: 知识引用索引
8762
+ instruction: |
8763
+ 列出本PRD引用的所有知识文档,便于追溯和维护。
8764
+ sections:
8765
+ - id: analysis-refs
8766
+ title: 分析报告引用
8767
+ type: table
8768
+ columns: [章节, 引用位置, 用途]
8769
+ - id: knowledge-refs
8770
+ title: 知识库引用
8771
+ type: table
8772
+ columns: [文件路径, 引用位置, 用途]
8773
+
8774
+ - id: next-steps
8775
+ title: 后续步骤
8776
+ sections:
8777
+ - id: ux-expert-prompt
8778
+ title: UX专家交接
8779
+ instruction: |
8780
+ 生成给UX专家的交接提示,包含:
8781
+ - 需要关注的用户角色
8782
+ - 核心屏幕和交互
8783
+ - 品牌和无障碍要求
8784
+ - 相关知识文档路径
8785
+ template: |
8786
+ **交接给UX专家**
8787
+
8788
+ 请基于本PRD的用户分析部分设计UI/UX方案:
8789
+
8790
+ **关键输入**:
8791
+ - PRD文档: docs/prd.md
8792
+ - 用户分析: docs/rag/_analysis-report.md#用户分析
8793
+ - 用户角色: {{user_roles}}
8794
+ - 核心屏幕: {{core_screens}}
8795
+
8796
+ **设计重点**:
8797
+ {{design_focus}}
8798
+
8799
+ **执行命令**: *create-ux-design docs/prd.md
8800
+ - id: architect-prompt
8801
+ title: 架构师交接
8802
+ instruction: |
8803
+ 生成给架构师的交接提示,包含:
8804
+ - 技术栈约束
8805
+ - 数据模型要点
8806
+ - 集成需求
8807
+ - 相关知识文档路径
8808
+ template: |
8809
+ **交接给架构师**
8810
+
8811
+ 请基于本PRD和技术知识库设计系统架构:
8812
+
8813
+ **关键输入**:
8814
+ - PRD文档: docs/prd.md
8815
+ - 技术分析: docs/rag/_analysis-report.md#技术分析
8816
+ - 技术知识: docs/rag/technical/
8817
+ - 数据模型: docs/rag/technical/data-model.md
8818
+
8819
+ **架构重点**:
8820
+ - 技术栈: {{tech_stack}}
8821
+ - 关键集成点: {{integration_points}}
8822
+ - 性能要求: {{performance_requirements}}
8823
+
8824
+ **执行命令**: *create-architecture docs/prd.md
8825
+ ==================== END: .xiaoma-core/templates/prd-from-rag-tmpl.yaml ====================
8826
+
8827
+ ==================== START: .xiaoma-core/checklists/change-checklist.md ====================
8828
+ <!-- Powered by XiaoMa™ Core -->
8829
+
8830
+ # Change Navigation Checklist
8831
+
8832
+ **Purpose:** To systematically guide the selected Agent and user through the analysis and planning required when a significant change (pivot, tech issue, missing requirement, failed story) is identified during the BMad workflow.
8833
+
8834
+ **Instructions:** Review each item with the user. Mark `[x]` for completed/confirmed, `[N/A]` if not applicable, or add notes for discussion points.
8835
+
8836
+ [[LLM: INITIALIZATION INSTRUCTIONS - CHANGE NAVIGATION
8837
+
8838
+ Changes during development are inevitable, but how we handle them determines project success or failure.
8839
+
8840
+ Before proceeding, understand:
8841
+
8842
+ 1. This checklist is for SIGNIFICANT changes that affect the project direction
8843
+ 2. Minor adjustments within a story don't require this process
8844
+ 3. The goal is to minimize wasted work while adapting to new realities
8845
+ 4. User buy-in is critical - they must understand and approve changes
8846
+
8847
+ Required context:
8848
+
8849
+ - The triggering story or issue
8850
+ - Current project state (completed stories, current epic)
8851
+ - Access to PRD, architecture, and other key documents
8852
+ - Understanding of remaining work planned
8853
+
8854
+ APPROACH:
8855
+ This is an interactive process with the user. Work through each section together, discussing implications and options. The user makes final decisions, but provide expert guidance on technical feasibility and impact.
8856
+
8857
+ REMEMBER: Changes are opportunities to improve, not failures. Handle them professionally and constructively.]]
8858
+
8859
+ ---
8860
+
8861
+ ## 1. Understand the Trigger & Context
8862
+
8863
+ [[LLM: Start by fully understanding what went wrong and why. Don't jump to solutions yet. Ask probing questions:
8864
+
8865
+ - What exactly happened that triggered this review?
8866
+ - Is this a one-time issue or symptomatic of a larger problem?
8867
+ - Could this have been anticipated earlier?
8868
+ - What assumptions were incorrect?
8869
+
8870
+ Be specific and factual, not blame-oriented.]]
8871
+
8872
+ - [ ] **Identify Triggering Story:** Clearly identify the story (or stories) that revealed the issue.
7764
8873
  - [ ] **Define the Issue:** Articulate the core problem precisely.
7765
8874
  - [ ] Is it a technical limitation/dead-end?
7766
8875
  - [ ] Is it a newly discovered requirement?
@@ -8698,6 +9807,534 @@ sections:
8698
9807
  instruction: 如果存在 UI/UX 清单,请用其检查本文档并在此处报告结果。
8699
9808
  ==================== END: .xiaoma-core/templates/front-end-spec-tmpl.yaml ====================
8700
9809
 
9810
+ ==================== START: .xiaoma-core/tasks/create-incremental-architecture.md ====================
9811
+ # 基于知识库的架构增量设计任务
9812
+
9813
+ ## Purpose
9814
+
9815
+ 基于 Analyst 智能体的技术知识库产出(`docs/rag/technical/`)和 PM 智能体生成的 PRD/Epic 文档,进行架构增量设计。通过对比现有技术架构与新需求,识别技术变动点,生成架构增量设计文档。
9816
+
9817
+ ## 上游交接物
9818
+
9819
+ ```yaml
9820
+ 必需输入:
9821
+ PRD/Epic文档:
9822
+ - docs/prd.md # PM生成的PRD文档
9823
+ - 或 docs/epic-{name}.md # PM生成的Epic文档
9824
+
9825
+ 技术知识库:
9826
+ - docs/rag/technical/architecture.md # 现有技术架构
9827
+ - docs/rag/technical/tech-stack.md # 技术栈详情
9828
+ - docs/rag/technical/module-structure.md # 模块结构
9829
+ - docs/rag/technical/data-model.md # 数据模型
9830
+
9831
+ 可选输入:
9832
+ 分析报告:
9833
+ - docs/rag/_analysis-report.md # 需求分析报告(技术分析章节)
9834
+
9835
+ 编码规范:
9836
+ - docs/rag/technical/coding-standards/ # 编码规范目录
9837
+ - docs/rag/technical/middleware/ # 中间件规范目录
9838
+
9839
+ 约束条件:
9840
+ - docs/rag/constraints/security.md # 安全要求
9841
+ - docs/rag/constraints/performance.md # 性能要求
9842
+ ```
9843
+
9844
+ ## Workflow Overview
9845
+
9846
+ ```
9847
+ 技术知识库 + PRD → 架构差异分析 → 变动点识别 → 增量设计 → 影响评估 → 架构增量文档
9848
+ ```
9849
+
9850
+ ---
9851
+
9852
+ ## Phase 1: 输入验证与上下文加载
9853
+
9854
+ ### 1.1 验证上游交接物
9855
+
9856
+ ```yaml
9857
+ 执行步骤:
9858
+ 步骤1_检查PRD文档:
9859
+ 动作: 检查 docs/prd.md 或 docs/epic-{name}.md 是否存在
9860
+ 缺失处理: |
9861
+ 如果缺失PRD文档,提示用户:
9862
+ "未找到PRD文档。请先执行 PM 智能体的 *create-prd-from-rag 命令生成PRD。"
9863
+
9864
+ 步骤2_检查技术知识库:
9865
+ 动作: 检查 docs/rag/technical/ 目录是否存在核心文件
9866
+ 核心文件:
9867
+ - architecture.md (现有架构)
9868
+ - data-model.md (数据模型)
9869
+ 缺失处理: |
9870
+ 如果技术知识库不完整,提示用户:
9871
+ "技术知识库不完整。建议先执行 Analyst 智能体完善技术知识:
9872
+ - 缺少 architecture.md:需要补充整体技术架构信息
9873
+ - 缺少 data-model.md:需要补充现有数据模型信息"
9874
+
9875
+ 步骤3_加载现有架构:
9876
+ 动作: 读取并解析技术知识库
9877
+ 提取内容:
9878
+ - 整体架构模式(单体/微服务/DDD等)
9879
+ - 技术栈详情(框架、数据库、中间件)
9880
+ - 模块结构(包结构、分层规范)
9881
+ - 现有数据模型(表结构、实体关系)
9882
+ - 编码规范(命名、注释、异常处理)
9883
+ - 中间件使用方式(Redis、MQ、ES等)
9884
+
9885
+ 步骤4_加载PRD需求:
9886
+ 动作: 读取并解析PRD文档
9887
+ 提取内容:
9888
+ - 功能性需求(FR列表)
9889
+ - 非功能性需求(NFR列表)
9890
+ - 数据实体与关系
9891
+ - 技术约束
9892
+ - Epic/Story结构
9893
+ ```
9894
+
9895
+ ### 1.2 上下文整合视图
9896
+
9897
+ ```yaml
9898
+ 整合输出:
9899
+ 现有架构视图:
9900
+ 架构模式: {从architecture.md提取}
9901
+ 技术栈:
9902
+ 后端: {框架、版本}
9903
+ 数据库: {类型、版本}
9904
+ 缓存: {类型、用途}
9905
+ 消息队列: {类型、用途}
9906
+ 模块结构: {包结构、分层}
9907
+ 数据模型: {现有实体、关系}
9908
+
9909
+ 新需求视图:
9910
+ 功能需求: {FR列表}
9911
+ 数据需求: {新增/修改实体}
9912
+ 性能需求: {NFR中的性能要求}
9913
+ 安全需求: {NFR中的安全要求}
9914
+ ```
9915
+
9916
+ ---
9917
+
9918
+ ## Phase 2: 架构差异分析
9919
+
9920
+ ### 2.1 技术变动检测
9921
+
9922
+ ```yaml
9923
+ 检测维度:
9924
+ 架构层面变动:
9925
+ 检测项:
9926
+ - 是否需要新增模块/服务
9927
+ - 是否需要调整分层结构
9928
+ - 是否需要引入新的架构模式
9929
+ 判定标准:
9930
+ 无变动: 完全遵循现有模块结构
9931
+ 小变动: 在现有模块内新增包/类
9932
+ 中变动: 新增独立模块
9933
+ 大变动: 需要调整整体架构
9934
+
9935
+ 技术栈变动:
9936
+ 检测项:
9937
+ - 是否需要引入新框架/库
9938
+ - 是否需要升级现有依赖版本
9939
+ - 是否需要新增中间件
9940
+ 判定标准:
9941
+ 无变动: 使用现有技术栈
9942
+ 小变动: 新增工具类库
9943
+ 中变动: 引入新中间件
9944
+ 大变动: 核心框架变更
9945
+
9946
+ 数据模型变动:
9947
+ 检测项:
9948
+ - 新增数据实体
9949
+ - 修改现有实体(字段增减)
9950
+ - 新增实体关系
9951
+ - 索引变更
9952
+ 判定标准:
9953
+ 无变动: 完全使用现有表结构
9954
+ 小变动: 现有表新增字段
9955
+ 中变动: 新增表/修改关联关系
9956
+ 大变动: 数据模型重构
9957
+
9958
+ 接口变动:
9959
+ 检测项:
9960
+ - 新增API端点
9961
+ - 修改现有API
9962
+ - 新增外部系统集成
9963
+ 判定标准:
9964
+ 无变动: 无接口变更
9965
+ 小变动: 新增内部API
9966
+ 中变动: 修改公开API/新增集成
9967
+ 大变动: API版本升级
9968
+
9969
+ 中间件变动:
9970
+ 检测项:
9971
+ - Redis使用变化(新增key类型、缓存策略)
9972
+ - MQ使用变化(新增Topic/Queue)
9973
+ - 定时任务变化
9974
+ - ES索引变化
9975
+ 判定标准:
9976
+ 无变动: 遵循现有使用方式
9977
+ 小变动: 新增使用场景
9978
+ 中变动: 新增配置/调整策略
9979
+ 大变动: 中间件架构调整
9980
+ ```
9981
+
9982
+ ### 2.2 变动分析报告
9983
+
9984
+ ```yaml
9985
+ 分析输出格式:
9986
+ 变动总览:
9987
+ 总体变动等级: 无/小/中/大
9988
+ 主要变动领域: [列表]
9989
+ 风险等级: 低/中/高
9990
+
9991
+ 详细变动清单:
9992
+ - 变动ID: CHG-001
9993
+ 领域: 数据模型
9994
+ 类型: 新增
9995
+ 描述: 新增订单实体
9996
+ 影响范围: order模块
9997
+ 关联需求: FR1, FR2
9998
+ 风险等级: 低
9999
+
10000
+ 兼容性分析:
10001
+ 向后兼容: 是/否
10002
+ 需要迁移: 是/否
10003
+ 影响范围: [受影响的模块/服务]
10004
+ ```
10005
+
10006
+ ---
10007
+
10008
+ ## Phase 3: 架构增量设计
10009
+
10010
+ ### 3.1 设计原则
10011
+
10012
+ ```yaml
10013
+ 设计原则:
10014
+ 最小变动原则:
10015
+ - 优先在现有架构内扩展
10016
+ - 避免不必要的重构
10017
+ - 保持与现有代码风格一致
10018
+
10019
+ 渐进演进原则:
10020
+ - 设计可分阶段实施的方案
10021
+ - 支持增量部署和回滚
10022
+ - 考虑向后兼容性
10023
+
10024
+ 知识复用原则:
10025
+ - 复用知识库中的编码规范
10026
+ - 遵循现有中间件使用模式
10027
+ - 参考已有代码示例
10028
+ ```
10029
+
10030
+ ### 3.2 增量设计内容
10031
+
10032
+ ```yaml
10033
+ 设计内容:
10034
+ 模块增量设计:
10035
+ 新增模块:
10036
+ - 模块名称
10037
+ - 职责描述
10038
+ - 包结构(遵循现有规范)
10039
+ - 与现有模块的关系
10040
+ 修改模块:
10041
+ - 模块名称
10042
+ - 修改内容
10043
+ - 修改理由
10044
+ - 影响评估
10045
+
10046
+ 数据模型增量设计:
10047
+ 新增实体:
10048
+ - 实体名称
10049
+ - 表名(遵循命名规范)
10050
+ - 字段定义(遵循字段规范)
10051
+ - 索引设计
10052
+ - DDL语句
10053
+ 修改实体:
10054
+ - 实体名称
10055
+ - 修改字段
10056
+ - 迁移脚本
10057
+ - 兼容性说明
10058
+
10059
+ 接口增量设计:
10060
+ 新增API:
10061
+ - 接口路径(遵循URL规范)
10062
+ - 请求方法
10063
+ - 请求参数(遵循参数规范)
10064
+ - 响应格式(遵循响应规范)
10065
+ - 错误码定义
10066
+ 修改API:
10067
+ - 接口路径
10068
+ - 变更内容
10069
+ - 版本策略
10070
+ - 兼容性说明
10071
+
10072
+ 中间件增量设计:
10073
+ Redis:
10074
+ - 新增Key定义(遵循Key命名规范)
10075
+ - 数据结构选择
10076
+ - 过期策略
10077
+ - 代码示例(参考知识库)
10078
+ MQ:
10079
+ - 新增Topic/Queue
10080
+ - 消息格式
10081
+ - 消费者配置
10082
+ - 代码示例(参考知识库)
10083
+ 定时任务:
10084
+ - 任务名称
10085
+ - 执行周期
10086
+ - 实现方式
10087
+ - 代码示例(参考知识库)
10088
+ ```
10089
+
10090
+ ### 3.3 知识库规范引用
10091
+
10092
+ ```yaml
10093
+ 规范引用:
10094
+ 编码规范引用:
10095
+ 来源: docs/rag/technical/coding-standards/
10096
+ 引用内容:
10097
+ - 命名规范 → 类/方法/变量命名
10098
+ - 分层规范 → Controller/Service/DAO实现
10099
+ - 异常处理 → 错误处理方式
10100
+ - 日志规范 → 日志打印方式
10101
+
10102
+ 中间件规范引用:
10103
+ 来源: docs/rag/technical/middleware/
10104
+ 引用内容:
10105
+ - Redis规范 → 缓存实现参考
10106
+ - MQ规范 → 消息处理参考
10107
+ - 定时任务规范 → 任务实现参考
10108
+
10109
+ SQL规范引用:
10110
+ 来源: docs/rag/technical/sql-standards/
10111
+ 引用内容:
10112
+ - 表设计规范 → DDL编写
10113
+ - 查询规范 → SQL编写
10114
+ - 性能规范 → 索引设计
10115
+ ```
10116
+
10117
+ ---
10118
+
10119
+ ## Phase 4: 影响评估与风险分析
10120
+
10121
+ ### 4.1 影响评估
10122
+
10123
+ ```yaml
10124
+ 评估维度:
10125
+ 代码影响:
10126
+ - 新增代码量估算
10127
+ - 修改代码范围
10128
+ - 测试代码需求
10129
+
10130
+ 数据影响:
10131
+ - 数据迁移需求
10132
+ - 数据一致性风险
10133
+ - 备份恢复策略
10134
+
10135
+ 性能影响:
10136
+ - 新增负载评估
10137
+ - 资源需求变化
10138
+ - 性能测试要求
10139
+
10140
+ 部署影响:
10141
+ - 部署步骤变更
10142
+ - 配置变更
10143
+ - 回滚方案
10144
+ ```
10145
+
10146
+ ### 4.2 风险分析
10147
+
10148
+ ```yaml
10149
+ 风险分析:
10150
+ 技术风险:
10151
+ - 新技术引入风险
10152
+ - 兼容性风险
10153
+ - 性能风险
10154
+
10155
+ 业务风险:
10156
+ - 功能影响范围
10157
+ - 数据安全风险
10158
+ - 服务可用性风险
10159
+
10160
+ 实施风险:
10161
+ - 实施复杂度
10162
+ - 团队技能匹配
10163
+ - 时间约束
10164
+
10165
+ 缓解措施:
10166
+ - 每个风险的缓解方案
10167
+ - 监控和告警策略
10168
+ - 应急预案
10169
+ ```
10170
+
10171
+ ---
10172
+
10173
+ ## Phase 5: 输出架构增量文档
10174
+
10175
+ ### 5.1 文档结构
10176
+
10177
+ ```yaml
10178
+ 文档结构:
10179
+ 元信息:
10180
+ - 文档版本
10181
+ - 生成时间
10182
+ - 关联PRD
10183
+ - 关联知识库版本
10184
+
10185
+ 变动总览:
10186
+ - 变动等级
10187
+ - 主要变动领域
10188
+ - 风险等级
10189
+
10190
+ 详细设计:
10191
+ - 模块增量设计
10192
+ - 数据模型增量设计
10193
+ - 接口增量设计
10194
+ - 中间件增量设计
10195
+
10196
+ 实施指南:
10197
+ - 实施顺序
10198
+ - 依赖关系
10199
+ - 检查点
10200
+
10201
+ 知识引用:
10202
+ - 引用的规范文档
10203
+ - 代码示例来源
10204
+
10205
+ 下游交接:
10206
+ - 开发者交接
10207
+ - QA交接
10208
+ ```
10209
+
10210
+ ### 5.2 输出文件
10211
+
10212
+ ```yaml
10213
+ 主输出:
10214
+ 架构增量文档:
10215
+ 路径: docs/architecture-increment.md
10216
+ 格式: Markdown
10217
+
10218
+ 辅助输出:
10219
+ 变动清单:
10220
+ 路径: docs/architecture-changes.yaml
10221
+ 格式: YAML
10222
+ 内容: 结构化的变动清单,便于追踪
10223
+
10224
+ DDL脚本:
10225
+ 路径: docs/ddl/
10226
+ 格式: SQL
10227
+ 内容: 数据库变更脚本
10228
+
10229
+ 知识引用索引:
10230
+ 路径: docs/architecture-knowledge-refs.md
10231
+ 内容: 设计中引用的知识库文档清单
10232
+ ```
10233
+
10234
+ ---
10235
+
10236
+ ## Phase 6: 下游交接
10237
+
10238
+ ### 6.1 交接给开发者
10239
+
10240
+ ```yaml
10241
+ 开发者交接:
10242
+ 必读文件:
10243
+ - docs/architecture-increment.md # 架构增量设计
10244
+ - docs/prd.md # PRD文档
10245
+ - docs/rag/technical/coding-standards/ # 编码规范
10246
+
10247
+ 关注点:
10248
+ - 新增模块的包结构
10249
+ - 数据模型变更
10250
+ - 中间件使用方式(含代码示例)
10251
+ - 接口设计规范
10252
+
10253
+ 建议命令: "*start-development docs/architecture-increment.md"
10254
+ ```
10255
+
10256
+ ### 6.2 交接给QA
10257
+
10258
+ ```yaml
10259
+ QA交接:
10260
+ 必读文件:
10261
+ - docs/architecture-increment.md # 架构增量设计(测试策略章节)
10262
+ - docs/prd.md # PRD文档(验收标准)
10263
+
10264
+ 关注点:
10265
+ - 功能测试范围
10266
+ - 集成测试要求
10267
+ - 回归测试范围
10268
+ - 性能测试要求
10269
+
10270
+ 建议命令: "*create-test-plan docs/architecture-increment.md"
10271
+ ```
10272
+
10273
+ ---
10274
+
10275
+ ## 使用说明
10276
+
10277
+ ### 激活命令
10278
+
10279
+ ```
10280
+ *create-incremental-architecture [prd_path] [rag_path]
10281
+ ```
10282
+
10283
+ ### 执行参数
10284
+
10285
+ ```yaml
10286
+ 参数:
10287
+ prd_path: PRD文档路径 (默认: docs/prd.md)
10288
+ rag_path: RAG知识目录路径 (默认: docs/rag/)
10289
+ output_path: 输出路径 (默认: docs/architecture-increment.md)
10290
+ interactive: 交互模式 (默认: true)
10291
+ ```
10292
+
10293
+ ### 交互模式流程
10294
+
10295
+ 1. **验证阶段**: 检查上游交接物完整性
10296
+ 2. **分析阶段**: 展示架构差异分析结果,确认变动点
10297
+ 3. **设计阶段**: 逐模块进行增量设计,关键节点请求确认
10298
+ 4. **评估阶段**: 展示影响评估和风险分析
10299
+ 5. **输出阶段**: 生成架构增量文档,提示下游交接
10300
+
10301
+ ### YOLO模式
10302
+
10303
+ 通过 `*yolo` 命令切换YOLO模式,一次性完成所有步骤,跳过中间确认环节。
10304
+
10305
+ ---
10306
+
10307
+ ## 任务完成标志
10308
+
10309
+ ```yaml
10310
+ 完成条件:
10311
+ 必要输出:
10312
+ - docs/architecture-increment.md
10313
+
10314
+ 完成提示: |
10315
+ ✅ 架构增量设计完成!
10316
+
10317
+ 📄 输出文件: docs/architecture-increment.md
10318
+ 📊 变动等级: {change_level}
10319
+ ⚠️ 风险等级: {risk_level}
10320
+
10321
+ 📋 变动摘要:
10322
+ - 模块变动: {module_changes}
10323
+ - 数据模型变动: {data_model_changes}
10324
+ - 接口变动: {api_changes}
10325
+ - 中间件变动: {middleware_changes}
10326
+
10327
+ 🔄 下一步建议:
10328
+ - 开发实施: *start-development docs/architecture-increment.md
10329
+ - 测试计划: *create-test-plan docs/architecture-increment.md
10330
+
10331
+ 💡 请在开发前确认架构设计,特别关注:
10332
+ - 风险清单中的高风险项
10333
+ - 数据迁移方案
10334
+ - 回滚策略
10335
+ ```
10336
+ ==================== END: .xiaoma-core/tasks/create-incremental-architecture.md ====================
10337
+
8701
10338
  ==================== START: .xiaoma-core/templates/architecture-tmpl.yaml ====================
8702
10339
  template:
8703
10340
  id: architecture-template-v2
@@ -11033,6 +12670,610 @@ sections:
11033
12670
  instruction: 在运行检查清单前,提议输出完整的架构文档。一旦用户确认,执行 architect-checklist 并在此处填充结果。
11034
12671
  ==================== END: .xiaoma-core/templates/fullstack-architecture-tmpl.yaml ====================
11035
12672
 
12673
+ ==================== START: .xiaoma-core/templates/incremental-architecture-tmpl.yaml ====================
12674
+ template:
12675
+ id: incremental-architecture-template-v1
12676
+ name: 架构增量设计文档
12677
+ version: 1.0
12678
+ description: 基于知识库和PRD进行架构增量设计,识别技术变动并生成增量架构文档
12679
+ output:
12680
+ format: markdown
12681
+ filename: docs/architecture-increment.md
12682
+ title: "{{project_name}} 架构增量设计文档"
12683
+
12684
+ workflow:
12685
+ mode: interactive
12686
+ elicitation: advanced-elicitation
12687
+ upstream:
12688
+ agents:
12689
+ - analyst # 提供技术知识库
12690
+ - pm # 提供PRD文档
12691
+ required_files:
12692
+ - docs/prd.md
12693
+ - docs/rag/technical/architecture.md
12694
+ optional_files:
12695
+ - docs/rag/technical/tech-stack.md
12696
+ - docs/rag/technical/data-model.md
12697
+ - docs/rag/technical/module-structure.md
12698
+ - docs/rag/technical/coding-standards/*
12699
+ - docs/rag/technical/middleware/*
12700
+ - docs/rag/constraints/*
12701
+
12702
+ sections:
12703
+ - id: input-validation
12704
+ title: 输入验证
12705
+ internal: true
12706
+ instruction: |
12707
+ 在开始架构设计之前,执行以下验证:
12708
+
12709
+ 1. **检查PRD文档**:
12710
+ - docs/prd.md 或 docs/epic-{name}.md 是否存在
12711
+ - 提取功能需求(FR)、非功能需求(NFR)、数据实体、技术约束
12712
+
12713
+ 2. **检查技术知识库**:
12714
+ - docs/rag/technical/architecture.md (现有架构)
12715
+ - docs/rag/technical/data-model.md (现有数据模型)
12716
+ - docs/rag/technical/coding-standards/ (编码规范)
12717
+ - docs/rag/technical/middleware/ (中间件规范)
12718
+
12719
+ 3. **加载现有架构信息**:
12720
+ - 架构模式、技术栈、模块结构
12721
+ - 现有数据实体和关系
12722
+ - 编码规范和中间件使用方式
12723
+
12724
+ 如果缺少必需文件,提示:
12725
+ "⚠️ 缺少必需的输入文件:
12726
+ - PRD文档:请先执行 PM 智能体 *create-prd-from-rag
12727
+ - 技术知识库:请先执行 Analyst 智能体完善技术知识"
12728
+
12729
+ - id: document-header
12730
+ title: 文档信息
12731
+ sections:
12732
+ - id: meta-info
12733
+ title: 元信息
12734
+ template: |
12735
+ | 属性 | 值 |
12736
+ |------|-----|
12737
+ | 文档版本 | {{version}} |
12738
+ | 生成时间 | {{timestamp}} |
12739
+ | 关联PRD | {{prd_path}} |
12740
+ | 技术知识库版本 | {{rag_version}} |
12741
+ | 架构师 | Architect Agent |
12742
+ - id: changelog
12743
+ title: 变更日志
12744
+ type: table
12745
+ columns: [日期, 版本, 变更内容, 作者]
12746
+
12747
+ - id: existing-architecture-summary
12748
+ title: 现有架构概要
12749
+ instruction: |
12750
+ 从技术知识库提取现有架构信息,作为增量设计的基线。
12751
+
12752
+ **来源**:
12753
+ - docs/rag/technical/architecture.md
12754
+ - docs/rag/technical/tech-stack.md
12755
+ - docs/rag/technical/module-structure.md
12756
+ sections:
12757
+ - id: architecture-pattern
12758
+ title: 架构模式
12759
+ instruction: 从 architecture.md 提取架构模式描述
12760
+ template: |
12761
+ **架构类型**: {{architecture_type}}
12762
+ **分层结构**: {{layer_structure}}
12763
+ **关键特征**: {{key_characteristics}}
12764
+ - id: tech-stack-baseline
12765
+ title: 技术栈基线
12766
+ type: table
12767
+ columns: [类别, 技术, 版本, 用途]
12768
+ instruction: 从 tech-stack.md 提取当前技术栈
12769
+ - id: module-structure-baseline
12770
+ title: 模块结构基线
12771
+ instruction: 从 module-structure.md 提取现有模块结构
12772
+ type: code
12773
+ language: plaintext
12774
+ - id: data-model-baseline
12775
+ title: 数据模型基线
12776
+ instruction: |
12777
+ 从 data-model.md 提取现有数据实体清单。
12778
+ 使用Mermaid ER图展示核心实体关系。
12779
+
12780
+ - id: requirement-extraction
12781
+ title: 需求提取
12782
+ instruction: |
12783
+ 从PRD文档提取与架构相关的需求。
12784
+
12785
+ **来源**:
12786
+ - docs/prd.md 或 docs/epic-{name}.md
12787
+ sections:
12788
+ - id: functional-requirements
12789
+ title: 功能性需求摘要
12790
+ type: table
12791
+ columns: [需求ID, 需求描述, 架构影响, 优先级]
12792
+ instruction: |
12793
+ 提取PRD中的功能性需求(FR),评估每个需求的架构影响:
12794
+ - 无影响:完全在现有架构内实现
12795
+ - 小影响:需要新增类/方法
12796
+ - 中影响:需要新增模块/表
12797
+ - 大影响:需要架构调整
12798
+ - id: non-functional-requirements
12799
+ title: 非功能性需求摘要
12800
+ type: table
12801
+ columns: [需求ID, 需求描述, 约束类型, 架构影响]
12802
+ instruction: 提取PRD中的非功能性需求(NFR),特别关注性能、安全、可用性约束
12803
+ - id: data-requirements
12804
+ title: 数据需求摘要
12805
+ type: table
12806
+ columns: [实体名称, 操作类型, 核心属性, 关联实体]
12807
+ instruction: |
12808
+ 从PRD中提取数据实体需求,标注:
12809
+ - 新增:PRD中定义的新实体
12810
+ - 修改:需要变更的现有实体
12811
+ - 复用:直接使用的现有实体
12812
+
12813
+ - id: change-analysis
12814
+ title: 架构变动分析
12815
+ instruction: |
12816
+ 对比现有架构与新需求,识别所有技术变动点。
12817
+
12818
+ **分析维度**:
12819
+ 1. 架构层面变动
12820
+ 2. 技术栈变动
12821
+ 3. 数据模型变动
12822
+ 4. 接口变动
12823
+ 5. 中间件变动
12824
+
12825
+ 展示分析结果,请用户确认变动识别是否准确。
12826
+ elicit: true
12827
+ sections:
12828
+ - id: change-overview
12829
+ title: 变动总览
12830
+ template: |
12831
+ | 维度 | 变动等级 | 变动数量 | 主要变动 |
12832
+ |------|----------|----------|----------|
12833
+ | 架构层面 | {{arch_level}} | {{arch_count}} | {{arch_main}} |
12834
+ | 技术栈 | {{tech_level}} | {{tech_count}} | {{tech_main}} |
12835
+ | 数据模型 | {{data_level}} | {{data_count}} | {{data_main}} |
12836
+ | 接口 | {{api_level}} | {{api_count}} | {{api_main}} |
12837
+ | 中间件 | {{mw_level}} | {{mw_count}} | {{mw_main}} |
12838
+
12839
+ **总体变动等级**: {{overall_level}}
12840
+ **风险等级**: {{risk_level}}
12841
+ - id: architecture-changes
12842
+ title: 架构层面变动
12843
+ condition: 存在架构层面变动
12844
+ sections:
12845
+ - id: new-modules
12846
+ title: 新增模块
12847
+ type: table
12848
+ columns: [模块名称, 职责, 所属层, 关联需求]
12849
+ - id: modified-modules
12850
+ title: 修改模块
12851
+ type: table
12852
+ columns: [模块名称, 变更内容, 变更原因, 关联需求]
12853
+ - id: tech-stack-changes
12854
+ title: 技术栈变动
12855
+ condition: 存在技术栈变动
12856
+ sections:
12857
+ - id: new-technologies
12858
+ title: 新增技术
12859
+ type: table
12860
+ columns: [技术名称, 版本, 用途, 引入理由, 替代方案]
12861
+ - id: version-upgrades
12862
+ title: 版本升级
12863
+ type: table
12864
+ columns: [技术名称, 当前版本, 目标版本, 升级原因, 兼容性风险]
12865
+ - id: data-model-changes
12866
+ title: 数据模型变动
12867
+ sections:
12868
+ - id: new-entities
12869
+ title: 新增实体
12870
+ type: table
12871
+ columns: [实体名称, 表名, 核心字段, 关联实体, 关联需求]
12872
+ - id: modified-entities
12873
+ title: 修改实体
12874
+ type: table
12875
+ columns: [实体名称, 变更字段, 变更类型, 兼容性, 关联需求]
12876
+ - id: new-relationships
12877
+ title: 新增关系
12878
+ type: table
12879
+ columns: [源实体, 目标实体, 关系类型, 关联字段, 关联需求]
12880
+ - id: api-changes
12881
+ title: 接口变动
12882
+ condition: 存在接口变动
12883
+ sections:
12884
+ - id: new-apis
12885
+ title: 新增API
12886
+ type: table
12887
+ columns: [接口路径, 方法, 功能描述, 关联需求]
12888
+ - id: modified-apis
12889
+ title: 修改API
12890
+ type: table
12891
+ columns: [接口路径, 变更内容, 兼容性策略, 关联需求]
12892
+ - id: middleware-changes
12893
+ title: 中间件变动
12894
+ condition: 存在中间件变动
12895
+ sections:
12896
+ - id: redis-changes
12897
+ title: Redis变动
12898
+ type: table
12899
+ columns: [Key名称, 数据结构, 用途, 过期策略, 关联需求]
12900
+ - id: mq-changes
12901
+ title: 消息队列变动
12902
+ type: table
12903
+ columns: [Topic/Queue, 消息类型, 生产者, 消费者, 关联需求]
12904
+ - id: scheduler-changes
12905
+ title: 定时任务变动
12906
+ type: table
12907
+ columns: [任务名称, 执行周期, 功能描述, 关联需求]
12908
+
12909
+ - id: incremental-design
12910
+ title: 增量设计详情
12911
+ instruction: |
12912
+ 为每个变动点提供详细的增量设计方案。
12913
+ 设计必须遵循知识库中的编码规范和中间件使用规范。
12914
+ elicit: true
12915
+ sections:
12916
+ - id: module-design
12917
+ title: 模块增量设计
12918
+ repeatable: true
12919
+ instruction: |
12920
+ 为每个新增/修改的模块提供详细设计。
12921
+ 包结构必须遵循 docs/rag/technical/module-structure.md 中的规范。
12922
+ sections:
12923
+ - id: module-detail
12924
+ title: "{{module_name}}"
12925
+ template: |
12926
+ **模块类型**: 新增 / 修改
12927
+ **职责描述**: {{responsibility}}
12928
+ **所属层**: {{layer}}
12929
+ **关联需求**: {{related_requirements}}
12930
+ sections:
12931
+ - id: package-structure
12932
+ title: 包结构设计
12933
+ instruction: 遵循现有模块结构规范设计包结构
12934
+ type: code
12935
+ language: plaintext
12936
+ - id: class-design
12937
+ title: 核心类设计
12938
+ instruction: |
12939
+ 列出核心类及其职责,命名遵循编码规范:
12940
+ - Controller: {Module}Controller
12941
+ - Service: {Module}Service / {Module}ServiceImpl
12942
+ - DAO: {Module}Mapper / {Module}Repository
12943
+ type: table
12944
+ columns: [类名, 类型, 职责, 依赖]
12945
+ - id: integration-points
12946
+ title: 集成点
12947
+ instruction: 描述与现有模块的集成方式
12948
+ type: bullet-list
12949
+
12950
+ - id: data-model-design
12951
+ title: 数据模型增量设计
12952
+ repeatable: true
12953
+ instruction: |
12954
+ 为每个新增/修改的数据实体提供详细设计。
12955
+ 设计必须遵循 docs/rag/technical/sql-standards/ 中的规范。
12956
+ sections:
12957
+ - id: entity-detail
12958
+ title: "{{entity_name}}"
12959
+ template: |
12960
+ **操作类型**: 新增 / 修改
12961
+ **表名**: {{table_name}}
12962
+ **关联需求**: {{related_requirements}}
12963
+ sections:
12964
+ - id: field-design
12965
+ title: 字段设计
12966
+ type: table
12967
+ columns: [字段名, 类型, 长度, 约束, 默认值, 说明]
12968
+ instruction: 字段命名遵循数据库命名规范
12969
+ - id: index-design
12970
+ title: 索引设计
12971
+ type: table
12972
+ columns: [索引名, 类型, 字段, 用途]
12973
+ instruction: 索引命名遵循 idx_{表名}_{字段} 规范
12974
+ - id: ddl-script
12975
+ title: DDL脚本
12976
+ type: code
12977
+ language: sql
12978
+ instruction: |
12979
+ 生成DDL脚本,遵循SQL规范:
12980
+ - 包含完整的字段定义
12981
+ - 包含索引创建
12982
+ - 包含注释
12983
+ - id: migration-script
12984
+ title: 迁移脚本
12985
+ condition: 修改现有表
12986
+ type: code
12987
+ language: sql
12988
+ instruction: 生成安全的迁移脚本,考虑向后兼容性
12989
+
12990
+ - id: api-design
12991
+ title: 接口增量设计
12992
+ repeatable: true
12993
+ condition: 存在接口变动
12994
+ instruction: |
12995
+ 为每个新增/修改的API提供详细设计。
12996
+ 设计必须遵循现有API规范。
12997
+ sections:
12998
+ - id: api-detail
12999
+ title: "{{api_name}}"
13000
+ template: |
13001
+ **操作类型**: 新增 / 修改
13002
+ **接口路径**: {{api_path}}
13003
+ **请求方法**: {{http_method}}
13004
+ **功能描述**: {{description}}
13005
+ **关联需求**: {{related_requirements}}
13006
+ sections:
13007
+ - id: request-design
13008
+ title: 请求设计
13009
+ sections:
13010
+ - id: request-params
13011
+ title: 请求参数
13012
+ type: table
13013
+ columns: [参数名, 类型, 必填, 说明, 示例]
13014
+ - id: request-body
13015
+ title: 请求体
13016
+ type: code
13017
+ language: json
13018
+ - id: response-design
13019
+ title: 响应设计
13020
+ sections:
13021
+ - id: success-response
13022
+ title: 成功响应
13023
+ type: code
13024
+ language: json
13025
+ - id: error-codes
13026
+ title: 错误码
13027
+ type: table
13028
+ columns: [错误码, 错误信息, 触发场景]
13029
+ - id: controller-skeleton
13030
+ title: Controller骨架代码
13031
+ type: code
13032
+ language: java
13033
+ instruction: |
13034
+ 生成Controller骨架代码,遵循编码规范:
13035
+ - 使用正确的注解
13036
+ - 参数校验
13037
+ - 统一响应格式
13038
+
13039
+ - id: middleware-design
13040
+ title: 中间件增量设计
13041
+ condition: 存在中间件变动
13042
+ instruction: |
13043
+ 为中间件使用提供详细设计。
13044
+ 必须参考 docs/rag/technical/middleware/ 中的规范和代码示例。
13045
+ sections:
13046
+ - id: redis-design
13047
+ title: Redis设计
13048
+ condition: 存在Redis变动
13049
+ repeatable: true
13050
+ sections:
13051
+ - id: redis-detail
13052
+ title: "{{redis_key_name}}"
13053
+ template: |
13054
+ **Key模式**: {{key_pattern}}
13055
+ **数据结构**: {{data_structure}}
13056
+ **用途**: {{purpose}}
13057
+ **过期策略**: {{expiration}}
13058
+ **关联需求**: {{related_requirements}}
13059
+ sections:
13060
+ - id: redis-code-example
13061
+ title: 代码示例
13062
+ type: code
13063
+ language: java
13064
+ instruction: 参考 docs/rag/technical/middleware/redis.md 中的代码示例
13065
+ - id: mq-design
13066
+ title: 消息队列设计
13067
+ condition: 存在MQ变动
13068
+ repeatable: true
13069
+ sections:
13070
+ - id: mq-detail
13071
+ title: "{{topic_name}}"
13072
+ template: |
13073
+ **Topic/Queue**: {{topic_queue}}
13074
+ **消息类型**: {{message_type}}
13075
+ **生产者**: {{producer}}
13076
+ **消费者**: {{consumer}}
13077
+ **关联需求**: {{related_requirements}}
13078
+ sections:
13079
+ - id: message-schema
13080
+ title: 消息格式
13081
+ type: code
13082
+ language: json
13083
+ - id: producer-code
13084
+ title: 生产者代码示例
13085
+ type: code
13086
+ language: java
13087
+ instruction: 参考 docs/rag/technical/middleware/mq.md 中的代码示例
13088
+ - id: consumer-code
13089
+ title: 消费者代码示例
13090
+ type: code
13091
+ language: java
13092
+ - id: scheduler-design
13093
+ title: 定时任务设计
13094
+ condition: 存在定时任务变动
13095
+ repeatable: true
13096
+ sections:
13097
+ - id: scheduler-detail
13098
+ title: "{{task_name}}"
13099
+ template: |
13100
+ **任务名称**: {{task_name}}
13101
+ **执行周期**: {{cron_expression}}
13102
+ **功能描述**: {{description}}
13103
+ **关联需求**: {{related_requirements}}
13104
+ sections:
13105
+ - id: scheduler-code
13106
+ title: 任务代码示例
13107
+ type: code
13108
+ language: java
13109
+ instruction: 参考 docs/rag/technical/middleware/scheduler.md 中的代码示例
13110
+
13111
+ - id: impact-assessment
13112
+ title: 影响评估
13113
+ instruction: 评估架构变动的影响范围和风险
13114
+ elicit: true
13115
+ sections:
13116
+ - id: code-impact
13117
+ title: 代码影响
13118
+ template: |
13119
+ **新增代码量估算**: {{new_code_estimate}}
13120
+ **修改代码范围**: {{modified_code_scope}}
13121
+ **测试代码需求**: {{test_code_requirement}}
13122
+ - id: data-impact
13123
+ title: 数据影响
13124
+ template: |
13125
+ **数据迁移需求**: {{migration_requirement}}
13126
+ **数据一致性风险**: {{consistency_risk}}
13127
+ **备份恢复策略**: {{backup_strategy}}
13128
+ - id: performance-impact
13129
+ title: 性能影响
13130
+ template: |
13131
+ **新增负载评估**: {{load_estimate}}
13132
+ **资源需求变化**: {{resource_change}}
13133
+ **性能测试要求**: {{performance_test_requirement}}
13134
+ - id: deployment-impact
13135
+ title: 部署影响
13136
+ template: |
13137
+ **部署步骤变更**: {{deployment_change}}
13138
+ **配置变更**: {{config_change}}
13139
+ **回滚方案**: {{rollback_plan}}
13140
+
13141
+ - id: risk-analysis
13142
+ title: 风险分析
13143
+ sections:
13144
+ - id: risk-list
13145
+ title: 风险清单
13146
+ type: table
13147
+ columns: [风险ID, 风险类型, 风险描述, 可能性, 影响, 缓解措施]
13148
+ instruction: |
13149
+ 识别所有风险,类型包括:
13150
+ - 技术风险:新技术引入、兼容性、性能
13151
+ - 业务风险:功能影响、数据安全、服务可用性
13152
+ - 实施风险:复杂度、技能匹配、时间约束
13153
+ - id: critical-risks
13154
+ title: 关键风险详述
13155
+ instruction: 对高风险项提供详细分析和缓解方案
13156
+ repeatable: true
13157
+ template: |
13158
+ ### {{risk_name}}
13159
+
13160
+ **风险描述**: {{description}}
13161
+ **可能性**: {{probability}}
13162
+ **影响程度**: {{impact}}
13163
+
13164
+ **根因分析**: {{root_cause}}
13165
+
13166
+ **缓解措施**:
13167
+ {{mitigation_measures}}
13168
+
13169
+ **应急预案**:
13170
+ {{contingency_plan}}
13171
+
13172
+ **监控指标**:
13173
+ {{monitoring_metrics}}
13174
+
13175
+ - id: implementation-guide
13176
+ title: 实施指南
13177
+ sections:
13178
+ - id: implementation-sequence
13179
+ title: 实施顺序
13180
+ instruction: |
13181
+ 基于依赖关系,规划实施顺序。
13182
+ 每个阶段对应PRD中的Epic/Story。
13183
+ type: numbered-list
13184
+ template: |
13185
+ 1. **阶段1: {{phase1_name}}**
13186
+ - Story: {{story_refs}}
13187
+ - 前置条件: {{prerequisites}}
13188
+ - 产出物: {{deliverables}}
13189
+ - 检查点: {{checkpoints}}
13190
+ - id: dependency-diagram
13191
+ title: 依赖关系图
13192
+ type: mermaid
13193
+ mermaid_type: graph
13194
+ instruction: 使用Mermaid图展示实施依赖关系
13195
+ - id: checkpoints
13196
+ title: 关键检查点
13197
+ type: table
13198
+ columns: [检查点, 阶段, 验证内容, 负责人]
13199
+
13200
+ - id: knowledge-references
13201
+ title: 知识引用索引
13202
+ instruction: 列出设计中引用的所有知识库文档
13203
+ sections:
13204
+ - id: architecture-refs
13205
+ title: 架构知识引用
13206
+ type: table
13207
+ columns: [文件路径, 引用章节, 引用内容]
13208
+ - id: coding-standard-refs
13209
+ title: 编码规范引用
13210
+ type: table
13211
+ columns: [文件路径, 引用规范, 应用位置]
13212
+ - id: middleware-refs
13213
+ title: 中间件规范引用
13214
+ type: table
13215
+ columns: [文件路径, 引用示例, 应用位置]
13216
+
13217
+ - id: next-steps
13218
+ title: 后续步骤
13219
+ sections:
13220
+ - id: developer-handoff
13221
+ title: 开发者交接
13222
+ instruction: |
13223
+ 生成给开发者的交接提示,包含:
13224
+ - 需要阅读的文档清单
13225
+ - 编码规范要点
13226
+ - 实施注意事项
13227
+ template: |
13228
+ **交接给开发者**
13229
+
13230
+ 请基于本架构增量设计文档进行开发:
13231
+
13232
+ **必读文档**:
13233
+ - 架构增量设计: docs/architecture-increment.md
13234
+ - PRD文档: {{prd_path}}
13235
+ - 编码规范: docs/rag/technical/coding-standards/
13236
+
13237
+ **开发重点**:
13238
+ - 变动模块: {{changed_modules}}
13239
+ - 数据模型变更: {{data_changes}}
13240
+ - 接口变更: {{api_changes}}
13241
+
13242
+ **注意事项**:
13243
+ - 严格遵循编码规范
13244
+ - 参考中间件代码示例
13245
+ - 每个Story完成后进行集成验证
13246
+
13247
+ **执行命令**: *start-development docs/architecture-increment.md
13248
+ - id: qa-handoff
13249
+ title: QA交接
13250
+ instruction: |
13251
+ 生成给QA的交接提示,包含:
13252
+ - 测试范围
13253
+ - 重点测试项
13254
+ - 回归测试要求
13255
+ template: |
13256
+ **交接给QA**
13257
+
13258
+ 请基于本架构增量设计制定测试计划:
13259
+
13260
+ **必读文档**:
13261
+ - 架构增量设计: docs/architecture-increment.md (影响评估章节)
13262
+ - PRD文档: {{prd_path}} (验收标准)
13263
+
13264
+ **测试范围**:
13265
+ - 新增功能: {{new_features}}
13266
+ - 修改功能: {{modified_features}}
13267
+ - 回归范围: {{regression_scope}}
13268
+
13269
+ **重点关注**:
13270
+ - 数据迁移验证
13271
+ - 接口兼容性测试
13272
+ - 性能影响验证
13273
+
13274
+ **执行命令**: *create-test-plan docs/architecture-increment.md
13275
+ ==================== END: .xiaoma-core/templates/incremental-architecture-tmpl.yaml ====================
13276
+
11036
13277
  ==================== START: .xiaoma-core/checklists/architect-checklist.md ====================
11037
13278
  <!-- Powered by XiaoMa™ Core -->
11038
13279