@zeyue0329/xiaoma-cli 1.0.43 → 1.0.45

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.
@@ -230,6 +230,10 @@ commands:
230
230
  - elicit: 运行任务 advanced-elicitation
231
231
  - perform-market-research: 使用任务 create-doc 和 market-research-tmpl.yaml
232
232
  - research-prompt {topic}: 执行任务 create-deep-research-prompt.md
233
+ - analyze-requirement {req_file}: 基于需求文档进行RAG增强的需求分析 (运行任务 requirement-analysis-with-rag.md)
234
+ - generate-rag-questions {req_file}: 根据需求文档生成知识库查询问题清单 (使用模板 rag-questions-tmpl.yaml)
235
+ - land-knowledge: 将知识库返回的内容结构化存储到docs/rag目录 (使用模板 rag-knowledge-tmpl.yaml)
236
+ - create-prd-from-rag: 基于docs/rag知识和需求文档生成PRD (使用任务 create-doc 和 prd-tmpl.yaml)
233
237
  - yolo: 切换 Yolo 模式
234
238
  - exit: 作为业务分析师道别,然后放弃扮演此角色
235
239
  dependencies:
@@ -242,11 +246,15 @@ dependencies:
242
246
  - create-doc.md
243
247
  - document-project.md
244
248
  - facilitate-brainstorming-session.md
249
+ - requirement-analysis-with-rag.md
245
250
  templates:
246
251
  - brainstorming-output-tmpl.yaml
247
252
  - competitor-analysis-tmpl.yaml
248
253
  - market-research-tmpl.yaml
249
254
  - project-brief-tmpl.yaml
255
+ - rag-questions-tmpl.yaml
256
+ - rag-knowledge-tmpl.yaml
257
+ - prd-tmpl.yaml
250
258
  ```
251
259
  ==================== END: .xiaoma-core/agents/analyst.md ====================
252
260
 
@@ -2565,6 +2573,361 @@ Generate structured document with these sections:
2565
2573
  - Respect their process and timing
2566
2574
  ==================== END: .xiaoma-core/tasks/facilitate-brainstorming-session.md ====================
2567
2575
 
2576
+ ==================== START: .xiaoma-core/tasks/requirement-analysis-with-rag.md ====================
2577
+ <!-- Powered by XiaoMa™ Core -->
2578
+
2579
+ # 基于知识库的需求分析任务
2580
+
2581
+ ## Purpose
2582
+
2583
+ 通过结合外部需求文档(req.txt)和知识库(RAG/MCP)进行深度需求分析,生成高质量的PRD文档。
2584
+
2585
+ ## Workflow Overview
2586
+
2587
+ ```
2588
+ req.txt → 问题生成 → 知识库查询 → 知识落地(docs/rag/) → 需求分析 → PRD生成
2589
+ ```
2590
+
2591
+ ## Phase 1: 需求文档解析与问题生成
2592
+
2593
+ ### 1.1 需求文档初步解析
2594
+
2595
+ 首先读取并分析 req.txt 文档,识别以下关键信息:
2596
+
2597
+ ```yaml
2598
+ 解析维度:
2599
+ 业务领域: 识别需求所属的业务领域和子领域
2600
+ 核心功能: 提取需求描述的主要功能点
2601
+ 用户角色: 识别涉及的用户类型和角色
2602
+ 业务流程: 提取隐含或显式的业务流程
2603
+ 数据实体: 识别涉及的数据对象和关系
2604
+ 集成点: 识别与外部系统的交互需求
2605
+ 约束条件: 提取技术、业务、时间等约束
2606
+ 模糊点: 标记需要澄清的不明确内容
2607
+ ```
2608
+
2609
+ ### 1.2 知识库问题生成框架
2610
+
2611
+ 基于解析结果,生成以下类别的问题向知识库查询:
2612
+
2613
+ ---
2614
+
2615
+ ## Phase 2: 知识库提问清单模板
2616
+
2617
+ ### 类别 A: 业务知识查询
2618
+
2619
+ #### A1. 业务领域背景
2620
+ ```
2621
+ 问题模板:
2622
+ - "关于[业务领域],现有系统中有哪些相关的业务规则和约束?"
2623
+ - "[业务流程名称]的完整流程是什么?包括哪些步骤和参与者?"
2624
+ - "在[业务场景]中,有哪些已知的边界情况和异常处理逻辑?"
2625
+ - "[业务概念A]和[业务概念B]之间的关系是什么?"
2626
+ ```
2627
+
2628
+ #### A2. 现有功能调研
2629
+ ```
2630
+ 问题模板:
2631
+ - "系统中是否已存在类似[功能描述]的功能?如果有,实现方式是什么?"
2632
+ - "[模块名称]目前支持哪些操作?有什么限制?"
2633
+ - "用户当前如何完成[业务目标]?现有流程有什么痛点?"
2634
+ ```
2635
+
2636
+ #### A3. 业务规则确认
2637
+ ```
2638
+ 问题模板:
2639
+ - "[数据实体]的业务规则有哪些?例如:必填字段、取值范围、状态流转规则"
2640
+ - "[操作A]在什么条件下可以执行?有哪些前置条件?"
2641
+ - "不同[用户角色]在[功能]上的权限差异是什么?"
2642
+ ```
2643
+
2644
+ ---
2645
+
2646
+ ### 类别 B: 技术知识查询
2647
+
2648
+ #### B1. 系统架构
2649
+ ```
2650
+ 问题模板:
2651
+ - "现有系统的技术架构是什么?使用了哪些核心框架和技术栈?"
2652
+ - "[模块名称]的代码结构和目录组织是怎样的?"
2653
+ - "系统的数据库设计采用什么模式?主要的数据表有哪些?"
2654
+ - "系统中有哪些公共组件和工具类可以复用?"
2655
+ ```
2656
+
2657
+ #### B2. 接口与集成
2658
+ ```
2659
+ 问题模板:
2660
+ - "与[外部系统]的集成接口是什么?数据格式和协议是什么?"
2661
+ - "系统提供了哪些API接口?[功能相关]的接口规范是什么?"
2662
+ - "现有的消息队列/事件机制是如何设计的?"
2663
+ ```
2664
+
2665
+ #### B3. 数据模型
2666
+ ```
2667
+ 问题模板:
2668
+ - "[数据实体]在数据库中的表结构是什么?包含哪些字段?"
2669
+ - "[实体A]和[实体B]之间的数据库关系是怎样的?"
2670
+ - "系统中有哪些枚举值或字典表与[业务领域]相关?"
2671
+ ```
2672
+
2673
+ #### B4. 代码实现参考
2674
+ ```
2675
+ 问题模板:
2676
+ - "类似[功能]的实现在代码中是如何组织的?请提供示例代码位置"
2677
+ - "[技术方案]在现有代码中有没有参考实现?"
2678
+ - "系统中处理[技术问题]的通用模式是什么?"
2679
+ ```
2680
+
2681
+ ---
2682
+
2683
+ ### 类别 C: 历史需求与变更
2684
+
2685
+ #### C1. 相关需求追溯
2686
+ ```
2687
+ 问题模板:
2688
+ - "之前有没有类似[需求描述]的需求?实现情况如何?"
2689
+ - "[功能模块]的历史变更记录有哪些?最近的改动是什么?"
2690
+ - "有没有与[需求]相关的已知问题或技术债务?"
2691
+ ```
2692
+
2693
+ #### C2. 决策记录
2694
+ ```
2695
+ 问题模板:
2696
+ - "[技术方案]为什么选择了当前的实现方式?有什么历史背景?"
2697
+ - "[设计决策]有没有相关的ADR(架构决策记录)?"
2698
+ ```
2699
+
2700
+ ---
2701
+
2702
+ ### 类别 D: 上下文与约束
2703
+
2704
+ #### D1. 项目约束
2705
+ ```
2706
+ 问题模板:
2707
+ - "项目的技术栈限制有哪些?必须遵循的技术规范是什么?"
2708
+ - "项目的安全合规要求有哪些?"
2709
+ - "项目的性能要求和SLA标准是什么?"
2710
+ ```
2711
+
2712
+ #### D2. 团队规范
2713
+ ```
2714
+ 问题模板:
2715
+ - "团队的代码规范和开发流程是什么?"
2716
+ - "团队的测试要求和代码审查标准是什么?"
2717
+ - "项目的部署流程和环境配置是怎样的?"
2718
+ ```
2719
+
2720
+ ---
2721
+
2722
+ ## Phase 3: 问题生成执行流程
2723
+
2724
+ ### 3.1 智能问题生成
2725
+
2726
+ ```yaml
2727
+ 执行步骤:
2728
+ 步骤1_解析需求:
2729
+ 输入: req.txt
2730
+ 动作: 提取关键实体、流程、约束
2731
+ 输出: 需求要素清单
2732
+
2733
+ 步骤2_映射问题类别:
2734
+ 输入: 需求要素清单
2735
+ 动作: 将每个要素映射到问题类别(A/B/C/D)
2736
+ 输出: 问题类别映射表
2737
+
2738
+ 步骤3_生成具体问题:
2739
+ 输入: 问题类别映射表 + 问题模板
2740
+ 动作: 用具体内容填充模板生成问题
2741
+ 输出: 知识库查询问题清单
2742
+
2743
+ 步骤4_问题优先级排序:
2744
+ 优先级规则:
2745
+ P0_阻塞级: 缺失会导致无法理解需求的核心问题
2746
+ P1_重要级: 影响需求完整性的问题
2747
+ P2_补充级: 有助于优化实现的问题
2748
+ ```
2749
+
2750
+ ### 3.2 问题清单输出格式
2751
+
2752
+ ```markdown
2753
+ # 知识库查询问题清单
2754
+
2755
+ ## 基本信息
2756
+ - 需求文档: req.txt
2757
+ - 生成时间: {{timestamp}}
2758
+ - 问题总数: {{total_count}}
2759
+
2760
+ ## P0 阻塞级问题 (必须回答)
2761
+
2762
+ ### 业务知识
2763
+ 1. [A1-001] {{具体问题}}
2764
+ - 关联需求点: {{需求中的相关描述}}
2765
+ - 预期答案类型: {{期望获得的信息类型}}
2766
+
2767
+ ### 技术知识
2768
+ 2. [B1-001] {{具体问题}}
2769
+ - 关联需求点: {{需求中的相关描述}}
2770
+ - 预期答案类型: {{期望获得的信息类型}}
2771
+
2772
+ ## P1 重要级问题 (建议回答)
2773
+ ...
2774
+
2775
+ ## P2 补充级问题 (可选回答)
2776
+ ...
2777
+ ```
2778
+
2779
+ ---
2780
+
2781
+ ## Phase 4: 知识落地与组织
2782
+
2783
+ ### 4.1 知识存储结构
2784
+
2785
+ ```
2786
+ docs/rag/
2787
+ ├── _index.md # 知识索引文件
2788
+ ├── business/ # 业务知识
2789
+ │ ├── domain-rules.md # 业务规则
2790
+ │ ├── processes.md # 业务流程
2791
+ │ └── entities.md # 业务实体
2792
+ ├── technical/ # 技术知识
2793
+ │ ├── architecture.md # 系统架构
2794
+ │ ├── data-model.md # 数据模型
2795
+ │ ├── apis.md # 接口规范
2796
+ │ └── code-patterns.md # 代码模式
2797
+ ├── history/ # 历史信息
2798
+ │ ├── related-requirements.md # 相关需求
2799
+ │ └── decisions.md # 决策记录
2800
+ └── constraints/ # 约束条件
2801
+ ├── technical.md # 技术约束
2802
+ └── compliance.md # 合规要求
2803
+ ```
2804
+
2805
+ ### 4.2 知识文档格式
2806
+
2807
+ ```markdown
2808
+ # {{知识标题}}
2809
+
2810
+ ## 元信息
2811
+ - 来源: 知识库MCP查询
2812
+ - 查询问题: {{原始问题}}
2813
+ - 查询时间: {{timestamp}}
2814
+ - 置信度: {{high/medium/low}}
2815
+
2816
+ ## 内容摘要
2817
+ {{一句话总结}}
2818
+
2819
+ ## 详细内容
2820
+ {{知识库返回的完整内容}}
2821
+
2822
+ ## 与需求的关联
2823
+ - 关联需求点: {{req.txt中的相关内容}}
2824
+ - 影响分析: {{这个知识如何影响需求实现}}
2825
+
2826
+ ## 后续问题
2827
+ {{基于此知识产生的新问题(如有)}}
2828
+ ```
2829
+
2830
+ ---
2831
+
2832
+ ## Phase 5: 需求分析与PRD生成
2833
+
2834
+ ### 5.1 分析输入整合
2835
+
2836
+ ```yaml
2837
+ 分析输入:
2838
+ 主要输入:
2839
+ - req.txt: 原始需求文档
2840
+ - docs/rag/*: 知识库查询结果
2841
+ 辅助输入:
2842
+ - 项目简报(如存在): docs/brief.md
2843
+ - 技术偏好(如存在): data/technical-preferences.yaml
2844
+ ```
2845
+
2846
+ ### 5.2 需求分析维度
2847
+
2848
+ ```yaml
2849
+ 分析维度:
2850
+ 功能分析:
2851
+ - 核心功能拆解
2852
+ - 功能优先级排序
2853
+ - 功能依赖关系
2854
+
2855
+ 用户分析:
2856
+ - 用户角色定义
2857
+ - 用户旅程映射
2858
+ - 用户价值主张
2859
+
2860
+ 技术分析:
2861
+ - 技术可行性评估
2862
+ - 与现有系统的兼容性
2863
+ - 技术风险识别
2864
+
2865
+ 业务分析:
2866
+ - 业务规则验证
2867
+ - 业务流程优化机会
2868
+ - 业务价值量化
2869
+
2870
+ 差距分析:
2871
+ - 现有能力 vs 需求能力
2872
+ - 需要新增/修改的功能
2873
+ - 需要新增/修改的数据
2874
+ ```
2875
+
2876
+ ### 5.3 PRD生成流程
2877
+
2878
+ ```yaml
2879
+ PRD生成:
2880
+ 步骤1:
2881
+ 动作: 整合所有知识输入
2882
+ 输出: 知识上下文汇总
2883
+
2884
+ 步骤2:
2885
+ 动作: 执行需求分析(5.2维度)
2886
+ 输出: 需求分析报告
2887
+
2888
+ 步骤3:
2889
+ 动作: 套用PRD模板(prd-tmpl.yaml)
2890
+ 输出: PRD草稿
2891
+
2892
+ 步骤4:
2893
+ 动作: 启发式验证(advanced-elicitation)
2894
+ 输出: 优化后的PRD
2895
+
2896
+ 步骤5:
2897
+ 动作: 输出最终PRD到指定位置
2898
+ 输出: docs/prd.md
2899
+ ```
2900
+
2901
+ ---
2902
+
2903
+ ## 使用说明
2904
+
2905
+ ### 智能体激活命令
2906
+
2907
+ ```
2908
+ *analyze-requirement {req_file}
2909
+ ```
2910
+
2911
+ ### 执行参数
2912
+
2913
+ ```yaml
2914
+ 参数:
2915
+ req_file: 需求文档路径 (默认: req.txt)
2916
+ rag_output: 知识输出路径 (默认: docs/rag/)
2917
+ prd_output: PRD输出路径 (默认: docs/prd.md)
2918
+ skip_rag: 跳过知识库查询 (默认: false)
2919
+ interactive: 交互模式 (默认: true)
2920
+ ```
2921
+
2922
+ ### 交互模式流程
2923
+
2924
+ 1. **解析阶段**: 展示需求解析结果,请用户确认
2925
+ 2. **提问阶段**: 展示问题清单,请用户确认或调整
2926
+ 3. **查询阶段**: 依次查询知识库,展示返回结果
2927
+ 4. **分析阶段**: 展示分析结论,请用户确认
2928
+ 5. **生成阶段**: 生成PRD草稿,启用启发式优化
2929
+ ==================== END: .xiaoma-core/tasks/requirement-analysis-with-rag.md ====================
2930
+
2568
2931
  ==================== START: .xiaoma-core/templates/brainstorming-output-tmpl.yaml ====================
2569
2932
  template:
2570
2933
  id: brainstorming-output-template-v2
@@ -3542,158 +3905,1887 @@ sections:
3542
3905
  这份项目简报为 {{project_name}} 提供了完整的背景信息。请启动‘PRD 生成模式’,彻底审阅此简报,并与用户合作,按照模板指示逐节创建 PRD,同时请求任何必要的澄清或提出改进建议。
3543
3906
  ==================== END: .xiaoma-core/templates/project-brief-tmpl.yaml ====================
3544
3907
 
3545
- ==================== START: .xiaoma-core/data/brainstorming-techniques.md ====================
3546
- <!-- Powered by XiaoMa™ Core -->
3908
+ ==================== START: .xiaoma-core/templates/rag-questions-tmpl.yaml ====================
3909
+ template:
3910
+ id: rag-questions-template-v2
3911
+ name: 知识库问题生成模板
3912
+ version: 2.0
3913
+ description: 基于需求文档(req.txt)生成知识库MCP查询问题,包含详细的技术架构、编码规范、中间件、业务流程等维度
3914
+ output:
3915
+ format: markdown
3916
+ filename: docs/rag-questions.md
3917
+ title: "知识库查询问题清单"
3547
3918
 
3548
- # Brainstorming Techniques Data
3919
+ workflow:
3920
+ mode: interactive
3921
+ phases:
3922
+ - 需求解析
3923
+ - 问题生成
3924
+ - 问题确认
3925
+ - 知识库查询
3926
+ - 知识落地
3549
3927
 
3550
- ## Creative Expansion
3928
+ sections:
3929
+ - id: requirement-parsing
3930
+ title: 第一阶段:需求文档深度解析
3931
+ instruction: |
3932
+ 读取并深度分析 req.txt 文档,提取以下要素:
3933
+
3934
+ 1. **业务领域识别**
3935
+ - 这个需求属于什么业务领域?(如:订单管理、用户管理、支付系统等)
3936
+ - 涉及哪些子领域或模块?
3937
+
3938
+ 2. **功能点提取**
3939
+ - 需求描述了哪些具体功能?
3940
+ - 每个功能的输入、处理、输出是什么?
3941
+
3942
+ 3. **用户角色识别**
3943
+ - 涉及哪些用户角色?(如:管理员、普通用户、访客)
3944
+ - 每个角色在此需求中的操作是什么?
3945
+
3946
+ 4. **数据实体识别**
3947
+ - 涉及哪些数据对象?(如:订单、商品、用户)
3948
+ - 数据之间的关系是什么?(一对一、一对多、多对多)
3949
+
3950
+ 5. **业务流程识别**
3951
+ - 描述了什么业务流程?
3952
+ - 流程的起点、终点、关键步骤是什么?
3953
+ - 每个步骤之间的触发条件和数据传递是什么?
3954
+
3955
+ 6. **技术关键词识别**
3956
+ - 需求中提及了哪些技术组件?(如:消息队列、缓存、定时任务)
3957
+ - 涉及哪些外部系统集成?
3958
+
3959
+ 7. **模糊点标记**
3960
+ - 哪些描述不够清晰?
3961
+ - 哪些内容有多种理解方式?
3962
+ output:
3963
+ format: yaml
3964
+ template: |
3965
+ 需求解析结果:
3966
+ 业务领域: {{domain}}
3967
+ 子领域: [{{sub_domains}}]
3968
+
3969
+ 功能点:
3970
+ {{#each features}}
3971
+ - 名称: {{name}}
3972
+ 描述: {{description}}
3973
+ 输入: {{input}}
3974
+ 输出: {{output}}
3975
+ 涉及实体: [{{entities}}]
3976
+ {{/each}}
3977
+
3978
+ 用户角色:
3979
+ {{#each roles}}
3980
+ - 角色: {{name}}
3981
+ 操作: [{{actions}}]
3982
+ 权限级别: {{permission_level}}
3983
+ {{/each}}
3984
+
3985
+ 数据实体:
3986
+ {{#each entities}}
3987
+ - 实体: {{name}}
3988
+ 属性: [{{attributes}}]
3989
+ 关系:
3990
+ {{#each relationships}}
3991
+ - 目标实体: {{target}}
3992
+ 关系类型: {{type}} # 一对一/一对多/多对一/多对多
3993
+ 关联字段: {{field}}
3994
+ {{/each}}
3995
+ {{/each}}
3996
+
3997
+ 业务流程:
3998
+ {{#each processes}}
3999
+ - 流程名称: {{name}}
4000
+ 触发条件: {{trigger}}
4001
+ 步骤:
4002
+ {{#each steps}}
4003
+ - 序号: {{index}}
4004
+ 名称: {{name}}
4005
+ 执行者: {{actor}}
4006
+ 前置步骤: {{previous_step}}
4007
+ 触发条件: {{trigger_from_previous}}
4008
+ 输入数据: {{input_data}}
4009
+ 输出数据: {{output_data}}
4010
+ 数据变更: {{data_changes}}
4011
+ {{/each}}
4012
+ 异常分支: [{{exception_branches}}]
4013
+ {{/each}}
4014
+
4015
+ 技术组件:
4016
+ {{#each tech_components}}
4017
+ - 组件: {{name}}
4018
+ 用途: {{purpose}}
4019
+ {{/each}}
4020
+
4021
+ 模糊点:
4022
+ {{#each ambiguities}}
4023
+ - 位置: {{location}}
4024
+ 内容: {{content}}
4025
+ 可能理解: [{{interpretations}}]
4026
+ {{/each}}
4027
+
4028
+ - id: question-generation
4029
+ title: 第二阶段:问题生成
4030
+ instruction: |
4031
+ 基于解析结果,为每个要素生成具体的知识库查询问题。
4032
+
4033
+ **问题生成原则**:
4034
+ 1. 每个问题必须具体、可回答
4035
+ 2. 优先生成阻塞性问题(缺失会导致无法继续)
4036
+ 3. 问题应覆盖:业务、技术、历史、约束 四个维度
4037
+ 4. 避免开放性过强的问题
4038
+ 5. 技术问题需要求提供代码示例
4039
+ 6. 业务流程问题需要追问每个节点的详细信息
4040
+ sections:
3551
4041
 
3552
- 1. **What If Scenarios**: Ask one provocative question, get their response, then ask another
3553
- 2. **Analogical Thinking**: Give one example analogy, ask them to find 2-3 more
3554
- 3. **Reversal/Inversion**: Pose the reverse question, let them work through it
3555
- 4. **First Principles Thinking**: Ask "What are the fundamentals?" and guide them to break it down
4042
+ # ==================== A. 业务知识问题(增强版)====================
4043
+ - id: business-questions
4044
+ title: A. 业务知识问题
4045
+ instruction: |
4046
+ 针对业务领域和流程生成问题,重点关注:
4047
+ - 业务规则和约束的完整定义
4048
+ - 业务流程的每个步骤详情
4049
+ - 步骤间的关联关系和数据流转
4050
+ - 数据实体间的关联关系
4051
+ - 边界情况和异常处理
4052
+ - 用户权限和角色
4053
+ question_templates:
4054
+
4055
+ - category: A1-业务规则详解
4056
+ priority: P0
4057
+ description: 深入了解业务规则的完整定义
4058
+ templates:
4059
+ - question: "[{entity}]实体有哪些业务规则?请详细说明:"
4060
+ sub_questions:
4061
+ - "状态有哪些?状态流转规则是什么?哪些状态可以互相转换?"
4062
+ - "必填字段有哪些?每个必填字段的校验规则是什么?"
4063
+ - "字段的取值范围和格式要求是什么?"
4064
+ - "是否有唯一性约束?唯一性的范围是什么(全局/租户/用户)?"
4065
+ - "是否有软删除?软删除的业务规则是什么?"
4066
+ - "创建/修改/删除操作的前置条件是什么?"
4067
+
4068
+ - question: "[{entity}]和[{related_entity}]之间的业务关联规则是什么?"
4069
+ sub_questions:
4070
+ - "关联关系的业务含义是什么?"
4071
+ - "关联是否必须存在?可以为空吗?"
4072
+ - "删除主实体时,关联实体如何处理?(级联删除/置空/禁止删除)"
4073
+ - "关联实体的生命周期如何与主实体绑定?"
4074
+
4075
+ - question: "[{role}]角色在[{operation}]操作上的权限规则是什么?"
4076
+ sub_questions:
4077
+ - "该角色可以操作哪些数据范围?(全部/本部门/本人)"
4078
+ - "操作需要哪些前置审批或确认?"
4079
+ - "操作是否有时间窗口限制?"
4080
+ - "操作失败时的提示信息应该是什么?"
4081
+
4082
+ - category: A2-业务流程详解
4083
+ priority: P0
4084
+ description: 深入了解业务流程的每个步骤和节点间关系
4085
+ templates:
4086
+ - question: "[{process}]业务流程的完整定义是什么?"
4087
+ sub_questions:
4088
+ - "流程的触发条件是什么?由谁/什么事件触发?"
4089
+ - "流程的正常结束条件是什么?"
4090
+ - "流程的异常结束条件有哪些?"
4091
+ - "流程是否支持取消/撤销?取消后如何回滚?"
4092
+ - "流程的超时处理机制是什么?"
4093
+
4094
+ - question: "[{process}]流程中,步骤[{step_a}]到步骤[{step_b}]的详细信息?"
4095
+ sub_questions:
4096
+ - "从[{step_a}]到[{step_b}]的触发条件是什么?"
4097
+ - "[{step_a}]完成后,需要传递哪些数据给[{step_b}]?"
4098
+ - "数据传递的格式和校验规则是什么?"
4099
+ - "[{step_a}]失败时,是否阻塞[{step_b}]?还是走其他分支?"
4100
+ - "这两个步骤之间是否有时间约束?(如必须在N分钟内完成)"
4101
+
4102
+ - question: "[{process}]流程的第[{n}]个步骤[{step_name}]的详细执行逻辑是什么?"
4103
+ sub_questions:
4104
+ - "该步骤的执行者是谁?(系统自动/人工操作/外部系统)"
4105
+ - "该步骤的输入数据有哪些?数据来源是什么?"
4106
+ - "该步骤的处理逻辑是什么?涉及哪些业务规则?"
4107
+ - "该步骤会产生/修改哪些数据?"
4108
+ - "该步骤完成的标志是什么?如何判定成功/失败?"
4109
+ - "该步骤失败后的重试机制是什么?"
4110
+ - "该步骤是否需要记录日志/审计?记录哪些信息?"
4111
+
4112
+ - question: "[{process}]流程中有哪些并行/分支节点?"
4113
+ sub_questions:
4114
+ - "哪些步骤可以并行执行?并行执行的条件是什么?"
4115
+ - "并行步骤的汇合点在哪里?汇合的条件是什么(全部完成/任一完成)?"
4116
+ - "有哪些条件分支?每个分支的触发条件是什么?"
4117
+ - "分支是否会重新汇合?汇合点在哪里?"
4118
+
4119
+ - question: "[{process}]流程的异常处理机制是什么?"
4120
+ sub_questions:
4121
+ - "每个步骤可能出现的异常有哪些?"
4122
+ - "异常发生后的处理策略是什么?(重试/跳过/终止/人工处理)"
4123
+ - "异常是否需要通知?通知谁?通知方式是什么?"
4124
+ - "流程中断后如何恢复?是否支持断点续传?"
4125
+
4126
+ - category: A3-数据关联关系详解
4127
+ priority: P0
4128
+ description: 深入了解数据实体间的关联关系
4129
+ templates:
4130
+ - question: "[{entity_a}]和[{entity_b}]的数据关联关系详情?"
4131
+ sub_questions:
4132
+ - "关联类型是什么?(一对一/一对多/多对一/多对多)"
4133
+ - "关联是通过什么字段建立的?外键在哪一方?"
4134
+ - "关联是否必须?能否存在孤立记录?"
4135
+ - "关联的建立时机是什么?创建时/后续关联?"
4136
+ - "关联可以修改吗?修改的业务场景是什么?"
4137
+ - "解除关联的条件是什么?解除后数据如何处理?"
4138
+
4139
+ - question: "[{entity}]的一对多关联详情?"
4140
+ sub_questions:
4141
+ - "一个[{entity}]最多可以关联多少个[{related_entity}]?"
4142
+ - "是否有最小关联数量要求?"
4143
+ - "关联顺序是否重要?如何维护顺序?"
4144
+ - "批量添加/删除关联的业务规则是什么?"
4145
+
4146
+ - question: "[{entity}]涉及的多对多关联详情?"
4147
+ sub_questions:
4148
+ - "多对多关联是否有中间表?中间表存储哪些额外信息?"
4149
+ - "关联的创建和删除权限由谁控制?"
4150
+ - "关联是否有时效性?过期如何处理?"
4151
+
4152
+ - category: A4-边界情况与异常处理
4153
+ priority: P1
4154
+ description: 深入了解边界情况的处理逻辑
4155
+ templates:
4156
+ - question: "[{operation}]操作的边界情况有哪些?"
4157
+ sub_questions:
4158
+ - "并发执行时如何处理?是否需要加锁?锁的粒度是什么?"
4159
+ - "数据不存在时如何处理?"
4160
+ - "数据已被其他操作锁定时如何处理?"
4161
+ - "操作超时时如何处理?"
4162
+ - "部分成功时如何处理?是否支持事务回滚?"
4163
+
4164
+ - question: "[{entity}]数据量很大时的处理规则?"
4165
+ sub_questions:
4166
+ - "列表查询的分页规则是什么?默认每页多少条?最大每页多少条?"
4167
+ - "是否支持批量操作?批量操作的最大数量是多少?"
4168
+ - "大数据量导出的限制是什么?是否需要异步处理?"
4169
+ - "历史数据的归档策略是什么?"
4170
+
4171
+ # ==================== B. 技术知识问题(增强版)====================
4172
+ - id: technical-questions
4173
+ title: B. 技术知识问题
4174
+ instruction: |
4175
+ 针对技术实现生成问题,重点关注:
4176
+ - 整体项目技术架构
4177
+ - 中间件使用规范和代码示例
4178
+ - Java编码规范
4179
+ - SQL规范
4180
+ - 数据模型设计
4181
+ - 接口规范
4182
+ - 代码实现模式
4183
+ question_templates:
4184
+
4185
+ - category: B1-整体项目技术架构
4186
+ priority: P0
4187
+ description: 了解项目的整体技术架构和技术栈
4188
+ templates:
4189
+ - question: "项目的整体技术架构是什么?"
4190
+ sub_questions:
4191
+ - "项目采用什么架构模式?(单体/微服务/SOA/DDD)"
4192
+ - "系统分为哪些层次?每层的职责是什么?"
4193
+ - "各层之间如何交互?调用方式是什么?"
4194
+ - "请提供架构图或架构说明文档"
4195
+
4196
+ - question: "项目的技术栈详情是什么?"
4197
+ sub_questions:
4198
+ - "后端框架:使用什么框架?版本是多少?(如Spring Boot版本)"
4199
+ - "数据库:使用什么数据库?版本是多少?是否有读写分离?"
4200
+ - "缓存:使用什么缓存?(Redis/Memcached等)版本是多少?"
4201
+ - "消息队列:使用什么MQ?(RabbitMQ/Kafka/RocketMQ等)版本是多少?"
4202
+ - "搜索引擎:是否使用?使用什么?(Elasticsearch等)"
4203
+ - "文件存储:使用什么存储?(本地/OSS/MinIO等)"
4204
+ - "日志系统:使用什么日志框架和日志收集系统?"
4205
+ - "监控系统:使用什么监控?(Prometheus/Grafana等)"
4206
+
4207
+ - question: "项目的模块划分是什么?"
4208
+ sub_questions:
4209
+ - "项目包含哪些Maven/Gradle模块?各模块的职责是什么?"
4210
+ - "模块之间的依赖关系是什么?"
4211
+ - "公共模块有哪些?提供什么能力?"
4212
+ - "请提供模块结构图或模块说明"
4213
+
4214
+ - question: "项目的包结构规范是什么?"
4215
+ sub_questions:
4216
+ - "Controller层的包路径和命名规范?"
4217
+ - "Service层的包路径和命名规范?"
4218
+ - "DAO/Repository层的包路径和命名规范?"
4219
+ - "Entity/Model层的包路径和命名规范?"
4220
+ - "DTO/VO层的包路径和命名规范?"
4221
+ - "工具类的包路径和命名规范?"
4222
+ - "配置类的包路径和命名规范?"
4223
+ - "请提供包结构示例"
4224
+
4225
+ - category: B2-中间件使用规范
4226
+ priority: P0
4227
+ description: 了解各中间件的使用规范和代码示例
4228
+ templates:
4229
+ - question: "项目中Redis的使用规范是什么?"
4230
+ sub_questions:
4231
+ - "Redis的连接配置在哪里?如何获取RedisTemplate?"
4232
+ - "Key的命名规范是什么?前缀规则是什么?"
4233
+ - "不同业务场景使用哪种数据结构?(String/Hash/List/Set/ZSet)"
4234
+ - "缓存的过期时间策略是什么?"
4235
+ - "如何处理缓存穿透、缓存击穿、缓存雪崩?"
4236
+ - "分布式锁如何实现?使用什么工具?(Redisson等)"
4237
+ - "请提供Redis操作的代码示例,包括:"
4238
+ - " - 字符串缓存的存取示例"
4239
+ - " - Hash结构的存取示例"
4240
+ - " - 分布式锁的使用示例"
4241
+ - " - 缓存注解(@Cacheable等)的使用示例"
4242
+
4243
+ - question: "项目中消息队列的使用规范是什么?"
4244
+ sub_questions:
4245
+ - "使用什么消息队列?配置在哪里?"
4246
+ - "Exchange/Topic的命名规范是什么?"
4247
+ - "Queue的命名规范是什么?"
4248
+ - "消息体的格式规范是什么?(JSON结构定义)"
4249
+ - "消息的可靠性如何保证?(确认机制、持久化、重试)"
4250
+ - "消费者的幂等性如何保证?"
4251
+ - "死信队列如何处理?"
4252
+ - "请提供消息队列的代码示例,包括:"
4253
+ - " - 生产者发送消息的示例"
4254
+ - " - 消费者接收消息的示例"
4255
+ - " - 延迟消息的发送示例"
4256
+ - " - 消息确认和重试的示例"
4257
+
4258
+ - question: "项目中定时任务的使用规范是什么?"
4259
+ sub_questions:
4260
+ - "使用什么定时任务框架?(Spring @Scheduled/XXL-Job/Quartz等)"
4261
+ - "定时任务的配置在哪里?"
4262
+ - "分布式环境下如何保证任务只执行一次?"
4263
+ - "任务执行失败如何处理?是否有重试机制?"
4264
+ - "任务执行日志如何记录?"
4265
+ - "请提供定时任务的代码示例,包括:"
4266
+ - " - 简单定时任务的定义示例"
4267
+ - " - 带参数定时任务的示例"
4268
+ - " - 分布式锁定时任务的示例"
4269
+
4270
+ - question: "项目中Elasticsearch的使用规范是什么?(如果使用)"
4271
+ sub_questions:
4272
+ - "ES的连接配置在哪里?"
4273
+ - "索引的命名规范是什么?"
4274
+ - "Mapping的定义规范是什么?"
4275
+ - "数据同步策略是什么?(同步/异步/Canal等)"
4276
+ - "请提供ES操作的代码示例,包括:"
4277
+ - " - 索引创建的示例"
4278
+ - " - 文档的CRUD示例"
4279
+ - " - 复杂查询的示例"
4280
+
4281
+ - question: "项目中文件存储的使用规范是什么?"
4282
+ sub_questions:
4283
+ - "使用什么文件存储?配置在哪里?"
4284
+ - "文件路径/Key的命名规范是什么?"
4285
+ - "文件大小限制是什么?"
4286
+ - "支持哪些文件类型?"
4287
+ - "文件访问权限如何控制?"
4288
+ - "请提供文件上传/下载的代码示例"
4289
+
4290
+ - question: "项目中是否使用其他中间件?使用规范是什么?"
4291
+ sub_questions:
4292
+ - "是否使用分布式配置中心?(Nacos/Apollo等)如何使用?"
4293
+ - "是否使用服务注册发现?如何使用?"
4294
+ - "是否使用链路追踪?如何使用?"
4295
+ - "是否使用限流熔断?(Sentinel等)如何使用?"
4296
+ - "请提供相关代码示例"
4297
+
4298
+ - category: B3-Java编码规范
4299
+ priority: P0
4300
+ description: 了解项目的Java编码规范和最佳实践
4301
+ templates:
4302
+ - question: "项目的Java编码规范是什么?"
4303
+ sub_questions:
4304
+ - "遵循什么编码规范?(阿里巴巴规范/Google规范/自定义)"
4305
+ - "是否有规范文档?请提供链接或内容"
4306
+
4307
+ - question: "类和接口的命名规范是什么?"
4308
+ sub_questions:
4309
+ - "Controller类的命名规范?后缀是什么?"
4310
+ - "Service接口和实现类的命名规范?"
4311
+ - "DAO/Mapper/Repository的命名规范?"
4312
+ - "Entity/PO的命名规范?"
4313
+ - "DTO的命名规范?请求和响应如何区分?"
4314
+ - "VO的命名规范?"
4315
+ - "枚举类的命名规范?"
4316
+ - "常量类的命名规范?"
4317
+ - "工具类的命名规范?"
4318
+ - "异常类的命名规范?"
4319
+ - "请提供各类型的命名示例"
4320
+
4321
+ - question: "方法的命名规范是什么?"
4322
+ sub_questions:
4323
+ - "查询单个对象的方法命名?(get/find/query/select)"
4324
+ - "查询列表的方法命名?"
4325
+ - "查询分页的方法命名?"
4326
+ - "新增的方法命名?(add/insert/create/save)"
4327
+ - "修改的方法命名?(update/modify/edit)"
4328
+ - "删除的方法命名?(delete/remove)"
4329
+ - "批量操作的方法命名?"
4330
+ - "布尔判断的方法命名?(is/has/can/should)"
4331
+ - "请提供方法命名示例"
4332
+
4333
+ - question: "注释规范是什么?"
4334
+ sub_questions:
4335
+ - "类注释的格式要求?必须包含哪些内容?"
4336
+ - "方法注释的格式要求?参数和返回值如何描述?"
4337
+ - "字段注释的格式要求?"
4338
+ - "是否使用Swagger注解?格式要求是什么?"
4339
+ - "TODO/FIXME注释的格式要求?"
4340
+ - "请提供注释示例"
4341
+
4342
+ - question: "异常处理规范是什么?"
4343
+ sub_questions:
4344
+ - "项目有哪些自定义异常类?何时使用?"
4345
+ - "异常应该在哪一层捕获和处理?"
4346
+ - "业务异常和系统异常如何区分?"
4347
+ - "异常信息如何记录日志?"
4348
+ - "全局异常处理器是如何实现的?"
4349
+ - "请提供异常处理的代码示例"
4350
+
4351
+ - question: "日志打印规范是什么?"
4352
+ sub_questions:
4353
+ - "使用什么日志框架?(SLF4J+Logback等)"
4354
+ - "不同级别日志(DEBUG/INFO/WARN/ERROR)的使用场景?"
4355
+ - "日志内容应该包含哪些信息?"
4356
+ - "敏感信息如何脱敏?"
4357
+ - "请求入参出参如何记录?"
4358
+ - "请提供日志打印的代码示例"
4359
+
4360
+ - question: "Controller层的编码规范是什么?"
4361
+ sub_questions:
4362
+ - "URL路径的命名规范?RESTful还是其他风格?"
4363
+ - "请求方法的使用规范?(GET/POST/PUT/DELETE)"
4364
+ - "参数接收方式的规范?(@RequestParam/@RequestBody/@PathVariable)"
4365
+ - "响应格式的统一规范?"
4366
+ - "参数校验如何实现?使用什么注解?"
4367
+ - "请提供Controller的代码模板"
4368
+
4369
+ - question: "Service层的编码规范是什么?"
4370
+ sub_questions:
4371
+ - "是否必须定义接口?接口和实现类的关系?"
4372
+ - "事务注解如何使用?事务传播行为如何选择?"
4373
+ - "Service之间如何调用?是否允许循环依赖?"
4374
+ - "复杂业务逻辑如何拆分?"
4375
+ - "请提供Service的代码模板"
4376
+
4377
+ - question: "DAO层的编码规范是什么?"
4378
+ sub_questions:
4379
+ - "使用什么ORM框架?(MyBatis/MyBatis-Plus/JPA等)"
4380
+ - "Mapper接口的编写规范?"
4381
+ - "XML文件还是注解方式?"
4382
+ - "动态SQL的编写规范?"
4383
+ - "请提供DAO的代码模板"
4384
+
4385
+ - category: B4-SQL规范
4386
+ priority: P0
4387
+ description: 了解项目的SQL编写规范
4388
+ templates:
4389
+ - question: "项目的SQL编写规范是什么?"
4390
+ sub_questions:
4391
+ - "是否有SQL规范文档?请提供链接或内容"
4392
+
4393
+ - question: "表设计规范是什么?"
4394
+ sub_questions:
4395
+ - "表名的命名规范?前缀规则?"
4396
+ - "字段名的命名规范?(驼峰/下划线)"
4397
+ - "主键的设计规范?(自增/UUID/雪花ID)"
4398
+ - "是否必须有创建时间/更新时间/创建人/更新人字段?"
4399
+ - "是否必须有逻辑删除字段?"
4400
+ - "是否必须有版本号字段(乐观锁)?"
4401
+ - "字段类型的选择规范?"
4402
+ - "字段长度的设计规范?"
4403
+ - "索引的命名和设计规范?"
4404
+ - "请提供建表语句的模板"
4405
+
4406
+ - question: "SQL查询规范是什么?"
4407
+ sub_questions:
4408
+ - "SELECT是否禁止使用*?"
4409
+ - "WHERE条件的编写规范?"
4410
+ - "JOIN的使用规范?最多允许关联几张表?"
4411
+ - "子查询的使用规范?"
4412
+ - "ORDER BY的使用规范?"
4413
+ - "LIMIT的使用规范?深分页如何处理?"
4414
+ - "请提供查询SQL的示例"
4415
+
4416
+ - question: "SQL更新规范是什么?"
4417
+ sub_questions:
4418
+ - "UPDATE是否必须带WHERE条件?"
4419
+ - "批量更新的写法规范?"
4420
+ - "是否使用乐观锁?如何使用?"
4421
+ - "请提供更新SQL的示例"
4422
+
4423
+ - question: "SQL性能规范是什么?"
4424
+ sub_questions:
4425
+ - "索引的使用规范?如何避免索引失效?"
4426
+ - "大表查询的规范?"
4427
+ - "慢SQL的定义标准?如何优化?"
4428
+ - "EXPLAIN的使用规范?"
4429
+ - "请提供SQL优化的示例"
4430
+
4431
+ - category: B5-数据模型
4432
+ priority: P0
4433
+ description: 了解数据库表结构和数据模型
4434
+ templates:
4435
+ - question: "[{entity}]对应的数据库表结构是什么?"
4436
+ sub_questions:
4437
+ - "表名是什么?"
4438
+ - "包含哪些字段?每个字段的类型、长度、约束?"
4439
+ - "主键是什么?主键生成策略是什么?"
4440
+ - "有哪些索引?索引类型是什么?"
4441
+ - "有哪些外键约束?(如果有)"
4442
+ - "请提供完整的DDL语句"
4443
+
4444
+ - question: "[{entity_a}]和[{entity_b}]的数据库关联设计是什么?"
4445
+ sub_questions:
4446
+ - "关联类型是什么?(一对一/一对多/多对多)"
4447
+ - "外键在哪张表?外键字段名是什么?"
4448
+ - "是否有中间表?中间表结构是什么?"
4449
+ - "关联查询的SQL怎么写?"
4450
+ - "请提供关联查询的示例SQL"
4451
+
4452
+ - question: "[{domain}]领域的ER图是什么?"
4453
+ sub_questions:
4454
+ - "涉及哪些表?"
4455
+ - "表之间的关系是什么?"
4456
+ - "请提供ER图或表关系说明"
4457
+
4458
+ - category: B6-接口规范
4459
+ priority: P1
4460
+ description: 了解API接口设计规范
4461
+ templates:
4462
+ - question: "项目的API接口规范是什么?"
4463
+ sub_questions:
4464
+ - "API风格是什么?(RESTful/RPC/GraphQL)"
4465
+ - "URL设计规范是什么?"
4466
+ - "版本控制如何实现?"
4467
+ - "认证授权如何实现?"
4468
+ - "请提供API设计规范文档"
4469
+
4470
+ - question: "接口请求规范是什么?"
4471
+ sub_questions:
4472
+ - "请求头的规范?必须包含哪些Header?"
4473
+ - "请求体的格式?(JSON/Form)"
4474
+ - "分页参数的规范?参数名是什么?"
4475
+ - "排序参数的规范?"
4476
+ - "请提供请求示例"
4477
+
4478
+ - question: "接口响应规范是什么?"
4479
+ sub_questions:
4480
+ - "统一响应格式是什么?包含哪些字段?"
4481
+ - "成功响应的格式?"
4482
+ - "错误响应的格式?"
4483
+ - "分页响应的格式?"
4484
+ - "错误码的设计规范?"
4485
+ - "请提供响应示例"
4486
+
4487
+ - question: "现有的[{module}]模块提供了哪些API接口?"
4488
+ sub_questions:
4489
+ - "接口列表是什么?"
4490
+ - "每个接口的URL、方法、参数、响应是什么?"
4491
+ - "请提供Swagger文档或接口文档链接"
4492
+
4493
+ - category: B7-代码实现模式
4494
+ priority: P1
4495
+ description: 了解项目中的通用代码实现模式
4496
+ templates:
4497
+ - question: "项目中通用的CRUD实现模式是什么?"
4498
+ sub_questions:
4499
+ - "是否有通用的BaseController/BaseService?"
4500
+ - "是否使用代码生成器?如何使用?"
4501
+ - "请提供标准CRUD的代码示例"
4502
+
4503
+ - question: "项目中分页查询的实现模式是什么?"
4504
+ sub_questions:
4505
+ - "使用什么分页插件?(PageHelper/MyBatis-Plus等)"
4506
+ - "分页参数如何接收?"
4507
+ - "分页结果如何封装?"
4508
+ - "请提供分页查询的代码示例"
4509
+
4510
+ - question: "项目中复杂查询的实现模式是什么?"
4511
+ sub_questions:
4512
+ - "多条件动态查询如何实现?"
4513
+ - "多表关联查询如何实现?"
4514
+ - "请提供复杂查询的代码示例"
4515
+
4516
+ - question: "项目中事务处理的实现模式是什么?"
4517
+ sub_questions:
4518
+ - "本地事务如何使用?"
4519
+ - "分布式事务如何处理?使用什么方案?"
4520
+ - "请提供事务处理的代码示例"
4521
+
4522
+ - question: "项目中有哪些通用工具类?"
4523
+ sub_questions:
4524
+ - "日期时间处理工具类?"
4525
+ - "字符串处理工具类?"
4526
+ - "JSON处理工具类?"
4527
+ - "加密解密工具类?"
4528
+ - "文件处理工具类?"
4529
+ - "HTTP请求工具类?"
4530
+ - "请提供工具类的使用示例"
4531
+
4532
+ # ==================== C. 历史追溯问题 ====================
4533
+ - id: history-questions
4534
+ title: C. 历史追溯问题
4535
+ instruction: |
4536
+ 针对历史需求和决策生成问题,重点关注:
4537
+ - 相关历史需求
4538
+ - 技术决策记录
4539
+ - 已知问题和债务
4540
+ question_templates:
4541
+ - category: C1-历史需求
4542
+ priority: P1
4543
+ templates:
4544
+ - question: "之前有没有类似[{feature}]的需求?"
4545
+ sub_questions:
4546
+ - "实现情况如何?是否上线?"
4547
+ - "实现过程中遇到了什么问题?"
4548
+ - "有什么经验教训可以借鉴?"
4549
+ - "相关代码在哪里?"
4550
+
4551
+ - question: "[{module}]模块最近有什么变更?"
4552
+ sub_questions:
4553
+ - "变更的内容是什么?"
4554
+ - "变更的原因是什么?"
4555
+ - "变更后是否有问题?"
4556
+
4557
+ - category: C2-决策记录
4558
+ priority: P2
4559
+ templates:
4560
+ - question: "[{technical_choice}]为什么选择当前的实现方式?"
4561
+ sub_questions:
4562
+ - "决策的背景是什么?"
4563
+ - "考虑过哪些备选方案?"
4564
+ - "选择当前方案的理由是什么?"
4565
+ - "这个决策有什么限制或trade-off?"
4566
+
4567
+ - category: C3-已知问题
4568
+ priority: P1
4569
+ templates:
4570
+ - question: "[{module}]模块有哪些已知的问题或技术债务?"
4571
+ sub_questions:
4572
+ - "问题的具体描述是什么?"
4573
+ - "问题的影响范围是什么?"
4574
+ - "是否有计划修复?"
4575
+ - "新功能开发需要注意什么?"
4576
+
4577
+ # ==================== D. 约束条件问题 ====================
4578
+ - id: constraint-questions
4579
+ title: D. 约束条件问题
4580
+ instruction: |
4581
+ 针对项目和技术约束生成问题,重点关注:
4582
+ - 技术栈限制
4583
+ - 安全合规要求
4584
+ - 性能要求
4585
+ - 团队规范
4586
+ question_templates:
4587
+ - category: D1-技术约束
4588
+ priority: P1
4589
+ templates:
4590
+ - question: "项目的技术栈限制有哪些?"
4591
+ sub_questions:
4592
+ - "必须使用什么框架/库?不能使用什么?"
4593
+ - "JDK版本要求是什么?"
4594
+ - "是否有第三方库的版本要求?"
4595
+ - "是否有禁止使用的技术或方案?"
4596
+
4597
+ - question: "[{technical_approach}]方案在当前技术栈下是否可行?"
4598
+ sub_questions:
4599
+ - "是否与现有技术兼容?"
4600
+ - "是否需要引入新的依赖?"
4601
+ - "团队是否有相关经验?"
4602
+
4603
+ - category: D2-安全合规
4604
+ priority: P0
4605
+ templates:
4606
+ - question: "[{data_type}]数据的安全要求是什么?"
4607
+ sub_questions:
4608
+ - "数据的敏感级别是什么?"
4609
+ - "存储时是否需要加密?用什么算法?"
4610
+ - "传输时是否需要加密?"
4611
+ - "是否需要脱敏?脱敏规则是什么?"
4612
+ - "数据的访问权限如何控制?"
4613
+ - "数据的保留期限是多久?"
4614
+
4615
+ - question: "项目的安全规范是什么?"
4616
+ sub_questions:
4617
+ - "SQL注入如何防范?"
4618
+ - "XSS如何防范?"
4619
+ - "CSRF如何防范?"
4620
+ - "接口防刷如何实现?"
4621
+ - "敏感操作是否需要二次确认?"
4622
+
4623
+ - question: "项目需要满足哪些合规要求?"
4624
+ sub_questions:
4625
+ - "是否需要满足等保要求?什么级别?"
4626
+ - "是否涉及个人隐私数据?需要满足什么要求?"
4627
+ - "是否有审计日志要求?记录哪些内容?"
4628
+
4629
+ - category: D3-性能要求
4630
+ priority: P1
4631
+ templates:
4632
+ - question: "项目的性能要求是什么?"
4633
+ sub_questions:
4634
+ - "接口响应时间要求?P99要求?"
4635
+ - "并发量要求?峰值并发是多少?"
4636
+ - "吞吐量要求?"
4637
+ - "可用性要求?99.9%还是99.99%?"
4638
+
4639
+ - question: "[{interface}]接口的性能要求是什么?"
4640
+ sub_questions:
4641
+ - "响应时间要求是多少?"
4642
+ - "预期的调用频率是多少?"
4643
+ - "是否需要限流?限流规则是什么?"
4644
+
4645
+ - category: D4-团队规范
4646
+ priority: P2
4647
+ templates:
4648
+ - question: "团队的开发流程是什么?"
4649
+ sub_questions:
4650
+ - "分支管理策略是什么?(GitFlow等)"
4651
+ - "代码审查流程是什么?"
4652
+ - "上线流程是什么?"
4653
+ - "环境有哪些?(dev/test/staging/prod)"
4654
+
4655
+ - question: "团队的测试要求是什么?"
4656
+ sub_questions:
4657
+ - "单元测试覆盖率要求?"
4658
+ - "是否需要集成测试?"
4659
+ - "是否需要性能测试?"
4660
+ - "测试用例的编写规范?"
4661
+
4662
+ - id: question-prioritization
4663
+ title: 第三阶段:问题优先级排序
4664
+ instruction: |
4665
+ 对生成的问题进行优先级排序:
4666
+
4667
+ **P0 - 阻塞级**(必须回答)
4668
+ - 缺失会导致完全无法理解需求
4669
+ - 涉及核心业务规则
4670
+ - 影响架构决策
4671
+ - 涉及安全合规
4672
+
4673
+ **P1 - 重要级**(强烈建议回答)
4674
+ - 影响需求完整性
4675
+ - 涉及边界情况处理
4676
+ - 影响实现方案选择
4677
+ - 涉及性能要求
4678
+
4679
+ **P2 - 补充级**(可选回答)
4680
+ - 有助于优化实现
4681
+ - 提供额外上下文
4682
+ - 历史参考信息
4683
+ output:
4684
+ format: markdown
4685
+ template: |
4686
+ # 知识库查询问题清单
4687
+
4688
+ ## 元信息
4689
+ - 源文档: req.txt
4690
+ - 生成时间: {{timestamp}}
4691
+ - 总问题数: {{total_count}}
4692
+ - P0问题: {{p0_count}} | P1问题: {{p1_count}} | P2问题: {{p2_count}}
4693
+
4694
+ ---
4695
+
4696
+ ## P0 阻塞级问题(必须回答)
4697
+
4698
+ ### A. 业务知识
4699
+ {{#each p0_business}}
4700
+ #### {{index}}. [{{id}}] {{question}}
4701
+ - 关联需求: "{{related_requirement}}"
4702
+ - 预期答案类型: {{expected_answer_type}}
4703
+ - 子问题:
4704
+ {{#each sub_questions}}
4705
+ - {{this}}
4706
+ {{/each}}
4707
+ {{/each}}
4708
+
4709
+ ### B. 技术知识
4710
+ {{#each p0_technical}}
4711
+ #### {{index}}. [{{id}}] {{question}}
4712
+ - 关联需求: "{{related_requirement}}"
4713
+ - 预期答案类型: {{expected_answer_type}}
4714
+ - 子问题:
4715
+ {{#each sub_questions}}
4716
+ - {{this}}
4717
+ {{/each}}
4718
+ - **注意**: 请提供相关代码示例
4719
+ {{/each}}
4720
+
4721
+ ---
4722
+
4723
+ ## P1 重要级问题(强烈建议回答)
4724
+
4725
+ ### A. 业务知识
4726
+ {{#each p1_business}}
4727
+ #### {{index}}. [{{id}}] {{question}}
4728
+ - 关联需求: "{{related_requirement}}"
4729
+ - 子问题:
4730
+ {{#each sub_questions}}
4731
+ - {{this}}
4732
+ {{/each}}
4733
+ {{/each}}
4734
+
4735
+ ### B. 技术知识
4736
+ {{#each p1_technical}}
4737
+ #### {{index}}. [{{id}}] {{question}}
4738
+ - 关联需求: "{{related_requirement}}"
4739
+ - 子问题:
4740
+ {{#each sub_questions}}
4741
+ - {{this}}
4742
+ {{/each}}
4743
+ {{/each}}
4744
+
4745
+ ### C. 历史追溯
4746
+ {{#each p1_history}}
4747
+ #### {{index}}. [{{id}}] {{question}}
4748
+ - 关联需求: "{{related_requirement}}"
4749
+ {{/each}}
4750
+
4751
+ ---
4752
+
4753
+ ## P2 补充级问题(可选回答)
4754
+
4755
+ {{#each p2_questions}}
4756
+ #### {{index}}. [{{id}}] {{question}}
4757
+ {{/each}}
4758
+
4759
+ - id: knowledge-landing
4760
+ title: 第四阶段:知识落地规范
4761
+ instruction: |
4762
+ 知识库返回的内容应按以下结构存储到 docs/rag/ 目录:
4763
+ output:
4764
+ structure: |
4765
+ docs/rag/
4766
+ ├── _index.md # 知识索引(自动生成)
4767
+ ├── _questions.md # 问题清单(本模板输出)
4768
+
4769
+ ├── business/ # 业务知识
4770
+ │ ├── domain-{{domain}}.md # 领域知识
4771
+ │ ├── rules-{{topic}}.md # 业务规则
4772
+ │ ├── process-{{name}}.md # 业务流程(含详细步骤和关联关系)
4773
+ │ ├── data-relations.md # 数据关联关系
4774
+ │ └── roles.md # 角色权限
4775
+
4776
+ ├── technical/ # 技术知识
4777
+ │ ├── architecture.md # 整体技术架构
4778
+ │ ├── tech-stack.md # 技术栈详情
4779
+ │ ├── module-structure.md # 模块结构
4780
+ │ ├── middleware/ # 中间件规范
4781
+ │ │ ├── redis.md # Redis使用规范和代码示例
4782
+ │ │ ├── mq.md # 消息队列规范和代码示例
4783
+ │ │ ├── scheduler.md # 定时任务规范和代码示例
4784
+ │ │ ├── elasticsearch.md # ES规范和代码示例
4785
+ │ │ └── file-storage.md # 文件存储规范
4786
+ │ ├── coding-standards/ # 编码规范
4787
+ │ │ ├── java-naming.md # Java命名规范
4788
+ │ │ ├── java-coding.md # Java编码规范
4789
+ │ │ ├── exception.md # 异常处理规范
4790
+ │ │ ├── logging.md # 日志规范
4791
+ │ │ └── layer-standards.md # 分层规范(Controller/Service/DAO)
4792
+ │ ├── sql-standards/ # SQL规范
4793
+ │ │ ├── table-design.md # 表设计规范
4794
+ │ │ ├── query-standards.md # 查询规范
4795
+ │ │ └── performance.md # SQL性能规范
4796
+ │ ├── data-model.md # 数据模型(表结构)
4797
+ │ ├── api-{{module}}.md # 接口规范
4798
+ │ └── patterns.md # 代码模式和示例
4799
+
4800
+ ├── history/ # 历史信息
4801
+ │ ├── related-features.md # 相关功能
4802
+ │ └── decisions.md # 决策记录
4803
+
4804
+ └── constraints/ # 约束条件
4805
+ ├── technical.md # 技术约束
4806
+ ├── security.md # 安全要求
4807
+ └── performance.md # 性能要求
4808
+
4809
+ file_template: |
4810
+ # {{title}}
4811
+
4812
+ ## 元信息
4813
+ - 查询问题: {{question}}
4814
+ - 问题ID: {{question_id}}
4815
+ - 查询时间: {{timestamp}}
4816
+ - 数据来源: 知识库MCP
4817
+
4818
+ ## 内容摘要
4819
+ {{summary}}
4820
+
4821
+ ## 详细内容
4822
+ {{content}}
4823
+
4824
+ ## 代码示例(如适用)
4825
+ {{#if code_examples}}
4826
+ {{#each code_examples}}
4827
+ ### {{title}}
4828
+ ```{{language}}
4829
+ {{code}}
4830
+ ```
4831
+ **说明**: {{description}}
4832
+ {{/each}}
4833
+ {{/if}}
4834
+
4835
+ ## 需求关联
4836
+ - 关联需求点: {{related_requirement}}
4837
+ - 影响分析: {{impact_analysis}}
4838
+
4839
+ ## 衍生问题
4840
+ {{#if follow_up_questions}}
4841
+ {{#each follow_up_questions}}
4842
+ - {{this}}
4843
+ {{/each}}
4844
+ {{else}}
4845
+
4846
+ {{/if}}
4847
+
4848
+ elicitation:
4849
+ after_each_phase: true
4850
+ options:
4851
+ - "调整问题优先级"
4852
+ - "添加更多问题"
4853
+ - "删除不相关问题"
4854
+ - "修改问题措辞"
4855
+ - "添加子问题"
4856
+ - "要求提供代码示例"
4857
+ - "进入下一阶段"
4858
+ ==================== END: .xiaoma-core/templates/rag-questions-tmpl.yaml ====================
4859
+
4860
+ ==================== START: .xiaoma-core/templates/rag-knowledge-tmpl.yaml ====================
4861
+ template:
4862
+ id: rag-knowledge-template-v1
4863
+ name: RAG知识落地模板
4864
+ version: 1.0
4865
+ description: 将知识库MCP返回的知识内容结构化存储到docs/rag目录
4866
+ output:
4867
+ format: markdown
4868
+ base_path: docs/rag/
3556
4869
 
3557
- ## Structured Frameworks
4870
+ sections:
4871
+ - id: index-template
4872
+ title: 知识索引模板
4873
+ filename: _index.md
4874
+ template: |
4875
+ # RAG知识库索引
4876
+
4877
+ ## 概览
4878
+ - 需求文档: {{requirement_file}}
4879
+ - 创建时间: {{created_at}}
4880
+ - 最后更新: {{updated_at}}
4881
+ - 知识条目数: {{total_entries}}
4882
+
4883
+ ## 知识分类统计
4884
+
4885
+ | 分类 | 条目数 | 覆盖率 |
4886
+ |------|--------|--------|
4887
+ | 业务知识 | {{business_count}} | {{business_coverage}}% |
4888
+ | 技术知识 | {{technical_count}} | {{technical_coverage}}% |
4889
+ | 历史信息 | {{history_count}} | {{history_coverage}}% |
4890
+ | 约束条件 | {{constraints_count}} | {{constraints_coverage}}% |
4891
+
4892
+ ## 知识目录
4893
+
4894
+ ### 业务知识 (business/)
4895
+ {{#each business_files}}
4896
+ - [{{title}}](business/{{filename}}) - {{summary}}
4897
+ {{/each}}
4898
+
4899
+ ### 技术知识 (technical/)
4900
+ {{#each technical_files}}
4901
+ - [{{title}}](technical/{{filename}}) - {{summary}}
4902
+ {{/each}}
4903
+
4904
+ ### 历史信息 (history/)
4905
+ {{#each history_files}}
4906
+ - [{{title}}](history/{{filename}}) - {{summary}}
4907
+ {{/each}}
4908
+
4909
+ ### 约束条件 (constraints/)
4910
+ {{#each constraints_files}}
4911
+ - [{{title}}](constraints/{{filename}}) - {{summary}}
4912
+ {{/each}}
4913
+
4914
+ ## 未回答问题
4915
+ {{#if unanswered_questions}}
4916
+ 以下问题未能从知识库获得答案:
4917
+ {{#each unanswered_questions}}
4918
+ - [{{id}}] {{question}}
4919
+ {{/each}}
4920
+ {{else}}
4921
+ 所有问题均已获得回答。
4922
+ {{/if}}
4923
+
4924
+ ## 后续行动
4925
+ {{#each follow_up_actions}}
4926
+ - [ ] {{action}}
4927
+ {{/each}}
4928
+
4929
+ - id: business-knowledge
4930
+ title: 业务知识模板
4931
+ path: business/
4932
+ variants:
4933
+ - id: domain-knowledge
4934
+ filename_pattern: "domain-{{domain_name}}.md"
4935
+ template: |
4936
+ # {{domain_name}} 领域知识
3558
4937
 
3559
- 5. **SCAMPER Method**: Go through one letter at a time, wait for their ideas before moving to next
3560
- 6. **Six Thinking Hats**: Present one hat, ask for their thoughts, then move to next hat
3561
- 7. **Mind Mapping**: Start with central concept, ask them to suggest branches
4938
+ ## 元信息
4939
+ - 查询问题ID: {{question_ids}}
4940
+ - 来源: 知识库MCP
4941
+ - 更新时间: {{timestamp}}
3562
4942
 
3563
- ## Collaborative Techniques
4943
+ ## 领域概述
4944
+ {{domain_overview}}
3564
4945
 
3565
- 8. **"Yes, And..." Building**: They give idea, you "yes and" it, they "yes and" back - alternate
3566
- 9. **Brainwriting/Round Robin**: They suggest idea, you build on it, ask them to build on yours
3567
- 10. **Random Stimulation**: Give one random prompt/word, ask them to make connections
4946
+ ## 核心概念
3568
4947
 
3569
- ## Deep Exploration
4948
+ {{#each concepts}}
4949
+ ### {{name}}
4950
+ - **定义**: {{definition}}
4951
+ - **业务含义**: {{business_meaning}}
4952
+ - **相关实体**: {{related_entities}}
4953
+ {{/each}}
3570
4954
 
3571
- 11. **Five Whys**: Ask "why" and wait for their answer before asking next "why"
3572
- 12. **Morphological Analysis**: Ask them to list parameters first, then explore combinations together
3573
- 13. **Provocation Technique (PO)**: Give one provocative statement, ask them to extract useful ideas
4955
+ ## 业务规则
3574
4956
 
3575
- ## Advanced Techniques
4957
+ {{#each rules}}
4958
+ ### 规则{{index}}: {{name}}
4959
+ - **描述**: {{description}}
4960
+ - **触发条件**: {{trigger}}
4961
+ - **执行逻辑**: {{logic}}
4962
+ - **异常处理**: {{exception}}
4963
+ {{/each}}
3576
4964
 
3577
- 14. **Forced Relationships**: Connect two unrelated concepts and ask them to find the bridge
3578
- 15. **Assumption Reversal**: Challenge their core assumptions and ask them to build from there
3579
- 16. **Role Playing**: Ask them to brainstorm from different stakeholder perspectives
3580
- 17. **Time Shifting**: "How would you solve this in 1995? 2030?"
3581
- 18. **Resource Constraints**: "What if you had only $10 and 1 hour?"
3582
- 19. **Metaphor Mapping**: Use extended metaphors to explore solutions
3583
- 20. **Question Storming**: Generate questions instead of answers first
3584
- ==================== END: .xiaoma-core/data/brainstorming-techniques.md ====================
4965
+ ## 与需求的关联
4966
+ {{requirement_mapping}}
3585
4967
 
3586
- ==================== START: .xiaoma-core/tasks/brownfield-create-epic.md ====================
3587
- <!-- Powered by XiaoMa™ Core -->
4968
+ - id: process-knowledge
4969
+ filename_pattern: "process-{{process_name}}.md"
4970
+ template: |
4971
+ # {{process_name}} 业务流程
3588
4972
 
3589
- # Create Brownfield Epic Task
4973
+ ## 元信息
4974
+ - 查询问题ID: {{question_ids}}
4975
+ - 来源: 知识库MCP
4976
+ - 更新时间: {{timestamp}}
3590
4977
 
3591
- ## Purpose
4978
+ ## 流程概述
4979
+ {{process_overview}}
3592
4980
 
3593
- Create a single epic for smaller brownfield enhancements that don't require the full PRD and Architecture documentation process. This task is for isolated features or modifications that can be completed within a focused scope.
4981
+ ## 流程步骤
3594
4982
 
3595
- ## When to Use This Task
4983
+ ```mermaid
4984
+ {{mermaid_diagram}}
4985
+ ```
3596
4986
 
3597
- **Use this task when:**
4987
+ ### 详细步骤
3598
4988
 
3599
- - The enhancement can be completed in 1-3 stories
3600
- - No significant architectural changes are required
3601
- - The enhancement follows existing project patterns
3602
- - Integration complexity is minimal
3603
- - Risk to existing system is low
4989
+ {{#each steps}}
4990
+ #### 步骤{{index}}: {{name}}
4991
+ - **执行者**: {{actor}}
4992
+ - **输入**: {{input}}
4993
+ - **处理**: {{processing}}
4994
+ - **输出**: {{output}}
4995
+ - **后置条件**: {{postcondition}}
4996
+ {{/each}}
3604
4997
 
3605
- **Use the full brownfield PRD/Architecture process when:**
4998
+ ## 异常流程
3606
4999
 
3607
- - The enhancement requires multiple coordinated stories
3608
- - Architectural planning is needed
3609
- - Significant integration work is required
3610
- - Risk assessment and mitigation planning is necessary
5000
+ {{#each exceptions}}
5001
+ ### {{name}}
5002
+ - **触发条件**: {{trigger}}
5003
+ - **处理方式**: {{handling}}
5004
+ - **恢复机制**: {{recovery}}
5005
+ {{/each}}
3611
5006
 
3612
- ## Instructions
5007
+ ## 与需求的关联
5008
+ {{requirement_mapping}}
3613
5009
 
3614
- ### 1. Project Analysis (Required)
5010
+ - id: roles-knowledge
5011
+ filename_pattern: "roles.md"
5012
+ template: |
5013
+ # 用户角色与权限
5014
+
5015
+ ## 元信息
5016
+ - 查询问题ID: {{question_ids}}
5017
+ - 来源: 知识库MCP
5018
+ - 更新时间: {{timestamp}}
5019
+
5020
+ ## 角色定义
5021
+
5022
+ {{#each roles}}
5023
+ ### {{name}}
5024
+ - **描述**: {{description}}
5025
+ - **职责**: {{responsibilities}}
5026
+ - **权限范围**: {{permissions}}
5027
+
5028
+ #### 可执行操作
5029
+ {{#each operations}}
5030
+ - {{name}}: {{description}} ({{permission_level}})
5031
+ {{/each}}
5032
+ {{/each}}
5033
+
5034
+ ## 权限矩阵
5035
+
5036
+ | 操作 | {{#each roles}}{{name}} | {{/each}}
5037
+ |------|{{#each roles}}--------|{{/each}}
5038
+ {{#each operations}}
5039
+ | {{name}} | {{#each role_permissions}}{{this}} | {{/each}}
5040
+ {{/each}}
5041
+
5042
+ ## 与需求的关联
5043
+ {{requirement_mapping}}
5044
+
5045
+ - id: technical-knowledge
5046
+ title: 技术知识模板
5047
+ path: technical/
5048
+ variants:
5049
+ - id: architecture
5050
+ filename_pattern: "architecture.md"
5051
+ template: |
5052
+ # 系统架构
3615
5053
 
3616
- Before creating the epic, gather essential information about the existing project:
5054
+ ## 元信息
5055
+ - 查询问题ID: {{question_ids}}
5056
+ - 来源: 知识库MCP
5057
+ - 更新时间: {{timestamp}}
3617
5058
 
3618
- **Existing Project Context:**
5059
+ ## 架构概览
5060
+ {{architecture_overview}}
3619
5061
 
3620
- - [ ] Project purpose and current functionality understood
3621
- - [ ] Existing technology stack identified
3622
- - [ ] Current architecture patterns noted
3623
- - [ ] Integration points with existing system identified
5062
+ ## 技术栈
5063
+ | 层级 | 技术 | 版本 | 说明 |
5064
+ |------|------|------|------|
5065
+ {{#each tech_stack}}
5066
+ | {{layer}} | {{technology}} | {{version}} | {{description}} |
5067
+ {{/each}}
3624
5068
 
3625
- **Enhancement Scope:**
5069
+ ## 模块结构
3626
5070
 
3627
- - [ ] Enhancement clearly defined and scoped
3628
- - [ ] Impact on existing functionality assessed
3629
- - [ ] Required integration points identified
3630
- - [ ] Success criteria established
5071
+ ```
5072
+ {{module_structure}}
5073
+ ```
3631
5074
 
3632
- ### 2. Epic Creation
5075
+ ## 模块说明
3633
5076
 
3634
- Create a focused epic following this structure:
5077
+ {{#each modules}}
5078
+ ### {{name}}
5079
+ - **职责**: {{responsibility}}
5080
+ - **依赖**: {{dependencies}}
5081
+ - **对外接口**: {{interfaces}}
5082
+ {{/each}}
3635
5083
 
3636
- #### Epic Title
5084
+ ## 与需求的关联
5085
+ - **建议实现位置**: {{suggested_location}}
5086
+ - **需要修改的模块**: {{affected_modules}}
5087
+ - **需要新增的模块**: {{new_modules}}
3637
5088
 
3638
- {{Enhancement Name}} - Brownfield Enhancement
5089
+ - id: data-model
5090
+ filename_pattern: "data-model.md"
5091
+ template: |
5092
+ # 数据模型
3639
5093
 
3640
- #### Epic Goal
5094
+ ## 元信息
5095
+ - 查询问题ID: {{question_ids}}
5096
+ - 来源: 知识库MCP
5097
+ - 更新时间: {{timestamp}}
3641
5098
 
3642
- {{1-2 sentences describing what the epic will accomplish and why it adds value}}
5099
+ ## 数据库概览
5100
+ - **数据库类型**: {{database_type}}
5101
+ - **数据库版本**: {{database_version}}
5102
+ - **ORM框架**: {{orm_framework}}
3643
5103
 
3644
- #### Epic Description
5104
+ ## 相关数据表
3645
5105
 
3646
- **Existing System Context:**
5106
+ {{#each tables}}
5107
+ ### {{table_name}}
3647
5108
 
3648
- - Current relevant functionality: {{brief description}}
3649
- - Technology stack: {{relevant existing technologies}}
3650
- - Integration points: {{where new work connects to existing system}}
5109
+ **说明**: {{description}}
3651
5110
 
3652
- **Enhancement Details:**
5111
+ | 字段名 | 类型 | 约束 | 说明 |
5112
+ |--------|------|------|------|
5113
+ {{#each columns}}
5114
+ | {{name}} | {{type}} | {{constraints}} | {{description}} |
5115
+ {{/each}}
3653
5116
 
3654
- - What's being added/changed: {{clear description}}
3655
- - How it integrates: {{integration approach}}
3656
- - Success criteria: {{measurable outcomes}}
5117
+ **索引**:
5118
+ {{#each indexes}}
5119
+ - {{name}}: {{columns}} ({{type}})
5120
+ {{/each}}
3657
5121
 
3658
- #### Stories
5122
+ {{/each}}
3659
5123
 
3660
- List 1-3 focused stories that complete the epic:
5124
+ ## 表关系
3661
5125
 
3662
- 1. **Story 1:** {{Story title and brief description}}
3663
- 2. **Story 2:** {{Story title and brief description}}
3664
- 3. **Story 3:** {{Story title and brief description}}
5126
+ ```mermaid
5127
+ erDiagram
5128
+ {{er_diagram}}
5129
+ ```
3665
5130
 
3666
- #### Compatibility Requirements
5131
+ ## 与需求的关联
5132
+ - **需要新增的表**: {{new_tables}}
5133
+ - **需要修改的表**: {{modified_tables}}
5134
+ - **数据迁移需求**: {{migration_needs}}
3667
5135
 
3668
- - [ ] Existing APIs remain unchanged
3669
- - [ ] Database schema changes are backward compatible
3670
- - [ ] UI changes follow existing patterns
3671
- - [ ] Performance impact is minimal
5136
+ - id: api-spec
5137
+ filename_pattern: "api-{{module}}.md"
5138
+ template: |
5139
+ # {{module}} 接口规范
5140
+
5141
+ ## 元信息
5142
+ - 查询问题ID: {{question_ids}}
5143
+ - 来源: 知识库MCP
5144
+ - 更新时间: {{timestamp}}
5145
+
5146
+ ## 接口概览
5147
+ - **基础路径**: {{base_path}}
5148
+ - **认证方式**: {{auth_method}}
5149
+ - **响应格式**: {{response_format}}
5150
+
5151
+ ## 接口列表
5152
+
5153
+ {{#each apis}}
5154
+ ### {{method}} {{path}}
5155
+
5156
+ **说明**: {{description}}
5157
+
5158
+ **请求参数**:
5159
+ | 参数名 | 位置 | 类型 | 必填 | 说明 |
5160
+ |--------|------|------|------|------|
5161
+ {{#each parameters}}
5162
+ | {{name}} | {{in}} | {{type}} | {{required}} | {{description}} |
5163
+ {{/each}}
5164
+
5165
+ **请求体**:
5166
+ ```json
5167
+ {{request_body}}
5168
+ ```
5169
+
5170
+ **响应**:
5171
+ ```json
5172
+ {{response_body}}
5173
+ ```
5174
+
5175
+ **错误码**:
5176
+ | 错误码 | 说明 |
5177
+ |--------|------|
5178
+ {{#each error_codes}}
5179
+ | {{code}} | {{message}} |
5180
+ {{/each}}
5181
+
5182
+ ---
5183
+ {{/each}}
5184
+
5185
+ ## 与需求的关联
5186
+ - **可复用的接口**: {{reusable_apis}}
5187
+ - **需要新增的接口**: {{new_apis}}
5188
+ - **需要修改的接口**: {{modified_apis}}
5189
+
5190
+ - id: code-patterns
5191
+ filename_pattern: "patterns.md"
5192
+ template: |
5193
+ # 代码模式与最佳实践
5194
+
5195
+ ## 元信息
5196
+ - 查询问题ID: {{question_ids}}
5197
+ - 来源: 知识库MCP
5198
+ - 更新时间: {{timestamp}}
5199
+
5200
+ ## 项目结构规范
5201
+ ```
5202
+ {{project_structure}}
5203
+ ```
5204
+
5205
+ ## 代码规范
5206
+ {{#each coding_standards}}
5207
+ ### {{category}}
5208
+ {{description}}
5209
+
5210
+ **示例**:
5211
+ ```{{language}}
5212
+ {{example}}
5213
+ ```
5214
+ {{/each}}
5215
+
5216
+ ## 常用模式
5217
+
5218
+ {{#each patterns}}
5219
+ ### {{name}}
5220
+ - **使用场景**: {{use_case}}
5221
+ - **实现示例**: {{example_location}}
5222
+ - **注意事项**: {{notes}}
5223
+ {{/each}}
5224
+
5225
+ ## 可复用组件
5226
+
5227
+ {{#each reusable_components}}
5228
+ ### {{name}}
5229
+ - **位置**: {{location}}
5230
+ - **功能**: {{functionality}}
5231
+ - **使用方法**: {{usage}}
5232
+ {{/each}}
5233
+
5234
+ ## 与需求的关联
5235
+ {{requirement_mapping}}
5236
+
5237
+ - id: history-knowledge
5238
+ title: 历史信息模板
5239
+ path: history/
5240
+ variants:
5241
+ - id: related-features
5242
+ filename_pattern: "related-features.md"
5243
+ template: |
5244
+ # 相关历史功能
3672
5245
 
3673
- #### Risk Mitigation
5246
+ ## 元信息
5247
+ - 查询问题ID: {{question_ids}}
5248
+ - 来源: 知识库MCP
5249
+ - 更新时间: {{timestamp}}
3674
5250
 
3675
- - **Primary Risk:** {{main risk to existing system}}
3676
- - **Mitigation:** {{how risk will be addressed}}
3677
- - **Rollback Plan:** {{how to undo changes if needed}}
5251
+ ## 相关功能列表
3678
5252
 
3679
- #### Definition of Done
5253
+ {{#each features}}
5254
+ ### {{name}}
5255
+ - **实现时间**: {{implemented_at}}
5256
+ - **当前状态**: {{status}}
5257
+ - **功能描述**: {{description}}
5258
+ - **实现位置**: {{location}}
3680
5259
 
3681
- - [ ] All stories completed with acceptance criteria met
3682
- - [ ] Existing functionality verified through testing
3683
- - [ ] Integration points working correctly
3684
- - [ ] Documentation updated appropriately
3685
- - [ ] No regression in existing features
5260
+ **与当前需求的关系**:
5261
+ {{relation_to_current}}
3686
5262
 
3687
- ### 3. Validation Checklist
5263
+ **可借鉴点**:
5264
+ {{lessons_learned}}
3688
5265
 
3689
- Before finalizing the epic, ensure:
5266
+ ---
5267
+ {{/each}}
3690
5268
 
3691
- **Scope Validation:**
5269
+ ## 建议
5270
+ {{recommendations}}
3692
5271
 
3693
- - [ ] Epic can be completed in 1-3 stories maximum
3694
- - [ ] No architectural documentation is required
3695
- - [ ] Enhancement follows existing patterns
3696
- - [ ] Integration complexity is manageable
5272
+ - id: decisions
5273
+ filename_pattern: "decisions.md"
5274
+ template: |
5275
+ # 架构决策记录
5276
+
5277
+ ## 元信息
5278
+ - 查询问题ID: {{question_ids}}
5279
+ - 来源: 知识库MCP
5280
+ - 更新时间: {{timestamp}}
5281
+
5282
+ ## 相关决策
5283
+
5284
+ {{#each decisions}}
5285
+ ### ADR-{{id}}: {{title}}
5286
+
5287
+ **状态**: {{status}}
5288
+ **日期**: {{date}}
5289
+
5290
+ **背景**:
5291
+ {{context}}
5292
+
5293
+ **决策**:
5294
+ {{decision}}
5295
+
5296
+ **理由**:
5297
+ {{rationale}}
5298
+
5299
+ **影响**:
5300
+ {{consequences}}
5301
+
5302
+ **与当前需求的关联**:
5303
+ {{relation_to_current}}
5304
+
5305
+ ---
5306
+ {{/each}}
5307
+
5308
+ - id: constraints-knowledge
5309
+ title: 约束条件模板
5310
+ path: constraints/
5311
+ variants:
5312
+ - id: technical-constraints
5313
+ filename_pattern: "technical.md"
5314
+ template: |
5315
+ # 技术约束
5316
+
5317
+ ## 元信息
5318
+ - 查询问题ID: {{question_ids}}
5319
+ - 来源: 知识库MCP
5320
+ - 更新时间: {{timestamp}}
5321
+
5322
+ ## 技术栈约束
5323
+
5324
+ {{#each tech_constraints}}
5325
+ ### {{category}}
5326
+ - **约束**: {{constraint}}
5327
+ - **原因**: {{reason}}
5328
+ - **影响**: {{impact}}
5329
+ {{/each}}
5330
+
5331
+ ## 依赖约束
5332
+
5333
+ {{#each dependency_constraints}}
5334
+ - **{{name}}**: {{constraint}}
5335
+ {{/each}}
5336
+
5337
+ ## 与需求的关联
5338
+ {{requirement_mapping}}
5339
+
5340
+ - id: security-constraints
5341
+ filename_pattern: "security.md"
5342
+ template: |
5343
+ # 安全合规要求
5344
+
5345
+ ## 元信息
5346
+ - 查询问题ID: {{question_ids}}
5347
+ - 来源: 知识库MCP
5348
+ - 更新时间: {{timestamp}}
5349
+
5350
+ ## 安全要求
5351
+
5352
+ {{#each security_requirements}}
5353
+ ### {{name}}
5354
+ - **描述**: {{description}}
5355
+ - **适用范围**: {{scope}}
5356
+ - **实现方式**: {{implementation}}
5357
+ {{/each}}
5358
+
5359
+ ## 合规要求
5360
+
5361
+ {{#each compliance_requirements}}
5362
+ ### {{standard}}
5363
+ - **要求**: {{requirement}}
5364
+ - **检查点**: {{checkpoints}}
5365
+ {{/each}}
5366
+
5367
+ ## 与需求的关联
5368
+ {{requirement_mapping}}
5369
+
5370
+ - id: performance-constraints
5371
+ filename_pattern: "performance.md"
5372
+ template: |
5373
+ # 性能要求
5374
+
5375
+ ## 元信息
5376
+ - 查询问题ID: {{question_ids}}
5377
+ - 来源: 知识库MCP
5378
+ - 更新时间: {{timestamp}}
5379
+
5380
+ ## 性能指标
5381
+
5382
+ | 指标 | 目标值 | 当前值 | 说明 |
5383
+ |------|--------|--------|------|
5384
+ {{#each metrics}}
5385
+ | {{name}} | {{target}} | {{current}} | {{description}} |
5386
+ {{/each}}
5387
+
5388
+ ## SLA要求
5389
+ {{#each sla_requirements}}
5390
+ - **{{name}}**: {{value}}
5391
+ {{/each}}
5392
+
5393
+ ## 与需求的关联
5394
+ {{requirement_mapping}}
5395
+
5396
+ workflow:
5397
+ knowledge_landing_process:
5398
+ step1:
5399
+ name: "创建目录结构"
5400
+ action: |
5401
+ 确保 docs/rag/ 目录结构存在:
5402
+ - docs/rag/business/
5403
+ - docs/rag/technical/
5404
+ - docs/rag/history/
5405
+ - docs/rag/constraints/
5406
+
5407
+ step2:
5408
+ name: "分类知识内容"
5409
+ action: |
5410
+ 根据问题类别(A/B/C/D)将知识库返回内容分类:
5411
+ - A类 → business/
5412
+ - B类 → technical/
5413
+ - C类 → history/
5414
+ - D类 → constraints/
5415
+
5416
+ step3:
5417
+ name: "应用模板生成文件"
5418
+ action: |
5419
+ 为每条知识选择合适的模板变体,填充内容并生成markdown文件
5420
+
5421
+ step4:
5422
+ name: "生成索引文件"
5423
+ action: |
5424
+ 更新 docs/rag/_index.md 索引文件,统计所有知识条目
5425
+
5426
+ step5:
5427
+ name: "标记未答问题"
5428
+ action: |
5429
+ 将无法从知识库获得答案的问题记录到索引文件的"未回答问题"部分
5430
+ ==================== END: .xiaoma-core/templates/rag-knowledge-tmpl.yaml ====================
5431
+
5432
+ ==================== START: .xiaoma-core/templates/prd-tmpl.yaml ====================
5433
+ template:
5434
+ id: prd-template-v2
5435
+ name: 产品需求文档
5436
+ version: 2.0
5437
+ output:
5438
+ format: markdown
5439
+ filename: docs/prd.md
5440
+ title: "{{project_name}} Product Requirements Document (PRD)"
5441
+
5442
+ workflow:
5443
+ mode: interactive
5444
+ elicitation: advanced-elicitation
5445
+
5446
+ sections:
5447
+ - id: goals-context
5448
+ title: 目标与背景上下文
5449
+ instruction: |
5450
+ 询问“项目简报”文档是否可用。如果不存在“项目简报”,强烈建议首先使用 project-brief-tmpl 创建一个(它提供了必要的基础:问题陈述、目标用户、成功指标、MVP 范围、约束条件)。如果用户坚持在没有简报的情况下编写 PRD,请在“目标”部分收集这些信息。如果“项目简报”存在,请审阅并用它来填充“目标”(期望成果的项目符号列表)和“背景上下文”(1-2 段关于此项目解决什么问题及其原因的说明),以便我们能确定 PRD MVP 的范围内外事项。无论哪种方式,这对于确定需求都至关重要。请包含“变更日志”表格。
5451
+ sections:
5452
+ - id: goals
5453
+ title: 目标
5454
+ type: bullet-list
5455
+ instruction: 以项目符号列表形式,每行一个,列出 PRD 成功后将交付的预期成果——用户和项目的期望。
5456
+ - id: background
5457
+ title: 背景上下文
5458
+ type: paragraphs
5459
+ instruction: 用 1-2 个简短段落总结背景上下文,例如我们在项目简报中学到了什么(避免与目标重复),这个项目解决什么问题以及为什么,当前的行业状况或需求是什么。
5460
+ - id: changelog
5461
+ title: 变更日志
5462
+ type: table
5463
+ columns: [日期, 版本, 描述, 作者]
5464
+ instruction: 跟踪文档版本和变更
5465
+
5466
+ - id: requirements
5467
+ title: 需求
5468
+ instruction: 在两个子部分下起草功能性和非功能性需求列表。
5469
+ elicit: true
5470
+ sections:
5471
+ - id: functional
5472
+ title: 功能性需求
5473
+ type: numbered-list
5474
+ prefix: FR
5475
+ instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 FR 开头的标识符序列。
5476
+ examples:
5477
+ - "FR6: 待办事项列表使用 AI 检测并警告措辞不同但可能重复的待办事项。"
5478
+ - id: non-functional
5479
+ title: 非功能性需求
5480
+ type: numbered-list
5481
+ prefix: NFR
5482
+ instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 NFR 开头的标识符序列。
5483
+ examples:
5484
+ - "NFR1: 在可行的情况下,AWS 服务的使用必须力求保持在免费套餐限制内。"
5485
+
5486
+ - id: ui-goals
5487
+ title: 用户界面设计目标
5488
+ condition: PRD 包含 UX/UI 需求时
5489
+ instruction: |
5490
+ 捕获高层次的 UI/UX 愿景,以指导设计架构师并为创建用户故事提供信息。步骤:
5491
+
5492
+ 1. 基于项目上下文,用有根据的猜测预先填充所有子部分。
5493
+ 2. 将渲染后的完整部分呈现给用户。
5494
+ 3. 清晰地告知用户哪些地方做了假设。
5495
+ 4. 针对不清晰/缺失的元素或需要更具体说明的领域提出有针对性的问题。
5496
+ 5. 这不是详细的 UI 规范——重点关注产品愿景和用户目标。
5497
+ elicit: true
5498
+ choices:
5499
+ accessibility: [无, WCAG AA, WCAG AAA]
5500
+ platforms: [响应式网页, 仅移动端, 仅桌面端, 跨平台]
5501
+ sections:
5502
+ - id: ux-vision
5503
+ title: 整体 UX 愿景
5504
+ - id: interaction-paradigms
5505
+ title: 关键交互范式
5506
+ - id: core-screens
5507
+ title: 核心屏幕与视图
5508
+ instruction: 从产品角度看,为实现 PRD 的价值和目标,最关键的屏幕或视图是什么?这旨在提供概念性的高层概览,以驱动粗略的模块或用户故事。
5509
+ examples:
5510
+ - "登录屏幕"
5511
+ - "主仪表盘"
5512
+ - "项目详情页"
5513
+ - "设置页面"
5514
+ - id: accessibility
5515
+ title: "无障碍性: {无|WCAG AA|WCAG AAA|自定义要求}"
5516
+ - id: branding
5517
+ title: 品牌
5518
+ instruction: 是否有任何已知的品牌元素或风格指南必须被整合进来?
5519
+ examples:
5520
+ - "复制 20 世纪初黑白电影的观感,包括在页面或状态转换期间模拟胶片损坏或投影仪故障的动画效果。"
5521
+ - "附件是我司品牌的全套调色板和设计元素。"
5522
+ - id: target-platforms
5523
+ title: "目标设备与平台: {响应式网页|仅移动端|仅桌面端|跨平台}"
5524
+ examples:
5525
+ - "响应式网页,以及所有移动平台"
5526
+ - "仅限 iPhone"
5527
+ - "ASCII 码 Windows 桌面"
5528
+
5529
+ - id: technical-assumptions
5530
+ title: 技术假设
5531
+ instruction: |
5532
+ 收集将指导架构师的技术决策。步骤:
5533
+
5534
+ 1. 检查 .xiaoma-core/data/technical-preferences.yaml 或附加的技术偏好文件是否存在——用它来预填充选项。
5535
+ 2. 询问用户关于:语言、框架、启动模板、库、API、部署目标。
5536
+ 3. 对于未知项,根据项目目标和 MVP 范围提供指导。
5537
+ 4. 记录所有技术选择及其理由(为什么这个选择适合该项目)。
5538
+ 5. 这些将成为架构师的约束条件——务必具体和完整。
5539
+ elicit: true
5540
+ choices:
5541
+ repository: [Monorepo, Polyrepo]
5542
+ architecture: [Monolith, Microservices, Serverless]
5543
+ testing: [仅单元测试, 单元+集成测试, 完整测试金字塔]
5544
+ sections:
5545
+ - id: repository-structure
5546
+ title: "代码仓库结构: {Monorepo|Polyrepo|Multi-repo}"
5547
+ - id: service-architecture
5548
+ title: 服务架构
5549
+ instruction: "关键决策 - 记录高层服务架构(例如,Monolith, Microservices, Monorepo 内的 Serverless 函数)。"
5550
+ - id: testing-requirements
5551
+ title: 测试要求
5552
+ instruction: "关键决策 - 记录测试要求(仅单元测试、集成测试、e2e 测试、手动测试,以及是否需要方便手动测试的方法)。"
5553
+ - id: additional-assumptions
5554
+ title: 其他技术假设与请求
5555
+ instruction: 在起草本文档的整个过程中,如果提出或发现任何其他适合架构师的技术假设,请在此处作为额外的项目符号添加。
5556
+
5557
+ - id: epic-list
5558
+ title: 模块列表
5559
+ instruction: |
5560
+ 向用户呈现一份高层次的模块列表以供批准。每个模块应有一个标题和一个简短的(1句话)目标陈述。这使用户能在深入细节之前审阅整体结构。
5561
+
5562
+ 关键:模块必须遵循敏捷最佳实践,保持逻辑上的顺序:
5563
+
5564
+ - 每个模块都应交付一个重要的、端到端的、完全可部署且可测试的功能增量。
5565
+ - 模块 1 必须建立基础项目设施(应用设置、Git、CI/CD、核心服务),除非我们是向现有应用添加新功能。同时,它还应交付一个初始功能,即使只是一个健康检查路由或一个简单的金丝雀页面显示——在为第一个模块编写用户故事时要记住这一点!
5566
+ - 每个后续的模块都在之前模块功能的基础上构建,交付主要的功能模块,这些模块在部署时能为用户或业务提供切实的价值。
5567
+ - 并非每个项目都需要多个模块,一个模块需要交付价值。例如,一个已完成的 API 即使 UI 尚未完成并计划在另一个模块中实现,也可以交付价值。
5568
+ - 倾向于设置较少的模块,但要告知用户你的理由,并提供拆分选项,如果某些模块看起来太大或关注点分散的话。
5569
+ - 横切关注点应该贯穿于模块和用户故事中,而不是作为最后的用户故事。例如,在一个模块的最后一个故事中添加日志框架,或者在项目结束时作为最后一个模块或故事来做,这将非常糟糕,因为我们从一开始就没有日志记录。
5570
+ elicit: true
5571
+ examples:
5572
+ - "模块 1:基础与核心设施:建立项目设置、认证和基本用户管理"
5573
+ - "模块 2:核心业务实体:创建和管理主要领域对象的 CRUD 操作"
5574
+ - "模块 3:用户工作流与交互:实现关键用户旅程和业务流程"
5575
+ - "模块 4:报告与分析:为用户提供洞察和数据可视化"
5576
+
5577
+ - id: epic-details
5578
+ title: 模块 {{epic_number}} {{epic_title}}
5579
+ repeatable: true
5580
+ instruction: |
5581
+ 在模块列表被批准后,将每个模块及其所有的用户故事和验收标准作为一个完整的审查单元呈现。
5582
+
5583
+ 为每个模块提供扩展的目标(2-3 句话描述所有故事将实现的目标和价值)。
5584
+
5585
+ 关键的用户故事排序要求:
5586
+
5587
+ - 每个模块中的用户故事必须在逻辑上是顺序的。
5588
+ - 每个故事都应该是一个“垂直切片”,交付完整的功能,除了项目基础的早期使能型故事。
5589
+ - 任何故事都不应依赖于后续故事或模块的工作。
5590
+ - 识别并注明任何直接的前置故事。
5591
+ - 关注“做什么”和“为什么”,而不是“怎么做”(将技术实现留给架构师),但要足够精确以支持故事之间逻辑上顺序的操作。
5592
+ - 确保每个故事都交付明确的用户或业务价值,尽量避免使能型故事,而是将它们构建到交付价值的故事中。
5593
+ - 为 AI 代理执行调整故事的大小:每个故事必须能由单个 AI 代理在一次专注的会话中完成,而不会出现上下文溢出。
5594
+ - 想象一个“初级开发人员工作 2-4 小时”的场景——故事必须是小型的、专注的、自包含的。
5595
+ - 如果一个故事看起来很复杂,只要它能交付一个垂直切片,就应进一步拆分。
5596
+ elicit: true
5597
+ template: "{{epic_goal}}"
5598
+ sections:
5599
+ - id: story
5600
+ title: 用户故事 {{epic_number}}.{{story_number}} {{story_title}}
5601
+ repeatable: true
5602
+ template: |
5603
+ 作为一名 {{user_type}},
5604
+ 我想要 {{action}},
5605
+ 以便 {{benefit}}。
5606
+ sections:
5607
+ - id: acceptance-criteria
5608
+ title: 验收标准
5609
+ type: numbered-list
5610
+ item_template: "{{criterion_number}}: {{criteria}}"
5611
+ repeatable: true
5612
+ instruction: |
5613
+ 定义清晰、全面且可测试的验收标准,这些标准应:
5614
+
5615
+ - 从功能角度精确定义“完成”的含义。
5616
+ - 明确无歧义,并作为验证的基础。
5617
+ - 包括来自 PRD 的任何关键非功能性需求。
5618
+ - 考虑后端/数据组件的本地可测试性。
5619
+ - 在适用时,指定 UI/UX 需求和框架遵循情况。
5620
+ - 避免应放在其他故事或 PRD 部分的横切关注点。
5621
+
5622
+ - id: checklist-results
5623
+ title: 检查清单结果报告
5624
+ instruction: 在运行检查清单和起草提示之前,提议输出更新后的完整 PRD。如果输出,请与用户确认你将继续运行检查清单并生成报告。一旦用户确认,执行 pm-checklist 并在此部分填充结果。
5625
+
5626
+ - id: next-steps
5627
+ title: 后续步骤
5628
+ sections:
5629
+ - id: ux-expert-prompt
5630
+ title: UX 专家提示
5631
+ instruction: 此部分将包含给 UX 专家的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
5632
+ - id: architect-prompt
5633
+ title: 架构师提示
5634
+ instruction: 此部分将包含给架构师的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
5635
+ ==================== END: .xiaoma-core/templates/prd-tmpl.yaml ====================
5636
+
5637
+ ==================== START: .xiaoma-core/data/brainstorming-techniques.md ====================
5638
+ <!-- Powered by XiaoMa™ Core -->
5639
+
5640
+ # Brainstorming Techniques Data
5641
+
5642
+ ## Creative Expansion
5643
+
5644
+ 1. **What If Scenarios**: Ask one provocative question, get their response, then ask another
5645
+ 2. **Analogical Thinking**: Give one example analogy, ask them to find 2-3 more
5646
+ 3. **Reversal/Inversion**: Pose the reverse question, let them work through it
5647
+ 4. **First Principles Thinking**: Ask "What are the fundamentals?" and guide them to break it down
5648
+
5649
+ ## Structured Frameworks
5650
+
5651
+ 5. **SCAMPER Method**: Go through one letter at a time, wait for their ideas before moving to next
5652
+ 6. **Six Thinking Hats**: Present one hat, ask for their thoughts, then move to next hat
5653
+ 7. **Mind Mapping**: Start with central concept, ask them to suggest branches
5654
+
5655
+ ## Collaborative Techniques
5656
+
5657
+ 8. **"Yes, And..." Building**: They give idea, you "yes and" it, they "yes and" back - alternate
5658
+ 9. **Brainwriting/Round Robin**: They suggest idea, you build on it, ask them to build on yours
5659
+ 10. **Random Stimulation**: Give one random prompt/word, ask them to make connections
5660
+
5661
+ ## Deep Exploration
5662
+
5663
+ 11. **Five Whys**: Ask "why" and wait for their answer before asking next "why"
5664
+ 12. **Morphological Analysis**: Ask them to list parameters first, then explore combinations together
5665
+ 13. **Provocation Technique (PO)**: Give one provocative statement, ask them to extract useful ideas
5666
+
5667
+ ## Advanced Techniques
5668
+
5669
+ 14. **Forced Relationships**: Connect two unrelated concepts and ask them to find the bridge
5670
+ 15. **Assumption Reversal**: Challenge their core assumptions and ask them to build from there
5671
+ 16. **Role Playing**: Ask them to brainstorm from different stakeholder perspectives
5672
+ 17. **Time Shifting**: "How would you solve this in 1995? 2030?"
5673
+ 18. **Resource Constraints**: "What if you had only $10 and 1 hour?"
5674
+ 19. **Metaphor Mapping**: Use extended metaphors to explore solutions
5675
+ 20. **Question Storming**: Generate questions instead of answers first
5676
+ ==================== END: .xiaoma-core/data/brainstorming-techniques.md ====================
5677
+
5678
+ ==================== START: .xiaoma-core/tasks/brownfield-create-epic.md ====================
5679
+ <!-- Powered by XiaoMa™ Core -->
5680
+
5681
+ # Create Brownfield Epic Task
5682
+
5683
+ ## Purpose
5684
+
5685
+ Create a single epic for smaller brownfield enhancements that don't require the full PRD and Architecture documentation process. This task is for isolated features or modifications that can be completed within a focused scope.
5686
+
5687
+ ## When to Use This Task
5688
+
5689
+ **Use this task when:**
5690
+
5691
+ - The enhancement can be completed in 1-3 stories
5692
+ - No significant architectural changes are required
5693
+ - The enhancement follows existing project patterns
5694
+ - Integration complexity is minimal
5695
+ - Risk to existing system is low
5696
+
5697
+ **Use the full brownfield PRD/Architecture process when:**
5698
+
5699
+ - The enhancement requires multiple coordinated stories
5700
+ - Architectural planning is needed
5701
+ - Significant integration work is required
5702
+ - Risk assessment and mitigation planning is necessary
5703
+
5704
+ ## Instructions
5705
+
5706
+ ### 1. Project Analysis (Required)
5707
+
5708
+ Before creating the epic, gather essential information about the existing project:
5709
+
5710
+ **Existing Project Context:**
5711
+
5712
+ - [ ] Project purpose and current functionality understood
5713
+ - [ ] Existing technology stack identified
5714
+ - [ ] Current architecture patterns noted
5715
+ - [ ] Integration points with existing system identified
5716
+
5717
+ **Enhancement Scope:**
5718
+
5719
+ - [ ] Enhancement clearly defined and scoped
5720
+ - [ ] Impact on existing functionality assessed
5721
+ - [ ] Required integration points identified
5722
+ - [ ] Success criteria established
5723
+
5724
+ ### 2. Epic Creation
5725
+
5726
+ Create a focused epic following this structure:
5727
+
5728
+ #### Epic Title
5729
+
5730
+ {{Enhancement Name}} - Brownfield Enhancement
5731
+
5732
+ #### Epic Goal
5733
+
5734
+ {{1-2 sentences describing what the epic will accomplish and why it adds value}}
5735
+
5736
+ #### Epic Description
5737
+
5738
+ **Existing System Context:**
5739
+
5740
+ - Current relevant functionality: {{brief description}}
5741
+ - Technology stack: {{relevant existing technologies}}
5742
+ - Integration points: {{where new work connects to existing system}}
5743
+
5744
+ **Enhancement Details:**
5745
+
5746
+ - What's being added/changed: {{clear description}}
5747
+ - How it integrates: {{integration approach}}
5748
+ - Success criteria: {{measurable outcomes}}
5749
+
5750
+ #### Stories
5751
+
5752
+ List 1-3 focused stories that complete the epic:
5753
+
5754
+ 1. **Story 1:** {{Story title and brief description}}
5755
+ 2. **Story 2:** {{Story title and brief description}}
5756
+ 3. **Story 3:** {{Story title and brief description}}
5757
+
5758
+ #### Compatibility Requirements
5759
+
5760
+ - [ ] Existing APIs remain unchanged
5761
+ - [ ] Database schema changes are backward compatible
5762
+ - [ ] UI changes follow existing patterns
5763
+ - [ ] Performance impact is minimal
5764
+
5765
+ #### Risk Mitigation
5766
+
5767
+ - **Primary Risk:** {{main risk to existing system}}
5768
+ - **Mitigation:** {{how risk will be addressed}}
5769
+ - **Rollback Plan:** {{how to undo changes if needed}}
5770
+
5771
+ #### Definition of Done
5772
+
5773
+ - [ ] All stories completed with acceptance criteria met
5774
+ - [ ] Existing functionality verified through testing
5775
+ - [ ] Integration points working correctly
5776
+ - [ ] Documentation updated appropriately
5777
+ - [ ] No regression in existing features
5778
+
5779
+ ### 3. Validation Checklist
5780
+
5781
+ Before finalizing the epic, ensure:
5782
+
5783
+ **Scope Validation:**
5784
+
5785
+ - [ ] Epic can be completed in 1-3 stories maximum
5786
+ - [ ] No architectural documentation is required
5787
+ - [ ] Enhancement follows existing patterns
5788
+ - [ ] Integration complexity is manageable
3697
5789
 
3698
5790
  **Risk Assessment:**
3699
5791
 
@@ -4539,211 +6631,6 @@ sections:
4539
6631
  - template: "IV3: {{performance_impact_verification}}"
4540
6632
  ==================== END: .xiaoma-core/templates/brownfield-prd-tmpl.yaml ====================
4541
6633
 
4542
- ==================== START: .xiaoma-core/templates/prd-tmpl.yaml ====================
4543
- template:
4544
- id: prd-template-v2
4545
- name: 产品需求文档
4546
- version: 2.0
4547
- output:
4548
- format: markdown
4549
- filename: docs/prd.md
4550
- title: "{{project_name}} Product Requirements Document (PRD)"
4551
-
4552
- workflow:
4553
- mode: interactive
4554
- elicitation: advanced-elicitation
4555
-
4556
- sections:
4557
- - id: goals-context
4558
- title: 目标与背景上下文
4559
- instruction: |
4560
- 询问“项目简报”文档是否可用。如果不存在“项目简报”,强烈建议首先使用 project-brief-tmpl 创建一个(它提供了必要的基础:问题陈述、目标用户、成功指标、MVP 范围、约束条件)。如果用户坚持在没有简报的情况下编写 PRD,请在“目标”部分收集这些信息。如果“项目简报”存在,请审阅并用它来填充“目标”(期望成果的项目符号列表)和“背景上下文”(1-2 段关于此项目解决什么问题及其原因的说明),以便我们能确定 PRD MVP 的范围内外事项。无论哪种方式,这对于确定需求都至关重要。请包含“变更日志”表格。
4561
- sections:
4562
- - id: goals
4563
- title: 目标
4564
- type: bullet-list
4565
- instruction: 以项目符号列表形式,每行一个,列出 PRD 成功后将交付的预期成果——用户和项目的期望。
4566
- - id: background
4567
- title: 背景上下文
4568
- type: paragraphs
4569
- instruction: 用 1-2 个简短段落总结背景上下文,例如我们在项目简报中学到了什么(避免与目标重复),这个项目解决什么问题以及为什么,当前的行业状况或需求是什么。
4570
- - id: changelog
4571
- title: 变更日志
4572
- type: table
4573
- columns: [日期, 版本, 描述, 作者]
4574
- instruction: 跟踪文档版本和变更
4575
-
4576
- - id: requirements
4577
- title: 需求
4578
- instruction: 在两个子部分下起草功能性和非功能性需求列表。
4579
- elicit: true
4580
- sections:
4581
- - id: functional
4582
- title: 功能性需求
4583
- type: numbered-list
4584
- prefix: FR
4585
- instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 FR 开头的标识符序列。
4586
- examples:
4587
- - "FR6: 待办事项列表使用 AI 检测并警告措辞不同但可能重复的待办事项。"
4588
- - id: non-functional
4589
- title: 非功能性需求
4590
- type: numbered-list
4591
- prefix: NFR
4592
- instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 NFR 开头的标识符序列。
4593
- examples:
4594
- - "NFR1: 在可行的情况下,AWS 服务的使用必须力求保持在免费套餐限制内。"
4595
-
4596
- - id: ui-goals
4597
- title: 用户界面设计目标
4598
- condition: PRD 包含 UX/UI 需求时
4599
- instruction: |
4600
- 捕获高层次的 UI/UX 愿景,以指导设计架构师并为创建用户故事提供信息。步骤:
4601
-
4602
- 1. 基于项目上下文,用有根据的猜测预先填充所有子部分。
4603
- 2. 将渲染后的完整部分呈现给用户。
4604
- 3. 清晰地告知用户哪些地方做了假设。
4605
- 4. 针对不清晰/缺失的元素或需要更具体说明的领域提出有针对性的问题。
4606
- 5. 这不是详细的 UI 规范——重点关注产品愿景和用户目标。
4607
- elicit: true
4608
- choices:
4609
- accessibility: [无, WCAG AA, WCAG AAA]
4610
- platforms: [响应式网页, 仅移动端, 仅桌面端, 跨平台]
4611
- sections:
4612
- - id: ux-vision
4613
- title: 整体 UX 愿景
4614
- - id: interaction-paradigms
4615
- title: 关键交互范式
4616
- - id: core-screens
4617
- title: 核心屏幕与视图
4618
- instruction: 从产品角度看,为实现 PRD 的价值和目标,最关键的屏幕或视图是什么?这旨在提供概念性的高层概览,以驱动粗略的模块或用户故事。
4619
- examples:
4620
- - "登录屏幕"
4621
- - "主仪表盘"
4622
- - "项目详情页"
4623
- - "设置页面"
4624
- - id: accessibility
4625
- title: "无障碍性: {无|WCAG AA|WCAG AAA|自定义要求}"
4626
- - id: branding
4627
- title: 品牌
4628
- instruction: 是否有任何已知的品牌元素或风格指南必须被整合进来?
4629
- examples:
4630
- - "复制 20 世纪初黑白电影的观感,包括在页面或状态转换期间模拟胶片损坏或投影仪故障的动画效果。"
4631
- - "附件是我司品牌的全套调色板和设计元素。"
4632
- - id: target-platforms
4633
- title: "目标设备与平台: {响应式网页|仅移动端|仅桌面端|跨平台}"
4634
- examples:
4635
- - "响应式网页,以及所有移动平台"
4636
- - "仅限 iPhone"
4637
- - "ASCII 码 Windows 桌面"
4638
-
4639
- - id: technical-assumptions
4640
- title: 技术假设
4641
- instruction: |
4642
- 收集将指导架构师的技术决策。步骤:
4643
-
4644
- 1. 检查 .xiaoma-core/data/technical-preferences.yaml 或附加的技术偏好文件是否存在——用它来预填充选项。
4645
- 2. 询问用户关于:语言、框架、启动模板、库、API、部署目标。
4646
- 3. 对于未知项,根据项目目标和 MVP 范围提供指导。
4647
- 4. 记录所有技术选择及其理由(为什么这个选择适合该项目)。
4648
- 5. 这些将成为架构师的约束条件——务必具体和完整。
4649
- elicit: true
4650
- choices:
4651
- repository: [Monorepo, Polyrepo]
4652
- architecture: [Monolith, Microservices, Serverless]
4653
- testing: [仅单元测试, 单元+集成测试, 完整测试金字塔]
4654
- sections:
4655
- - id: repository-structure
4656
- title: "代码仓库结构: {Monorepo|Polyrepo|Multi-repo}"
4657
- - id: service-architecture
4658
- title: 服务架构
4659
- instruction: "关键决策 - 记录高层服务架构(例如,Monolith, Microservices, Monorepo 内的 Serverless 函数)。"
4660
- - id: testing-requirements
4661
- title: 测试要求
4662
- instruction: "关键决策 - 记录测试要求(仅单元测试、集成测试、e2e 测试、手动测试,以及是否需要方便手动测试的方法)。"
4663
- - id: additional-assumptions
4664
- title: 其他技术假设与请求
4665
- instruction: 在起草本文档的整个过程中,如果提出或发现任何其他适合架构师的技术假设,请在此处作为额外的项目符号添加。
4666
-
4667
- - id: epic-list
4668
- title: 模块列表
4669
- instruction: |
4670
- 向用户呈现一份高层次的模块列表以供批准。每个模块应有一个标题和一个简短的(1句话)目标陈述。这使用户能在深入细节之前审阅整体结构。
4671
-
4672
- 关键:模块必须遵循敏捷最佳实践,保持逻辑上的顺序:
4673
-
4674
- - 每个模块都应交付一个重要的、端到端的、完全可部署且可测试的功能增量。
4675
- - 模块 1 必须建立基础项目设施(应用设置、Git、CI/CD、核心服务),除非我们是向现有应用添加新功能。同时,它还应交付一个初始功能,即使只是一个健康检查路由或一个简单的金丝雀页面显示——在为第一个模块编写用户故事时要记住这一点!
4676
- - 每个后续的模块都在之前模块功能的基础上构建,交付主要的功能模块,这些模块在部署时能为用户或业务提供切实的价值。
4677
- - 并非每个项目都需要多个模块,一个模块需要交付价值。例如,一个已完成的 API 即使 UI 尚未完成并计划在另一个模块中实现,也可以交付价值。
4678
- - 倾向于设置较少的模块,但要告知用户你的理由,并提供拆分选项,如果某些模块看起来太大或关注点分散的话。
4679
- - 横切关注点应该贯穿于模块和用户故事中,而不是作为最后的用户故事。例如,在一个模块的最后一个故事中添加日志框架,或者在项目结束时作为最后一个模块或故事来做,这将非常糟糕,因为我们从一开始就没有日志记录。
4680
- elicit: true
4681
- examples:
4682
- - "模块 1:基础与核心设施:建立项目设置、认证和基本用户管理"
4683
- - "模块 2:核心业务实体:创建和管理主要领域对象的 CRUD 操作"
4684
- - "模块 3:用户工作流与交互:实现关键用户旅程和业务流程"
4685
- - "模块 4:报告与分析:为用户提供洞察和数据可视化"
4686
-
4687
- - id: epic-details
4688
- title: 模块 {{epic_number}} {{epic_title}}
4689
- repeatable: true
4690
- instruction: |
4691
- 在模块列表被批准后,将每个模块及其所有的用户故事和验收标准作为一个完整的审查单元呈现。
4692
-
4693
- 为每个模块提供扩展的目标(2-3 句话描述所有故事将实现的目标和价值)。
4694
-
4695
- 关键的用户故事排序要求:
4696
-
4697
- - 每个模块中的用户故事必须在逻辑上是顺序的。
4698
- - 每个故事都应该是一个“垂直切片”,交付完整的功能,除了项目基础的早期使能型故事。
4699
- - 任何故事都不应依赖于后续故事或模块的工作。
4700
- - 识别并注明任何直接的前置故事。
4701
- - 关注“做什么”和“为什么”,而不是“怎么做”(将技术实现留给架构师),但要足够精确以支持故事之间逻辑上顺序的操作。
4702
- - 确保每个故事都交付明确的用户或业务价值,尽量避免使能型故事,而是将它们构建到交付价值的故事中。
4703
- - 为 AI 代理执行调整故事的大小:每个故事必须能由单个 AI 代理在一次专注的会话中完成,而不会出现上下文溢出。
4704
- - 想象一个“初级开发人员工作 2-4 小时”的场景——故事必须是小型的、专注的、自包含的。
4705
- - 如果一个故事看起来很复杂,只要它能交付一个垂直切片,就应进一步拆分。
4706
- elicit: true
4707
- template: "{{epic_goal}}"
4708
- sections:
4709
- - id: story
4710
- title: 用户故事 {{epic_number}}.{{story_number}} {{story_title}}
4711
- repeatable: true
4712
- template: |
4713
- 作为一名 {{user_type}},
4714
- 我想要 {{action}},
4715
- 以便 {{benefit}}。
4716
- sections:
4717
- - id: acceptance-criteria
4718
- title: 验收标准
4719
- type: numbered-list
4720
- item_template: "{{criterion_number}}: {{criteria}}"
4721
- repeatable: true
4722
- instruction: |
4723
- 定义清晰、全面且可测试的验收标准,这些标准应:
4724
-
4725
- - 从功能角度精确定义“完成”的含义。
4726
- - 明确无歧义,并作为验证的基础。
4727
- - 包括来自 PRD 的任何关键非功能性需求。
4728
- - 考虑后端/数据组件的本地可测试性。
4729
- - 在适用时,指定 UI/UX 需求和框架遵循情况。
4730
- - 避免应放在其他故事或 PRD 部分的横切关注点。
4731
-
4732
- - id: checklist-results
4733
- title: 检查清单结果报告
4734
- instruction: 在运行检查清单和起草提示之前,提议输出更新后的完整 PRD。如果输出,请与用户确认你将继续运行检查清单并生成报告。一旦用户确认,执行 pm-checklist 并在此部分填充结果。
4735
-
4736
- - id: next-steps
4737
- title: 后续步骤
4738
- sections:
4739
- - id: ux-expert-prompt
4740
- title: UX 专家提示
4741
- instruction: 此部分将包含给 UX 专家的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
4742
- - id: architect-prompt
4743
- title: 架构师提示
4744
- instruction: 此部分将包含给架构师的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
4745
- ==================== END: .xiaoma-core/templates/prd-tmpl.yaml ====================
4746
-
4747
6634
  ==================== START: .xiaoma-core/checklists/change-checklist.md ====================
4748
6635
  <!-- Powered by XiaoMa™ Core -->
4749
6636