@zeyue0329/xiaoma-cli 1.0.48 → 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.
@@ -298,6 +298,7 @@ commands:
298
298
  - create-brownfield-story: 运行任务 brownfield-create-story.md
299
299
  - create-epic: 为现有项目项目创建模块 (任务 brownfield-create-epic)
300
300
  - create-prd: 使用模板 prd-tmpl.yaml 运行任务 create-doc.md
301
+ - create-prd-from-rag: 基于Analyst需求分析产出物生成PRD (任务 create-prd-from-rag.md,模板 prd-from-rag-tmpl.yaml)
301
302
  - create-story: 从需求创建用户故事 (任务 brownfield-create-story)
302
303
  - doc-out: 将完整文档输出到当前目标文件
303
304
  - shard-prd: 为提供的 prd.md 运行任务 shard-doc.md (如果未找到则询问)
@@ -315,11 +316,13 @@ dependencies:
315
316
  - correct-course.md
316
317
  - create-deep-research-prompt.md
317
318
  - create-doc.md
319
+ - create-prd-from-rag.md
318
320
  - execute-checklist.md
319
321
  - shard-doc.md
320
322
  templates:
321
323
  - brownfield-prd-tmpl.yaml
322
324
  - prd-tmpl.yaml
325
+ - prd-from-rag-tmpl.yaml
323
326
  ```
324
327
  ==================== END: .xiaoma-core/agents/pm.md ====================
325
328
 
@@ -363,6 +366,7 @@ commands:
363
366
  - create-brownfield-architecture: 使用 create-doc 和 brownfield-architecture-tmpl.yaml
364
367
  - create-front-end-architecture: 使用 create-doc 和 front-end-architecture-tmpl.yaml
365
368
  - create-full-stack-architecture: 使用 create-doc 和 fullstack-architecture-tmpl.yaml
369
+ - create-incremental-architecture: 基于知识库和PRD进行架构增量设计 (任务 create-incremental-architecture.md,模板 incremental-architecture-tmpl.yaml)
366
370
  - doc-out: 将完整文档输出到当前目标文件
367
371
  - document-project: 执行任务 document-project.md
368
372
  - execute-checklist {checklist}: 运行任务 execute-checklist (默认为->architect-checklist)
@@ -379,6 +383,7 @@ dependencies:
379
383
  tasks:
380
384
  - create-deep-research-prompt.md
381
385
  - create-doc.md
386
+ - create-incremental-architecture.md
382
387
  - document-project.md
383
388
  - execute-checklist.md
384
389
  - shard-doc.md
@@ -387,6 +392,7 @@ dependencies:
387
392
  - brownfield-architecture-tmpl.yaml
388
393
  - front-end-architecture-tmpl.yaml
389
394
  - fullstack-architecture-tmpl.yaml
395
+ - incremental-architecture-tmpl.yaml
390
396
  ```
391
397
  ==================== END: .xiaoma-core/agents/architect.md ====================
392
398
 
@@ -7349,6 +7355,444 @@ The story creation is successful when:
7349
7355
  - **Implicit:** An annotated change-checklist (or the record of its completion) reflecting the discussions, findings, and decisions made during the process.
7350
7356
  ==================== END: .xiaoma-core/tasks/correct-course.md ====================
7351
7357
 
7358
+ ==================== START: .xiaoma-core/tasks/create-prd-from-rag.md ====================
7359
+ # 基于需求分析创建PRD任务
7360
+
7361
+ ## Purpose
7362
+
7363
+ 基于 Analyst 智能体的需求分析产出物(`docs/rag/` 目录),结合原始需求文档,生成高质量的 PRD 或 Epic 文档。本任务是 Analyst 智能体的下游任务,承接需求分析报告并转化为可执行的产品文档。
7364
+
7365
+ ## 上游交接物
7366
+
7367
+ ```yaml
7368
+ 必需输入:
7369
+ - docs/rag/_analysis-report.md # 需求分析报告(核心输入)
7370
+ - docs/rag/_requirement-parsing.yaml # 需求解析结果
7371
+ - req.txt # 原始需求文档
7372
+
7373
+ 可选输入:
7374
+ - docs/rag/_questions.md # 问题清单
7375
+ - docs/rag/_index.md # 知识索引
7376
+ - docs/rag/business/ # 业务知识
7377
+ - docs/rag/technical/ # 技术知识
7378
+ - docs/rag/constraints/ # 约束条件
7379
+ ```
7380
+
7381
+ ## Workflow Overview
7382
+
7383
+ ```
7384
+ Analyst产出物 → 输入验证 → 复杂度评估 → 文档类型选择 → 文档生成 → 质量检查
7385
+ ```
7386
+
7387
+ ---
7388
+
7389
+ ## Phase 1: 输入验证与上下文加载
7390
+
7391
+ ### 1.1 验证上游交接物
7392
+
7393
+ ```yaml
7394
+ 执行步骤:
7395
+ 步骤1_检查必需文件:
7396
+ 动作: 检查 docs/rag/ 目录是否存在以下文件
7397
+ 必需文件:
7398
+ - _analysis-report.md
7399
+ - _requirement-parsing.yaml
7400
+ 缺失处理: |
7401
+ 如果缺失必需文件,提示用户:
7402
+ "未找到需求分析报告。请先执行 Analyst 智能体的 *analyze-requirement 命令完成需求分析。"
7403
+
7404
+ 步骤2_加载分析报告:
7405
+ 动作: 读取并解析 _analysis-report.md
7406
+ 提取内容:
7407
+ - 需求概述(背景、目标、范围)
7408
+ - 功能分析(功能清单、优先级、依赖关系)
7409
+ - 用户分析(角色、旅程)
7410
+ - 数据分析(实体、关系)
7411
+ - 技术分析(可行性、兼容性)
7412
+ - 业务规则汇总
7413
+ - 差距分析
7414
+ - 风险分析
7415
+ - 待澄清事项
7416
+
7417
+ 步骤3_加载原始需求:
7418
+ 动作: 读取 req.txt 原始需求文档
7419
+ 目的: 确保不遗漏原始需求中的细节
7420
+
7421
+ 步骤4_加载知识上下文:
7422
+ 动作: 扫描 docs/rag/ 子目录,加载相关知识文件
7423
+ 加载顺序:
7424
+ - technical/architecture.md # 技术架构
7425
+ - technical/coding-standards/ # 编码规范
7426
+ - technical/data-model.md # 数据模型
7427
+ - business/ # 业务知识
7428
+ - constraints/ # 约束条件
7429
+ ```
7430
+
7431
+ ### 1.2 上下文整合
7432
+
7433
+ ```yaml
7434
+ 整合输出:
7435
+ 项目上下文:
7436
+ - 项目背景与目标
7437
+ - 技术栈与架构约束
7438
+ - 现有系统兼容性要求
7439
+
7440
+ 需求上下文:
7441
+ - 功能清单与优先级
7442
+ - 用户角色与权限
7443
+ - 数据实体与关系
7444
+ - 业务规则
7445
+
7446
+ 约束上下文:
7447
+ - 技术约束
7448
+ - 安全合规要求
7449
+ - 性能要求
7450
+
7451
+ 风险上下文:
7452
+ - 已识别风险
7453
+ - 待澄清事项
7454
+ ```
7455
+
7456
+ ---
7457
+
7458
+ ## Phase 2: 复杂度评估与文档类型选择
7459
+
7460
+ ### 2.1 复杂度评估矩阵
7461
+
7462
+ ```yaml
7463
+ 评估维度:
7464
+ 功能复杂度:
7465
+ 低: 功能点 <= 3,无复杂业务流程
7466
+ 中: 功能点 4-8,存在中等复杂度业务流程
7467
+ 高: 功能点 > 8,存在复杂业务流程或多系统集成
7468
+
7469
+ 技术复杂度:
7470
+ 低: 遵循现有模式,无架构变更
7471
+ 中: 部分新技术引入,小范围架构调整
7472
+ 高: 重大技术决策,架构级变更
7473
+
7474
+ 集成复杂度:
7475
+ 低: 单一系统,无外部集成
7476
+ 中: 2-3个系统集成
7477
+ 高: 多系统集成,复杂数据流
7478
+
7479
+ 风险等级:
7480
+ 低: 风险清单中无高风险项
7481
+ 中: 存在1-2个中等风险项
7482
+ 高: 存在高风险项或多个中等风险项
7483
+ ```
7484
+
7485
+ ### 2.2 文档类型选择规则
7486
+
7487
+ ```yaml
7488
+ 选择规则:
7489
+ 生成完整PRD:
7490
+ 条件:
7491
+ - 功能复杂度 >= 中 OR
7492
+ - 技术复杂度 >= 中 OR
7493
+ - 需要架构设计 OR
7494
+ - 涉及多个Epic
7495
+ 输出: docs/prd.md
7496
+ 模板: prd-from-rag-tmpl.yaml
7497
+
7498
+ 生成单Epic:
7499
+ 条件:
7500
+ - 功能复杂度 = 低
7501
+ - 技术复杂度 = 低
7502
+ - 可在1-3个Story内完成
7503
+ - 无重大架构变更
7504
+ 输出: docs/epic-{name}.md
7505
+ 模板: epic-from-rag-tmpl.yaml
7506
+
7507
+ 需要澄清:
7508
+ 条件:
7509
+ - 待澄清事项 > 5 OR
7510
+ - 存在阻塞性待澄清项
7511
+ 动作: 暂停生成,先与用户澄清关键问题
7512
+ ```
7513
+
7514
+ ### 2.3 交互确认
7515
+
7516
+ ```yaml
7517
+ 确认点:
7518
+ 展示内容:
7519
+ - 复杂度评估结果
7520
+ - 建议的文档类型
7521
+ - 预计的Epic/Story数量
7522
+ - 关键风险提示
7523
+
7524
+ 用户选项:
7525
+ - 确认并继续
7526
+ - 调整文档类型
7527
+ - 先澄清待定事项
7528
+ ```
7529
+
7530
+ ---
7531
+
7532
+ ## Phase 3: PRD文档生成
7533
+
7534
+ ### 3.1 PRD结构映射
7535
+
7536
+ 将分析报告内容映射到PRD结构:
7537
+
7538
+ ```yaml
7539
+ 映射规则:
7540
+ 目标与背景:
7541
+ 来源: 分析报告.需求概述
7542
+ 映射:
7543
+ - 需求背景 → PRD.背景上下文
7544
+ - 核心目标 → PRD.目标
7545
+ - 范围边界 → PRD.范围定义
7546
+
7547
+ 需求章节:
7548
+ 来源: 分析报告.功能分析 + 业务规则汇总
7549
+ 映射:
7550
+ - 功能清单 → PRD.功能性需求 (FR)
7551
+ - 业务规则 → PRD.功能性需求 (补充)
7552
+ - 技术分析.性能要求 → PRD.非功能性需求 (NFR)
7553
+ - 约束条件 → PRD.非功能性需求 (NFR)
7554
+
7555
+ UI设计目标:
7556
+ 来源: 分析报告.用户分析
7557
+ 映射:
7558
+ - 用户角色 → PRD.用户角色定义
7559
+ - 用户旅程 → PRD.关键交互范式
7560
+ - 功能清单中的UI相关项 → PRD.核心屏幕与视图
7561
+
7562
+ 技术假设:
7563
+ 来源: docs/rag/technical/ + 分析报告.技术分析
7564
+ 映射:
7565
+ - architecture.md → PRD.服务架构
7566
+ - coding-standards/ → PRD.编码规范约束
7567
+ - 技术可行性评估 → PRD.技术假设
7568
+
7569
+ Epic结构:
7570
+ 来源: 分析报告.功能分析
7571
+ 映射:
7572
+ - 功能清单(按优先级分组) → Epic列表
7573
+ - 功能依赖关系 → Story顺序
7574
+ - P0功能 → Epic 1 (核心功能)
7575
+ - P1功能 → Epic 2+ (增强功能)
7576
+
7577
+ 风险与待办:
7578
+ 来源: 分析报告.风险分析 + 待澄清事项
7579
+ 映射:
7580
+ - 风险清单 → PRD.风险评估
7581
+ - 待澄清事项 → PRD.开放问题
7582
+ ```
7583
+
7584
+ ### 3.2 Epic/Story 生成规则
7585
+
7586
+ ```yaml
7587
+ Epic生成规则:
7588
+ 分组策略:
7589
+ - 按功能模块分组
7590
+ - 每个Epic交付独立可测试的功能增量
7591
+ - Epic 1 优先包含P0功能
7592
+ - 后续Epic按优先级和依赖关系排列
7593
+
7594
+ Epic结构:
7595
+ - Epic标题
7596
+ - Epic目标 (2-3句话)
7597
+ - 包含的功能点
7598
+ - 技术实现要点(来自技术知识)
7599
+ - Story列表
7600
+
7601
+ Story生成规则:
7602
+ 拆分策略:
7603
+ - 每个Story是垂直切片
7604
+ - 单个AI Agent会话可完成(2-4小时工作量)
7605
+ - 明确的输入输出边界
7606
+
7607
+ Story结构:
7608
+ - Story标题
7609
+ - 用户故事格式 (As a... I want... So that...)
7610
+ - 验收标准 (基于分析报告中的业务规则)
7611
+ - 技术实现提示(来自技术知识)
7612
+ - 集成验证点(来自数据关系分析)
7613
+
7614
+ 排序规则:
7615
+ - 基础设施优先
7616
+ - 数据模型优先于业务逻辑
7617
+ - 核心流程优先于边缘场景
7618
+ - 遵循功能依赖关系图
7619
+ ```
7620
+
7621
+ ### 3.3 知识融合
7622
+
7623
+ ```yaml
7624
+ 知识融合点:
7625
+ 业务规则融合:
7626
+ 来源: docs/rag/business/rules-*.md
7627
+ 融合到: 验收标准、业务逻辑描述
7628
+
7629
+ 数据模型融合:
7630
+ 来源: docs/rag/technical/data-model.md
7631
+ 融合到: 数据实体定义、关联关系说明
7632
+
7633
+ 编码规范融合:
7634
+ 来源: docs/rag/technical/coding-standards/
7635
+ 融合到: 技术实现提示、代码示例引用
7636
+
7637
+ 中间件规范融合:
7638
+ 来源: docs/rag/technical/middleware/
7639
+ 融合到: 技术假设、实现约束
7640
+
7641
+ 安全要求融合:
7642
+ 来源: docs/rag/constraints/security.md
7643
+ 融合到: 非功能性需求、验收标准
7644
+ ```
7645
+
7646
+ ---
7647
+
7648
+ ## Phase 4: 质量检查与输出
7649
+
7650
+ ### 4.1 PRD质量检查清单
7651
+
7652
+ ```yaml
7653
+ 完整性检查:
7654
+ - [ ] 所有P0功能已覆盖
7655
+ - [ ] 所有P1功能已覆盖或标记为后续迭代
7656
+ - [ ] 所有已识别的业务规则已融入
7657
+ - [ ] 所有数据实体已定义
7658
+ - [ ] 所有用户角色已覆盖
7659
+
7660
+ 一致性检查:
7661
+ - [ ] 功能需求与分析报告一致
7662
+ - [ ] 技术假设与知识库一致
7663
+ - [ ] Epic/Story顺序符合依赖关系
7664
+ - [ ] 验收标准可测试
7665
+
7666
+ 可执行性检查:
7667
+ - [ ] 每个Story大小适合AI Agent执行
7668
+ - [ ] Story之间无循环依赖
7669
+ - [ ] 技术实现路径清晰
7670
+ - [ ] 风险缓解措施具体
7671
+
7672
+ 交接完整性检查:
7673
+ - [ ] 包含UX专家提示
7674
+ - [ ] 包含架构师提示
7675
+ - [ ] 待澄清事项已列出
7676
+ ```
7677
+
7678
+ ### 4.2 输出文件
7679
+
7680
+ ```yaml
7681
+ 主输出:
7682
+ PRD文档:
7683
+ 路径: docs/prd.md
7684
+ 格式: Markdown
7685
+
7686
+ 或 Epic文档:
7687
+ 路径: docs/epic-{name}.md
7688
+ 格式: Markdown
7689
+
7690
+ 辅助输出:
7691
+ 知识引用索引:
7692
+ 路径: docs/prd-knowledge-refs.md
7693
+ 内容: PRD中引用的知识文件清单
7694
+
7695
+ 待澄清事项:
7696
+ 路径: docs/prd-open-questions.md
7697
+ 内容: 需要进一步确认的问题
7698
+ ```
7699
+
7700
+ ---
7701
+
7702
+ ## Phase 5: 下游交接
7703
+
7704
+ ### 5.1 交接给UX专家
7705
+
7706
+ ```yaml
7707
+ UX专家交接:
7708
+ 必读文件:
7709
+ - docs/prd.md (UI设计目标章节)
7710
+ - docs/rag/_analysis-report.md (用户分析章节)
7711
+
7712
+ 关注点:
7713
+ - 用户角色与权限
7714
+ - 核心屏幕与视图
7715
+ - 关键用户旅程
7716
+ - 无障碍性要求
7717
+
7718
+ 建议命令: "*create-ux-design docs/prd.md"
7719
+ ```
7720
+
7721
+ ### 5.2 交接给架构师
7722
+
7723
+ ```yaml
7724
+ 架构师交接:
7725
+ 必读文件:
7726
+ - docs/prd.md (技术假设章节)
7727
+ - docs/rag/technical/ (技术知识目录)
7728
+ - docs/rag/_analysis-report.md (技术分析章节)
7729
+
7730
+ 关注点:
7731
+ - 技术栈与架构约束
7732
+ - 数据模型与关系
7733
+ - 集成点与接口
7734
+ - 性能与安全要求
7735
+
7736
+ 建议命令: "*create-architecture docs/prd.md"
7737
+ ```
7738
+
7739
+ ---
7740
+
7741
+ ## 使用说明
7742
+
7743
+ ### 激活命令
7744
+
7745
+ ```
7746
+ *create-prd-from-rag [rag_path]
7747
+ ```
7748
+
7749
+ ### 执行参数
7750
+
7751
+ ```yaml
7752
+ 参数:
7753
+ rag_path: RAG知识目录路径 (默认: docs/rag/)
7754
+ output_path: PRD输出路径 (默认: docs/prd.md)
7755
+ doc_type: 文档类型 (auto|prd|epic, 默认: auto)
7756
+ interactive: 交互模式 (默认: true)
7757
+ ```
7758
+
7759
+ ### 交互模式流程
7760
+
7761
+ 1. **验证阶段**: 检查上游交接物完整性
7762
+ 2. **评估阶段**: 展示复杂度评估结果,确认文档类型
7763
+ 3. **生成阶段**: 逐章节生成PRD,关键节点请求确认
7764
+ 4. **检查阶段**: 执行质量检查清单
7765
+ 5. **输出阶段**: 生成最终文档,提示下游交接
7766
+
7767
+ ### YOLO模式
7768
+
7769
+ 通过 `*yolo` 命令切换YOLO模式,一次性完成所有步骤,跳过中间确认环节。
7770
+
7771
+ ---
7772
+
7773
+ ## 任务完成标志
7774
+
7775
+ ```yaml
7776
+ 完成条件:
7777
+ 必要输出:
7778
+ - docs/prd.md 或 docs/epic-{name}.md
7779
+
7780
+ 完成提示: |
7781
+ ✅ PRD/Epic 文档生成完成!
7782
+
7783
+ 📄 输出文件: {output_path}
7784
+ 📊 Epic数量: {epic_count}
7785
+ 📝 Story数量: {story_count}
7786
+
7787
+ 🔄 下一步建议:
7788
+ - UX设计: *create-ux-design docs/prd.md
7789
+ - 架构设计: *create-architecture docs/prd.md
7790
+
7791
+ ⚠️ 待澄清事项: {open_questions_count} 项
7792
+ 请在开发前确认这些问题。
7793
+ ```
7794
+ ==================== END: .xiaoma-core/tasks/create-prd-from-rag.md ====================
7795
+
7352
7796
  ==================== START: .xiaoma-core/tasks/execute-checklist.md ====================
7353
7797
  <!-- Powered by XIAOMA™ Core -->
7354
7798
 
@@ -7913,6 +8357,419 @@ sections:
7913
8357
  - template: "IV3: {{performance_impact_verification}}"
7914
8358
  ==================== END: .xiaoma-core/templates/brownfield-prd-tmpl.yaml ====================
7915
8359
 
8360
+ ==================== START: .xiaoma-core/templates/prd-from-rag-tmpl.yaml ====================
8361
+ template:
8362
+ id: prd-from-rag-template-v1
8363
+ name: 基于需求分析的PRD文档
8364
+ version: 1.0
8365
+ description: 基于Analyst智能体的需求分析产出物生成PRD
8366
+ output:
8367
+ format: markdown
8368
+ filename: docs/prd.md
8369
+ title: "{{project_name}} 产品需求文档 (PRD)"
8370
+
8371
+ workflow:
8372
+ mode: interactive
8373
+ elicitation: advanced-elicitation
8374
+ upstream:
8375
+ agent: analyst
8376
+ required_files:
8377
+ - docs/rag/_analysis-report.md
8378
+ - docs/rag/_requirement-parsing.yaml
8379
+ optional_files:
8380
+ - docs/rag/_questions.md
8381
+ - docs/rag/_index.md
8382
+ - docs/rag/business/*
8383
+ - docs/rag/technical/*
8384
+ - docs/rag/constraints/*
8385
+
8386
+ sections:
8387
+ - id: input-validation
8388
+ title: 输入验证
8389
+ internal: true
8390
+ instruction: |
8391
+ 在开始生成PRD之前,执行以下验证:
8392
+
8393
+ 1. **检查必需文件**:
8394
+ - docs/rag/_analysis-report.md 是否存在
8395
+ - docs/rag/_requirement-parsing.yaml 是否存在
8396
+ - req.txt 原始需求文档是否存在
8397
+
8398
+ 2. **加载分析报告**:
8399
+ - 读取并解析 _analysis-report.md 的所有章节
8400
+ - 提取关键信息:功能清单、用户角色、数据实体、风险、待澄清事项
8401
+
8402
+ 3. **加载知识上下文**:
8403
+ - 扫描 docs/rag/technical/ 获取技术约束
8404
+ - 扫描 docs/rag/business/ 获取业务规则
8405
+ - 扫描 docs/rag/constraints/ 获取约束条件
8406
+
8407
+ 如果缺少必需文件,提示:
8408
+ "⚠️ 未找到需求分析报告。请先执行 Analyst 智能体完成需求分析:*analyze-requirement req.txt"
8409
+
8410
+ - id: complexity-assessment
8411
+ title: 复杂度评估
8412
+ instruction: |
8413
+ 基于分析报告内容,评估项目复杂度并推荐文档类型。
8414
+
8415
+ **评估维度**:
8416
+ 1. 功能复杂度:基于功能清单数量和依赖关系
8417
+ 2. 技术复杂度:基于技术可行性评估
8418
+ 3. 集成复杂度:基于数据关系和外部依赖
8419
+ 4. 风险等级:基于风险清单
8420
+
8421
+ **推荐文档类型**:
8422
+ - 完整PRD:复杂度 >= 中等,或涉及多个Epic
8423
+ - 单Epic:复杂度低,可在1-3个Story内完成
8424
+
8425
+ 展示评估结果并请用户确认文档类型。
8426
+ elicit: true
8427
+ sections:
8428
+ - id: assessment-result
8429
+ title: 评估结果
8430
+ type: table
8431
+ columns: [评估维度, 等级, 依据]
8432
+ - id: recommendation
8433
+ title: 推荐方案
8434
+ instruction: 基于评估结果给出文档类型推荐和理由
8435
+
8436
+ - id: goals-context
8437
+ title: 目标与背景
8438
+ instruction: |
8439
+ 从分析报告的"需求概述"章节提取内容,映射到PRD结构。
8440
+
8441
+ **映射规则**:
8442
+ - 分析报告.需求背景 → 背景上下文
8443
+ - 分析报告.核心目标 → 目标
8444
+ - 分析报告.范围边界 → 范围定义
8445
+
8446
+ 如果分析报告中信息不足,参考 req.txt 原始需求补充。
8447
+ sections:
8448
+ - id: goals
8449
+ title: 目标
8450
+ type: bullet-list
8451
+ instruction: |
8452
+ 从分析报告提取核心目标,转换为PRD目标格式。
8453
+ 每个目标应该是:
8454
+ - 可衡量的成果
8455
+ - 用户或业务价值
8456
+ - 与原始需求对应
8457
+ - id: background
8458
+ title: 背景上下文
8459
+ type: paragraphs
8460
+ instruction: |
8461
+ 综合以下来源生成背景描述:
8462
+ - 分析报告.需求背景
8463
+ - 分析报告.业务分析
8464
+ - 原始需求文档中的背景信息
8465
+ - id: scope
8466
+ title: 范围定义
8467
+ instruction: 从分析报告.范围边界提取,明确包含和不包含的内容
8468
+ sections:
8469
+ - id: in-scope
8470
+ title: 范围内
8471
+ type: bullet-list
8472
+ - id: out-of-scope
8473
+ title: 范围外
8474
+ type: bullet-list
8475
+ - id: changelog
8476
+ title: 变更日志
8477
+ type: table
8478
+ columns: [日期, 版本, 描述, 作者]
8479
+
8480
+ - id: requirements
8481
+ title: 需求
8482
+ instruction: |
8483
+ 从分析报告的"功能分析"和"业务规则汇总"章节提取需求。
8484
+
8485
+ **功能性需求来源**:
8486
+ - 分析报告.功能清单 → FR列表
8487
+ - 分析报告.业务规则 → FR补充说明
8488
+ - docs/rag/business/rules-*.md → 详细规则
8489
+
8490
+ **非功能性需求来源**:
8491
+ - 分析报告.技术分析.性能要求
8492
+ - docs/rag/constraints/security.md
8493
+ - docs/rag/constraints/performance.md
8494
+
8495
+ 确保每个需求都可追溯到分析报告或知识库文档。
8496
+ elicit: true
8497
+ sections:
8498
+ - id: functional
8499
+ title: 功能性需求
8500
+ type: numbered-list
8501
+ prefix: FR
8502
+ instruction: |
8503
+ 按优先级排列功能性需求:
8504
+ - P0功能优先列出
8505
+ - 每个FR包含:需求描述 + 来源标注
8506
+ - 复杂业务规则单独标注参考文档
8507
+
8508
+ 格式示例:
8509
+ FR1: [P0] 用户可以创建订单 (来源: 分析报告.功能清单.F001)
8510
+ examples:
8511
+ - "FR1: [P0] 系统支持用户通过手机号注册账户 (来源: _analysis-report.md#功能清单)"
8512
+ - "FR2: [P0] 订单状态流转遵循:待支付→已支付→已发货→已完成 (来源: business/rules-order.md)"
8513
+ - id: non-functional
8514
+ title: 非功能性需求
8515
+ type: numbered-list
8516
+ prefix: NFR
8517
+ instruction: |
8518
+ 从约束条件和技术分析中提取非功能性需求。
8519
+ 包括:性能、安全、可用性、兼容性等。
8520
+ examples:
8521
+ - "NFR1: 接口响应时间P99 < 500ms (来源: constraints/performance.md)"
8522
+ - "NFR2: 敏感数据传输必须使用HTTPS加密 (来源: constraints/security.md)"
8523
+
8524
+ - id: data-model
8525
+ title: 数据模型
8526
+ instruction: |
8527
+ 从分析报告的"数据分析"章节和技术知识中提取数据模型。
8528
+
8529
+ **来源**:
8530
+ - 分析报告.数据实体清单
8531
+ - 分析报告.数据关系图
8532
+ - docs/rag/technical/data-model.md
8533
+ sections:
8534
+ - id: entities
8535
+ title: 数据实体
8536
+ type: table
8537
+ columns: [实体名称, 描述, 核心属性, 来源]
8538
+ instruction: 列出所有数据实体及其核心属性
8539
+ - id: relationships
8540
+ title: 数据关系
8541
+ instruction: |
8542
+ 描述实体间的关系,使用Mermaid ER图表示。
8543
+ 从分析报告.数据关系图提取,补充详细说明。
8544
+ examples:
8545
+ - |
8546
+ ```mermaid
8547
+ erDiagram
8548
+ User ||--o{ Order : creates
8549
+ Order ||--|{ OrderItem : contains
8550
+ ```
8551
+
8552
+ - id: technical-constraints
8553
+ title: 技术约束
8554
+ instruction: |
8555
+ 整合技术知识库中的约束条件,指导后续架构设计。
8556
+
8557
+ **来源**:
8558
+ - docs/rag/technical/architecture.md
8559
+ - docs/rag/technical/tech-stack.md
8560
+ - docs/rag/technical/coding-standards/
8561
+ - docs/rag/technical/middleware/
8562
+ - 分析报告.技术分析.与现有系统兼容性
8563
+ elicit: true
8564
+ sections:
8565
+ - id: tech-stack
8566
+ title: 技术栈约束
8567
+ instruction: |
8568
+ 从技术知识库提取技术栈要求:
8569
+ - 后端框架和版本
8570
+ - 数据库类型和版本
8571
+ - 中间件要求
8572
+ template: |
8573
+ **后端**: {{backend_framework}}
8574
+ **数据库**: {{database}}
8575
+ **缓存**: {{cache}}
8576
+ **消息队列**: {{mq}}
8577
+ - id: architecture-constraints
8578
+ title: 架构约束
8579
+ instruction: 从 architecture.md 提取架构模式和约束
8580
+ - id: coding-standards
8581
+ title: 编码规范约束
8582
+ instruction: |
8583
+ 从 coding-standards/ 目录提取关键规范:
8584
+ - 命名规范
8585
+ - 分层规范
8586
+ - 异常处理规范
8587
+ - id: integration-constraints
8588
+ title: 集成约束
8589
+ instruction: 从分析报告.技术分析提取集成相关约束
8590
+
8591
+ - id: epic-list
8592
+ title: 模块列表
8593
+ instruction: |
8594
+ 基于分析报告的功能分析,规划Epic结构。
8595
+
8596
+ **规划原则**:
8597
+ - 按功能优先级分组:P0功能 → Epic 1
8598
+ - 遵循功能依赖关系
8599
+ - 每个Epic交付独立可测试的功能增量
8600
+
8601
+ **Epic分组策略**:
8602
+ 1. 从分析报告.功能清单提取所有功能
8603
+ 2. 按优先级排序:P0 > P1 > P2
8604
+ 3. 分析依赖关系,确定Epic边界
8605
+ 4. 每个Epic包含相关联的功能集
8606
+
8607
+ 展示Epic列表,请用户确认分组是否合理。
8608
+ elicit: true
8609
+ sections:
8610
+ - id: epic-overview
8611
+ title: Epic概览
8612
+ type: table
8613
+ columns: [Epic, 标题, 包含功能, 优先级, Story数量(预估)]
8614
+ instruction: 展示所有Epic的概览表格
8615
+
8616
+ - id: epic-details
8617
+ title: "Epic {{epic_number}}: {{epic_title}}"
8618
+ repeatable: true
8619
+ instruction: |
8620
+ 为每个Epic生成详细内容,包含所有Story和验收标准。
8621
+
8622
+ **Epic内容来源**:
8623
+ - 分析报告.功能清单 (对应功能)
8624
+ - 分析报告.业务规则 (相关规则)
8625
+ - docs/rag/business/ (详细业务知识)
8626
+ - docs/rag/technical/ (技术实现参考)
8627
+
8628
+ **Story生成规则**:
8629
+ - 每个Story是垂直切片
8630
+ - 单个AI Agent会话可完成(2-4小时)
8631
+ - 验收标准来源于分析报告中的业务规则
8632
+ - 包含技术实现提示(来自技术知识)
8633
+
8634
+ **Story排序**:
8635
+ - 遵循分析报告.功能依赖关系
8636
+ - 基础设施和数据模型优先
8637
+ - 核心流程优先于边缘场景
8638
+ elicit: true
8639
+ template: |
8640
+ **Epic目标**: {{epic_goal}}
8641
+
8642
+ **包含功能**:
8643
+ {{功能列表,来源于分析报告}}
8644
+
8645
+ **技术要点**:
8646
+ {{技术实现要点,来源于技术知识库}}
8647
+ sections:
8648
+ - id: story
8649
+ title: "Story {{epic_number}}.{{story_number}}: {{story_title}}"
8650
+ repeatable: true
8651
+ template: |
8652
+ 作为一名 {{user_type}},
8653
+ 我想要 {{action}},
8654
+ 以便 {{benefit}}。
8655
+ sections:
8656
+ - id: acceptance-criteria
8657
+ title: 验收标准
8658
+ type: numbered-list
8659
+ instruction: |
8660
+ 从以下来源生成验收标准:
8661
+ - 分析报告.业务规则 (对应规则)
8662
+ - docs/rag/business/rules-*.md (详细规则)
8663
+ - 分析报告.数据分析 (数据约束)
8664
+
8665
+ 每个标准必须:
8666
+ - 可测试、可验证
8667
+ - 明确无歧义
8668
+ - 包含边界条件
8669
+ item_template: "AC{{criterion_number}}: {{criteria}} (来源: {{source}})"
8670
+ - id: technical-hints
8671
+ title: 技术实现提示
8672
+ instruction: |
8673
+ 从技术知识库提取实现提示:
8674
+ - 相关编码规范
8675
+ - 中间件使用示例
8676
+ - 数据模型参考
8677
+ type: bullet-list
8678
+ - id: knowledge-refs
8679
+ title: 知识引用
8680
+ instruction: 列出Story实现时需要参考的知识文档
8681
+ type: bullet-list
8682
+
8683
+ - id: risks-and-open-items
8684
+ title: 风险与待澄清事项
8685
+ instruction: |
8686
+ 从分析报告直接提取风险和待澄清事项。
8687
+
8688
+ **来源**:
8689
+ - 分析报告.风险分析
8690
+ - 分析报告.待澄清事项
8691
+ sections:
8692
+ - id: risks
8693
+ title: 风险清单
8694
+ type: table
8695
+ columns: [风险ID, 风险描述, 等级, 缓解措施]
8696
+ instruction: 从分析报告.风险清单直接映射
8697
+ - id: open-questions
8698
+ title: 待澄清事项
8699
+ type: table
8700
+ columns: [序号, 问题, 上下文, 建议选项, 状态]
8701
+ instruction: |
8702
+ 从分析报告.待澄清事项提取。
8703
+ 标注状态:待确认/已确认/已关闭
8704
+ 在PRD评审时需要逐一确认这些问题。
8705
+
8706
+ - id: knowledge-index
8707
+ title: 知识引用索引
8708
+ instruction: |
8709
+ 列出本PRD引用的所有知识文档,便于追溯和维护。
8710
+ sections:
8711
+ - id: analysis-refs
8712
+ title: 分析报告引用
8713
+ type: table
8714
+ columns: [章节, 引用位置, 用途]
8715
+ - id: knowledge-refs
8716
+ title: 知识库引用
8717
+ type: table
8718
+ columns: [文件路径, 引用位置, 用途]
8719
+
8720
+ - id: next-steps
8721
+ title: 后续步骤
8722
+ sections:
8723
+ - id: ux-expert-prompt
8724
+ title: UX专家交接
8725
+ instruction: |
8726
+ 生成给UX专家的交接提示,包含:
8727
+ - 需要关注的用户角色
8728
+ - 核心屏幕和交互
8729
+ - 品牌和无障碍要求
8730
+ - 相关知识文档路径
8731
+ template: |
8732
+ **交接给UX专家**
8733
+
8734
+ 请基于本PRD的用户分析部分设计UI/UX方案:
8735
+
8736
+ **关键输入**:
8737
+ - PRD文档: docs/prd.md
8738
+ - 用户分析: docs/rag/_analysis-report.md#用户分析
8739
+ - 用户角色: {{user_roles}}
8740
+ - 核心屏幕: {{core_screens}}
8741
+
8742
+ **设计重点**:
8743
+ {{design_focus}}
8744
+
8745
+ **执行命令**: *create-ux-design docs/prd.md
8746
+ - id: architect-prompt
8747
+ title: 架构师交接
8748
+ instruction: |
8749
+ 生成给架构师的交接提示,包含:
8750
+ - 技术栈约束
8751
+ - 数据模型要点
8752
+ - 集成需求
8753
+ - 相关知识文档路径
8754
+ template: |
8755
+ **交接给架构师**
8756
+
8757
+ 请基于本PRD和技术知识库设计系统架构:
8758
+
8759
+ **关键输入**:
8760
+ - PRD文档: docs/prd.md
8761
+ - 技术分析: docs/rag/_analysis-report.md#技术分析
8762
+ - 技术知识: docs/rag/technical/
8763
+ - 数据模型: docs/rag/technical/data-model.md
8764
+
8765
+ **架构重点**:
8766
+ - 技术栈: {{tech_stack}}
8767
+ - 关键集成点: {{integration_points}}
8768
+ - 性能要求: {{performance_requirements}}
8769
+
8770
+ **执行命令**: *create-architecture docs/prd.md
8771
+ ==================== END: .xiaoma-core/templates/prd-from-rag-tmpl.yaml ====================
8772
+
7916
8773
  ==================== START: .xiaoma-core/checklists/change-checklist.md ====================
7917
8774
  <!-- Powered by XiaoMa™ Core -->
7918
8775
 
@@ -8361,127 +9218,655 @@ Ask the user if they want to work through the checklist:
8361
9218
 
8362
9219
  ### 8.1 Data Requirements
8363
9220
 
8364
- - [ ] Data entities and relationships identified
8365
- - [ ] Data storage requirements specified
8366
- - [ ] Data quality requirements defined
8367
- - [ ] Data retention policies identified
8368
- - [ ] Data migration needs addressed (if applicable)
8369
- - [ ] Schema changes planned iteratively, tied to stories requiring them
9221
+ - [ ] Data entities and relationships identified
9222
+ - [ ] Data storage requirements specified
9223
+ - [ ] Data quality requirements defined
9224
+ - [ ] Data retention policies identified
9225
+ - [ ] Data migration needs addressed (if applicable)
9226
+ - [ ] Schema changes planned iteratively, tied to stories requiring them
9227
+
9228
+ ### 8.2 Integration Requirements
9229
+
9230
+ - [ ] External system integrations identified
9231
+ - [ ] API requirements documented
9232
+ - [ ] Authentication for integrations specified
9233
+ - [ ] Data exchange formats defined
9234
+ - [ ] Integration testing requirements outlined
9235
+
9236
+ ### 8.3 Operational Requirements
9237
+
9238
+ - [ ] Deployment frequency expectations set
9239
+ - [ ] Environment requirements defined
9240
+ - [ ] Monitoring and alerting needs identified
9241
+ - [ ] Support requirements documented
9242
+ - [ ] Performance monitoring approach specified
9243
+
9244
+ ## 9. CLARITY & COMMUNICATION
9245
+
9246
+ ### 9.1 Documentation Quality
9247
+
9248
+ - [ ] Documents use clear, consistent language
9249
+ - [ ] Documents are well-structured and organized
9250
+ - [ ] Technical terms are defined where necessary
9251
+ - [ ] Diagrams/visuals included where helpful
9252
+ - [ ] Documentation is versioned appropriately
9253
+
9254
+ ### 9.2 Stakeholder Alignment
9255
+
9256
+ - [ ] Key stakeholders identified
9257
+ - [ ] Stakeholder input incorporated
9258
+ - [ ] Potential areas of disagreement addressed
9259
+ - [ ] Communication plan for updates established
9260
+ - [ ] Approval process defined
9261
+
9262
+ ## PRD & EPIC VALIDATION SUMMARY
9263
+
9264
+ [[LLM: FINAL PM CHECKLIST REPORT GENERATION
9265
+
9266
+ Create a comprehensive validation report that includes:
9267
+
9268
+ 1. Executive Summary
9269
+ - Overall PRD completeness (percentage)
9270
+ - MVP scope appropriateness (Too Large/Just Right/Too Small)
9271
+ - Readiness for architecture phase (Ready/Nearly Ready/Not Ready)
9272
+ - Most critical gaps or concerns
9273
+
9274
+ 2. Category Analysis Table
9275
+ Fill in the actual table with:
9276
+ - Status: PASS (90%+ complete), PARTIAL (60-89%), FAIL (<60%)
9277
+ - Critical Issues: Specific problems that block progress
9278
+
9279
+ 3. Top Issues by Priority
9280
+ - BLOCKERS: Must fix before architect can proceed
9281
+ - HIGH: Should fix for quality
9282
+ - MEDIUM: Would improve clarity
9283
+ - LOW: Nice to have
9284
+
9285
+ 4. MVP Scope Assessment
9286
+ - Features that might be cut for true MVP
9287
+ - Missing features that are essential
9288
+ - Complexity concerns
9289
+ - Timeline realism
9290
+
9291
+ 5. Technical Readiness
9292
+ - Clarity of technical constraints
9293
+ - Identified technical risks
9294
+ - Areas needing architect investigation
9295
+
9296
+ 6. Recommendations
9297
+ - Specific actions to address each blocker
9298
+ - Suggested improvements
9299
+ - Next steps
9300
+
9301
+ After presenting the report, ask if the user wants:
9302
+
9303
+ - Detailed analysis of any failed sections
9304
+ - Suggestions for improving specific areas
9305
+ - Help with refining MVP scope]]
9306
+
9307
+ ### Category Statuses
9308
+
9309
+ | Category | Status | Critical Issues |
9310
+ | -------------------------------- | ------ | --------------- |
9311
+ | 1. Problem Definition & Context | _TBD_ | |
9312
+ | 2. MVP Scope Definition | _TBD_ | |
9313
+ | 3. User Experience Requirements | _TBD_ | |
9314
+ | 4. Functional Requirements | _TBD_ | |
9315
+ | 5. Non-Functional Requirements | _TBD_ | |
9316
+ | 6. Epic & Story Structure | _TBD_ | |
9317
+ | 7. Technical Guidance | _TBD_ | |
9318
+ | 8. Cross-Functional Requirements | _TBD_ | |
9319
+ | 9. Clarity & Communication | _TBD_ | |
9320
+
9321
+ ### Critical Deficiencies
9322
+
9323
+ (To be populated during validation)
9324
+
9325
+ ### Recommendations
9326
+
9327
+ (To be populated during validation)
9328
+
9329
+ ### Final Decision
9330
+
9331
+ - **READY FOR ARCHITECT**: The PRD and epics are comprehensive, properly structured, and ready for architectural design.
9332
+ - **NEEDS REFINEMENT**: The requirements documentation requires additional work to address the identified deficiencies.
9333
+ ==================== END: .xiaoma-core/checklists/pm-checklist.md ====================
9334
+
9335
+ ==================== START: .xiaoma-core/data/technical-preferences.md ====================
9336
+ <!-- Powered by XiaoMa™ Core -->
9337
+
9338
+ # User-Defined Preferred Patterns and Preferences
9339
+
9340
+ None Listed
9341
+ ==================== END: .xiaoma-core/data/technical-preferences.md ====================
9342
+
9343
+ ==================== START: .xiaoma-core/tasks/create-incremental-architecture.md ====================
9344
+ # 基于知识库的架构增量设计任务
9345
+
9346
+ ## Purpose
9347
+
9348
+ 基于 Analyst 智能体的技术知识库产出(`docs/rag/technical/`)和 PM 智能体生成的 PRD/Epic 文档,进行架构增量设计。通过对比现有技术架构与新需求,识别技术变动点,生成架构增量设计文档。
9349
+
9350
+ ## 上游交接物
9351
+
9352
+ ```yaml
9353
+ 必需输入:
9354
+ PRD/Epic文档:
9355
+ - docs/prd.md # PM生成的PRD文档
9356
+ - 或 docs/epic-{name}.md # PM生成的Epic文档
9357
+
9358
+ 技术知识库:
9359
+ - docs/rag/technical/architecture.md # 现有技术架构
9360
+ - docs/rag/technical/tech-stack.md # 技术栈详情
9361
+ - docs/rag/technical/module-structure.md # 模块结构
9362
+ - docs/rag/technical/data-model.md # 数据模型
9363
+
9364
+ 可选输入:
9365
+ 分析报告:
9366
+ - docs/rag/_analysis-report.md # 需求分析报告(技术分析章节)
9367
+
9368
+ 编码规范:
9369
+ - docs/rag/technical/coding-standards/ # 编码规范目录
9370
+ - docs/rag/technical/middleware/ # 中间件规范目录
9371
+
9372
+ 约束条件:
9373
+ - docs/rag/constraints/security.md # 安全要求
9374
+ - docs/rag/constraints/performance.md # 性能要求
9375
+ ```
9376
+
9377
+ ## Workflow Overview
9378
+
9379
+ ```
9380
+ 技术知识库 + PRD → 架构差异分析 → 变动点识别 → 增量设计 → 影响评估 → 架构增量文档
9381
+ ```
9382
+
9383
+ ---
9384
+
9385
+ ## Phase 1: 输入验证与上下文加载
9386
+
9387
+ ### 1.1 验证上游交接物
9388
+
9389
+ ```yaml
9390
+ 执行步骤:
9391
+ 步骤1_检查PRD文档:
9392
+ 动作: 检查 docs/prd.md 或 docs/epic-{name}.md 是否存在
9393
+ 缺失处理: |
9394
+ 如果缺失PRD文档,提示用户:
9395
+ "未找到PRD文档。请先执行 PM 智能体的 *create-prd-from-rag 命令生成PRD。"
9396
+
9397
+ 步骤2_检查技术知识库:
9398
+ 动作: 检查 docs/rag/technical/ 目录是否存在核心文件
9399
+ 核心文件:
9400
+ - architecture.md (现有架构)
9401
+ - data-model.md (数据模型)
9402
+ 缺失处理: |
9403
+ 如果技术知识库不完整,提示用户:
9404
+ "技术知识库不完整。建议先执行 Analyst 智能体完善技术知识:
9405
+ - 缺少 architecture.md:需要补充整体技术架构信息
9406
+ - 缺少 data-model.md:需要补充现有数据模型信息"
9407
+
9408
+ 步骤3_加载现有架构:
9409
+ 动作: 读取并解析技术知识库
9410
+ 提取内容:
9411
+ - 整体架构模式(单体/微服务/DDD等)
9412
+ - 技术栈详情(框架、数据库、中间件)
9413
+ - 模块结构(包结构、分层规范)
9414
+ - 现有数据模型(表结构、实体关系)
9415
+ - 编码规范(命名、注释、异常处理)
9416
+ - 中间件使用方式(Redis、MQ、ES等)
9417
+
9418
+ 步骤4_加载PRD需求:
9419
+ 动作: 读取并解析PRD文档
9420
+ 提取内容:
9421
+ - 功能性需求(FR列表)
9422
+ - 非功能性需求(NFR列表)
9423
+ - 数据实体与关系
9424
+ - 技术约束
9425
+ - Epic/Story结构
9426
+ ```
9427
+
9428
+ ### 1.2 上下文整合视图
9429
+
9430
+ ```yaml
9431
+ 整合输出:
9432
+ 现有架构视图:
9433
+ 架构模式: {从architecture.md提取}
9434
+ 技术栈:
9435
+ 后端: {框架、版本}
9436
+ 数据库: {类型、版本}
9437
+ 缓存: {类型、用途}
9438
+ 消息队列: {类型、用途}
9439
+ 模块结构: {包结构、分层}
9440
+ 数据模型: {现有实体、关系}
9441
+
9442
+ 新需求视图:
9443
+ 功能需求: {FR列表}
9444
+ 数据需求: {新增/修改实体}
9445
+ 性能需求: {NFR中的性能要求}
9446
+ 安全需求: {NFR中的安全要求}
9447
+ ```
9448
+
9449
+ ---
9450
+
9451
+ ## Phase 2: 架构差异分析
9452
+
9453
+ ### 2.1 技术变动检测
9454
+
9455
+ ```yaml
9456
+ 检测维度:
9457
+ 架构层面变动:
9458
+ 检测项:
9459
+ - 是否需要新增模块/服务
9460
+ - 是否需要调整分层结构
9461
+ - 是否需要引入新的架构模式
9462
+ 判定标准:
9463
+ 无变动: 完全遵循现有模块结构
9464
+ 小变动: 在现有模块内新增包/类
9465
+ 中变动: 新增独立模块
9466
+ 大变动: 需要调整整体架构
9467
+
9468
+ 技术栈变动:
9469
+ 检测项:
9470
+ - 是否需要引入新框架/库
9471
+ - 是否需要升级现有依赖版本
9472
+ - 是否需要新增中间件
9473
+ 判定标准:
9474
+ 无变动: 使用现有技术栈
9475
+ 小变动: 新增工具类库
9476
+ 中变动: 引入新中间件
9477
+ 大变动: 核心框架变更
9478
+
9479
+ 数据模型变动:
9480
+ 检测项:
9481
+ - 新增数据实体
9482
+ - 修改现有实体(字段增减)
9483
+ - 新增实体关系
9484
+ - 索引变更
9485
+ 判定标准:
9486
+ 无变动: 完全使用现有表结构
9487
+ 小变动: 现有表新增字段
9488
+ 中变动: 新增表/修改关联关系
9489
+ 大变动: 数据模型重构
9490
+
9491
+ 接口变动:
9492
+ 检测项:
9493
+ - 新增API端点
9494
+ - 修改现有API
9495
+ - 新增外部系统集成
9496
+ 判定标准:
9497
+ 无变动: 无接口变更
9498
+ 小变动: 新增内部API
9499
+ 中变动: 修改公开API/新增集成
9500
+ 大变动: API版本升级
9501
+
9502
+ 中间件变动:
9503
+ 检测项:
9504
+ - Redis使用变化(新增key类型、缓存策略)
9505
+ - MQ使用变化(新增Topic/Queue)
9506
+ - 定时任务变化
9507
+ - ES索引变化
9508
+ 判定标准:
9509
+ 无变动: 遵循现有使用方式
9510
+ 小变动: 新增使用场景
9511
+ 中变动: 新增配置/调整策略
9512
+ 大变动: 中间件架构调整
9513
+ ```
9514
+
9515
+ ### 2.2 变动分析报告
9516
+
9517
+ ```yaml
9518
+ 分析输出格式:
9519
+ 变动总览:
9520
+ 总体变动等级: 无/小/中/大
9521
+ 主要变动领域: [列表]
9522
+ 风险等级: 低/中/高
9523
+
9524
+ 详细变动清单:
9525
+ - 变动ID: CHG-001
9526
+ 领域: 数据模型
9527
+ 类型: 新增
9528
+ 描述: 新增订单实体
9529
+ 影响范围: order模块
9530
+ 关联需求: FR1, FR2
9531
+ 风险等级: 低
9532
+
9533
+ 兼容性分析:
9534
+ 向后兼容: 是/否
9535
+ 需要迁移: 是/否
9536
+ 影响范围: [受影响的模块/服务]
9537
+ ```
9538
+
9539
+ ---
9540
+
9541
+ ## Phase 3: 架构增量设计
9542
+
9543
+ ### 3.1 设计原则
9544
+
9545
+ ```yaml
9546
+ 设计原则:
9547
+ 最小变动原则:
9548
+ - 优先在现有架构内扩展
9549
+ - 避免不必要的重构
9550
+ - 保持与现有代码风格一致
9551
+
9552
+ 渐进演进原则:
9553
+ - 设计可分阶段实施的方案
9554
+ - 支持增量部署和回滚
9555
+ - 考虑向后兼容性
9556
+
9557
+ 知识复用原则:
9558
+ - 复用知识库中的编码规范
9559
+ - 遵循现有中间件使用模式
9560
+ - 参考已有代码示例
9561
+ ```
9562
+
9563
+ ### 3.2 增量设计内容
9564
+
9565
+ ```yaml
9566
+ 设计内容:
9567
+ 模块增量设计:
9568
+ 新增模块:
9569
+ - 模块名称
9570
+ - 职责描述
9571
+ - 包结构(遵循现有规范)
9572
+ - 与现有模块的关系
9573
+ 修改模块:
9574
+ - 模块名称
9575
+ - 修改内容
9576
+ - 修改理由
9577
+ - 影响评估
9578
+
9579
+ 数据模型增量设计:
9580
+ 新增实体:
9581
+ - 实体名称
9582
+ - 表名(遵循命名规范)
9583
+ - 字段定义(遵循字段规范)
9584
+ - 索引设计
9585
+ - DDL语句
9586
+ 修改实体:
9587
+ - 实体名称
9588
+ - 修改字段
9589
+ - 迁移脚本
9590
+ - 兼容性说明
9591
+
9592
+ 接口增量设计:
9593
+ 新增API:
9594
+ - 接口路径(遵循URL规范)
9595
+ - 请求方法
9596
+ - 请求参数(遵循参数规范)
9597
+ - 响应格式(遵循响应规范)
9598
+ - 错误码定义
9599
+ 修改API:
9600
+ - 接口路径
9601
+ - 变更内容
9602
+ - 版本策略
9603
+ - 兼容性说明
9604
+
9605
+ 中间件增量设计:
9606
+ Redis:
9607
+ - 新增Key定义(遵循Key命名规范)
9608
+ - 数据结构选择
9609
+ - 过期策略
9610
+ - 代码示例(参考知识库)
9611
+ MQ:
9612
+ - 新增Topic/Queue
9613
+ - 消息格式
9614
+ - 消费者配置
9615
+ - 代码示例(参考知识库)
9616
+ 定时任务:
9617
+ - 任务名称
9618
+ - 执行周期
9619
+ - 实现方式
9620
+ - 代码示例(参考知识库)
9621
+ ```
9622
+
9623
+ ### 3.3 知识库规范引用
9624
+
9625
+ ```yaml
9626
+ 规范引用:
9627
+ 编码规范引用:
9628
+ 来源: docs/rag/technical/coding-standards/
9629
+ 引用内容:
9630
+ - 命名规范 → 类/方法/变量命名
9631
+ - 分层规范 → Controller/Service/DAO实现
9632
+ - 异常处理 → 错误处理方式
9633
+ - 日志规范 → 日志打印方式
9634
+
9635
+ 中间件规范引用:
9636
+ 来源: docs/rag/technical/middleware/
9637
+ 引用内容:
9638
+ - Redis规范 → 缓存实现参考
9639
+ - MQ规范 → 消息处理参考
9640
+ - 定时任务规范 → 任务实现参考
9641
+
9642
+ SQL规范引用:
9643
+ 来源: docs/rag/technical/sql-standards/
9644
+ 引用内容:
9645
+ - 表设计规范 → DDL编写
9646
+ - 查询规范 → SQL编写
9647
+ - 性能规范 → 索引设计
9648
+ ```
9649
+
9650
+ ---
9651
+
9652
+ ## Phase 4: 影响评估与风险分析
9653
+
9654
+ ### 4.1 影响评估
9655
+
9656
+ ```yaml
9657
+ 评估维度:
9658
+ 代码影响:
9659
+ - 新增代码量估算
9660
+ - 修改代码范围
9661
+ - 测试代码需求
9662
+
9663
+ 数据影响:
9664
+ - 数据迁移需求
9665
+ - 数据一致性风险
9666
+ - 备份恢复策略
9667
+
9668
+ 性能影响:
9669
+ - 新增负载评估
9670
+ - 资源需求变化
9671
+ - 性能测试要求
9672
+
9673
+ 部署影响:
9674
+ - 部署步骤变更
9675
+ - 配置变更
9676
+ - 回滚方案
9677
+ ```
9678
+
9679
+ ### 4.2 风险分析
8370
9680
 
8371
- ### 8.2 Integration Requirements
9681
+ ```yaml
9682
+ 风险分析:
9683
+ 技术风险:
9684
+ - 新技术引入风险
9685
+ - 兼容性风险
9686
+ - 性能风险
9687
+
9688
+ 业务风险:
9689
+ - 功能影响范围
9690
+ - 数据安全风险
9691
+ - 服务可用性风险
9692
+
9693
+ 实施风险:
9694
+ - 实施复杂度
9695
+ - 团队技能匹配
9696
+ - 时间约束
9697
+
9698
+ 缓解措施:
9699
+ - 每个风险的缓解方案
9700
+ - 监控和告警策略
9701
+ - 应急预案
9702
+ ```
8372
9703
 
8373
- - [ ] External system integrations identified
8374
- - [ ] API requirements documented
8375
- - [ ] Authentication for integrations specified
8376
- - [ ] Data exchange formats defined
8377
- - [ ] Integration testing requirements outlined
9704
+ ---
8378
9705
 
8379
- ### 8.3 Operational Requirements
9706
+ ## Phase 5: 输出架构增量文档
8380
9707
 
8381
- - [ ] Deployment frequency expectations set
8382
- - [ ] Environment requirements defined
8383
- - [ ] Monitoring and alerting needs identified
8384
- - [ ] Support requirements documented
8385
- - [ ] Performance monitoring approach specified
9708
+ ### 5.1 文档结构
8386
9709
 
8387
- ## 9. CLARITY & COMMUNICATION
9710
+ ```yaml
9711
+ 文档结构:
9712
+ 元信息:
9713
+ - 文档版本
9714
+ - 生成时间
9715
+ - 关联PRD
9716
+ - 关联知识库版本
9717
+
9718
+ 变动总览:
9719
+ - 变动等级
9720
+ - 主要变动领域
9721
+ - 风险等级
9722
+
9723
+ 详细设计:
9724
+ - 模块增量设计
9725
+ - 数据模型增量设计
9726
+ - 接口增量设计
9727
+ - 中间件增量设计
9728
+
9729
+ 实施指南:
9730
+ - 实施顺序
9731
+ - 依赖关系
9732
+ - 检查点
9733
+
9734
+ 知识引用:
9735
+ - 引用的规范文档
9736
+ - 代码示例来源
9737
+
9738
+ 下游交接:
9739
+ - 开发者交接
9740
+ - QA交接
9741
+ ```
8388
9742
 
8389
- ### 9.1 Documentation Quality
9743
+ ### 5.2 输出文件
8390
9744
 
8391
- - [ ] Documents use clear, consistent language
8392
- - [ ] Documents are well-structured and organized
8393
- - [ ] Technical terms are defined where necessary
8394
- - [ ] Diagrams/visuals included where helpful
8395
- - [ ] Documentation is versioned appropriately
9745
+ ```yaml
9746
+ 主输出:
9747
+ 架构增量文档:
9748
+ 路径: docs/architecture-increment.md
9749
+ 格式: Markdown
9750
+
9751
+ 辅助输出:
9752
+ 变动清单:
9753
+ 路径: docs/architecture-changes.yaml
9754
+ 格式: YAML
9755
+ 内容: 结构化的变动清单,便于追踪
9756
+
9757
+ DDL脚本:
9758
+ 路径: docs/ddl/
9759
+ 格式: SQL
9760
+ 内容: 数据库变更脚本
9761
+
9762
+ 知识引用索引:
9763
+ 路径: docs/architecture-knowledge-refs.md
9764
+ 内容: 设计中引用的知识库文档清单
9765
+ ```
8396
9766
 
8397
- ### 9.2 Stakeholder Alignment
9767
+ ---
8398
9768
 
8399
- - [ ] Key stakeholders identified
8400
- - [ ] Stakeholder input incorporated
8401
- - [ ] Potential areas of disagreement addressed
8402
- - [ ] Communication plan for updates established
8403
- - [ ] Approval process defined
9769
+ ## Phase 6: 下游交接
8404
9770
 
8405
- ## PRD & EPIC VALIDATION SUMMARY
9771
+ ### 6.1 交接给开发者
8406
9772
 
8407
- [[LLM: FINAL PM CHECKLIST REPORT GENERATION
9773
+ ```yaml
9774
+ 开发者交接:
9775
+ 必读文件:
9776
+ - docs/architecture-increment.md # 架构增量设计
9777
+ - docs/prd.md # PRD文档
9778
+ - docs/rag/technical/coding-standards/ # 编码规范
8408
9779
 
8409
- Create a comprehensive validation report that includes:
9780
+ 关注点:
9781
+ - 新增模块的包结构
9782
+ - 数据模型变更
9783
+ - 中间件使用方式(含代码示例)
9784
+ - 接口设计规范
8410
9785
 
8411
- 1. Executive Summary
8412
- - Overall PRD completeness (percentage)
8413
- - MVP scope appropriateness (Too Large/Just Right/Too Small)
8414
- - Readiness for architecture phase (Ready/Nearly Ready/Not Ready)
8415
- - Most critical gaps or concerns
9786
+ 建议命令: "*start-development docs/architecture-increment.md"
9787
+ ```
8416
9788
 
8417
- 2. Category Analysis Table
8418
- Fill in the actual table with:
8419
- - Status: PASS (90%+ complete), PARTIAL (60-89%), FAIL (<60%)
8420
- - Critical Issues: Specific problems that block progress
9789
+ ### 6.2 交接给QA
8421
9790
 
8422
- 3. Top Issues by Priority
8423
- - BLOCKERS: Must fix before architect can proceed
8424
- - HIGH: Should fix for quality
8425
- - MEDIUM: Would improve clarity
8426
- - LOW: Nice to have
9791
+ ```yaml
9792
+ QA交接:
9793
+ 必读文件:
9794
+ - docs/architecture-increment.md # 架构增量设计(测试策略章节)
9795
+ - docs/prd.md # PRD文档(验收标准)
8427
9796
 
8428
- 4. MVP Scope Assessment
8429
- - Features that might be cut for true MVP
8430
- - Missing features that are essential
8431
- - Complexity concerns
8432
- - Timeline realism
9797
+ 关注点:
9798
+ - 功能测试范围
9799
+ - 集成测试要求
9800
+ - 回归测试范围
9801
+ - 性能测试要求
8433
9802
 
8434
- 5. Technical Readiness
8435
- - Clarity of technical constraints
8436
- - Identified technical risks
8437
- - Areas needing architect investigation
9803
+ 建议命令: "*create-test-plan docs/architecture-increment.md"
9804
+ ```
8438
9805
 
8439
- 6. Recommendations
8440
- - Specific actions to address each blocker
8441
- - Suggested improvements
8442
- - Next steps
9806
+ ---
8443
9807
 
8444
- After presenting the report, ask if the user wants:
9808
+ ## 使用说明
8445
9809
 
8446
- - Detailed analysis of any failed sections
8447
- - Suggestions for improving specific areas
8448
- - Help with refining MVP scope]]
9810
+ ### 激活命令
8449
9811
 
8450
- ### Category Statuses
9812
+ ```
9813
+ *create-incremental-architecture [prd_path] [rag_path]
9814
+ ```
8451
9815
 
8452
- | Category | Status | Critical Issues |
8453
- | -------------------------------- | ------ | --------------- |
8454
- | 1. Problem Definition & Context | _TBD_ | |
8455
- | 2. MVP Scope Definition | _TBD_ | |
8456
- | 3. User Experience Requirements | _TBD_ | |
8457
- | 4. Functional Requirements | _TBD_ | |
8458
- | 5. Non-Functional Requirements | _TBD_ | |
8459
- | 6. Epic & Story Structure | _TBD_ | |
8460
- | 7. Technical Guidance | _TBD_ | |
8461
- | 8. Cross-Functional Requirements | _TBD_ | |
8462
- | 9. Clarity & Communication | _TBD_ | |
9816
+ ### 执行参数
8463
9817
 
8464
- ### Critical Deficiencies
9818
+ ```yaml
9819
+ 参数:
9820
+ prd_path: PRD文档路径 (默认: docs/prd.md)
9821
+ rag_path: RAG知识目录路径 (默认: docs/rag/)
9822
+ output_path: 输出路径 (默认: docs/architecture-increment.md)
9823
+ interactive: 交互模式 (默认: true)
9824
+ ```
8465
9825
 
8466
- (To be populated during validation)
9826
+ ### 交互模式流程
8467
9827
 
8468
- ### Recommendations
9828
+ 1. **验证阶段**: 检查上游交接物完整性
9829
+ 2. **分析阶段**: 展示架构差异分析结果,确认变动点
9830
+ 3. **设计阶段**: 逐模块进行增量设计,关键节点请求确认
9831
+ 4. **评估阶段**: 展示影响评估和风险分析
9832
+ 5. **输出阶段**: 生成架构增量文档,提示下游交接
8469
9833
 
8470
- (To be populated during validation)
9834
+ ### YOLO模式
8471
9835
 
8472
- ### Final Decision
9836
+ 通过 `*yolo` 命令切换YOLO模式,一次性完成所有步骤,跳过中间确认环节。
8473
9837
 
8474
- - **READY FOR ARCHITECT**: The PRD and epics are comprehensive, properly structured, and ready for architectural design.
8475
- - **NEEDS REFINEMENT**: The requirements documentation requires additional work to address the identified deficiencies.
8476
- ==================== END: .xiaoma-core/checklists/pm-checklist.md ====================
9838
+ ---
8477
9839
 
8478
- ==================== START: .xiaoma-core/data/technical-preferences.md ====================
8479
- <!-- Powered by XiaoMa™ Core -->
9840
+ ## 任务完成标志
8480
9841
 
8481
- # User-Defined Preferred Patterns and Preferences
9842
+ ```yaml
9843
+ 完成条件:
9844
+ 必要输出:
9845
+ - docs/architecture-increment.md
8482
9846
 
8483
- None Listed
8484
- ==================== END: .xiaoma-core/data/technical-preferences.md ====================
9847
+ 完成提示: |
9848
+ 架构增量设计完成!
9849
+
9850
+ 📄 输出文件: docs/architecture-increment.md
9851
+ 📊 变动等级: {change_level}
9852
+ ⚠️ 风险等级: {risk_level}
9853
+
9854
+ 📋 变动摘要:
9855
+ - 模块变动: {module_changes}
9856
+ - 数据模型变动: {data_model_changes}
9857
+ - 接口变动: {api_changes}
9858
+ - 中间件变动: {middleware_changes}
9859
+
9860
+ 🔄 下一步建议:
9861
+ - 开发实施: *start-development docs/architecture-increment.md
9862
+ - 测试计划: *create-test-plan docs/architecture-increment.md
9863
+
9864
+ 💡 请在开发前确认架构设计,特别关注:
9865
+ - 风险清单中的高风险项
9866
+ - 数据迁移方案
9867
+ - 回滚策略
9868
+ ```
9869
+ ==================== END: .xiaoma-core/tasks/create-incremental-architecture.md ====================
8485
9870
 
8486
9871
  ==================== START: .xiaoma-core/templates/architecture-tmpl.yaml ====================
8487
9872
  template:
@@ -10818,6 +12203,610 @@ sections:
10818
12203
  instruction: 在运行检查清单前,提议输出完整的架构文档。一旦用户确认,执行 architect-checklist 并在此处填充结果。
10819
12204
  ==================== END: .xiaoma-core/templates/fullstack-architecture-tmpl.yaml ====================
10820
12205
 
12206
+ ==================== START: .xiaoma-core/templates/incremental-architecture-tmpl.yaml ====================
12207
+ template:
12208
+ id: incremental-architecture-template-v1
12209
+ name: 架构增量设计文档
12210
+ version: 1.0
12211
+ description: 基于知识库和PRD进行架构增量设计,识别技术变动并生成增量架构文档
12212
+ output:
12213
+ format: markdown
12214
+ filename: docs/architecture-increment.md
12215
+ title: "{{project_name}} 架构增量设计文档"
12216
+
12217
+ workflow:
12218
+ mode: interactive
12219
+ elicitation: advanced-elicitation
12220
+ upstream:
12221
+ agents:
12222
+ - analyst # 提供技术知识库
12223
+ - pm # 提供PRD文档
12224
+ required_files:
12225
+ - docs/prd.md
12226
+ - docs/rag/technical/architecture.md
12227
+ optional_files:
12228
+ - docs/rag/technical/tech-stack.md
12229
+ - docs/rag/technical/data-model.md
12230
+ - docs/rag/technical/module-structure.md
12231
+ - docs/rag/technical/coding-standards/*
12232
+ - docs/rag/technical/middleware/*
12233
+ - docs/rag/constraints/*
12234
+
12235
+ sections:
12236
+ - id: input-validation
12237
+ title: 输入验证
12238
+ internal: true
12239
+ instruction: |
12240
+ 在开始架构设计之前,执行以下验证:
12241
+
12242
+ 1. **检查PRD文档**:
12243
+ - docs/prd.md 或 docs/epic-{name}.md 是否存在
12244
+ - 提取功能需求(FR)、非功能需求(NFR)、数据实体、技术约束
12245
+
12246
+ 2. **检查技术知识库**:
12247
+ - docs/rag/technical/architecture.md (现有架构)
12248
+ - docs/rag/technical/data-model.md (现有数据模型)
12249
+ - docs/rag/technical/coding-standards/ (编码规范)
12250
+ - docs/rag/technical/middleware/ (中间件规范)
12251
+
12252
+ 3. **加载现有架构信息**:
12253
+ - 架构模式、技术栈、模块结构
12254
+ - 现有数据实体和关系
12255
+ - 编码规范和中间件使用方式
12256
+
12257
+ 如果缺少必需文件,提示:
12258
+ "⚠️ 缺少必需的输入文件:
12259
+ - PRD文档:请先执行 PM 智能体 *create-prd-from-rag
12260
+ - 技术知识库:请先执行 Analyst 智能体完善技术知识"
12261
+
12262
+ - id: document-header
12263
+ title: 文档信息
12264
+ sections:
12265
+ - id: meta-info
12266
+ title: 元信息
12267
+ template: |
12268
+ | 属性 | 值 |
12269
+ |------|-----|
12270
+ | 文档版本 | {{version}} |
12271
+ | 生成时间 | {{timestamp}} |
12272
+ | 关联PRD | {{prd_path}} |
12273
+ | 技术知识库版本 | {{rag_version}} |
12274
+ | 架构师 | Architect Agent |
12275
+ - id: changelog
12276
+ title: 变更日志
12277
+ type: table
12278
+ columns: [日期, 版本, 变更内容, 作者]
12279
+
12280
+ - id: existing-architecture-summary
12281
+ title: 现有架构概要
12282
+ instruction: |
12283
+ 从技术知识库提取现有架构信息,作为增量设计的基线。
12284
+
12285
+ **来源**:
12286
+ - docs/rag/technical/architecture.md
12287
+ - docs/rag/technical/tech-stack.md
12288
+ - docs/rag/technical/module-structure.md
12289
+ sections:
12290
+ - id: architecture-pattern
12291
+ title: 架构模式
12292
+ instruction: 从 architecture.md 提取架构模式描述
12293
+ template: |
12294
+ **架构类型**: {{architecture_type}}
12295
+ **分层结构**: {{layer_structure}}
12296
+ **关键特征**: {{key_characteristics}}
12297
+ - id: tech-stack-baseline
12298
+ title: 技术栈基线
12299
+ type: table
12300
+ columns: [类别, 技术, 版本, 用途]
12301
+ instruction: 从 tech-stack.md 提取当前技术栈
12302
+ - id: module-structure-baseline
12303
+ title: 模块结构基线
12304
+ instruction: 从 module-structure.md 提取现有模块结构
12305
+ type: code
12306
+ language: plaintext
12307
+ - id: data-model-baseline
12308
+ title: 数据模型基线
12309
+ instruction: |
12310
+ 从 data-model.md 提取现有数据实体清单。
12311
+ 使用Mermaid ER图展示核心实体关系。
12312
+
12313
+ - id: requirement-extraction
12314
+ title: 需求提取
12315
+ instruction: |
12316
+ 从PRD文档提取与架构相关的需求。
12317
+
12318
+ **来源**:
12319
+ - docs/prd.md 或 docs/epic-{name}.md
12320
+ sections:
12321
+ - id: functional-requirements
12322
+ title: 功能性需求摘要
12323
+ type: table
12324
+ columns: [需求ID, 需求描述, 架构影响, 优先级]
12325
+ instruction: |
12326
+ 提取PRD中的功能性需求(FR),评估每个需求的架构影响:
12327
+ - 无影响:完全在现有架构内实现
12328
+ - 小影响:需要新增类/方法
12329
+ - 中影响:需要新增模块/表
12330
+ - 大影响:需要架构调整
12331
+ - id: non-functional-requirements
12332
+ title: 非功能性需求摘要
12333
+ type: table
12334
+ columns: [需求ID, 需求描述, 约束类型, 架构影响]
12335
+ instruction: 提取PRD中的非功能性需求(NFR),特别关注性能、安全、可用性约束
12336
+ - id: data-requirements
12337
+ title: 数据需求摘要
12338
+ type: table
12339
+ columns: [实体名称, 操作类型, 核心属性, 关联实体]
12340
+ instruction: |
12341
+ 从PRD中提取数据实体需求,标注:
12342
+ - 新增:PRD中定义的新实体
12343
+ - 修改:需要变更的现有实体
12344
+ - 复用:直接使用的现有实体
12345
+
12346
+ - id: change-analysis
12347
+ title: 架构变动分析
12348
+ instruction: |
12349
+ 对比现有架构与新需求,识别所有技术变动点。
12350
+
12351
+ **分析维度**:
12352
+ 1. 架构层面变动
12353
+ 2. 技术栈变动
12354
+ 3. 数据模型变动
12355
+ 4. 接口变动
12356
+ 5. 中间件变动
12357
+
12358
+ 展示分析结果,请用户确认变动识别是否准确。
12359
+ elicit: true
12360
+ sections:
12361
+ - id: change-overview
12362
+ title: 变动总览
12363
+ template: |
12364
+ | 维度 | 变动等级 | 变动数量 | 主要变动 |
12365
+ |------|----------|----------|----------|
12366
+ | 架构层面 | {{arch_level}} | {{arch_count}} | {{arch_main}} |
12367
+ | 技术栈 | {{tech_level}} | {{tech_count}} | {{tech_main}} |
12368
+ | 数据模型 | {{data_level}} | {{data_count}} | {{data_main}} |
12369
+ | 接口 | {{api_level}} | {{api_count}} | {{api_main}} |
12370
+ | 中间件 | {{mw_level}} | {{mw_count}} | {{mw_main}} |
12371
+
12372
+ **总体变动等级**: {{overall_level}}
12373
+ **风险等级**: {{risk_level}}
12374
+ - id: architecture-changes
12375
+ title: 架构层面变动
12376
+ condition: 存在架构层面变动
12377
+ sections:
12378
+ - id: new-modules
12379
+ title: 新增模块
12380
+ type: table
12381
+ columns: [模块名称, 职责, 所属层, 关联需求]
12382
+ - id: modified-modules
12383
+ title: 修改模块
12384
+ type: table
12385
+ columns: [模块名称, 变更内容, 变更原因, 关联需求]
12386
+ - id: tech-stack-changes
12387
+ title: 技术栈变动
12388
+ condition: 存在技术栈变动
12389
+ sections:
12390
+ - id: new-technologies
12391
+ title: 新增技术
12392
+ type: table
12393
+ columns: [技术名称, 版本, 用途, 引入理由, 替代方案]
12394
+ - id: version-upgrades
12395
+ title: 版本升级
12396
+ type: table
12397
+ columns: [技术名称, 当前版本, 目标版本, 升级原因, 兼容性风险]
12398
+ - id: data-model-changes
12399
+ title: 数据模型变动
12400
+ sections:
12401
+ - id: new-entities
12402
+ title: 新增实体
12403
+ type: table
12404
+ columns: [实体名称, 表名, 核心字段, 关联实体, 关联需求]
12405
+ - id: modified-entities
12406
+ title: 修改实体
12407
+ type: table
12408
+ columns: [实体名称, 变更字段, 变更类型, 兼容性, 关联需求]
12409
+ - id: new-relationships
12410
+ title: 新增关系
12411
+ type: table
12412
+ columns: [源实体, 目标实体, 关系类型, 关联字段, 关联需求]
12413
+ - id: api-changes
12414
+ title: 接口变动
12415
+ condition: 存在接口变动
12416
+ sections:
12417
+ - id: new-apis
12418
+ title: 新增API
12419
+ type: table
12420
+ columns: [接口路径, 方法, 功能描述, 关联需求]
12421
+ - id: modified-apis
12422
+ title: 修改API
12423
+ type: table
12424
+ columns: [接口路径, 变更内容, 兼容性策略, 关联需求]
12425
+ - id: middleware-changes
12426
+ title: 中间件变动
12427
+ condition: 存在中间件变动
12428
+ sections:
12429
+ - id: redis-changes
12430
+ title: Redis变动
12431
+ type: table
12432
+ columns: [Key名称, 数据结构, 用途, 过期策略, 关联需求]
12433
+ - id: mq-changes
12434
+ title: 消息队列变动
12435
+ type: table
12436
+ columns: [Topic/Queue, 消息类型, 生产者, 消费者, 关联需求]
12437
+ - id: scheduler-changes
12438
+ title: 定时任务变动
12439
+ type: table
12440
+ columns: [任务名称, 执行周期, 功能描述, 关联需求]
12441
+
12442
+ - id: incremental-design
12443
+ title: 增量设计详情
12444
+ instruction: |
12445
+ 为每个变动点提供详细的增量设计方案。
12446
+ 设计必须遵循知识库中的编码规范和中间件使用规范。
12447
+ elicit: true
12448
+ sections:
12449
+ - id: module-design
12450
+ title: 模块增量设计
12451
+ repeatable: true
12452
+ instruction: |
12453
+ 为每个新增/修改的模块提供详细设计。
12454
+ 包结构必须遵循 docs/rag/technical/module-structure.md 中的规范。
12455
+ sections:
12456
+ - id: module-detail
12457
+ title: "{{module_name}}"
12458
+ template: |
12459
+ **模块类型**: 新增 / 修改
12460
+ **职责描述**: {{responsibility}}
12461
+ **所属层**: {{layer}}
12462
+ **关联需求**: {{related_requirements}}
12463
+ sections:
12464
+ - id: package-structure
12465
+ title: 包结构设计
12466
+ instruction: 遵循现有模块结构规范设计包结构
12467
+ type: code
12468
+ language: plaintext
12469
+ - id: class-design
12470
+ title: 核心类设计
12471
+ instruction: |
12472
+ 列出核心类及其职责,命名遵循编码规范:
12473
+ - Controller: {Module}Controller
12474
+ - Service: {Module}Service / {Module}ServiceImpl
12475
+ - DAO: {Module}Mapper / {Module}Repository
12476
+ type: table
12477
+ columns: [类名, 类型, 职责, 依赖]
12478
+ - id: integration-points
12479
+ title: 集成点
12480
+ instruction: 描述与现有模块的集成方式
12481
+ type: bullet-list
12482
+
12483
+ - id: data-model-design
12484
+ title: 数据模型增量设计
12485
+ repeatable: true
12486
+ instruction: |
12487
+ 为每个新增/修改的数据实体提供详细设计。
12488
+ 设计必须遵循 docs/rag/technical/sql-standards/ 中的规范。
12489
+ sections:
12490
+ - id: entity-detail
12491
+ title: "{{entity_name}}"
12492
+ template: |
12493
+ **操作类型**: 新增 / 修改
12494
+ **表名**: {{table_name}}
12495
+ **关联需求**: {{related_requirements}}
12496
+ sections:
12497
+ - id: field-design
12498
+ title: 字段设计
12499
+ type: table
12500
+ columns: [字段名, 类型, 长度, 约束, 默认值, 说明]
12501
+ instruction: 字段命名遵循数据库命名规范
12502
+ - id: index-design
12503
+ title: 索引设计
12504
+ type: table
12505
+ columns: [索引名, 类型, 字段, 用途]
12506
+ instruction: 索引命名遵循 idx_{表名}_{字段} 规范
12507
+ - id: ddl-script
12508
+ title: DDL脚本
12509
+ type: code
12510
+ language: sql
12511
+ instruction: |
12512
+ 生成DDL脚本,遵循SQL规范:
12513
+ - 包含完整的字段定义
12514
+ - 包含索引创建
12515
+ - 包含注释
12516
+ - id: migration-script
12517
+ title: 迁移脚本
12518
+ condition: 修改现有表
12519
+ type: code
12520
+ language: sql
12521
+ instruction: 生成安全的迁移脚本,考虑向后兼容性
12522
+
12523
+ - id: api-design
12524
+ title: 接口增量设计
12525
+ repeatable: true
12526
+ condition: 存在接口变动
12527
+ instruction: |
12528
+ 为每个新增/修改的API提供详细设计。
12529
+ 设计必须遵循现有API规范。
12530
+ sections:
12531
+ - id: api-detail
12532
+ title: "{{api_name}}"
12533
+ template: |
12534
+ **操作类型**: 新增 / 修改
12535
+ **接口路径**: {{api_path}}
12536
+ **请求方法**: {{http_method}}
12537
+ **功能描述**: {{description}}
12538
+ **关联需求**: {{related_requirements}}
12539
+ sections:
12540
+ - id: request-design
12541
+ title: 请求设计
12542
+ sections:
12543
+ - id: request-params
12544
+ title: 请求参数
12545
+ type: table
12546
+ columns: [参数名, 类型, 必填, 说明, 示例]
12547
+ - id: request-body
12548
+ title: 请求体
12549
+ type: code
12550
+ language: json
12551
+ - id: response-design
12552
+ title: 响应设计
12553
+ sections:
12554
+ - id: success-response
12555
+ title: 成功响应
12556
+ type: code
12557
+ language: json
12558
+ - id: error-codes
12559
+ title: 错误码
12560
+ type: table
12561
+ columns: [错误码, 错误信息, 触发场景]
12562
+ - id: controller-skeleton
12563
+ title: Controller骨架代码
12564
+ type: code
12565
+ language: java
12566
+ instruction: |
12567
+ 生成Controller骨架代码,遵循编码规范:
12568
+ - 使用正确的注解
12569
+ - 参数校验
12570
+ - 统一响应格式
12571
+
12572
+ - id: middleware-design
12573
+ title: 中间件增量设计
12574
+ condition: 存在中间件变动
12575
+ instruction: |
12576
+ 为中间件使用提供详细设计。
12577
+ 必须参考 docs/rag/technical/middleware/ 中的规范和代码示例。
12578
+ sections:
12579
+ - id: redis-design
12580
+ title: Redis设计
12581
+ condition: 存在Redis变动
12582
+ repeatable: true
12583
+ sections:
12584
+ - id: redis-detail
12585
+ title: "{{redis_key_name}}"
12586
+ template: |
12587
+ **Key模式**: {{key_pattern}}
12588
+ **数据结构**: {{data_structure}}
12589
+ **用途**: {{purpose}}
12590
+ **过期策略**: {{expiration}}
12591
+ **关联需求**: {{related_requirements}}
12592
+ sections:
12593
+ - id: redis-code-example
12594
+ title: 代码示例
12595
+ type: code
12596
+ language: java
12597
+ instruction: 参考 docs/rag/technical/middleware/redis.md 中的代码示例
12598
+ - id: mq-design
12599
+ title: 消息队列设计
12600
+ condition: 存在MQ变动
12601
+ repeatable: true
12602
+ sections:
12603
+ - id: mq-detail
12604
+ title: "{{topic_name}}"
12605
+ template: |
12606
+ **Topic/Queue**: {{topic_queue}}
12607
+ **消息类型**: {{message_type}}
12608
+ **生产者**: {{producer}}
12609
+ **消费者**: {{consumer}}
12610
+ **关联需求**: {{related_requirements}}
12611
+ sections:
12612
+ - id: message-schema
12613
+ title: 消息格式
12614
+ type: code
12615
+ language: json
12616
+ - id: producer-code
12617
+ title: 生产者代码示例
12618
+ type: code
12619
+ language: java
12620
+ instruction: 参考 docs/rag/technical/middleware/mq.md 中的代码示例
12621
+ - id: consumer-code
12622
+ title: 消费者代码示例
12623
+ type: code
12624
+ language: java
12625
+ - id: scheduler-design
12626
+ title: 定时任务设计
12627
+ condition: 存在定时任务变动
12628
+ repeatable: true
12629
+ sections:
12630
+ - id: scheduler-detail
12631
+ title: "{{task_name}}"
12632
+ template: |
12633
+ **任务名称**: {{task_name}}
12634
+ **执行周期**: {{cron_expression}}
12635
+ **功能描述**: {{description}}
12636
+ **关联需求**: {{related_requirements}}
12637
+ sections:
12638
+ - id: scheduler-code
12639
+ title: 任务代码示例
12640
+ type: code
12641
+ language: java
12642
+ instruction: 参考 docs/rag/technical/middleware/scheduler.md 中的代码示例
12643
+
12644
+ - id: impact-assessment
12645
+ title: 影响评估
12646
+ instruction: 评估架构变动的影响范围和风险
12647
+ elicit: true
12648
+ sections:
12649
+ - id: code-impact
12650
+ title: 代码影响
12651
+ template: |
12652
+ **新增代码量估算**: {{new_code_estimate}}
12653
+ **修改代码范围**: {{modified_code_scope}}
12654
+ **测试代码需求**: {{test_code_requirement}}
12655
+ - id: data-impact
12656
+ title: 数据影响
12657
+ template: |
12658
+ **数据迁移需求**: {{migration_requirement}}
12659
+ **数据一致性风险**: {{consistency_risk}}
12660
+ **备份恢复策略**: {{backup_strategy}}
12661
+ - id: performance-impact
12662
+ title: 性能影响
12663
+ template: |
12664
+ **新增负载评估**: {{load_estimate}}
12665
+ **资源需求变化**: {{resource_change}}
12666
+ **性能测试要求**: {{performance_test_requirement}}
12667
+ - id: deployment-impact
12668
+ title: 部署影响
12669
+ template: |
12670
+ **部署步骤变更**: {{deployment_change}}
12671
+ **配置变更**: {{config_change}}
12672
+ **回滚方案**: {{rollback_plan}}
12673
+
12674
+ - id: risk-analysis
12675
+ title: 风险分析
12676
+ sections:
12677
+ - id: risk-list
12678
+ title: 风险清单
12679
+ type: table
12680
+ columns: [风险ID, 风险类型, 风险描述, 可能性, 影响, 缓解措施]
12681
+ instruction: |
12682
+ 识别所有风险,类型包括:
12683
+ - 技术风险:新技术引入、兼容性、性能
12684
+ - 业务风险:功能影响、数据安全、服务可用性
12685
+ - 实施风险:复杂度、技能匹配、时间约束
12686
+ - id: critical-risks
12687
+ title: 关键风险详述
12688
+ instruction: 对高风险项提供详细分析和缓解方案
12689
+ repeatable: true
12690
+ template: |
12691
+ ### {{risk_name}}
12692
+
12693
+ **风险描述**: {{description}}
12694
+ **可能性**: {{probability}}
12695
+ **影响程度**: {{impact}}
12696
+
12697
+ **根因分析**: {{root_cause}}
12698
+
12699
+ **缓解措施**:
12700
+ {{mitigation_measures}}
12701
+
12702
+ **应急预案**:
12703
+ {{contingency_plan}}
12704
+
12705
+ **监控指标**:
12706
+ {{monitoring_metrics}}
12707
+
12708
+ - id: implementation-guide
12709
+ title: 实施指南
12710
+ sections:
12711
+ - id: implementation-sequence
12712
+ title: 实施顺序
12713
+ instruction: |
12714
+ 基于依赖关系,规划实施顺序。
12715
+ 每个阶段对应PRD中的Epic/Story。
12716
+ type: numbered-list
12717
+ template: |
12718
+ 1. **阶段1: {{phase1_name}}**
12719
+ - Story: {{story_refs}}
12720
+ - 前置条件: {{prerequisites}}
12721
+ - 产出物: {{deliverables}}
12722
+ - 检查点: {{checkpoints}}
12723
+ - id: dependency-diagram
12724
+ title: 依赖关系图
12725
+ type: mermaid
12726
+ mermaid_type: graph
12727
+ instruction: 使用Mermaid图展示实施依赖关系
12728
+ - id: checkpoints
12729
+ title: 关键检查点
12730
+ type: table
12731
+ columns: [检查点, 阶段, 验证内容, 负责人]
12732
+
12733
+ - id: knowledge-references
12734
+ title: 知识引用索引
12735
+ instruction: 列出设计中引用的所有知识库文档
12736
+ sections:
12737
+ - id: architecture-refs
12738
+ title: 架构知识引用
12739
+ type: table
12740
+ columns: [文件路径, 引用章节, 引用内容]
12741
+ - id: coding-standard-refs
12742
+ title: 编码规范引用
12743
+ type: table
12744
+ columns: [文件路径, 引用规范, 应用位置]
12745
+ - id: middleware-refs
12746
+ title: 中间件规范引用
12747
+ type: table
12748
+ columns: [文件路径, 引用示例, 应用位置]
12749
+
12750
+ - id: next-steps
12751
+ title: 后续步骤
12752
+ sections:
12753
+ - id: developer-handoff
12754
+ title: 开发者交接
12755
+ instruction: |
12756
+ 生成给开发者的交接提示,包含:
12757
+ - 需要阅读的文档清单
12758
+ - 编码规范要点
12759
+ - 实施注意事项
12760
+ template: |
12761
+ **交接给开发者**
12762
+
12763
+ 请基于本架构增量设计文档进行开发:
12764
+
12765
+ **必读文档**:
12766
+ - 架构增量设计: docs/architecture-increment.md
12767
+ - PRD文档: {{prd_path}}
12768
+ - 编码规范: docs/rag/technical/coding-standards/
12769
+
12770
+ **开发重点**:
12771
+ - 变动模块: {{changed_modules}}
12772
+ - 数据模型变更: {{data_changes}}
12773
+ - 接口变更: {{api_changes}}
12774
+
12775
+ **注意事项**:
12776
+ - 严格遵循编码规范
12777
+ - 参考中间件代码示例
12778
+ - 每个Story完成后进行集成验证
12779
+
12780
+ **执行命令**: *start-development docs/architecture-increment.md
12781
+ - id: qa-handoff
12782
+ title: QA交接
12783
+ instruction: |
12784
+ 生成给QA的交接提示,包含:
12785
+ - 测试范围
12786
+ - 重点测试项
12787
+ - 回归测试要求
12788
+ template: |
12789
+ **交接给QA**
12790
+
12791
+ 请基于本架构增量设计制定测试计划:
12792
+
12793
+ **必读文档**:
12794
+ - 架构增量设计: docs/architecture-increment.md (影响评估章节)
12795
+ - PRD文档: {{prd_path}} (验收标准)
12796
+
12797
+ **测试范围**:
12798
+ - 新增功能: {{new_features}}
12799
+ - 修改功能: {{modified_features}}
12800
+ - 回归范围: {{regression_scope}}
12801
+
12802
+ **重点关注**:
12803
+ - 数据迁移验证
12804
+ - 接口兼容性测试
12805
+ - 性能影响验证
12806
+
12807
+ **执行命令**: *create-test-plan docs/architecture-increment.md
12808
+ ==================== END: .xiaoma-core/templates/incremental-architecture-tmpl.yaml ====================
12809
+
10821
12810
  ==================== START: .xiaoma-core/checklists/architect-checklist.md ====================
10822
12811
  <!-- Powered by XiaoMa™ Core -->
10823
12812