@zeyue0329/xiaoma-cli 1.0.42 → 1.0.44
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.
- package/.idea/workspace.xml +2 -7
- package/JAVA-BACKEND-COMMANDS-REFERENCE.md +2 -2
- package/JAVA-BACKEND-ITERATION-GUIDE.md +31 -31
- package/dist/agents/analyst.txt +1514 -0
- package/dist/agents/architect.txt +1 -1
- package/dist/agents/pm.txt +20 -20
- package/dist/agents/po.txt +1 -1
- package/dist/agents/sm.txt +1 -1
- package/dist/agents/workflow-executor.txt +22 -22
- package/dist/agents/xiaoma-master.txt +20 -20
- package/dist/teams/team-all.txt +1640 -331
- package/dist/teams/team-fullstack-with-database.txt +1616 -307
- package/dist/teams/team-fullstack.txt +1618 -309
- package/dist/teams/team-ide-minimal.txt +2 -2
- package/dist/teams/team-no-ui.txt +1618 -309
- package/docs/architecture-sharding-modification.md +4 -4
- package/docs/automated-requirements-analysis-outputs.md +29 -29
- package/docs/prd/workflow-coordinator-prd.md +2 -2
- package/package.json +1 -1
- package/xiaoma-core/agents/analyst.md +8 -0
- package/xiaoma-core/agents/pm.md +1 -1
- package/xiaoma-core/agents/po.md +1 -1
- package/xiaoma-core/agents/requirements-coverage-auditor.yaml +1 -1
- package/xiaoma-core/agents/sm.md +1 -1
- package/xiaoma-core/agents/workflow-executor.md +22 -22
- package/xiaoma-core/tasks/batch-story-generation.md +1 -1
- package/xiaoma-core/tasks/requirement-analysis-with-rag.md +352 -0
- package/xiaoma-core/tasks/requirements-coverage-audit.md +5 -5
- package/xiaoma-core/templates/fullstack-architecture-tmpl.yaml +1 -1
- package/xiaoma-core/templates/prd-tmpl.yaml +19 -19
- package/xiaoma-core/templates/rag-knowledge-tmpl.yaml +569 -0
- package/xiaoma-core/templates/rag-questions-tmpl.yaml +371 -0
- package/xiaoma-core/templates/requirements-coverage-audit.yaml +6 -6
- package/xiaoma-core/workflows/automated-requirements-analysis.yaml +90 -90
- package/xiaoma-core/workflows/automated-requirements-development.yaml +10 -10
- package/xiaoma-core/workflows/enhanced-fullstack-with-qa-loop.yaml +1 -1
- package/xiaoma-core/workflows/full-requirement-automation.yaml +1 -1
package/dist/teams/team-all.txt
CHANGED
|
@@ -231,6 +231,10 @@ commands:
|
|
|
231
231
|
- elicit: 运行任务 advanced-elicitation
|
|
232
232
|
- perform-market-research: 使用任务 create-doc 和 market-research-tmpl.yaml
|
|
233
233
|
- research-prompt {topic}: 执行任务 create-deep-research-prompt.md
|
|
234
|
+
- analyze-requirement {req_file}: 基于需求文档进行RAG增强的需求分析 (运行任务 requirement-analysis-with-rag.md)
|
|
235
|
+
- generate-rag-questions {req_file}: 根据需求文档生成知识库查询问题清单 (使用模板 rag-questions-tmpl.yaml)
|
|
236
|
+
- land-knowledge: 将知识库返回的内容结构化存储到docs/rag目录 (使用模板 rag-knowledge-tmpl.yaml)
|
|
237
|
+
- create-prd-from-rag: 基于docs/rag知识和需求文档生成PRD (使用任务 create-doc 和 prd-tmpl.yaml)
|
|
234
238
|
- yolo: 切换 Yolo 模式
|
|
235
239
|
- exit: 作为业务分析师道别,然后放弃扮演此角色
|
|
236
240
|
dependencies:
|
|
@@ -243,11 +247,15 @@ dependencies:
|
|
|
243
247
|
- create-doc.md
|
|
244
248
|
- document-project.md
|
|
245
249
|
- facilitate-brainstorming-session.md
|
|
250
|
+
- requirement-analysis-with-rag.md
|
|
246
251
|
templates:
|
|
247
252
|
- brainstorming-output-tmpl.yaml
|
|
248
253
|
- competitor-analysis-tmpl.yaml
|
|
249
254
|
- market-research-tmpl.yaml
|
|
250
255
|
- project-brief-tmpl.yaml
|
|
256
|
+
- rag-questions-tmpl.yaml
|
|
257
|
+
- rag-knowledge-tmpl.yaml
|
|
258
|
+
- prd-tmpl.yaml
|
|
251
259
|
```
|
|
252
260
|
==================== END: .xiaoma-core/agents/analyst.md ====================
|
|
253
261
|
|
|
@@ -1230,7 +1238,7 @@ commands:
|
|
|
1230
1238
|
- create-brownfield-epic: 运行任务 brownfield-create-epic.md
|
|
1231
1239
|
- create-brownfield-prd: 使用模板 brownfield-prd-tmpl.yaml 运行任务 create-doc.md
|
|
1232
1240
|
- create-brownfield-story: 运行任务 brownfield-create-story.md
|
|
1233
|
-
- create-epic:
|
|
1241
|
+
- create-epic: 为现有项目项目创建模块 (任务 brownfield-create-epic)
|
|
1234
1242
|
- create-prd: 使用模板 prd-tmpl.yaml 运行任务 create-doc.md
|
|
1235
1243
|
- create-story: 从需求创建用户故事 (任务 brownfield-create-story)
|
|
1236
1244
|
- doc-out: 将完整文档输出到当前目标文件
|
|
@@ -1294,7 +1302,7 @@ persona:
|
|
|
1294
1302
|
commands:
|
|
1295
1303
|
- help: 显示以下命令的编号列表以供选择
|
|
1296
1304
|
- correct-course: 执行 correct-course 任务
|
|
1297
|
-
- create-epic:
|
|
1305
|
+
- create-epic: 为现有项目项目创建模块 (任务 brownfield-create-epic)
|
|
1298
1306
|
- create-story: 从需求创建用户故事 (任务 brownfield-create-story)
|
|
1299
1307
|
- doc-out: 将完整文档输出到当前目标文件
|
|
1300
1308
|
- execute-checklist-po: 运行任务 execute-checklist (清单 po-master-checklist)
|
|
@@ -1402,7 +1410,7 @@ agent:
|
|
|
1402
1410
|
id: sm
|
|
1403
1411
|
title: Scrum Master
|
|
1404
1412
|
icon: 🏃
|
|
1405
|
-
whenToUse:
|
|
1413
|
+
whenToUse: 用于创建故事、模块管理、在派对模式下进行回顾以及敏捷流程指导
|
|
1406
1414
|
customization: null
|
|
1407
1415
|
persona:
|
|
1408
1416
|
role: 技术 Scrum Master - 故事准备专家
|
|
@@ -1523,7 +1531,7 @@ persona:
|
|
|
1523
1531
|
- 自动切换智能体:根据工作流定义,自动使用 /analyst、/architect、/pm、/po、/sm、/dev、/qa 等命令切换到相应的智能体角色
|
|
1524
1532
|
- 连续执行模式:完成一个步骤后,立即显示简短进度(1-2行)并**无需任何确认**直接进入下一个步骤,直到整个工作流完成或遇到真正的技术错误
|
|
1525
1533
|
- 🚫 严禁中断询问:不要问'是否继续'、'请选择'、'您希望'等问题。用户启动工作流就是明确要求自动执行到底。唯一允许暂停的情况:文件不存在、执行报错、质量门控失败。
|
|
1526
|
-
- '✅ 正确的进度报告格式:简短报告 + 立即继续,例如:''✅ 步骤 3/6 完成: PM 创建 PRD → 立即开始步骤 4/6: PM
|
|
1534
|
+
- '✅ 正确的进度报告格式:简短报告 + 立即继续,例如:''✅ 步骤 3/6 完成: PM 创建 PRD → 立即开始步骤 4/6: PM 拆分模块...'''
|
|
1527
1535
|
commands:
|
|
1528
1536
|
- help: 显示以下命令的编号列表以供选择
|
|
1529
1537
|
- run-requirements-analysis: 🔥 自动化需求分析工作流(完全自动执行,不暂停)- 加载 automated-requirements-analysis.yaml 并连续执行所有 6 个步骤,从 req.txt 到最终的架构设计文档,全程自动化无需人工干预
|
|
@@ -1603,7 +1611,7 @@ workflow_stages:
|
|
|
1603
1611
|
tasks:
|
|
1604
1612
|
- 创建 Brownfield 项目迭代需求的 PRD 文档
|
|
1605
1613
|
- 定义功能模块、数据变更、API 规范
|
|
1606
|
-
-
|
|
1614
|
+
- 制定验收标准和模块拆分建议
|
|
1607
1615
|
- 自检 PRD 质量(16项检查)
|
|
1608
1616
|
outputs:
|
|
1609
1617
|
- docs/prd/brownfield-iteration-prd.md
|
|
@@ -1611,15 +1619,15 @@ workflow_stages:
|
|
|
1611
1619
|
stage_4_pm_epics:
|
|
1612
1620
|
agent: pm
|
|
1613
1621
|
command: "*create-epic"
|
|
1614
|
-
duration: "
|
|
1622
|
+
duration: "变动,取决于模块数量"
|
|
1615
1623
|
tasks:
|
|
1616
|
-
- 从 PRD
|
|
1617
|
-
-
|
|
1624
|
+
- 从 PRD 提取模块清单
|
|
1625
|
+
- 循环创建每个模块文档
|
|
1618
1626
|
- 初步识别用户故事
|
|
1619
1627
|
- 定义技术设计概要和数据库/API 变更
|
|
1620
|
-
-
|
|
1628
|
+
- 验证模块质量
|
|
1621
1629
|
outputs:
|
|
1622
|
-
- docs/epics
|
|
1630
|
+
- docs/epics/Epic-*.md (多个模块文件)
|
|
1623
1631
|
|
|
1624
1632
|
stage_5_architect_design:
|
|
1625
1633
|
agent: architect
|
|
@@ -1628,7 +1636,7 @@ workflow_stages:
|
|
|
1628
1636
|
duration: "30-40分钟"
|
|
1629
1637
|
inputs:
|
|
1630
1638
|
- docs/prd/brownfield-iteration-prd.md
|
|
1631
|
-
- docs/epics
|
|
1639
|
+
- docs/epics/Epic-*.md
|
|
1632
1640
|
- docs/architecture/current-architecture-analysis.md
|
|
1633
1641
|
tasks:
|
|
1634
1642
|
- 设计新增数据模型(Entity + DDL)
|
|
@@ -1676,7 +1684,7 @@ workflow_stages:
|
|
|
1676
1684
|
├─ 步骤 1/6: Analyst 需求分析
|
|
1677
1685
|
├─ 步骤 2/6: Architect 架构分析
|
|
1678
1686
|
├─ 步骤 3/6: PM 创建 PRD
|
|
1679
|
-
├─ 步骤 4/6: PM
|
|
1687
|
+
├─ 步骤 4/6: PM 拆分模块
|
|
1680
1688
|
├─ 步骤 5/6: Architect 架构设计
|
|
1681
1689
|
└─ 步骤 6/6: 生成需求分析报告
|
|
1682
1690
|
↓
|
|
@@ -1931,7 +1939,7 @@ quality_gates:
|
|
|
1931
1939
|
# ✓ 步骤 1/6: Analyst 需求分析 → 生成需求分析报告
|
|
1932
1940
|
# ✓ 步骤 2/6: Architect 架构分析 → 生成架构分析报告
|
|
1933
1941
|
# ✓ 步骤 3/6: PM 创建 PRD → 生成 Brownfield PRD
|
|
1934
|
-
# ✓ 步骤 4/6: PM
|
|
1942
|
+
# ✓ 步骤 4/6: PM 拆分模块 → 生成 Epic 文档
|
|
1935
1943
|
# ✓ 步骤 5/6: Architect 架构设计 → 生成架构设计和数据库脚本
|
|
1936
1944
|
# ✓ 步骤 6/6: 生成需求分析完成报告
|
|
1937
1945
|
# ↓
|
|
@@ -1954,7 +1962,7 @@ quality_gates:
|
|
|
1954
1962
|
# - docs/requirements/requirements-analysis.md
|
|
1955
1963
|
# - docs/architecture/current-architecture-analysis.md
|
|
1956
1964
|
# - docs/prd/brownfield-iteration-prd.md
|
|
1957
|
-
# - docs/epics
|
|
1965
|
+
# - docs/epics/Epic-*.md
|
|
1958
1966
|
# - docs/architecture/iteration-backend-design.md
|
|
1959
1967
|
# - docs/architecture/db-migration-scripts.sql
|
|
1960
1968
|
# - docs/architecture/*.md (7个模块文档)
|
|
@@ -2006,7 +2014,7 @@ quality_gates:
|
|
|
2006
2014
|
# ✓ 步骤 1/6: 切换到 Analyst 进行需求分析(15-25分钟)
|
|
2007
2015
|
# ✓ 步骤 2/6: 切换到 Architect 分析现有架构(10-20分钟)
|
|
2008
2016
|
# ✓ 步骤 3/6: 切换到 PM 创建 Brownfield PRD(20-30分钟)
|
|
2009
|
-
# ✓ 步骤 4/6: 切换到 PM
|
|
2017
|
+
# ✓ 步骤 4/6: 切换到 PM 拆分模块(取决于模块数量)
|
|
2010
2018
|
# ✓ 步骤 5/6: 切换到 Architect 设计增量架构(30-40分钟)
|
|
2011
2019
|
# ✓ 步骤 6/6: 生成完成报告
|
|
2012
2020
|
|
|
@@ -2014,7 +2022,7 @@ quality_gates:
|
|
|
2014
2022
|
# - docs/requirements/requirements-analysis.md
|
|
2015
2023
|
# - docs/architecture/current-architecture-analysis.md
|
|
2016
2024
|
# - docs/prd/brownfield-iteration-prd.md
|
|
2017
|
-
# - docs/epics
|
|
2025
|
+
# - docs/epics/Epic-*.md
|
|
2018
2026
|
# - docs/architecture/iteration-backend-design.md
|
|
2019
2027
|
# - docs/architecture/db-migration-scripts.sql
|
|
2020
2028
|
```
|
|
@@ -2064,7 +2072,7 @@ quality_gates:
|
|
|
2064
2072
|
|
|
2065
2073
|
# 输出示例:
|
|
2066
2074
|
# 当前工作流: automated-requirements-analysis
|
|
2067
|
-
# 当前阶段: stage_4_pm_epics (PM
|
|
2075
|
+
# 当前阶段: stage_4_pm_epics (PM 拆分模块)
|
|
2068
2076
|
# 进度: 60% (3/5 步骤完成)
|
|
2069
2077
|
# 当前智能体: pm
|
|
2070
2078
|
# 已完成步骤:
|
|
@@ -2073,7 +2081,7 @@ quality_gates:
|
|
|
2073
2081
|
# ✓ stage_2_architect - 架构分析
|
|
2074
2082
|
# ✓ stage_3_pm_prd - PRD 创建
|
|
2075
2083
|
# 进行中步骤:
|
|
2076
|
-
# ⏳ stage_4_pm_epics -
|
|
2084
|
+
# ⏳ stage_4_pm_epics - 模块拆分 (2/4 模块已创建)
|
|
2077
2085
|
# 待执行步骤:
|
|
2078
2086
|
# ⏸ stage_5_architect_design - 架构设计
|
|
2079
2087
|
```
|
|
@@ -2175,7 +2183,7 @@ escalation_protocol:
|
|
|
2175
2183
|
*validate-prerequisites
|
|
2176
2184
|
|
|
2177
2185
|
# 检查项目:
|
|
2178
|
-
# ✓ Epic 文档存在 (docs/epics
|
|
2186
|
+
# ✓ Epic 文档存在 (docs/epics/Epic-*.md)
|
|
2179
2187
|
# ✓ 数据库设计文档存在 (docs/architecture/iteration-backend-design.md)
|
|
2180
2188
|
# ✓ 架构分析文档存在 (docs/architecture/current-architecture-analysis.md)
|
|
2181
2189
|
# ✓ 代码生成器配置完成 (如使用 MyBatis-Plus Generator)
|
|
@@ -2203,7 +2211,7 @@ escalation_protocol:
|
|
|
2203
2211
|
# 示例输出:
|
|
2204
2212
|
# 检测到未完成的工作流: automated-requirements-analysis
|
|
2205
2213
|
# 最后完成的步骤: stage_3_pm_prd (PRD 创建)
|
|
2206
|
-
# 准备从步骤 stage_4_pm_epics (
|
|
2214
|
+
# 准备从步骤 stage_4_pm_epics (模块拆分) 恢复执行
|
|
2207
2215
|
#
|
|
2208
2216
|
# 验证前序输出:
|
|
2209
2217
|
# ✓ docs/requirements/requirements-analysis.md
|
|
@@ -2383,7 +2391,7 @@ completion_report:
|
|
|
2383
2391
|
# ✅ 步骤 1/6: Analyst 需求分析 → 立即开始步骤 2/6...
|
|
2384
2392
|
# ✅ 步骤 2/6: Architect 架构分析 → 立即开始步骤 3/6...
|
|
2385
2393
|
# ✅ 步骤 3/6: PM 创建 PRD → 立即开始步骤 4/6...
|
|
2386
|
-
# ✅ 步骤 4/6: PM
|
|
2394
|
+
# ✅ 步骤 4/6: PM 拆分模块 → 立即开始步骤 5/6...
|
|
2387
2395
|
# ✅ 步骤 5/6: Architect 架构设计 → 立即开始步骤 6/6...
|
|
2388
2396
|
# ✅ 步骤 6/6: 生成完成报告 → 🎉 工作流完成!
|
|
2389
2397
|
|
|
@@ -2419,9 +2427,9 @@ completion_report:
|
|
|
2419
2427
|
[20-30分钟后]
|
|
2420
2428
|
✅ 步骤 3/6 完成: 已生成 docs/prd/brownfield-iteration-prd.md
|
|
2421
2429
|
|
|
2422
|
-
正在执行步骤 4/6: PM
|
|
2423
|
-
[
|
|
2424
|
-
✅ 步骤 4/6 完成: 已生成 4
|
|
2430
|
+
正在执行步骤 4/6: PM 拆分模块...
|
|
2431
|
+
[根据模块数量]
|
|
2432
|
+
✅ 步骤 4/6 完成: 已生成 4 个模块文档
|
|
2425
2433
|
|
|
2426
2434
|
正在执行步骤 5/6: Architect 设计增量架构...
|
|
2427
2435
|
[30-40分钟后]
|
|
@@ -2437,7 +2445,7 @@ completion_report:
|
|
|
2437
2445
|
- docs/requirements/requirements-analysis.md
|
|
2438
2446
|
- docs/architecture/current-architecture-analysis.md
|
|
2439
2447
|
- docs/prd/brownfield-iteration-prd.md
|
|
2440
|
-
- docs/epics
|
|
2448
|
+
- docs/epics/Epic-*.md (4个)
|
|
2441
2449
|
- docs/architecture/iteration-backend-design.md
|
|
2442
2450
|
- docs/architecture/db-migration-scripts.sql
|
|
2443
2451
|
|
|
@@ -4651,6 +4659,361 @@ Generate structured document with these sections:
|
|
|
4651
4659
|
- Respect their process and timing
|
|
4652
4660
|
==================== END: .xiaoma-core/tasks/facilitate-brainstorming-session.md ====================
|
|
4653
4661
|
|
|
4662
|
+
==================== START: .xiaoma-core/tasks/requirement-analysis-with-rag.md ====================
|
|
4663
|
+
<!-- Powered by XiaoMa™ Core -->
|
|
4664
|
+
|
|
4665
|
+
# 基于知识库的需求分析任务
|
|
4666
|
+
|
|
4667
|
+
## Purpose
|
|
4668
|
+
|
|
4669
|
+
通过结合外部需求文档(req.txt)和知识库(RAG/MCP)进行深度需求分析,生成高质量的PRD文档。
|
|
4670
|
+
|
|
4671
|
+
## Workflow Overview
|
|
4672
|
+
|
|
4673
|
+
```
|
|
4674
|
+
req.txt → 问题生成 → 知识库查询 → 知识落地(docs/rag/) → 需求分析 → PRD生成
|
|
4675
|
+
```
|
|
4676
|
+
|
|
4677
|
+
## Phase 1: 需求文档解析与问题生成
|
|
4678
|
+
|
|
4679
|
+
### 1.1 需求文档初步解析
|
|
4680
|
+
|
|
4681
|
+
首先读取并分析 req.txt 文档,识别以下关键信息:
|
|
4682
|
+
|
|
4683
|
+
```yaml
|
|
4684
|
+
解析维度:
|
|
4685
|
+
业务领域: 识别需求所属的业务领域和子领域
|
|
4686
|
+
核心功能: 提取需求描述的主要功能点
|
|
4687
|
+
用户角色: 识别涉及的用户类型和角色
|
|
4688
|
+
业务流程: 提取隐含或显式的业务流程
|
|
4689
|
+
数据实体: 识别涉及的数据对象和关系
|
|
4690
|
+
集成点: 识别与外部系统的交互需求
|
|
4691
|
+
约束条件: 提取技术、业务、时间等约束
|
|
4692
|
+
模糊点: 标记需要澄清的不明确内容
|
|
4693
|
+
```
|
|
4694
|
+
|
|
4695
|
+
### 1.2 知识库问题生成框架
|
|
4696
|
+
|
|
4697
|
+
基于解析结果,生成以下类别的问题向知识库查询:
|
|
4698
|
+
|
|
4699
|
+
---
|
|
4700
|
+
|
|
4701
|
+
## Phase 2: 知识库提问清单模板
|
|
4702
|
+
|
|
4703
|
+
### 类别 A: 业务知识查询
|
|
4704
|
+
|
|
4705
|
+
#### A1. 业务领域背景
|
|
4706
|
+
```
|
|
4707
|
+
问题模板:
|
|
4708
|
+
- "关于[业务领域],现有系统中有哪些相关的业务规则和约束?"
|
|
4709
|
+
- "[业务流程名称]的完整流程是什么?包括哪些步骤和参与者?"
|
|
4710
|
+
- "在[业务场景]中,有哪些已知的边界情况和异常处理逻辑?"
|
|
4711
|
+
- "[业务概念A]和[业务概念B]之间的关系是什么?"
|
|
4712
|
+
```
|
|
4713
|
+
|
|
4714
|
+
#### A2. 现有功能调研
|
|
4715
|
+
```
|
|
4716
|
+
问题模板:
|
|
4717
|
+
- "系统中是否已存在类似[功能描述]的功能?如果有,实现方式是什么?"
|
|
4718
|
+
- "[模块名称]目前支持哪些操作?有什么限制?"
|
|
4719
|
+
- "用户当前如何完成[业务目标]?现有流程有什么痛点?"
|
|
4720
|
+
```
|
|
4721
|
+
|
|
4722
|
+
#### A3. 业务规则确认
|
|
4723
|
+
```
|
|
4724
|
+
问题模板:
|
|
4725
|
+
- "[数据实体]的业务规则有哪些?例如:必填字段、取值范围、状态流转规则"
|
|
4726
|
+
- "[操作A]在什么条件下可以执行?有哪些前置条件?"
|
|
4727
|
+
- "不同[用户角色]在[功能]上的权限差异是什么?"
|
|
4728
|
+
```
|
|
4729
|
+
|
|
4730
|
+
---
|
|
4731
|
+
|
|
4732
|
+
### 类别 B: 技术知识查询
|
|
4733
|
+
|
|
4734
|
+
#### B1. 系统架构
|
|
4735
|
+
```
|
|
4736
|
+
问题模板:
|
|
4737
|
+
- "现有系统的技术架构是什么?使用了哪些核心框架和技术栈?"
|
|
4738
|
+
- "[模块名称]的代码结构和目录组织是怎样的?"
|
|
4739
|
+
- "系统的数据库设计采用什么模式?主要的数据表有哪些?"
|
|
4740
|
+
- "系统中有哪些公共组件和工具类可以复用?"
|
|
4741
|
+
```
|
|
4742
|
+
|
|
4743
|
+
#### B2. 接口与集成
|
|
4744
|
+
```
|
|
4745
|
+
问题模板:
|
|
4746
|
+
- "与[外部系统]的集成接口是什么?数据格式和协议是什么?"
|
|
4747
|
+
- "系统提供了哪些API接口?[功能相关]的接口规范是什么?"
|
|
4748
|
+
- "现有的消息队列/事件机制是如何设计的?"
|
|
4749
|
+
```
|
|
4750
|
+
|
|
4751
|
+
#### B3. 数据模型
|
|
4752
|
+
```
|
|
4753
|
+
问题模板:
|
|
4754
|
+
- "[数据实体]在数据库中的表结构是什么?包含哪些字段?"
|
|
4755
|
+
- "[实体A]和[实体B]之间的数据库关系是怎样的?"
|
|
4756
|
+
- "系统中有哪些枚举值或字典表与[业务领域]相关?"
|
|
4757
|
+
```
|
|
4758
|
+
|
|
4759
|
+
#### B4. 代码实现参考
|
|
4760
|
+
```
|
|
4761
|
+
问题模板:
|
|
4762
|
+
- "类似[功能]的实现在代码中是如何组织的?请提供示例代码位置"
|
|
4763
|
+
- "[技术方案]在现有代码中有没有参考实现?"
|
|
4764
|
+
- "系统中处理[技术问题]的通用模式是什么?"
|
|
4765
|
+
```
|
|
4766
|
+
|
|
4767
|
+
---
|
|
4768
|
+
|
|
4769
|
+
### 类别 C: 历史需求与变更
|
|
4770
|
+
|
|
4771
|
+
#### C1. 相关需求追溯
|
|
4772
|
+
```
|
|
4773
|
+
问题模板:
|
|
4774
|
+
- "之前有没有类似[需求描述]的需求?实现情况如何?"
|
|
4775
|
+
- "[功能模块]的历史变更记录有哪些?最近的改动是什么?"
|
|
4776
|
+
- "有没有与[需求]相关的已知问题或技术债务?"
|
|
4777
|
+
```
|
|
4778
|
+
|
|
4779
|
+
#### C2. 决策记录
|
|
4780
|
+
```
|
|
4781
|
+
问题模板:
|
|
4782
|
+
- "[技术方案]为什么选择了当前的实现方式?有什么历史背景?"
|
|
4783
|
+
- "[设计决策]有没有相关的ADR(架构决策记录)?"
|
|
4784
|
+
```
|
|
4785
|
+
|
|
4786
|
+
---
|
|
4787
|
+
|
|
4788
|
+
### 类别 D: 上下文与约束
|
|
4789
|
+
|
|
4790
|
+
#### D1. 项目约束
|
|
4791
|
+
```
|
|
4792
|
+
问题模板:
|
|
4793
|
+
- "项目的技术栈限制有哪些?必须遵循的技术规范是什么?"
|
|
4794
|
+
- "项目的安全合规要求有哪些?"
|
|
4795
|
+
- "项目的性能要求和SLA标准是什么?"
|
|
4796
|
+
```
|
|
4797
|
+
|
|
4798
|
+
#### D2. 团队规范
|
|
4799
|
+
```
|
|
4800
|
+
问题模板:
|
|
4801
|
+
- "团队的代码规范和开发流程是什么?"
|
|
4802
|
+
- "团队的测试要求和代码审查标准是什么?"
|
|
4803
|
+
- "项目的部署流程和环境配置是怎样的?"
|
|
4804
|
+
```
|
|
4805
|
+
|
|
4806
|
+
---
|
|
4807
|
+
|
|
4808
|
+
## Phase 3: 问题生成执行流程
|
|
4809
|
+
|
|
4810
|
+
### 3.1 智能问题生成
|
|
4811
|
+
|
|
4812
|
+
```yaml
|
|
4813
|
+
执行步骤:
|
|
4814
|
+
步骤1_解析需求:
|
|
4815
|
+
输入: req.txt
|
|
4816
|
+
动作: 提取关键实体、流程、约束
|
|
4817
|
+
输出: 需求要素清单
|
|
4818
|
+
|
|
4819
|
+
步骤2_映射问题类别:
|
|
4820
|
+
输入: 需求要素清单
|
|
4821
|
+
动作: 将每个要素映射到问题类别(A/B/C/D)
|
|
4822
|
+
输出: 问题类别映射表
|
|
4823
|
+
|
|
4824
|
+
步骤3_生成具体问题:
|
|
4825
|
+
输入: 问题类别映射表 + 问题模板
|
|
4826
|
+
动作: 用具体内容填充模板生成问题
|
|
4827
|
+
输出: 知识库查询问题清单
|
|
4828
|
+
|
|
4829
|
+
步骤4_问题优先级排序:
|
|
4830
|
+
优先级规则:
|
|
4831
|
+
P0_阻塞级: 缺失会导致无法理解需求的核心问题
|
|
4832
|
+
P1_重要级: 影响需求完整性的问题
|
|
4833
|
+
P2_补充级: 有助于优化实现的问题
|
|
4834
|
+
```
|
|
4835
|
+
|
|
4836
|
+
### 3.2 问题清单输出格式
|
|
4837
|
+
|
|
4838
|
+
```markdown
|
|
4839
|
+
# 知识库查询问题清单
|
|
4840
|
+
|
|
4841
|
+
## 基本信息
|
|
4842
|
+
- 需求文档: req.txt
|
|
4843
|
+
- 生成时间: {{timestamp}}
|
|
4844
|
+
- 问题总数: {{total_count}}
|
|
4845
|
+
|
|
4846
|
+
## P0 阻塞级问题 (必须回答)
|
|
4847
|
+
|
|
4848
|
+
### 业务知识
|
|
4849
|
+
1. [A1-001] {{具体问题}}
|
|
4850
|
+
- 关联需求点: {{需求中的相关描述}}
|
|
4851
|
+
- 预期答案类型: {{期望获得的信息类型}}
|
|
4852
|
+
|
|
4853
|
+
### 技术知识
|
|
4854
|
+
2. [B1-001] {{具体问题}}
|
|
4855
|
+
- 关联需求点: {{需求中的相关描述}}
|
|
4856
|
+
- 预期答案类型: {{期望获得的信息类型}}
|
|
4857
|
+
|
|
4858
|
+
## P1 重要级问题 (建议回答)
|
|
4859
|
+
...
|
|
4860
|
+
|
|
4861
|
+
## P2 补充级问题 (可选回答)
|
|
4862
|
+
...
|
|
4863
|
+
```
|
|
4864
|
+
|
|
4865
|
+
---
|
|
4866
|
+
|
|
4867
|
+
## Phase 4: 知识落地与组织
|
|
4868
|
+
|
|
4869
|
+
### 4.1 知识存储结构
|
|
4870
|
+
|
|
4871
|
+
```
|
|
4872
|
+
docs/rag/
|
|
4873
|
+
├── _index.md # 知识索引文件
|
|
4874
|
+
├── business/ # 业务知识
|
|
4875
|
+
│ ├── domain-rules.md # 业务规则
|
|
4876
|
+
│ ├── processes.md # 业务流程
|
|
4877
|
+
│ └── entities.md # 业务实体
|
|
4878
|
+
├── technical/ # 技术知识
|
|
4879
|
+
│ ├── architecture.md # 系统架构
|
|
4880
|
+
│ ├── data-model.md # 数据模型
|
|
4881
|
+
│ ├── apis.md # 接口规范
|
|
4882
|
+
│ └── code-patterns.md # 代码模式
|
|
4883
|
+
├── history/ # 历史信息
|
|
4884
|
+
│ ├── related-requirements.md # 相关需求
|
|
4885
|
+
│ └── decisions.md # 决策记录
|
|
4886
|
+
└── constraints/ # 约束条件
|
|
4887
|
+
├── technical.md # 技术约束
|
|
4888
|
+
└── compliance.md # 合规要求
|
|
4889
|
+
```
|
|
4890
|
+
|
|
4891
|
+
### 4.2 知识文档格式
|
|
4892
|
+
|
|
4893
|
+
```markdown
|
|
4894
|
+
# {{知识标题}}
|
|
4895
|
+
|
|
4896
|
+
## 元信息
|
|
4897
|
+
- 来源: 知识库MCP查询
|
|
4898
|
+
- 查询问题: {{原始问题}}
|
|
4899
|
+
- 查询时间: {{timestamp}}
|
|
4900
|
+
- 置信度: {{high/medium/low}}
|
|
4901
|
+
|
|
4902
|
+
## 内容摘要
|
|
4903
|
+
{{一句话总结}}
|
|
4904
|
+
|
|
4905
|
+
## 详细内容
|
|
4906
|
+
{{知识库返回的完整内容}}
|
|
4907
|
+
|
|
4908
|
+
## 与需求的关联
|
|
4909
|
+
- 关联需求点: {{req.txt中的相关内容}}
|
|
4910
|
+
- 影响分析: {{这个知识如何影响需求实现}}
|
|
4911
|
+
|
|
4912
|
+
## 后续问题
|
|
4913
|
+
{{基于此知识产生的新问题(如有)}}
|
|
4914
|
+
```
|
|
4915
|
+
|
|
4916
|
+
---
|
|
4917
|
+
|
|
4918
|
+
## Phase 5: 需求分析与PRD生成
|
|
4919
|
+
|
|
4920
|
+
### 5.1 分析输入整合
|
|
4921
|
+
|
|
4922
|
+
```yaml
|
|
4923
|
+
分析输入:
|
|
4924
|
+
主要输入:
|
|
4925
|
+
- req.txt: 原始需求文档
|
|
4926
|
+
- docs/rag/*: 知识库查询结果
|
|
4927
|
+
辅助输入:
|
|
4928
|
+
- 项目简报(如存在): docs/brief.md
|
|
4929
|
+
- 技术偏好(如存在): data/technical-preferences.yaml
|
|
4930
|
+
```
|
|
4931
|
+
|
|
4932
|
+
### 5.2 需求分析维度
|
|
4933
|
+
|
|
4934
|
+
```yaml
|
|
4935
|
+
分析维度:
|
|
4936
|
+
功能分析:
|
|
4937
|
+
- 核心功能拆解
|
|
4938
|
+
- 功能优先级排序
|
|
4939
|
+
- 功能依赖关系
|
|
4940
|
+
|
|
4941
|
+
用户分析:
|
|
4942
|
+
- 用户角色定义
|
|
4943
|
+
- 用户旅程映射
|
|
4944
|
+
- 用户价值主张
|
|
4945
|
+
|
|
4946
|
+
技术分析:
|
|
4947
|
+
- 技术可行性评估
|
|
4948
|
+
- 与现有系统的兼容性
|
|
4949
|
+
- 技术风险识别
|
|
4950
|
+
|
|
4951
|
+
业务分析:
|
|
4952
|
+
- 业务规则验证
|
|
4953
|
+
- 业务流程优化机会
|
|
4954
|
+
- 业务价值量化
|
|
4955
|
+
|
|
4956
|
+
差距分析:
|
|
4957
|
+
- 现有能力 vs 需求能力
|
|
4958
|
+
- 需要新增/修改的功能
|
|
4959
|
+
- 需要新增/修改的数据
|
|
4960
|
+
```
|
|
4961
|
+
|
|
4962
|
+
### 5.3 PRD生成流程
|
|
4963
|
+
|
|
4964
|
+
```yaml
|
|
4965
|
+
PRD生成:
|
|
4966
|
+
步骤1:
|
|
4967
|
+
动作: 整合所有知识输入
|
|
4968
|
+
输出: 知识上下文汇总
|
|
4969
|
+
|
|
4970
|
+
步骤2:
|
|
4971
|
+
动作: 执行需求分析(5.2维度)
|
|
4972
|
+
输出: 需求分析报告
|
|
4973
|
+
|
|
4974
|
+
步骤3:
|
|
4975
|
+
动作: 套用PRD模板(prd-tmpl.yaml)
|
|
4976
|
+
输出: PRD草稿
|
|
4977
|
+
|
|
4978
|
+
步骤4:
|
|
4979
|
+
动作: 启发式验证(advanced-elicitation)
|
|
4980
|
+
输出: 优化后的PRD
|
|
4981
|
+
|
|
4982
|
+
步骤5:
|
|
4983
|
+
动作: 输出最终PRD到指定位置
|
|
4984
|
+
输出: docs/prd.md
|
|
4985
|
+
```
|
|
4986
|
+
|
|
4987
|
+
---
|
|
4988
|
+
|
|
4989
|
+
## 使用说明
|
|
4990
|
+
|
|
4991
|
+
### 智能体激活命令
|
|
4992
|
+
|
|
4993
|
+
```
|
|
4994
|
+
*analyze-requirement {req_file}
|
|
4995
|
+
```
|
|
4996
|
+
|
|
4997
|
+
### 执行参数
|
|
4998
|
+
|
|
4999
|
+
```yaml
|
|
5000
|
+
参数:
|
|
5001
|
+
req_file: 需求文档路径 (默认: req.txt)
|
|
5002
|
+
rag_output: 知识输出路径 (默认: docs/rag/)
|
|
5003
|
+
prd_output: PRD输出路径 (默认: docs/prd.md)
|
|
5004
|
+
skip_rag: 跳过知识库查询 (默认: false)
|
|
5005
|
+
interactive: 交互模式 (默认: true)
|
|
5006
|
+
```
|
|
5007
|
+
|
|
5008
|
+
### 交互模式流程
|
|
5009
|
+
|
|
5010
|
+
1. **解析阶段**: 展示需求解析结果,请用户确认
|
|
5011
|
+
2. **提问阶段**: 展示问题清单,请用户确认或调整
|
|
5012
|
+
3. **查询阶段**: 依次查询知识库,展示返回结果
|
|
5013
|
+
4. **分析阶段**: 展示分析结论,请用户确认
|
|
5014
|
+
5. **生成阶段**: 生成PRD草稿,启用启发式优化
|
|
5015
|
+
==================== END: .xiaoma-core/tasks/requirement-analysis-with-rag.md ====================
|
|
5016
|
+
|
|
4654
5017
|
==================== START: .xiaoma-core/templates/brainstorming-output-tmpl.yaml ====================
|
|
4655
5018
|
template:
|
|
4656
5019
|
id: brainstorming-output-template-v2
|
|
@@ -5628,140 +5991,1291 @@ sections:
|
|
|
5628
5991
|
这份项目简报为 {{project_name}} 提供了完整的背景信息。请启动‘PRD 生成模式’,彻底审阅此简报,并与用户合作,按照模板指示逐节创建 PRD,同时请求任何必要的澄清或提出改进建议。
|
|
5629
5992
|
==================== END: .xiaoma-core/templates/project-brief-tmpl.yaml ====================
|
|
5630
5993
|
|
|
5631
|
-
==================== START: .xiaoma-core/
|
|
5632
|
-
|
|
5994
|
+
==================== START: .xiaoma-core/templates/rag-questions-tmpl.yaml ====================
|
|
5995
|
+
template:
|
|
5996
|
+
id: rag-questions-template-v1
|
|
5997
|
+
name: 知识库问题生成模板
|
|
5998
|
+
version: 1.0
|
|
5999
|
+
description: 基于需求文档(req.txt)生成知识库MCP查询问题
|
|
6000
|
+
output:
|
|
6001
|
+
format: markdown
|
|
6002
|
+
filename: docs/rag-questions.md
|
|
6003
|
+
title: "知识库查询问题清单"
|
|
5633
6004
|
|
|
5634
|
-
|
|
6005
|
+
workflow:
|
|
6006
|
+
mode: interactive
|
|
6007
|
+
phases:
|
|
6008
|
+
- 需求解析
|
|
6009
|
+
- 问题生成
|
|
6010
|
+
- 问题确认
|
|
6011
|
+
- 知识库查询
|
|
6012
|
+
- 知识落地
|
|
5635
6013
|
|
|
5636
|
-
|
|
6014
|
+
sections:
|
|
6015
|
+
- id: requirement-parsing
|
|
6016
|
+
title: 第一阶段:需求文档解析
|
|
6017
|
+
instruction: |
|
|
6018
|
+
读取并深度分析 req.txt 文档,提取以下要素:
|
|
6019
|
+
|
|
6020
|
+
1. **业务领域识别**
|
|
6021
|
+
- 这个需求属于什么业务领域?(如:订单管理、用户管理、支付系统等)
|
|
6022
|
+
- 涉及哪些子领域或模块?
|
|
6023
|
+
|
|
6024
|
+
2. **功能点提取**
|
|
6025
|
+
- 需求描述了哪些具体功能?
|
|
6026
|
+
- 每个功能的输入、处理、输出是什么?
|
|
6027
|
+
|
|
6028
|
+
3. **用户角色识别**
|
|
6029
|
+
- 涉及哪些用户角色?(如:管理员、普通用户、访客)
|
|
6030
|
+
- 每个角色在此需求中的操作是什么?
|
|
6031
|
+
|
|
6032
|
+
4. **数据实体识别**
|
|
6033
|
+
- 涉及哪些数据对象?(如:订单、商品、用户)
|
|
6034
|
+
- 数据之间的关系是什么?
|
|
6035
|
+
|
|
6036
|
+
5. **业务流程识别**
|
|
6037
|
+
- 描述了什么业务流程?
|
|
6038
|
+
- 流程的起点、终点、关键步骤是什么?
|
|
6039
|
+
|
|
6040
|
+
6. **模糊点标记**
|
|
6041
|
+
- 哪些描述不够清晰?
|
|
6042
|
+
- 哪些内容有多种理解方式?
|
|
6043
|
+
output:
|
|
6044
|
+
format: yaml
|
|
6045
|
+
template: |
|
|
6046
|
+
需求解析结果:
|
|
6047
|
+
业务领域: {{domain}}
|
|
6048
|
+
子领域: [{{sub_domains}}]
|
|
6049
|
+
|
|
6050
|
+
功能点:
|
|
6051
|
+
{{#each features}}
|
|
6052
|
+
- 名称: {{name}}
|
|
6053
|
+
描述: {{description}}
|
|
6054
|
+
输入: {{input}}
|
|
6055
|
+
输出: {{output}}
|
|
6056
|
+
{{/each}}
|
|
6057
|
+
|
|
6058
|
+
用户角色:
|
|
6059
|
+
{{#each roles}}
|
|
6060
|
+
- 角色: {{name}}
|
|
6061
|
+
操作: [{{actions}}]
|
|
6062
|
+
{{/each}}
|
|
6063
|
+
|
|
6064
|
+
数据实体:
|
|
6065
|
+
{{#each entities}}
|
|
6066
|
+
- 实体: {{name}}
|
|
6067
|
+
属性: [{{attributes}}]
|
|
6068
|
+
关系: {{relationships}}
|
|
6069
|
+
{{/each}}
|
|
6070
|
+
|
|
6071
|
+
业务流程:
|
|
6072
|
+
{{#each processes}}
|
|
6073
|
+
- 流程: {{name}}
|
|
6074
|
+
步骤: [{{steps}}]
|
|
6075
|
+
{{/each}}
|
|
6076
|
+
|
|
6077
|
+
模糊点:
|
|
6078
|
+
{{#each ambiguities}}
|
|
6079
|
+
- 位置: {{location}}
|
|
6080
|
+
内容: {{content}}
|
|
6081
|
+
可能理解: [{{interpretations}}]
|
|
6082
|
+
{{/each}}
|
|
6083
|
+
|
|
6084
|
+
- id: question-generation
|
|
6085
|
+
title: 第二阶段:问题生成
|
|
6086
|
+
instruction: |
|
|
6087
|
+
基于解析结果,为每个要素生成具体的知识库查询问题。
|
|
5637
6088
|
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
6089
|
+
**问题生成原则**:
|
|
6090
|
+
1. 每个问题必须具体、可回答
|
|
6091
|
+
2. 优先生成阻塞性问题(缺失会导致无法继续)
|
|
6092
|
+
3. 问题应覆盖:业务、技术、历史、约束 四个维度
|
|
6093
|
+
4. 避免开放性过强的问题
|
|
6094
|
+
sections:
|
|
6095
|
+
- id: business-questions
|
|
6096
|
+
title: A. 业务知识问题
|
|
6097
|
+
instruction: |
|
|
6098
|
+
针对业务领域和流程生成问题,重点关注:
|
|
6099
|
+
- 业务规则和约束
|
|
6100
|
+
- 业务流程细节
|
|
6101
|
+
- 边界情况处理
|
|
6102
|
+
- 用户权限和角色
|
|
6103
|
+
question_templates:
|
|
6104
|
+
- category: A1-业务规则
|
|
6105
|
+
templates:
|
|
6106
|
+
- "[{entity}]有哪些业务规则?如:状态流转、必填约束、取值范围"
|
|
6107
|
+
- "[{process}]流程中,[{step}]步骤的具体业务规则是什么?"
|
|
6108
|
+
- "[{role}]角色在[{operation}]操作上有什么权限限制?"
|
|
6109
|
+
- "[{entity}]和[{related_entity}]之间的业务关联规则是什么?"
|
|
6110
|
+
|
|
6111
|
+
- category: A2-业务流程
|
|
6112
|
+
templates:
|
|
6113
|
+
- "[{process}]的完整流程是什么?包括正常流程和异常流程"
|
|
6114
|
+
- "触发[{process}]的条件有哪些?"
|
|
6115
|
+
- "[{process}]流程中有哪些人工审批或确认节点?"
|
|
6116
|
+
- "[{process}]失败后的补偿或回退机制是什么?"
|
|
6117
|
+
|
|
6118
|
+
- category: A3-边界情况
|
|
6119
|
+
templates:
|
|
6120
|
+
- "[{operation}]操作在什么情况下会失败?失败后如何处理?"
|
|
6121
|
+
- "[{entity}]存在并发操作时,系统如何处理冲突?"
|
|
6122
|
+
- "[{data}]数据量很大时,有什么限制或分页规则?"
|
|
6123
|
+
- "[{scenario}]场景下的异常处理逻辑是什么?"
|
|
6124
|
+
|
|
6125
|
+
- id: technical-questions
|
|
6126
|
+
title: B. 技术知识问题
|
|
6127
|
+
instruction: |
|
|
6128
|
+
针对技术实现生成问题,重点关注:
|
|
6129
|
+
- 现有系统架构
|
|
6130
|
+
- 数据模型设计
|
|
6131
|
+
- 接口规范
|
|
6132
|
+
- 代码实现模式
|
|
6133
|
+
question_templates:
|
|
6134
|
+
- category: B1-系统架构
|
|
6135
|
+
templates:
|
|
6136
|
+
- "[{module}]模块的技术架构是什么?与其他模块如何交互?"
|
|
6137
|
+
- "系统中有哪些公共服务或组件可以复用于[{feature}]?"
|
|
6138
|
+
- "[{functionality}]功能应该放在哪个服务/模块中实现?"
|
|
6139
|
+
- "系统的缓存策略是什么?[{data}]数据需要缓存吗?"
|
|
6140
|
+
|
|
6141
|
+
- category: B2-数据模型
|
|
6142
|
+
templates:
|
|
6143
|
+
- "[{entity}]在数据库中的表结构是什么?包含哪些字段?"
|
|
6144
|
+
- "[{entity_a}]和[{entity_b}]的数据库关系是怎样的?外键设计?"
|
|
6145
|
+
- "与[{domain}]相关的枚举值或字典表有哪些?"
|
|
6146
|
+
- "[{entity}]的历史记录/审计日志如何存储?"
|
|
6147
|
+
|
|
6148
|
+
- category: B3-接口规范
|
|
6149
|
+
templates:
|
|
6150
|
+
- "现有的[{module}]模块提供了哪些API接口?"
|
|
6151
|
+
- "[{operation}]操作的接口入参和出参规范是什么?"
|
|
6152
|
+
- "系统的统一错误码和响应格式是什么?"
|
|
6153
|
+
- "[{external_system}]的集成接口协议和数据格式是什么?"
|
|
6154
|
+
|
|
6155
|
+
- category: B4-代码实现
|
|
6156
|
+
templates:
|
|
6157
|
+
- "类似[{feature}]的功能在现有代码中是如何实现的?"
|
|
6158
|
+
- "系统中处理[{technical_concern}]的通用模式是什么?"
|
|
6159
|
+
- "[{framework}]框架在项目中的使用规范和最佳实践是什么?"
|
|
6160
|
+
- "现有代码中有哪些工具类或辅助方法可以用于[{task}]?"
|
|
6161
|
+
|
|
6162
|
+
- id: history-questions
|
|
6163
|
+
title: C. 历史追溯问题
|
|
6164
|
+
instruction: |
|
|
6165
|
+
针对历史需求和决策生成问题,重点关注:
|
|
6166
|
+
- 相关历史需求
|
|
6167
|
+
- 技术决策记录
|
|
6168
|
+
- 已知问题和债务
|
|
6169
|
+
question_templates:
|
|
6170
|
+
- category: C1-历史需求
|
|
6171
|
+
templates:
|
|
6172
|
+
- "之前有没有类似[{feature}]的需求?实现情况如何?"
|
|
6173
|
+
- "[{module}]模块最近有什么变更?变更原因是什么?"
|
|
6174
|
+
- "[{feature}]功能的历史版本迭代情况是什么?"
|
|
6175
|
+
|
|
6176
|
+
- category: C2-决策记录
|
|
6177
|
+
templates:
|
|
6178
|
+
- "[{technical_choice}]为什么选择当前的实现方式?"
|
|
6179
|
+
- "[{architecture_decision}]的架构决策背景是什么?"
|
|
6180
|
+
- "有没有被否决的[{alternative}]方案?为什么被否决?"
|
|
6181
|
+
|
|
6182
|
+
- category: C3-已知问题
|
|
6183
|
+
templates:
|
|
6184
|
+
- "[{module}]模块有哪些已知的问题或技术债务?"
|
|
6185
|
+
- "[{feature}]功能有没有用户反馈的问题或改进建议?"
|
|
6186
|
+
- "与[{domain}]相关的性能或稳定性问题有哪些?"
|
|
6187
|
+
|
|
6188
|
+
- id: constraint-questions
|
|
6189
|
+
title: D. 约束条件问题
|
|
6190
|
+
instruction: |
|
|
6191
|
+
针对项目和技术约束生成问题,重点关注:
|
|
6192
|
+
- 技术栈限制
|
|
6193
|
+
- 安全合规要求
|
|
6194
|
+
- 性能要求
|
|
6195
|
+
- 团队规范
|
|
6196
|
+
question_templates:
|
|
6197
|
+
- category: D1-技术约束
|
|
6198
|
+
templates:
|
|
6199
|
+
- "项目的技术栈限制有哪些?必须使用什么框架/库?"
|
|
6200
|
+
- "[{technical_approach}]方案在当前技术栈下是否可行?"
|
|
6201
|
+
- "项目对[{resource}]资源的使用有什么限制?"
|
|
6202
|
+
|
|
6203
|
+
- category: D2-安全合规
|
|
6204
|
+
templates:
|
|
6205
|
+
- "[{data_type}]数据的安全存储和传输要求是什么?"
|
|
6206
|
+
- "[{operation}]操作需要哪些权限验证?"
|
|
6207
|
+
- "项目需要满足哪些合规要求?(如GDPR、等保)"
|
|
6208
|
+
|
|
6209
|
+
- category: D3-性能要求
|
|
6210
|
+
templates:
|
|
6211
|
+
- "[{interface}]接口的响应时间要求是什么?"
|
|
6212
|
+
- "[{process}]流程的并发处理能力要求是多少?"
|
|
6213
|
+
- "系统的可用性SLA要求是什么?"
|
|
6214
|
+
|
|
6215
|
+
- category: D4-团队规范
|
|
6216
|
+
templates:
|
|
6217
|
+
- "团队的代码规范和风格指南是什么?"
|
|
6218
|
+
- "代码审查的标准和流程是什么?"
|
|
6219
|
+
- "测试覆盖率和测试类型的要求是什么?"
|
|
6220
|
+
|
|
6221
|
+
- id: question-prioritization
|
|
6222
|
+
title: 第三阶段:问题优先级排序
|
|
6223
|
+
instruction: |
|
|
6224
|
+
对生成的问题进行优先级排序:
|
|
6225
|
+
|
|
6226
|
+
**P0 - 阻塞级**(必须回答)
|
|
6227
|
+
- 缺失会导致完全无法理解需求
|
|
6228
|
+
- 涉及核心业务规则
|
|
6229
|
+
- 影响架构决策
|
|
6230
|
+
|
|
6231
|
+
**P1 - 重要级**(强烈建议回答)
|
|
6232
|
+
- 影响需求完整性
|
|
6233
|
+
- 涉及边界情况处理
|
|
6234
|
+
- 影响实现方案选择
|
|
6235
|
+
|
|
6236
|
+
**P2 - 补充级**(可选回答)
|
|
6237
|
+
- 有助于优化实现
|
|
6238
|
+
- 提供额外上下文
|
|
6239
|
+
- 历史参考信息
|
|
6240
|
+
output:
|
|
6241
|
+
format: markdown
|
|
6242
|
+
template: |
|
|
6243
|
+
# 知识库查询问题清单
|
|
6244
|
+
|
|
6245
|
+
## 元信息
|
|
6246
|
+
- 源文档: req.txt
|
|
6247
|
+
- 生成时间: {{timestamp}}
|
|
6248
|
+
- 总问题数: {{total_count}}
|
|
6249
|
+
- P0问题: {{p0_count}} | P1问题: {{p1_count}} | P2问题: {{p2_count}}
|
|
6250
|
+
|
|
6251
|
+
---
|
|
6252
|
+
|
|
6253
|
+
## P0 阻塞级问题(必须回答)
|
|
6254
|
+
|
|
6255
|
+
### 业务知识
|
|
6256
|
+
{{#each p0_business}}
|
|
6257
|
+
{{index}}. [{{id}}] {{question}}
|
|
6258
|
+
- 关联需求: "{{related_requirement}}"
|
|
6259
|
+
- 预期答案: {{expected_answer_type}}
|
|
6260
|
+
{{/each}}
|
|
6261
|
+
|
|
6262
|
+
### 技术知识
|
|
6263
|
+
{{#each p0_technical}}
|
|
6264
|
+
{{index}}. [{{id}}] {{question}}
|
|
6265
|
+
- 关联需求: "{{related_requirement}}"
|
|
6266
|
+
- 预期答案: {{expected_answer_type}}
|
|
6267
|
+
{{/each}}
|
|
6268
|
+
|
|
6269
|
+
---
|
|
6270
|
+
|
|
6271
|
+
## P1 重要级问题(强烈建议回答)
|
|
6272
|
+
|
|
6273
|
+
### 业务知识
|
|
6274
|
+
{{#each p1_business}}
|
|
6275
|
+
{{index}}. [{{id}}] {{question}}
|
|
6276
|
+
- 关联需求: "{{related_requirement}}"
|
|
6277
|
+
{{/each}}
|
|
6278
|
+
|
|
6279
|
+
### 技术知识
|
|
6280
|
+
{{#each p1_technical}}
|
|
6281
|
+
{{index}}. [{{id}}] {{question}}
|
|
6282
|
+
- 关联需求: "{{related_requirement}}"
|
|
6283
|
+
{{/each}}
|
|
6284
|
+
|
|
6285
|
+
### 历史追溯
|
|
6286
|
+
{{#each p1_history}}
|
|
6287
|
+
{{index}}. [{{id}}] {{question}}
|
|
6288
|
+
- 关联需求: "{{related_requirement}}"
|
|
6289
|
+
{{/each}}
|
|
6290
|
+
|
|
6291
|
+
---
|
|
6292
|
+
|
|
6293
|
+
## P2 补充级问题(可选回答)
|
|
6294
|
+
|
|
6295
|
+
{{#each p2_questions}}
|
|
6296
|
+
{{index}}. [{{id}}] {{question}}
|
|
6297
|
+
{{/each}}
|
|
6298
|
+
|
|
6299
|
+
- id: knowledge-landing
|
|
6300
|
+
title: 第四阶段:知识落地规范
|
|
6301
|
+
instruction: |
|
|
6302
|
+
知识库返回的内容应按以下结构存储到 docs/rag/ 目录:
|
|
6303
|
+
output:
|
|
6304
|
+
structure: |
|
|
6305
|
+
docs/rag/
|
|
6306
|
+
├── _index.md # 知识索引(自动生成)
|
|
6307
|
+
├── _questions.md # 问题清单(本模板输出)
|
|
6308
|
+
│
|
|
6309
|
+
├── business/ # 业务知识
|
|
6310
|
+
│ ├── domain-{{domain}}.md # 领域知识
|
|
6311
|
+
│ ├── rules-{{topic}}.md # 业务规则
|
|
6312
|
+
│ ├── process-{{name}}.md # 业务流程
|
|
6313
|
+
│ └── roles.md # 角色权限
|
|
6314
|
+
│
|
|
6315
|
+
├── technical/ # 技术知识
|
|
6316
|
+
│ ├── architecture.md # 系统架构
|
|
6317
|
+
│ ├── data-model.md # 数据模型
|
|
6318
|
+
│ ├── api-{{module}}.md # 接口规范
|
|
6319
|
+
│ └── patterns.md # 代码模式
|
|
6320
|
+
│
|
|
6321
|
+
├── history/ # 历史信息
|
|
6322
|
+
│ ├── related-features.md # 相关功能
|
|
6323
|
+
│ └── decisions.md # 决策记录
|
|
6324
|
+
│
|
|
6325
|
+
└── constraints/ # 约束条件
|
|
6326
|
+
├── technical.md # 技术约束
|
|
6327
|
+
├── security.md # 安全要求
|
|
6328
|
+
└── performance.md # 性能要求
|
|
6329
|
+
|
|
6330
|
+
file_template: |
|
|
6331
|
+
# {{title}}
|
|
6332
|
+
|
|
6333
|
+
## 元信息
|
|
6334
|
+
- 查询问题: {{question}}
|
|
6335
|
+
- 问题ID: {{question_id}}
|
|
6336
|
+
- 查询时间: {{timestamp}}
|
|
6337
|
+
- 数据来源: 知识库MCP
|
|
6338
|
+
|
|
6339
|
+
## 内容摘要
|
|
6340
|
+
{{summary}}
|
|
6341
|
+
|
|
6342
|
+
## 详细内容
|
|
6343
|
+
{{content}}
|
|
6344
|
+
|
|
6345
|
+
## 需求关联
|
|
6346
|
+
- 关联需求点: {{related_requirement}}
|
|
6347
|
+
- 影响分析: {{impact_analysis}}
|
|
6348
|
+
|
|
6349
|
+
## 衍生问题
|
|
6350
|
+
{{#if follow_up_questions}}
|
|
6351
|
+
{{#each follow_up_questions}}
|
|
6352
|
+
- {{this}}
|
|
6353
|
+
{{/each}}
|
|
6354
|
+
{{else}}
|
|
6355
|
+
无
|
|
6356
|
+
{{/if}}
|
|
6357
|
+
|
|
6358
|
+
elicitation:
|
|
6359
|
+
after_each_phase: true
|
|
6360
|
+
options:
|
|
6361
|
+
- "调整问题优先级"
|
|
6362
|
+
- "添加更多问题"
|
|
6363
|
+
- "删除不相关问题"
|
|
6364
|
+
- "修改问题措辞"
|
|
6365
|
+
- "进入下一阶段"
|
|
6366
|
+
==================== END: .xiaoma-core/templates/rag-questions-tmpl.yaml ====================
|
|
6367
|
+
|
|
6368
|
+
==================== START: .xiaoma-core/templates/rag-knowledge-tmpl.yaml ====================
|
|
6369
|
+
template:
|
|
6370
|
+
id: rag-knowledge-template-v1
|
|
6371
|
+
name: RAG知识落地模板
|
|
6372
|
+
version: 1.0
|
|
6373
|
+
description: 将知识库MCP返回的知识内容结构化存储到docs/rag目录
|
|
6374
|
+
output:
|
|
6375
|
+
format: markdown
|
|
6376
|
+
base_path: docs/rag/
|
|
5642
6377
|
|
|
5643
|
-
|
|
6378
|
+
sections:
|
|
6379
|
+
- id: index-template
|
|
6380
|
+
title: 知识索引模板
|
|
6381
|
+
filename: _index.md
|
|
6382
|
+
template: |
|
|
6383
|
+
# RAG知识库索引
|
|
6384
|
+
|
|
6385
|
+
## 概览
|
|
6386
|
+
- 需求文档: {{requirement_file}}
|
|
6387
|
+
- 创建时间: {{created_at}}
|
|
6388
|
+
- 最后更新: {{updated_at}}
|
|
6389
|
+
- 知识条目数: {{total_entries}}
|
|
6390
|
+
|
|
6391
|
+
## 知识分类统计
|
|
6392
|
+
|
|
6393
|
+
| 分类 | 条目数 | 覆盖率 |
|
|
6394
|
+
|------|--------|--------|
|
|
6395
|
+
| 业务知识 | {{business_count}} | {{business_coverage}}% |
|
|
6396
|
+
| 技术知识 | {{technical_count}} | {{technical_coverage}}% |
|
|
6397
|
+
| 历史信息 | {{history_count}} | {{history_coverage}}% |
|
|
6398
|
+
| 约束条件 | {{constraints_count}} | {{constraints_coverage}}% |
|
|
6399
|
+
|
|
6400
|
+
## 知识目录
|
|
6401
|
+
|
|
6402
|
+
### 业务知识 (business/)
|
|
6403
|
+
{{#each business_files}}
|
|
6404
|
+
- [{{title}}](business/{{filename}}) - {{summary}}
|
|
6405
|
+
{{/each}}
|
|
6406
|
+
|
|
6407
|
+
### 技术知识 (technical/)
|
|
6408
|
+
{{#each technical_files}}
|
|
6409
|
+
- [{{title}}](technical/{{filename}}) - {{summary}}
|
|
6410
|
+
{{/each}}
|
|
6411
|
+
|
|
6412
|
+
### 历史信息 (history/)
|
|
6413
|
+
{{#each history_files}}
|
|
6414
|
+
- [{{title}}](history/{{filename}}) - {{summary}}
|
|
6415
|
+
{{/each}}
|
|
6416
|
+
|
|
6417
|
+
### 约束条件 (constraints/)
|
|
6418
|
+
{{#each constraints_files}}
|
|
6419
|
+
- [{{title}}](constraints/{{filename}}) - {{summary}}
|
|
6420
|
+
{{/each}}
|
|
6421
|
+
|
|
6422
|
+
## 未回答问题
|
|
6423
|
+
{{#if unanswered_questions}}
|
|
6424
|
+
以下问题未能从知识库获得答案:
|
|
6425
|
+
{{#each unanswered_questions}}
|
|
6426
|
+
- [{{id}}] {{question}}
|
|
6427
|
+
{{/each}}
|
|
6428
|
+
{{else}}
|
|
6429
|
+
所有问题均已获得回答。
|
|
6430
|
+
{{/if}}
|
|
6431
|
+
|
|
6432
|
+
## 后续行动
|
|
6433
|
+
{{#each follow_up_actions}}
|
|
6434
|
+
- [ ] {{action}}
|
|
6435
|
+
{{/each}}
|
|
6436
|
+
|
|
6437
|
+
- id: business-knowledge
|
|
6438
|
+
title: 业务知识模板
|
|
6439
|
+
path: business/
|
|
6440
|
+
variants:
|
|
6441
|
+
- id: domain-knowledge
|
|
6442
|
+
filename_pattern: "domain-{{domain_name}}.md"
|
|
6443
|
+
template: |
|
|
6444
|
+
# {{domain_name}} 领域知识
|
|
5644
6445
|
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
6446
|
+
## 元信息
|
|
6447
|
+
- 查询问题ID: {{question_ids}}
|
|
6448
|
+
- 来源: 知识库MCP
|
|
6449
|
+
- 更新时间: {{timestamp}}
|
|
5648
6450
|
|
|
5649
|
-
##
|
|
6451
|
+
## 领域概述
|
|
6452
|
+
{{domain_overview}}
|
|
5650
6453
|
|
|
5651
|
-
|
|
5652
|
-
9. **Brainwriting/Round Robin**: They suggest idea, you build on it, ask them to build on yours
|
|
5653
|
-
10. **Random Stimulation**: Give one random prompt/word, ask them to make connections
|
|
6454
|
+
## 核心概念
|
|
5654
6455
|
|
|
5655
|
-
|
|
6456
|
+
{{#each concepts}}
|
|
6457
|
+
### {{name}}
|
|
6458
|
+
- **定义**: {{definition}}
|
|
6459
|
+
- **业务含义**: {{business_meaning}}
|
|
6460
|
+
- **相关实体**: {{related_entities}}
|
|
6461
|
+
{{/each}}
|
|
5656
6462
|
|
|
5657
|
-
|
|
5658
|
-
12. **Morphological Analysis**: Ask them to list parameters first, then explore combinations together
|
|
5659
|
-
13. **Provocation Technique (PO)**: Give one provocative statement, ask them to extract useful ideas
|
|
6463
|
+
## 业务规则
|
|
5660
6464
|
|
|
5661
|
-
|
|
6465
|
+
{{#each rules}}
|
|
6466
|
+
### 规则{{index}}: {{name}}
|
|
6467
|
+
- **描述**: {{description}}
|
|
6468
|
+
- **触发条件**: {{trigger}}
|
|
6469
|
+
- **执行逻辑**: {{logic}}
|
|
6470
|
+
- **异常处理**: {{exception}}
|
|
6471
|
+
{{/each}}
|
|
5662
6472
|
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
16. **Role Playing**: Ask them to brainstorm from different stakeholder perspectives
|
|
5666
|
-
17. **Time Shifting**: "How would you solve this in 1995? 2030?"
|
|
5667
|
-
18. **Resource Constraints**: "What if you had only $10 and 1 hour?"
|
|
5668
|
-
19. **Metaphor Mapping**: Use extended metaphors to explore solutions
|
|
5669
|
-
20. **Question Storming**: Generate questions instead of answers first
|
|
5670
|
-
==================== END: .xiaoma-core/data/brainstorming-techniques.md ====================
|
|
6473
|
+
## 与需求的关联
|
|
6474
|
+
{{requirement_mapping}}
|
|
5671
6475
|
|
|
5672
|
-
|
|
5673
|
-
|
|
6476
|
+
- id: process-knowledge
|
|
6477
|
+
filename_pattern: "process-{{process_name}}.md"
|
|
6478
|
+
template: |
|
|
6479
|
+
# {{process_name}} 业务流程
|
|
5674
6480
|
|
|
5675
|
-
|
|
6481
|
+
## 元信息
|
|
6482
|
+
- 查询问题ID: {{question_ids}}
|
|
6483
|
+
- 来源: 知识库MCP
|
|
6484
|
+
- 更新时间: {{timestamp}}
|
|
5676
6485
|
|
|
5677
|
-
|
|
6486
|
+
## 流程概述
|
|
6487
|
+
{{process_overview}}
|
|
5678
6488
|
|
|
5679
|
-
##
|
|
6489
|
+
## 流程步骤
|
|
5680
6490
|
|
|
5681
|
-
|
|
6491
|
+
```mermaid
|
|
6492
|
+
{{mermaid_diagram}}
|
|
6493
|
+
```
|
|
5682
6494
|
|
|
5683
|
-
|
|
6495
|
+
### 详细步骤
|
|
5684
6496
|
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
- Confirm if they want to work through the checklist:
|
|
5694
|
-
- Section by section (interactive mode - very time consuming)
|
|
5695
|
-
- All at once (YOLO mode - recommended for checklists, there will be a summary of sections at the end to discuss)
|
|
6497
|
+
{{#each steps}}
|
|
6498
|
+
#### 步骤{{index}}: {{name}}
|
|
6499
|
+
- **执行者**: {{actor}}
|
|
6500
|
+
- **输入**: {{input}}
|
|
6501
|
+
- **处理**: {{processing}}
|
|
6502
|
+
- **输出**: {{output}}
|
|
6503
|
+
- **后置条件**: {{postcondition}}
|
|
6504
|
+
{{/each}}
|
|
5696
6505
|
|
|
5697
|
-
|
|
5698
|
-
- Each checklist will specify its required documents/artifacts at the beginning
|
|
5699
|
-
- Follow the checklist's specific instructions for what to gather, generally a file can be resolved in the docs folder, if not or unsure, halt and ask or confirm with the user.
|
|
6506
|
+
## 异常流程
|
|
5700
6507
|
|
|
5701
|
-
|
|
6508
|
+
{{#each exceptions}}
|
|
6509
|
+
### {{name}}
|
|
6510
|
+
- **触发条件**: {{trigger}}
|
|
6511
|
+
- **处理方式**: {{handling}}
|
|
6512
|
+
- **恢复机制**: {{recovery}}
|
|
6513
|
+
{{/each}}
|
|
5702
6514
|
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
- For each section:
|
|
5706
|
-
- Review all items in the section following instructions for that section embedded in the checklist
|
|
5707
|
-
- Check each item against the relevant documentation or artifacts as appropriate
|
|
5708
|
-
- Present summary of findings for that section, highlighting warnings, errors and non applicable items (rationale for non-applicability).
|
|
5709
|
-
- Get user confirmation before proceeding to next section or if any thing major do we need to halt and take corrective action
|
|
6515
|
+
## 与需求的关联
|
|
6516
|
+
{{requirement_mapping}}
|
|
5710
6517
|
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
6518
|
+
- id: roles-knowledge
|
|
6519
|
+
filename_pattern: "roles.md"
|
|
6520
|
+
template: |
|
|
6521
|
+
# 用户角色与权限
|
|
6522
|
+
|
|
6523
|
+
## 元信息
|
|
6524
|
+
- 查询问题ID: {{question_ids}}
|
|
6525
|
+
- 来源: 知识库MCP
|
|
6526
|
+
- 更新时间: {{timestamp}}
|
|
6527
|
+
|
|
6528
|
+
## 角色定义
|
|
6529
|
+
|
|
6530
|
+
{{#each roles}}
|
|
6531
|
+
### {{name}}
|
|
6532
|
+
- **描述**: {{description}}
|
|
6533
|
+
- **职责**: {{responsibilities}}
|
|
6534
|
+
- **权限范围**: {{permissions}}
|
|
6535
|
+
|
|
6536
|
+
#### 可执行操作
|
|
6537
|
+
{{#each operations}}
|
|
6538
|
+
- {{name}}: {{description}} ({{permission_level}})
|
|
6539
|
+
{{/each}}
|
|
6540
|
+
{{/each}}
|
|
6541
|
+
|
|
6542
|
+
## 权限矩阵
|
|
6543
|
+
|
|
6544
|
+
| 操作 | {{#each roles}}{{name}} | {{/each}}
|
|
6545
|
+
|------|{{#each roles}}--------|{{/each}}
|
|
6546
|
+
{{#each operations}}
|
|
6547
|
+
| {{name}} | {{#each role_permissions}}{{this}} | {{/each}}
|
|
6548
|
+
{{/each}}
|
|
6549
|
+
|
|
6550
|
+
## 与需求的关联
|
|
6551
|
+
{{requirement_mapping}}
|
|
6552
|
+
|
|
6553
|
+
- id: technical-knowledge
|
|
6554
|
+
title: 技术知识模板
|
|
6555
|
+
path: technical/
|
|
6556
|
+
variants:
|
|
6557
|
+
- id: architecture
|
|
6558
|
+
filename_pattern: "architecture.md"
|
|
6559
|
+
template: |
|
|
6560
|
+
# 系统架构
|
|
5715
6561
|
|
|
5716
|
-
|
|
6562
|
+
## 元信息
|
|
6563
|
+
- 查询问题ID: {{question_ids}}
|
|
6564
|
+
- 来源: 知识库MCP
|
|
6565
|
+
- 更新时间: {{timestamp}}
|
|
5717
6566
|
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
- Look for evidence in the documentation that satisfies the requirement
|
|
5721
|
-
- Consider both explicit mentions and implicit coverage
|
|
5722
|
-
- Aside from this, follow all checklist llm instructions
|
|
5723
|
-
- Mark items as:
|
|
5724
|
-
- ✅ PASS: Requirement clearly met
|
|
5725
|
-
- ❌ FAIL: Requirement not met or insufficient coverage
|
|
5726
|
-
- ⚠️ PARTIAL: Some aspects covered but needs improvement
|
|
5727
|
-
- N/A: Not applicable to this case
|
|
6567
|
+
## 架构概览
|
|
6568
|
+
{{architecture_overview}}
|
|
5728
6569
|
|
|
5729
|
-
|
|
6570
|
+
## 技术栈
|
|
6571
|
+
| 层级 | 技术 | 版本 | 说明 |
|
|
6572
|
+
|------|------|------|------|
|
|
6573
|
+
{{#each tech_stack}}
|
|
6574
|
+
| {{layer}} | {{technology}} | {{version}} | {{description}} |
|
|
6575
|
+
{{/each}}
|
|
5730
6576
|
|
|
5731
|
-
|
|
5732
|
-
- think step by step to calculate pass rate
|
|
5733
|
-
- Identify common themes in failed items
|
|
5734
|
-
- Provide specific recommendations for improvement
|
|
5735
|
-
- In interactive mode, discuss findings with user
|
|
5736
|
-
- Document any user decisions or explanations
|
|
6577
|
+
## 模块结构
|
|
5737
6578
|
|
|
5738
|
-
|
|
6579
|
+
```
|
|
6580
|
+
{{module_structure}}
|
|
6581
|
+
```
|
|
5739
6582
|
|
|
5740
|
-
|
|
5741
|
-
- Overall checklist completion status
|
|
5742
|
-
- Pass rates by section
|
|
5743
|
-
- List of failed items with context
|
|
5744
|
-
- Specific recommendations for improvement
|
|
5745
|
-
- Any sections or items marked as N/A with justification
|
|
6583
|
+
## 模块说明
|
|
5746
6584
|
|
|
5747
|
-
|
|
6585
|
+
{{#each modules}}
|
|
6586
|
+
### {{name}}
|
|
6587
|
+
- **职责**: {{responsibility}}
|
|
6588
|
+
- **依赖**: {{dependencies}}
|
|
6589
|
+
- **对外接口**: {{interfaces}}
|
|
6590
|
+
{{/each}}
|
|
5748
6591
|
|
|
5749
|
-
|
|
6592
|
+
## 与需求的关联
|
|
6593
|
+
- **建议实现位置**: {{suggested_location}}
|
|
6594
|
+
- **需要修改的模块**: {{affected_modules}}
|
|
6595
|
+
- **需要新增的模块**: {{new_modules}}
|
|
5750
6596
|
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
6597
|
+
- id: data-model
|
|
6598
|
+
filename_pattern: "data-model.md"
|
|
6599
|
+
template: |
|
|
6600
|
+
# 数据模型
|
|
5755
6601
|
|
|
5756
|
-
|
|
6602
|
+
## 元信息
|
|
6603
|
+
- 查询问题ID: {{question_ids}}
|
|
6604
|
+
- 来源: 知识库MCP
|
|
6605
|
+
- 更新时间: {{timestamp}}
|
|
5757
6606
|
|
|
5758
|
-
|
|
5759
|
-
-
|
|
5760
|
-
-
|
|
5761
|
-
|
|
6607
|
+
## 数据库概览
|
|
6608
|
+
- **数据库类型**: {{database_type}}
|
|
6609
|
+
- **数据库版本**: {{database_version}}
|
|
6610
|
+
- **ORM框架**: {{orm_framework}}
|
|
5762
6611
|
|
|
5763
|
-
|
|
5764
|
-
|
|
6612
|
+
## 相关数据表
|
|
6613
|
+
|
|
6614
|
+
{{#each tables}}
|
|
6615
|
+
### {{table_name}}
|
|
6616
|
+
|
|
6617
|
+
**说明**: {{description}}
|
|
6618
|
+
|
|
6619
|
+
| 字段名 | 类型 | 约束 | 说明 |
|
|
6620
|
+
|--------|------|------|------|
|
|
6621
|
+
{{#each columns}}
|
|
6622
|
+
| {{name}} | {{type}} | {{constraints}} | {{description}} |
|
|
6623
|
+
{{/each}}
|
|
6624
|
+
|
|
6625
|
+
**索引**:
|
|
6626
|
+
{{#each indexes}}
|
|
6627
|
+
- {{name}}: {{columns}} ({{type}})
|
|
6628
|
+
{{/each}}
|
|
6629
|
+
|
|
6630
|
+
{{/each}}
|
|
6631
|
+
|
|
6632
|
+
## 表关系
|
|
6633
|
+
|
|
6634
|
+
```mermaid
|
|
6635
|
+
erDiagram
|
|
6636
|
+
{{er_diagram}}
|
|
6637
|
+
```
|
|
6638
|
+
|
|
6639
|
+
## 与需求的关联
|
|
6640
|
+
- **需要新增的表**: {{new_tables}}
|
|
6641
|
+
- **需要修改的表**: {{modified_tables}}
|
|
6642
|
+
- **数据迁移需求**: {{migration_needs}}
|
|
6643
|
+
|
|
6644
|
+
- id: api-spec
|
|
6645
|
+
filename_pattern: "api-{{module}}.md"
|
|
6646
|
+
template: |
|
|
6647
|
+
# {{module}} 接口规范
|
|
6648
|
+
|
|
6649
|
+
## 元信息
|
|
6650
|
+
- 查询问题ID: {{question_ids}}
|
|
6651
|
+
- 来源: 知识库MCP
|
|
6652
|
+
- 更新时间: {{timestamp}}
|
|
6653
|
+
|
|
6654
|
+
## 接口概览
|
|
6655
|
+
- **基础路径**: {{base_path}}
|
|
6656
|
+
- **认证方式**: {{auth_method}}
|
|
6657
|
+
- **响应格式**: {{response_format}}
|
|
6658
|
+
|
|
6659
|
+
## 接口列表
|
|
6660
|
+
|
|
6661
|
+
{{#each apis}}
|
|
6662
|
+
### {{method}} {{path}}
|
|
6663
|
+
|
|
6664
|
+
**说明**: {{description}}
|
|
6665
|
+
|
|
6666
|
+
**请求参数**:
|
|
6667
|
+
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|
|
6668
|
+
|--------|------|------|------|------|
|
|
6669
|
+
{{#each parameters}}
|
|
6670
|
+
| {{name}} | {{in}} | {{type}} | {{required}} | {{description}} |
|
|
6671
|
+
{{/each}}
|
|
6672
|
+
|
|
6673
|
+
**请求体**:
|
|
6674
|
+
```json
|
|
6675
|
+
{{request_body}}
|
|
6676
|
+
```
|
|
6677
|
+
|
|
6678
|
+
**响应**:
|
|
6679
|
+
```json
|
|
6680
|
+
{{response_body}}
|
|
6681
|
+
```
|
|
6682
|
+
|
|
6683
|
+
**错误码**:
|
|
6684
|
+
| 错误码 | 说明 |
|
|
6685
|
+
|--------|------|
|
|
6686
|
+
{{#each error_codes}}
|
|
6687
|
+
| {{code}} | {{message}} |
|
|
6688
|
+
{{/each}}
|
|
6689
|
+
|
|
6690
|
+
---
|
|
6691
|
+
{{/each}}
|
|
6692
|
+
|
|
6693
|
+
## 与需求的关联
|
|
6694
|
+
- **可复用的接口**: {{reusable_apis}}
|
|
6695
|
+
- **需要新增的接口**: {{new_apis}}
|
|
6696
|
+
- **需要修改的接口**: {{modified_apis}}
|
|
6697
|
+
|
|
6698
|
+
- id: code-patterns
|
|
6699
|
+
filename_pattern: "patterns.md"
|
|
6700
|
+
template: |
|
|
6701
|
+
# 代码模式与最佳实践
|
|
6702
|
+
|
|
6703
|
+
## 元信息
|
|
6704
|
+
- 查询问题ID: {{question_ids}}
|
|
6705
|
+
- 来源: 知识库MCP
|
|
6706
|
+
- 更新时间: {{timestamp}}
|
|
6707
|
+
|
|
6708
|
+
## 项目结构规范
|
|
6709
|
+
```
|
|
6710
|
+
{{project_structure}}
|
|
6711
|
+
```
|
|
6712
|
+
|
|
6713
|
+
## 代码规范
|
|
6714
|
+
{{#each coding_standards}}
|
|
6715
|
+
### {{category}}
|
|
6716
|
+
{{description}}
|
|
6717
|
+
|
|
6718
|
+
**示例**:
|
|
6719
|
+
```{{language}}
|
|
6720
|
+
{{example}}
|
|
6721
|
+
```
|
|
6722
|
+
{{/each}}
|
|
6723
|
+
|
|
6724
|
+
## 常用模式
|
|
6725
|
+
|
|
6726
|
+
{{#each patterns}}
|
|
6727
|
+
### {{name}}
|
|
6728
|
+
- **使用场景**: {{use_case}}
|
|
6729
|
+
- **实现示例**: {{example_location}}
|
|
6730
|
+
- **注意事项**: {{notes}}
|
|
6731
|
+
{{/each}}
|
|
6732
|
+
|
|
6733
|
+
## 可复用组件
|
|
6734
|
+
|
|
6735
|
+
{{#each reusable_components}}
|
|
6736
|
+
### {{name}}
|
|
6737
|
+
- **位置**: {{location}}
|
|
6738
|
+
- **功能**: {{functionality}}
|
|
6739
|
+
- **使用方法**: {{usage}}
|
|
6740
|
+
{{/each}}
|
|
6741
|
+
|
|
6742
|
+
## 与需求的关联
|
|
6743
|
+
{{requirement_mapping}}
|
|
6744
|
+
|
|
6745
|
+
- id: history-knowledge
|
|
6746
|
+
title: 历史信息模板
|
|
6747
|
+
path: history/
|
|
6748
|
+
variants:
|
|
6749
|
+
- id: related-features
|
|
6750
|
+
filename_pattern: "related-features.md"
|
|
6751
|
+
template: |
|
|
6752
|
+
# 相关历史功能
|
|
6753
|
+
|
|
6754
|
+
## 元信息
|
|
6755
|
+
- 查询问题ID: {{question_ids}}
|
|
6756
|
+
- 来源: 知识库MCP
|
|
6757
|
+
- 更新时间: {{timestamp}}
|
|
6758
|
+
|
|
6759
|
+
## 相关功能列表
|
|
6760
|
+
|
|
6761
|
+
{{#each features}}
|
|
6762
|
+
### {{name}}
|
|
6763
|
+
- **实现时间**: {{implemented_at}}
|
|
6764
|
+
- **当前状态**: {{status}}
|
|
6765
|
+
- **功能描述**: {{description}}
|
|
6766
|
+
- **实现位置**: {{location}}
|
|
6767
|
+
|
|
6768
|
+
**与当前需求的关系**:
|
|
6769
|
+
{{relation_to_current}}
|
|
6770
|
+
|
|
6771
|
+
**可借鉴点**:
|
|
6772
|
+
{{lessons_learned}}
|
|
6773
|
+
|
|
6774
|
+
---
|
|
6775
|
+
{{/each}}
|
|
6776
|
+
|
|
6777
|
+
## 建议
|
|
6778
|
+
{{recommendations}}
|
|
6779
|
+
|
|
6780
|
+
- id: decisions
|
|
6781
|
+
filename_pattern: "decisions.md"
|
|
6782
|
+
template: |
|
|
6783
|
+
# 架构决策记录
|
|
6784
|
+
|
|
6785
|
+
## 元信息
|
|
6786
|
+
- 查询问题ID: {{question_ids}}
|
|
6787
|
+
- 来源: 知识库MCP
|
|
6788
|
+
- 更新时间: {{timestamp}}
|
|
6789
|
+
|
|
6790
|
+
## 相关决策
|
|
6791
|
+
|
|
6792
|
+
{{#each decisions}}
|
|
6793
|
+
### ADR-{{id}}: {{title}}
|
|
6794
|
+
|
|
6795
|
+
**状态**: {{status}}
|
|
6796
|
+
**日期**: {{date}}
|
|
6797
|
+
|
|
6798
|
+
**背景**:
|
|
6799
|
+
{{context}}
|
|
6800
|
+
|
|
6801
|
+
**决策**:
|
|
6802
|
+
{{decision}}
|
|
6803
|
+
|
|
6804
|
+
**理由**:
|
|
6805
|
+
{{rationale}}
|
|
6806
|
+
|
|
6807
|
+
**影响**:
|
|
6808
|
+
{{consequences}}
|
|
6809
|
+
|
|
6810
|
+
**与当前需求的关联**:
|
|
6811
|
+
{{relation_to_current}}
|
|
6812
|
+
|
|
6813
|
+
---
|
|
6814
|
+
{{/each}}
|
|
6815
|
+
|
|
6816
|
+
- id: constraints-knowledge
|
|
6817
|
+
title: 约束条件模板
|
|
6818
|
+
path: constraints/
|
|
6819
|
+
variants:
|
|
6820
|
+
- id: technical-constraints
|
|
6821
|
+
filename_pattern: "technical.md"
|
|
6822
|
+
template: |
|
|
6823
|
+
# 技术约束
|
|
6824
|
+
|
|
6825
|
+
## 元信息
|
|
6826
|
+
- 查询问题ID: {{question_ids}}
|
|
6827
|
+
- 来源: 知识库MCP
|
|
6828
|
+
- 更新时间: {{timestamp}}
|
|
6829
|
+
|
|
6830
|
+
## 技术栈约束
|
|
6831
|
+
|
|
6832
|
+
{{#each tech_constraints}}
|
|
6833
|
+
### {{category}}
|
|
6834
|
+
- **约束**: {{constraint}}
|
|
6835
|
+
- **原因**: {{reason}}
|
|
6836
|
+
- **影响**: {{impact}}
|
|
6837
|
+
{{/each}}
|
|
6838
|
+
|
|
6839
|
+
## 依赖约束
|
|
6840
|
+
|
|
6841
|
+
{{#each dependency_constraints}}
|
|
6842
|
+
- **{{name}}**: {{constraint}}
|
|
6843
|
+
{{/each}}
|
|
6844
|
+
|
|
6845
|
+
## 与需求的关联
|
|
6846
|
+
{{requirement_mapping}}
|
|
6847
|
+
|
|
6848
|
+
- id: security-constraints
|
|
6849
|
+
filename_pattern: "security.md"
|
|
6850
|
+
template: |
|
|
6851
|
+
# 安全合规要求
|
|
6852
|
+
|
|
6853
|
+
## 元信息
|
|
6854
|
+
- 查询问题ID: {{question_ids}}
|
|
6855
|
+
- 来源: 知识库MCP
|
|
6856
|
+
- 更新时间: {{timestamp}}
|
|
6857
|
+
|
|
6858
|
+
## 安全要求
|
|
6859
|
+
|
|
6860
|
+
{{#each security_requirements}}
|
|
6861
|
+
### {{name}}
|
|
6862
|
+
- **描述**: {{description}}
|
|
6863
|
+
- **适用范围**: {{scope}}
|
|
6864
|
+
- **实现方式**: {{implementation}}
|
|
6865
|
+
{{/each}}
|
|
6866
|
+
|
|
6867
|
+
## 合规要求
|
|
6868
|
+
|
|
6869
|
+
{{#each compliance_requirements}}
|
|
6870
|
+
### {{standard}}
|
|
6871
|
+
- **要求**: {{requirement}}
|
|
6872
|
+
- **检查点**: {{checkpoints}}
|
|
6873
|
+
{{/each}}
|
|
6874
|
+
|
|
6875
|
+
## 与需求的关联
|
|
6876
|
+
{{requirement_mapping}}
|
|
6877
|
+
|
|
6878
|
+
- id: performance-constraints
|
|
6879
|
+
filename_pattern: "performance.md"
|
|
6880
|
+
template: |
|
|
6881
|
+
# 性能要求
|
|
6882
|
+
|
|
6883
|
+
## 元信息
|
|
6884
|
+
- 查询问题ID: {{question_ids}}
|
|
6885
|
+
- 来源: 知识库MCP
|
|
6886
|
+
- 更新时间: {{timestamp}}
|
|
6887
|
+
|
|
6888
|
+
## 性能指标
|
|
6889
|
+
|
|
6890
|
+
| 指标 | 目标值 | 当前值 | 说明 |
|
|
6891
|
+
|------|--------|--------|------|
|
|
6892
|
+
{{#each metrics}}
|
|
6893
|
+
| {{name}} | {{target}} | {{current}} | {{description}} |
|
|
6894
|
+
{{/each}}
|
|
6895
|
+
|
|
6896
|
+
## SLA要求
|
|
6897
|
+
{{#each sla_requirements}}
|
|
6898
|
+
- **{{name}}**: {{value}}
|
|
6899
|
+
{{/each}}
|
|
6900
|
+
|
|
6901
|
+
## 与需求的关联
|
|
6902
|
+
{{requirement_mapping}}
|
|
6903
|
+
|
|
6904
|
+
workflow:
|
|
6905
|
+
knowledge_landing_process:
|
|
6906
|
+
step1:
|
|
6907
|
+
name: "创建目录结构"
|
|
6908
|
+
action: |
|
|
6909
|
+
确保 docs/rag/ 目录结构存在:
|
|
6910
|
+
- docs/rag/business/
|
|
6911
|
+
- docs/rag/technical/
|
|
6912
|
+
- docs/rag/history/
|
|
6913
|
+
- docs/rag/constraints/
|
|
6914
|
+
|
|
6915
|
+
step2:
|
|
6916
|
+
name: "分类知识内容"
|
|
6917
|
+
action: |
|
|
6918
|
+
根据问题类别(A/B/C/D)将知识库返回内容分类:
|
|
6919
|
+
- A类 → business/
|
|
6920
|
+
- B类 → technical/
|
|
6921
|
+
- C类 → history/
|
|
6922
|
+
- D类 → constraints/
|
|
6923
|
+
|
|
6924
|
+
step3:
|
|
6925
|
+
name: "应用模板生成文件"
|
|
6926
|
+
action: |
|
|
6927
|
+
为每条知识选择合适的模板变体,填充内容并生成markdown文件
|
|
6928
|
+
|
|
6929
|
+
step4:
|
|
6930
|
+
name: "生成索引文件"
|
|
6931
|
+
action: |
|
|
6932
|
+
更新 docs/rag/_index.md 索引文件,统计所有知识条目
|
|
6933
|
+
|
|
6934
|
+
step5:
|
|
6935
|
+
name: "标记未答问题"
|
|
6936
|
+
action: |
|
|
6937
|
+
将无法从知识库获得答案的问题记录到索引文件的"未回答问题"部分
|
|
6938
|
+
==================== END: .xiaoma-core/templates/rag-knowledge-tmpl.yaml ====================
|
|
6939
|
+
|
|
6940
|
+
==================== START: .xiaoma-core/templates/prd-tmpl.yaml ====================
|
|
6941
|
+
template:
|
|
6942
|
+
id: prd-template-v2
|
|
6943
|
+
name: 产品需求文档
|
|
6944
|
+
version: 2.0
|
|
6945
|
+
output:
|
|
6946
|
+
format: markdown
|
|
6947
|
+
filename: docs/prd.md
|
|
6948
|
+
title: "{{project_name}} Product Requirements Document (PRD)"
|
|
6949
|
+
|
|
6950
|
+
workflow:
|
|
6951
|
+
mode: interactive
|
|
6952
|
+
elicitation: advanced-elicitation
|
|
6953
|
+
|
|
6954
|
+
sections:
|
|
6955
|
+
- id: goals-context
|
|
6956
|
+
title: 目标与背景上下文
|
|
6957
|
+
instruction: |
|
|
6958
|
+
询问“项目简报”文档是否可用。如果不存在“项目简报”,强烈建议首先使用 project-brief-tmpl 创建一个(它提供了必要的基础:问题陈述、目标用户、成功指标、MVP 范围、约束条件)。如果用户坚持在没有简报的情况下编写 PRD,请在“目标”部分收集这些信息。如果“项目简报”存在,请审阅并用它来填充“目标”(期望成果的项目符号列表)和“背景上下文”(1-2 段关于此项目解决什么问题及其原因的说明),以便我们能确定 PRD MVP 的范围内外事项。无论哪种方式,这对于确定需求都至关重要。请包含“变更日志”表格。
|
|
6959
|
+
sections:
|
|
6960
|
+
- id: goals
|
|
6961
|
+
title: 目标
|
|
6962
|
+
type: bullet-list
|
|
6963
|
+
instruction: 以项目符号列表形式,每行一个,列出 PRD 成功后将交付的预期成果——用户和项目的期望。
|
|
6964
|
+
- id: background
|
|
6965
|
+
title: 背景上下文
|
|
6966
|
+
type: paragraphs
|
|
6967
|
+
instruction: 用 1-2 个简短段落总结背景上下文,例如我们在项目简报中学到了什么(避免与目标重复),这个项目解决什么问题以及为什么,当前的行业状况或需求是什么。
|
|
6968
|
+
- id: changelog
|
|
6969
|
+
title: 变更日志
|
|
6970
|
+
type: table
|
|
6971
|
+
columns: [日期, 版本, 描述, 作者]
|
|
6972
|
+
instruction: 跟踪文档版本和变更
|
|
6973
|
+
|
|
6974
|
+
- id: requirements
|
|
6975
|
+
title: 需求
|
|
6976
|
+
instruction: 在两个子部分下起草功能性和非功能性需求列表。
|
|
6977
|
+
elicit: true
|
|
6978
|
+
sections:
|
|
6979
|
+
- id: functional
|
|
6980
|
+
title: 功能性需求
|
|
6981
|
+
type: numbered-list
|
|
6982
|
+
prefix: FR
|
|
6983
|
+
instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 FR 开头的标识符序列。
|
|
6984
|
+
examples:
|
|
6985
|
+
- "FR6: 待办事项列表使用 AI 检测并警告措辞不同但可能重复的待办事项。"
|
|
6986
|
+
- id: non-functional
|
|
6987
|
+
title: 非功能性需求
|
|
6988
|
+
type: numbered-list
|
|
6989
|
+
prefix: NFR
|
|
6990
|
+
instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 NFR 开头的标识符序列。
|
|
6991
|
+
examples:
|
|
6992
|
+
- "NFR1: 在可行的情况下,AWS 服务的使用必须力求保持在免费套餐限制内。"
|
|
6993
|
+
|
|
6994
|
+
- id: ui-goals
|
|
6995
|
+
title: 用户界面设计目标
|
|
6996
|
+
condition: PRD 包含 UX/UI 需求时
|
|
6997
|
+
instruction: |
|
|
6998
|
+
捕获高层次的 UI/UX 愿景,以指导设计架构师并为创建用户故事提供信息。步骤:
|
|
6999
|
+
|
|
7000
|
+
1. 基于项目上下文,用有根据的猜测预先填充所有子部分。
|
|
7001
|
+
2. 将渲染后的完整部分呈现给用户。
|
|
7002
|
+
3. 清晰地告知用户哪些地方做了假设。
|
|
7003
|
+
4. 针对不清晰/缺失的元素或需要更具体说明的领域提出有针对性的问题。
|
|
7004
|
+
5. 这不是详细的 UI 规范——重点关注产品愿景和用户目标。
|
|
7005
|
+
elicit: true
|
|
7006
|
+
choices:
|
|
7007
|
+
accessibility: [无, WCAG AA, WCAG AAA]
|
|
7008
|
+
platforms: [响应式网页, 仅移动端, 仅桌面端, 跨平台]
|
|
7009
|
+
sections:
|
|
7010
|
+
- id: ux-vision
|
|
7011
|
+
title: 整体 UX 愿景
|
|
7012
|
+
- id: interaction-paradigms
|
|
7013
|
+
title: 关键交互范式
|
|
7014
|
+
- id: core-screens
|
|
7015
|
+
title: 核心屏幕与视图
|
|
7016
|
+
instruction: 从产品角度看,为实现 PRD 的价值和目标,最关键的屏幕或视图是什么?这旨在提供概念性的高层概览,以驱动粗略的模块或用户故事。
|
|
7017
|
+
examples:
|
|
7018
|
+
- "登录屏幕"
|
|
7019
|
+
- "主仪表盘"
|
|
7020
|
+
- "项目详情页"
|
|
7021
|
+
- "设置页面"
|
|
7022
|
+
- id: accessibility
|
|
7023
|
+
title: "无障碍性: {无|WCAG AA|WCAG AAA|自定义要求}"
|
|
7024
|
+
- id: branding
|
|
7025
|
+
title: 品牌
|
|
7026
|
+
instruction: 是否有任何已知的品牌元素或风格指南必须被整合进来?
|
|
7027
|
+
examples:
|
|
7028
|
+
- "复制 20 世纪初黑白电影的观感,包括在页面或状态转换期间模拟胶片损坏或投影仪故障的动画效果。"
|
|
7029
|
+
- "附件是我司品牌的全套调色板和设计元素。"
|
|
7030
|
+
- id: target-platforms
|
|
7031
|
+
title: "目标设备与平台: {响应式网页|仅移动端|仅桌面端|跨平台}"
|
|
7032
|
+
examples:
|
|
7033
|
+
- "响应式网页,以及所有移动平台"
|
|
7034
|
+
- "仅限 iPhone"
|
|
7035
|
+
- "ASCII 码 Windows 桌面"
|
|
7036
|
+
|
|
7037
|
+
- id: technical-assumptions
|
|
7038
|
+
title: 技术假设
|
|
7039
|
+
instruction: |
|
|
7040
|
+
收集将指导架构师的技术决策。步骤:
|
|
7041
|
+
|
|
7042
|
+
1. 检查 .xiaoma-core/data/technical-preferences.yaml 或附加的技术偏好文件是否存在——用它来预填充选项。
|
|
7043
|
+
2. 询问用户关于:语言、框架、启动模板、库、API、部署目标。
|
|
7044
|
+
3. 对于未知项,根据项目目标和 MVP 范围提供指导。
|
|
7045
|
+
4. 记录所有技术选择及其理由(为什么这个选择适合该项目)。
|
|
7046
|
+
5. 这些将成为架构师的约束条件——务必具体和完整。
|
|
7047
|
+
elicit: true
|
|
7048
|
+
choices:
|
|
7049
|
+
repository: [Monorepo, Polyrepo]
|
|
7050
|
+
architecture: [Monolith, Microservices, Serverless]
|
|
7051
|
+
testing: [仅单元测试, 单元+集成测试, 完整测试金字塔]
|
|
7052
|
+
sections:
|
|
7053
|
+
- id: repository-structure
|
|
7054
|
+
title: "代码仓库结构: {Monorepo|Polyrepo|Multi-repo}"
|
|
7055
|
+
- id: service-architecture
|
|
7056
|
+
title: 服务架构
|
|
7057
|
+
instruction: "关键决策 - 记录高层服务架构(例如,Monolith, Microservices, Monorepo 内的 Serverless 函数)。"
|
|
7058
|
+
- id: testing-requirements
|
|
7059
|
+
title: 测试要求
|
|
7060
|
+
instruction: "关键决策 - 记录测试要求(仅单元测试、集成测试、e2e 测试、手动测试,以及是否需要方便手动测试的方法)。"
|
|
7061
|
+
- id: additional-assumptions
|
|
7062
|
+
title: 其他技术假设与请求
|
|
7063
|
+
instruction: 在起草本文档的整个过程中,如果提出或发现任何其他适合架构师的技术假设,请在此处作为额外的项目符号添加。
|
|
7064
|
+
|
|
7065
|
+
- id: epic-list
|
|
7066
|
+
title: 模块列表
|
|
7067
|
+
instruction: |
|
|
7068
|
+
向用户呈现一份高层次的模块列表以供批准。每个模块应有一个标题和一个简短的(1句话)目标陈述。这使用户能在深入细节之前审阅整体结构。
|
|
7069
|
+
|
|
7070
|
+
关键:模块必须遵循敏捷最佳实践,保持逻辑上的顺序:
|
|
7071
|
+
|
|
7072
|
+
- 每个模块都应交付一个重要的、端到端的、完全可部署且可测试的功能增量。
|
|
7073
|
+
- 模块 1 必须建立基础项目设施(应用设置、Git、CI/CD、核心服务),除非我们是向现有应用添加新功能。同时,它还应交付一个初始功能,即使只是一个健康检查路由或一个简单的金丝雀页面显示——在为第一个模块编写用户故事时要记住这一点!
|
|
7074
|
+
- 每个后续的模块都在之前模块功能的基础上构建,交付主要的功能模块,这些模块在部署时能为用户或业务提供切实的价值。
|
|
7075
|
+
- 并非每个项目都需要多个模块,一个模块需要交付价值。例如,一个已完成的 API 即使 UI 尚未完成并计划在另一个模块中实现,也可以交付价值。
|
|
7076
|
+
- 倾向于设置较少的模块,但要告知用户你的理由,并提供拆分选项,如果某些模块看起来太大或关注点分散的话。
|
|
7077
|
+
- 横切关注点应该贯穿于模块和用户故事中,而不是作为最后的用户故事。例如,在一个模块的最后一个故事中添加日志框架,或者在项目结束时作为最后一个模块或故事来做,这将非常糟糕,因为我们从一开始就没有日志记录。
|
|
7078
|
+
elicit: true
|
|
7079
|
+
examples:
|
|
7080
|
+
- "模块 1:基础与核心设施:建立项目设置、认证和基本用户管理"
|
|
7081
|
+
- "模块 2:核心业务实体:创建和管理主要领域对象的 CRUD 操作"
|
|
7082
|
+
- "模块 3:用户工作流与交互:实现关键用户旅程和业务流程"
|
|
7083
|
+
- "模块 4:报告与分析:为用户提供洞察和数据可视化"
|
|
7084
|
+
|
|
7085
|
+
- id: epic-details
|
|
7086
|
+
title: 模块 {{epic_number}} {{epic_title}}
|
|
7087
|
+
repeatable: true
|
|
7088
|
+
instruction: |
|
|
7089
|
+
在模块列表被批准后,将每个模块及其所有的用户故事和验收标准作为一个完整的审查单元呈现。
|
|
7090
|
+
|
|
7091
|
+
为每个模块提供扩展的目标(2-3 句话描述所有故事将实现的目标和价值)。
|
|
7092
|
+
|
|
7093
|
+
关键的用户故事排序要求:
|
|
7094
|
+
|
|
7095
|
+
- 每个模块中的用户故事必须在逻辑上是顺序的。
|
|
7096
|
+
- 每个故事都应该是一个“垂直切片”,交付完整的功能,除了项目基础的早期使能型故事。
|
|
7097
|
+
- 任何故事都不应依赖于后续故事或模块的工作。
|
|
7098
|
+
- 识别并注明任何直接的前置故事。
|
|
7099
|
+
- 关注“做什么”和“为什么”,而不是“怎么做”(将技术实现留给架构师),但要足够精确以支持故事之间逻辑上顺序的操作。
|
|
7100
|
+
- 确保每个故事都交付明确的用户或业务价值,尽量避免使能型故事,而是将它们构建到交付价值的故事中。
|
|
7101
|
+
- 为 AI 代理执行调整故事的大小:每个故事必须能由单个 AI 代理在一次专注的会话中完成,而不会出现上下文溢出。
|
|
7102
|
+
- 想象一个“初级开发人员工作 2-4 小时”的场景——故事必须是小型的、专注的、自包含的。
|
|
7103
|
+
- 如果一个故事看起来很复杂,只要它能交付一个垂直切片,就应进一步拆分。
|
|
7104
|
+
elicit: true
|
|
7105
|
+
template: "{{epic_goal}}"
|
|
7106
|
+
sections:
|
|
7107
|
+
- id: story
|
|
7108
|
+
title: 用户故事 {{epic_number}}.{{story_number}} {{story_title}}
|
|
7109
|
+
repeatable: true
|
|
7110
|
+
template: |
|
|
7111
|
+
作为一名 {{user_type}},
|
|
7112
|
+
我想要 {{action}},
|
|
7113
|
+
以便 {{benefit}}。
|
|
7114
|
+
sections:
|
|
7115
|
+
- id: acceptance-criteria
|
|
7116
|
+
title: 验收标准
|
|
7117
|
+
type: numbered-list
|
|
7118
|
+
item_template: "{{criterion_number}}: {{criteria}}"
|
|
7119
|
+
repeatable: true
|
|
7120
|
+
instruction: |
|
|
7121
|
+
定义清晰、全面且可测试的验收标准,这些标准应:
|
|
7122
|
+
|
|
7123
|
+
- 从功能角度精确定义“完成”的含义。
|
|
7124
|
+
- 明确无歧义,并作为验证的基础。
|
|
7125
|
+
- 包括来自 PRD 的任何关键非功能性需求。
|
|
7126
|
+
- 考虑后端/数据组件的本地可测试性。
|
|
7127
|
+
- 在适用时,指定 UI/UX 需求和框架遵循情况。
|
|
7128
|
+
- 避免应放在其他故事或 PRD 部分的横切关注点。
|
|
7129
|
+
|
|
7130
|
+
- id: checklist-results
|
|
7131
|
+
title: 检查清单结果报告
|
|
7132
|
+
instruction: 在运行检查清单和起草提示之前,提议输出更新后的完整 PRD。如果输出,请与用户确认你将继续运行检查清单并生成报告。一旦用户确认,执行 pm-checklist 并在此部分填充结果。
|
|
7133
|
+
|
|
7134
|
+
- id: next-steps
|
|
7135
|
+
title: 后续步骤
|
|
7136
|
+
sections:
|
|
7137
|
+
- id: ux-expert-prompt
|
|
7138
|
+
title: UX 专家提示
|
|
7139
|
+
instruction: 此部分将包含给 UX 专家的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
|
|
7140
|
+
- id: architect-prompt
|
|
7141
|
+
title: 架构师提示
|
|
7142
|
+
instruction: 此部分将包含给架构师的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
|
|
7143
|
+
==================== END: .xiaoma-core/templates/prd-tmpl.yaml ====================
|
|
7144
|
+
|
|
7145
|
+
==================== START: .xiaoma-core/data/brainstorming-techniques.md ====================
|
|
7146
|
+
<!-- Powered by XiaoMa™ Core -->
|
|
7147
|
+
|
|
7148
|
+
# Brainstorming Techniques Data
|
|
7149
|
+
|
|
7150
|
+
## Creative Expansion
|
|
7151
|
+
|
|
7152
|
+
1. **What If Scenarios**: Ask one provocative question, get their response, then ask another
|
|
7153
|
+
2. **Analogical Thinking**: Give one example analogy, ask them to find 2-3 more
|
|
7154
|
+
3. **Reversal/Inversion**: Pose the reverse question, let them work through it
|
|
7155
|
+
4. **First Principles Thinking**: Ask "What are the fundamentals?" and guide them to break it down
|
|
7156
|
+
|
|
7157
|
+
## Structured Frameworks
|
|
7158
|
+
|
|
7159
|
+
5. **SCAMPER Method**: Go through one letter at a time, wait for their ideas before moving to next
|
|
7160
|
+
6. **Six Thinking Hats**: Present one hat, ask for their thoughts, then move to next hat
|
|
7161
|
+
7. **Mind Mapping**: Start with central concept, ask them to suggest branches
|
|
7162
|
+
|
|
7163
|
+
## Collaborative Techniques
|
|
7164
|
+
|
|
7165
|
+
8. **"Yes, And..." Building**: They give idea, you "yes and" it, they "yes and" back - alternate
|
|
7166
|
+
9. **Brainwriting/Round Robin**: They suggest idea, you build on it, ask them to build on yours
|
|
7167
|
+
10. **Random Stimulation**: Give one random prompt/word, ask them to make connections
|
|
7168
|
+
|
|
7169
|
+
## Deep Exploration
|
|
7170
|
+
|
|
7171
|
+
11. **Five Whys**: Ask "why" and wait for their answer before asking next "why"
|
|
7172
|
+
12. **Morphological Analysis**: Ask them to list parameters first, then explore combinations together
|
|
7173
|
+
13. **Provocation Technique (PO)**: Give one provocative statement, ask them to extract useful ideas
|
|
7174
|
+
|
|
7175
|
+
## Advanced Techniques
|
|
7176
|
+
|
|
7177
|
+
14. **Forced Relationships**: Connect two unrelated concepts and ask them to find the bridge
|
|
7178
|
+
15. **Assumption Reversal**: Challenge their core assumptions and ask them to build from there
|
|
7179
|
+
16. **Role Playing**: Ask them to brainstorm from different stakeholder perspectives
|
|
7180
|
+
17. **Time Shifting**: "How would you solve this in 1995? 2030?"
|
|
7181
|
+
18. **Resource Constraints**: "What if you had only $10 and 1 hour?"
|
|
7182
|
+
19. **Metaphor Mapping**: Use extended metaphors to explore solutions
|
|
7183
|
+
20. **Question Storming**: Generate questions instead of answers first
|
|
7184
|
+
==================== END: .xiaoma-core/data/brainstorming-techniques.md ====================
|
|
7185
|
+
|
|
7186
|
+
==================== START: .xiaoma-core/tasks/execute-checklist.md ====================
|
|
7187
|
+
<!-- Powered by XIAOMA™ Core -->
|
|
7188
|
+
|
|
7189
|
+
# Checklist Validation Task
|
|
7190
|
+
|
|
7191
|
+
This task provides instructions for validating documentation against checklists. The agent MUST follow these instructions to ensure thorough and systematic validation of documents.
|
|
7192
|
+
|
|
7193
|
+
## Available Checklists
|
|
7194
|
+
|
|
7195
|
+
If the user asks or does not specify a specific checklist, list the checklists available to the agent persona. If the task is being run not with a specific agent, tell the user to check the .xiaoma-core/checklists folder to select the appropriate one to run.
|
|
7196
|
+
|
|
7197
|
+
## Instructions
|
|
7198
|
+
|
|
7199
|
+
1. **Initial Assessment**
|
|
7200
|
+
- If user or the task being run provides a checklist name:
|
|
7201
|
+
- Try fuzzy matching (e.g. "architecture checklist" -> "architect-checklist")
|
|
7202
|
+
- If multiple matches found, ask user to clarify
|
|
7203
|
+
- Load the appropriate checklist from .xiaoma-core/checklists/
|
|
7204
|
+
- If no checklist specified:
|
|
7205
|
+
- Ask the user which checklist they want to use
|
|
7206
|
+
- Present the available options from the files in the checklists folder
|
|
7207
|
+
- Confirm if they want to work through the checklist:
|
|
7208
|
+
- Section by section (interactive mode - very time consuming)
|
|
7209
|
+
- All at once (YOLO mode - recommended for checklists, there will be a summary of sections at the end to discuss)
|
|
7210
|
+
|
|
7211
|
+
2. **Document and Artifact Gathering**
|
|
7212
|
+
- Each checklist will specify its required documents/artifacts at the beginning
|
|
7213
|
+
- Follow the checklist's specific instructions for what to gather, generally a file can be resolved in the docs folder, if not or unsure, halt and ask or confirm with the user.
|
|
7214
|
+
|
|
7215
|
+
3. **Checklist Processing**
|
|
7216
|
+
|
|
7217
|
+
If in interactive mode:
|
|
7218
|
+
- Work through each section of the checklist one at a time
|
|
7219
|
+
- For each section:
|
|
7220
|
+
- Review all items in the section following instructions for that section embedded in the checklist
|
|
7221
|
+
- Check each item against the relevant documentation or artifacts as appropriate
|
|
7222
|
+
- Present summary of findings for that section, highlighting warnings, errors and non applicable items (rationale for non-applicability).
|
|
7223
|
+
- Get user confirmation before proceeding to next section or if any thing major do we need to halt and take corrective action
|
|
7224
|
+
|
|
7225
|
+
If in YOLO mode:
|
|
7226
|
+
- Process all sections at once
|
|
7227
|
+
- Create a comprehensive report of all findings
|
|
7228
|
+
- Present the complete analysis to the user
|
|
7229
|
+
|
|
7230
|
+
4. **Validation Approach**
|
|
7231
|
+
|
|
7232
|
+
For each checklist item:
|
|
7233
|
+
- Read and understand the requirement
|
|
7234
|
+
- Look for evidence in the documentation that satisfies the requirement
|
|
7235
|
+
- Consider both explicit mentions and implicit coverage
|
|
7236
|
+
- Aside from this, follow all checklist llm instructions
|
|
7237
|
+
- Mark items as:
|
|
7238
|
+
- ✅ PASS: Requirement clearly met
|
|
7239
|
+
- ❌ FAIL: Requirement not met or insufficient coverage
|
|
7240
|
+
- ⚠️ PARTIAL: Some aspects covered but needs improvement
|
|
7241
|
+
- N/A: Not applicable to this case
|
|
7242
|
+
|
|
7243
|
+
5. **Section Analysis**
|
|
7244
|
+
|
|
7245
|
+
For each section:
|
|
7246
|
+
- think step by step to calculate pass rate
|
|
7247
|
+
- Identify common themes in failed items
|
|
7248
|
+
- Provide specific recommendations for improvement
|
|
7249
|
+
- In interactive mode, discuss findings with user
|
|
7250
|
+
- Document any user decisions or explanations
|
|
7251
|
+
|
|
7252
|
+
6. **Final Report**
|
|
7253
|
+
|
|
7254
|
+
Prepare a summary that includes:
|
|
7255
|
+
- Overall checklist completion status
|
|
7256
|
+
- Pass rates by section
|
|
7257
|
+
- List of failed items with context
|
|
7258
|
+
- Specific recommendations for improvement
|
|
7259
|
+
- Any sections or items marked as N/A with justification
|
|
7260
|
+
|
|
7261
|
+
## Checklist Execution Methodology
|
|
7262
|
+
|
|
7263
|
+
Each checklist now contains embedded LLM prompts and instructions that will:
|
|
7264
|
+
|
|
7265
|
+
1. **Guide thorough thinking** - Prompts ensure deep analysis of each section
|
|
7266
|
+
2. **Request specific artifacts** - Clear instructions on what documents/access is needed
|
|
7267
|
+
3. **Provide contextual guidance** - Section-specific prompts for better validation
|
|
7268
|
+
4. **Generate comprehensive reports** - Final summary with detailed findings
|
|
7269
|
+
|
|
7270
|
+
The LLM will:
|
|
7271
|
+
|
|
7272
|
+
- Execute the complete checklist validation
|
|
7273
|
+
- Present a final report with pass/fail rates and key findings
|
|
7274
|
+
- Offer to provide detailed analysis of any section, especially those with warnings or failures
|
|
7275
|
+
==================== END: .xiaoma-core/tasks/execute-checklist.md ====================
|
|
7276
|
+
|
|
7277
|
+
==================== START: .xiaoma-core/tasks/shard-doc.md ====================
|
|
7278
|
+
<!-- Powered by XiaoMa™ Core -->
|
|
5765
7279
|
|
|
5766
7280
|
# Document Sharding Task
|
|
5767
7281
|
|
|
@@ -7700,7 +9214,7 @@ sections:
|
|
|
7700
9214
|
1. 如果是 REST API, 创建一个 OpenAPI 3.0 规范
|
|
7701
9215
|
2. 如果是 GraphQL, 提供 GraphQL 模式
|
|
7702
9216
|
3. 如果是 tRPC, 展示路由定义
|
|
7703
|
-
4.
|
|
9217
|
+
4. 包括来自模块/故事的所有端点
|
|
7704
9218
|
5. 基于数据模型定义请求/响应模式
|
|
7705
9219
|
6. 记录认证要求
|
|
7706
9220
|
7. 包括请求/响应示例
|
|
@@ -9802,211 +11316,6 @@ sections:
|
|
|
9802
11316
|
- template: "IV3: {{performance_impact_verification}}"
|
|
9803
11317
|
==================== END: .xiaoma-core/templates/brownfield-prd-tmpl.yaml ====================
|
|
9804
11318
|
|
|
9805
|
-
==================== START: .xiaoma-core/templates/prd-tmpl.yaml ====================
|
|
9806
|
-
template:
|
|
9807
|
-
id: prd-template-v2
|
|
9808
|
-
name: 产品需求文档
|
|
9809
|
-
version: 2.0
|
|
9810
|
-
output:
|
|
9811
|
-
format: markdown
|
|
9812
|
-
filename: docs/prd.md
|
|
9813
|
-
title: "{{project_name}} Product Requirements Document (PRD)"
|
|
9814
|
-
|
|
9815
|
-
workflow:
|
|
9816
|
-
mode: interactive
|
|
9817
|
-
elicitation: advanced-elicitation
|
|
9818
|
-
|
|
9819
|
-
sections:
|
|
9820
|
-
- id: goals-context
|
|
9821
|
-
title: 目标与背景上下文
|
|
9822
|
-
instruction: |
|
|
9823
|
-
询问“项目简报”文档是否可用。如果不存在“项目简报”,强烈建议首先使用 project-brief-tmpl 创建一个(它提供了必要的基础:问题陈述、目标用户、成功指标、MVP 范围、约束条件)。如果用户坚持在没有简报的情况下编写 PRD,请在“目标”部分收集这些信息。如果“项目简报”存在,请审阅并用它来填充“目标”(期望成果的项目符号列表)和“背景上下文”(1-2 段关于此项目解决什么问题及其原因的说明),以便我们能确定 PRD MVP 的范围内外事项。无论哪种方式,这对于确定需求都至关重要。请包含“变更日志”表格。
|
|
9824
|
-
sections:
|
|
9825
|
-
- id: goals
|
|
9826
|
-
title: 目标
|
|
9827
|
-
type: bullet-list
|
|
9828
|
-
instruction: 以项目符号列表形式,每行一个,列出 PRD 成功后将交付的预期成果——用户和项目的期望。
|
|
9829
|
-
- id: background
|
|
9830
|
-
title: 背景上下文
|
|
9831
|
-
type: paragraphs
|
|
9832
|
-
instruction: 用 1-2 个简短段落总结背景上下文,例如我们在项目简报中学到了什么(避免与目标重复),这个项目解决什么问题以及为什么,当前的行业状况或需求是什么。
|
|
9833
|
-
- id: changelog
|
|
9834
|
-
title: 变更日志
|
|
9835
|
-
type: table
|
|
9836
|
-
columns: [日期, 版本, 描述, 作者]
|
|
9837
|
-
instruction: 跟踪文档版本和变更
|
|
9838
|
-
|
|
9839
|
-
- id: requirements
|
|
9840
|
-
title: 需求
|
|
9841
|
-
instruction: 在两个子部分下起草功能性和非功能性需求列表。
|
|
9842
|
-
elicit: true
|
|
9843
|
-
sections:
|
|
9844
|
-
- id: functional
|
|
9845
|
-
title: 功能性需求
|
|
9846
|
-
type: numbered-list
|
|
9847
|
-
prefix: FR
|
|
9848
|
-
instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 FR 开头的标识符序列。
|
|
9849
|
-
examples:
|
|
9850
|
-
- "FR6: 待办事项列表使用 AI 检测并警告措辞不同但可能重复的待办事项。"
|
|
9851
|
-
- id: non-functional
|
|
9852
|
-
title: 非功能性需求
|
|
9853
|
-
type: numbered-list
|
|
9854
|
-
prefix: NFR
|
|
9855
|
-
instruction: 每个需求将是一个 Markdown 项目符号,并带有一个以 NFR 开头的标识符序列。
|
|
9856
|
-
examples:
|
|
9857
|
-
- "NFR1: 在可行的情况下,AWS 服务的使用必须力求保持在免费套餐限制内。"
|
|
9858
|
-
|
|
9859
|
-
- id: ui-goals
|
|
9860
|
-
title: 用户界面设计目标
|
|
9861
|
-
condition: PRD 包含 UX/UI 需求时
|
|
9862
|
-
instruction: |
|
|
9863
|
-
捕获高层次的 UI/UX 愿景,以指导设计架构师并为创建用户故事提供信息。步骤:
|
|
9864
|
-
|
|
9865
|
-
1. 基于项目上下文,用有根据的猜测预先填充所有子部分。
|
|
9866
|
-
2. 将渲染后的完整部分呈现给用户。
|
|
9867
|
-
3. 清晰地告知用户哪些地方做了假设。
|
|
9868
|
-
4. 针对不清晰/缺失的元素或需要更具体说明的领域提出有针对性的问题。
|
|
9869
|
-
5. 这不是详细的 UI 规范——重点关注产品愿景和用户目标。
|
|
9870
|
-
elicit: true
|
|
9871
|
-
choices:
|
|
9872
|
-
accessibility: [无, WCAG AA, WCAG AAA]
|
|
9873
|
-
platforms: [响应式网页, 仅移动端, 仅桌面端, 跨平台]
|
|
9874
|
-
sections:
|
|
9875
|
-
- id: ux-vision
|
|
9876
|
-
title: 整体 UX 愿景
|
|
9877
|
-
- id: interaction-paradigms
|
|
9878
|
-
title: 关键交互范式
|
|
9879
|
-
- id: core-screens
|
|
9880
|
-
title: 核心屏幕与视图
|
|
9881
|
-
instruction: 从产品角度看,为实现 PRD 的价值和目标,最关键的屏幕或视图是什么?这旨在提供概念性的高层概览,以驱动粗略的史诗或用户故事。
|
|
9882
|
-
examples:
|
|
9883
|
-
- "登录屏幕"
|
|
9884
|
-
- "主仪表盘"
|
|
9885
|
-
- "项目详情页"
|
|
9886
|
-
- "设置页面"
|
|
9887
|
-
- id: accessibility
|
|
9888
|
-
title: "无障碍性: {无|WCAG AA|WCAG AAA|自定义要求}"
|
|
9889
|
-
- id: branding
|
|
9890
|
-
title: 品牌
|
|
9891
|
-
instruction: 是否有任何已知的品牌元素或风格指南必须被整合进来?
|
|
9892
|
-
examples:
|
|
9893
|
-
- "复制 20 世纪初黑白电影的观感,包括在页面或状态转换期间模拟胶片损坏或投影仪故障的动画效果。"
|
|
9894
|
-
- "附件是我司品牌的全套调色板和设计元素。"
|
|
9895
|
-
- id: target-platforms
|
|
9896
|
-
title: "目标设备与平台: {响应式网页|仅移动端|仅桌面端|跨平台}"
|
|
9897
|
-
examples:
|
|
9898
|
-
- "响应式网页,以及所有移动平台"
|
|
9899
|
-
- "仅限 iPhone"
|
|
9900
|
-
- "ASCII 码 Windows 桌面"
|
|
9901
|
-
|
|
9902
|
-
- id: technical-assumptions
|
|
9903
|
-
title: 技术假设
|
|
9904
|
-
instruction: |
|
|
9905
|
-
收集将指导架构师的技术决策。步骤:
|
|
9906
|
-
|
|
9907
|
-
1. 检查 .xiaoma-core/data/technical-preferences.yaml 或附加的技术偏好文件是否存在——用它来预填充选项。
|
|
9908
|
-
2. 询问用户关于:语言、框架、启动模板、库、API、部署目标。
|
|
9909
|
-
3. 对于未知项,根据项目目标和 MVP 范围提供指导。
|
|
9910
|
-
4. 记录所有技术选择及其理由(为什么这个选择适合该项目)。
|
|
9911
|
-
5. 这些将成为架构师的约束条件——务必具体和完整。
|
|
9912
|
-
elicit: true
|
|
9913
|
-
choices:
|
|
9914
|
-
repository: [Monorepo, Polyrepo]
|
|
9915
|
-
architecture: [Monolith, Microservices, Serverless]
|
|
9916
|
-
testing: [仅单元测试, 单元+集成测试, 完整测试金字塔]
|
|
9917
|
-
sections:
|
|
9918
|
-
- id: repository-structure
|
|
9919
|
-
title: "代码仓库结构: {Monorepo|Polyrepo|Multi-repo}"
|
|
9920
|
-
- id: service-architecture
|
|
9921
|
-
title: 服务架构
|
|
9922
|
-
instruction: "关键决策 - 记录高层服务架构(例如,Monolith, Microservices, Monorepo 内的 Serverless 函数)。"
|
|
9923
|
-
- id: testing-requirements
|
|
9924
|
-
title: 测试要求
|
|
9925
|
-
instruction: "关键决策 - 记录测试要求(仅单元测试、集成测试、e2e 测试、手动测试,以及是否需要方便手动测试的方法)。"
|
|
9926
|
-
- id: additional-assumptions
|
|
9927
|
-
title: 其他技术假设与请求
|
|
9928
|
-
instruction: 在起草本文档的整个过程中,如果提出或发现任何其他适合架构师的技术假设,请在此处作为额外的项目符号添加。
|
|
9929
|
-
|
|
9930
|
-
- id: epic-list
|
|
9931
|
-
title: 史诗列表
|
|
9932
|
-
instruction: |
|
|
9933
|
-
向用户呈现一份高层次的史诗列表以供批准。每个史诗应有一个标题和一个简短的(1句话)目标陈述。这使用户能在深入细节之前审阅整体结构。
|
|
9934
|
-
|
|
9935
|
-
关键:史诗必须遵循敏捷最佳实践,保持逻辑上的顺序:
|
|
9936
|
-
|
|
9937
|
-
- 每个史诗都应交付一个重要的、端到端的、完全可部署且可测试的功能增量。
|
|
9938
|
-
- 史诗 1 必须建立基础项目设施(应用设置、Git、CI/CD、核心服务),除非我们是向现有应用添加新功能。同时,它还应交付一个初始功能,即使只是一个健康检查路由或一个简单的金丝雀页面显示——在为第一个史诗编写用户故事时要记住这一点!
|
|
9939
|
-
- 每个后续的史诗都在之前史诗功能的基础上构建,交付主要的功能模块,这些模块在部署时能为用户或业务提供切实的价值。
|
|
9940
|
-
- 并非每个项目都需要多个史诗,一个史诗需要交付价值。例如,一个已完成的 API 即使 UI 尚未完成并计划在另一个史诗中实现,也可以交付价值。
|
|
9941
|
-
- 倾向于设置较少的史诗,但要告知用户你的理由,并提供拆分选项,如果某些史诗看起来太大或关注点分散的话。
|
|
9942
|
-
- 横切关注点应该贯穿于史诗和用户故事中,而不是作为最后的用户故事。例如,在一个史诗的最后一个故事中添加日志框架,或者在项目结束时作为最后一个史诗或故事来做,这将非常糟糕,因为我们从一开始就没有日志记录。
|
|
9943
|
-
elicit: true
|
|
9944
|
-
examples:
|
|
9945
|
-
- "史诗 1:基础与核心设施:建立项目设置、认证和基本用户管理"
|
|
9946
|
-
- "史诗 2:核心业务实体:创建和管理主要领域对象的 CRUD 操作"
|
|
9947
|
-
- "史诗 3:用户工作流与交互:实现关键用户旅程和业务流程"
|
|
9948
|
-
- "史诗 4:报告与分析:为用户提供洞察和数据可视化"
|
|
9949
|
-
|
|
9950
|
-
- id: epic-details
|
|
9951
|
-
title: 史诗 {{epic_number}} {{epic_title}}
|
|
9952
|
-
repeatable: true
|
|
9953
|
-
instruction: |
|
|
9954
|
-
在史诗列表被批准后,将每个史诗及其所有的用户故事和验收标准作为一个完整的审查单元呈现。
|
|
9955
|
-
|
|
9956
|
-
为每个史诗提供扩展的目标(2-3 句话描述所有故事将实现的目标和价值)。
|
|
9957
|
-
|
|
9958
|
-
关键的用户故事排序要求:
|
|
9959
|
-
|
|
9960
|
-
- 每个史诗中的用户故事必须在逻辑上是顺序的。
|
|
9961
|
-
- 每个故事都应该是一个“垂直切片”,交付完整的功能,除了项目基础的早期使能型故事。
|
|
9962
|
-
- 任何故事都不应依赖于后续故事或史诗的工作。
|
|
9963
|
-
- 识别并注明任何直接的前置故事。
|
|
9964
|
-
- 关注“做什么”和“为什么”,而不是“怎么做”(将技术实现留给架构师),但要足够精确以支持故事之间逻辑上顺序的操作。
|
|
9965
|
-
- 确保每个故事都交付明确的用户或业务价值,尽量避免使能型故事,而是将它们构建到交付价值的故事中。
|
|
9966
|
-
- 为 AI 代理执行调整故事的大小:每个故事必须能由单个 AI 代理在一次专注的会话中完成,而不会出现上下文溢出。
|
|
9967
|
-
- 想象一个“初级开发人员工作 2-4 小时”的场景——故事必须是小型的、专注的、自包含的。
|
|
9968
|
-
- 如果一个故事看起来很复杂,只要它能交付一个垂直切片,就应进一步拆分。
|
|
9969
|
-
elicit: true
|
|
9970
|
-
template: "{{epic_goal}}"
|
|
9971
|
-
sections:
|
|
9972
|
-
- id: story
|
|
9973
|
-
title: 用户故事 {{epic_number}}.{{story_number}} {{story_title}}
|
|
9974
|
-
repeatable: true
|
|
9975
|
-
template: |
|
|
9976
|
-
作为一名 {{user_type}},
|
|
9977
|
-
我想要 {{action}},
|
|
9978
|
-
以便 {{benefit}}。
|
|
9979
|
-
sections:
|
|
9980
|
-
- id: acceptance-criteria
|
|
9981
|
-
title: 验收标准
|
|
9982
|
-
type: numbered-list
|
|
9983
|
-
item_template: "{{criterion_number}}: {{criteria}}"
|
|
9984
|
-
repeatable: true
|
|
9985
|
-
instruction: |
|
|
9986
|
-
定义清晰、全面且可测试的验收标准,这些标准应:
|
|
9987
|
-
|
|
9988
|
-
- 从功能角度精确定义“完成”的含义。
|
|
9989
|
-
- 明确无歧义,并作为验证的基础。
|
|
9990
|
-
- 包括来自 PRD 的任何关键非功能性需求。
|
|
9991
|
-
- 考虑后端/数据组件的本地可测试性。
|
|
9992
|
-
- 在适用时,指定 UI/UX 需求和框架遵循情况。
|
|
9993
|
-
- 避免应放在其他故事或 PRD 部分的横切关注点。
|
|
9994
|
-
|
|
9995
|
-
- id: checklist-results
|
|
9996
|
-
title: 检查清单结果报告
|
|
9997
|
-
instruction: 在运行检查清单和起草提示之前,提议输出更新后的完整 PRD。如果输出,请与用户确认你将继续运行检查清单并生成报告。一旦用户确认,执行 pm-checklist 并在此部分填充结果。
|
|
9998
|
-
|
|
9999
|
-
- id: next-steps
|
|
10000
|
-
title: 后续步骤
|
|
10001
|
-
sections:
|
|
10002
|
-
- id: ux-expert-prompt
|
|
10003
|
-
title: UX 专家提示
|
|
10004
|
-
instruction: 此部分将包含给 UX 专家的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
|
|
10005
|
-
- id: architect-prompt
|
|
10006
|
-
title: 架构师提示
|
|
10007
|
-
instruction: 此部分将包含给架构师的提示,保持简短扼要,以启动使用本文档作为输入的架构创建模式。
|
|
10008
|
-
==================== END: .xiaoma-core/templates/prd-tmpl.yaml ====================
|
|
10009
|
-
|
|
10010
11319
|
==================== START: .xiaoma-core/checklists/change-checklist.md ====================
|
|
10011
11320
|
<!-- Powered by XiaoMa™ Core -->
|
|
10012
11321
|
|