@zeyue0329/xiaoma-cli 1.0.47 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,410 @@
1
+ template:
2
+ id: prd-from-rag-template-v1
3
+ name: 基于需求分析的PRD文档
4
+ version: 1.0
5
+ description: 基于Analyst智能体的需求分析产出物生成PRD
6
+ output:
7
+ format: markdown
8
+ filename: docs/prd.md
9
+ title: "{{project_name}} 产品需求文档 (PRD)"
10
+
11
+ workflow:
12
+ mode: interactive
13
+ elicitation: advanced-elicitation
14
+ upstream:
15
+ agent: analyst
16
+ required_files:
17
+ - docs/rag/_analysis-report.md
18
+ - docs/rag/_requirement-parsing.yaml
19
+ optional_files:
20
+ - docs/rag/_questions.md
21
+ - docs/rag/_index.md
22
+ - docs/rag/business/*
23
+ - docs/rag/technical/*
24
+ - docs/rag/constraints/*
25
+
26
+ sections:
27
+ - id: input-validation
28
+ title: 输入验证
29
+ internal: true
30
+ instruction: |
31
+ 在开始生成PRD之前,执行以下验证:
32
+
33
+ 1. **检查必需文件**:
34
+ - docs/rag/_analysis-report.md 是否存在
35
+ - docs/rag/_requirement-parsing.yaml 是否存在
36
+ - req.txt 原始需求文档是否存在
37
+
38
+ 2. **加载分析报告**:
39
+ - 读取并解析 _analysis-report.md 的所有章节
40
+ - 提取关键信息:功能清单、用户角色、数据实体、风险、待澄清事项
41
+
42
+ 3. **加载知识上下文**:
43
+ - 扫描 docs/rag/technical/ 获取技术约束
44
+ - 扫描 docs/rag/business/ 获取业务规则
45
+ - 扫描 docs/rag/constraints/ 获取约束条件
46
+
47
+ 如果缺少必需文件,提示:
48
+ "⚠️ 未找到需求分析报告。请先执行 Analyst 智能体完成需求分析:*analyze-requirement req.txt"
49
+
50
+ - id: complexity-assessment
51
+ title: 复杂度评估
52
+ instruction: |
53
+ 基于分析报告内容,评估项目复杂度并推荐文档类型。
54
+
55
+ **评估维度**:
56
+ 1. 功能复杂度:基于功能清单数量和依赖关系
57
+ 2. 技术复杂度:基于技术可行性评估
58
+ 3. 集成复杂度:基于数据关系和外部依赖
59
+ 4. 风险等级:基于风险清单
60
+
61
+ **推荐文档类型**:
62
+ - 完整PRD:复杂度 >= 中等,或涉及多个Epic
63
+ - 单Epic:复杂度低,可在1-3个Story内完成
64
+
65
+ 展示评估结果并请用户确认文档类型。
66
+ elicit: true
67
+ sections:
68
+ - id: assessment-result
69
+ title: 评估结果
70
+ type: table
71
+ columns: [评估维度, 等级, 依据]
72
+ - id: recommendation
73
+ title: 推荐方案
74
+ instruction: 基于评估结果给出文档类型推荐和理由
75
+
76
+ - id: goals-context
77
+ title: 目标与背景
78
+ instruction: |
79
+ 从分析报告的"需求概述"章节提取内容,映射到PRD结构。
80
+
81
+ **映射规则**:
82
+ - 分析报告.需求背景 → 背景上下文
83
+ - 分析报告.核心目标 → 目标
84
+ - 分析报告.范围边界 → 范围定义
85
+
86
+ 如果分析报告中信息不足,参考 req.txt 原始需求补充。
87
+ sections:
88
+ - id: goals
89
+ title: 目标
90
+ type: bullet-list
91
+ instruction: |
92
+ 从分析报告提取核心目标,转换为PRD目标格式。
93
+ 每个目标应该是:
94
+ - 可衡量的成果
95
+ - 用户或业务价值
96
+ - 与原始需求对应
97
+ - id: background
98
+ title: 背景上下文
99
+ type: paragraphs
100
+ instruction: |
101
+ 综合以下来源生成背景描述:
102
+ - 分析报告.需求背景
103
+ - 分析报告.业务分析
104
+ - 原始需求文档中的背景信息
105
+ - id: scope
106
+ title: 范围定义
107
+ instruction: 从分析报告.范围边界提取,明确包含和不包含的内容
108
+ sections:
109
+ - id: in-scope
110
+ title: 范围内
111
+ type: bullet-list
112
+ - id: out-of-scope
113
+ title: 范围外
114
+ type: bullet-list
115
+ - id: changelog
116
+ title: 变更日志
117
+ type: table
118
+ columns: [日期, 版本, 描述, 作者]
119
+
120
+ - id: requirements
121
+ title: 需求
122
+ instruction: |
123
+ 从分析报告的"功能分析"和"业务规则汇总"章节提取需求。
124
+
125
+ **功能性需求来源**:
126
+ - 分析报告.功能清单 → FR列表
127
+ - 分析报告.业务规则 → FR补充说明
128
+ - docs/rag/business/rules-*.md → 详细规则
129
+
130
+ **非功能性需求来源**:
131
+ - 分析报告.技术分析.性能要求
132
+ - docs/rag/constraints/security.md
133
+ - docs/rag/constraints/performance.md
134
+
135
+ 确保每个需求都可追溯到分析报告或知识库文档。
136
+ elicit: true
137
+ sections:
138
+ - id: functional
139
+ title: 功能性需求
140
+ type: numbered-list
141
+ prefix: FR
142
+ instruction: |
143
+ 按优先级排列功能性需求:
144
+ - P0功能优先列出
145
+ - 每个FR包含:需求描述 + 来源标注
146
+ - 复杂业务规则单独标注参考文档
147
+
148
+ 格式示例:
149
+ FR1: [P0] 用户可以创建订单 (来源: 分析报告.功能清单.F001)
150
+ examples:
151
+ - "FR1: [P0] 系统支持用户通过手机号注册账户 (来源: _analysis-report.md#功能清单)"
152
+ - "FR2: [P0] 订单状态流转遵循:待支付→已支付→已发货→已完成 (来源: business/rules-order.md)"
153
+ - id: non-functional
154
+ title: 非功能性需求
155
+ type: numbered-list
156
+ prefix: NFR
157
+ instruction: |
158
+ 从约束条件和技术分析中提取非功能性需求。
159
+ 包括:性能、安全、可用性、兼容性等。
160
+ examples:
161
+ - "NFR1: 接口响应时间P99 < 500ms (来源: constraints/performance.md)"
162
+ - "NFR2: 敏感数据传输必须使用HTTPS加密 (来源: constraints/security.md)"
163
+
164
+ - id: data-model
165
+ title: 数据模型
166
+ instruction: |
167
+ 从分析报告的"数据分析"章节和技术知识中提取数据模型。
168
+
169
+ **来源**:
170
+ - 分析报告.数据实体清单
171
+ - 分析报告.数据关系图
172
+ - docs/rag/technical/data-model.md
173
+ sections:
174
+ - id: entities
175
+ title: 数据实体
176
+ type: table
177
+ columns: [实体名称, 描述, 核心属性, 来源]
178
+ instruction: 列出所有数据实体及其核心属性
179
+ - id: relationships
180
+ title: 数据关系
181
+ instruction: |
182
+ 描述实体间的关系,使用Mermaid ER图表示。
183
+ 从分析报告.数据关系图提取,补充详细说明。
184
+ examples:
185
+ - |
186
+ ```mermaid
187
+ erDiagram
188
+ User ||--o{ Order : creates
189
+ Order ||--|{ OrderItem : contains
190
+ ```
191
+
192
+ - id: technical-constraints
193
+ title: 技术约束
194
+ instruction: |
195
+ 整合技术知识库中的约束条件,指导后续架构设计。
196
+
197
+ **来源**:
198
+ - docs/rag/technical/architecture.md
199
+ - docs/rag/technical/tech-stack.md
200
+ - docs/rag/technical/coding-standards/
201
+ - docs/rag/technical/middleware/
202
+ - 分析报告.技术分析.与现有系统兼容性
203
+ elicit: true
204
+ sections:
205
+ - id: tech-stack
206
+ title: 技术栈约束
207
+ instruction: |
208
+ 从技术知识库提取技术栈要求:
209
+ - 后端框架和版本
210
+ - 数据库类型和版本
211
+ - 中间件要求
212
+ template: |
213
+ **后端**: {{backend_framework}}
214
+ **数据库**: {{database}}
215
+ **缓存**: {{cache}}
216
+ **消息队列**: {{mq}}
217
+ - id: architecture-constraints
218
+ title: 架构约束
219
+ instruction: 从 architecture.md 提取架构模式和约束
220
+ - id: coding-standards
221
+ title: 编码规范约束
222
+ instruction: |
223
+ 从 coding-standards/ 目录提取关键规范:
224
+ - 命名规范
225
+ - 分层规范
226
+ - 异常处理规范
227
+ - id: integration-constraints
228
+ title: 集成约束
229
+ instruction: 从分析报告.技术分析提取集成相关约束
230
+
231
+ - id: epic-list
232
+ title: 模块列表
233
+ instruction: |
234
+ 基于分析报告的功能分析,规划Epic结构。
235
+
236
+ **规划原则**:
237
+ - 按功能优先级分组:P0功能 → Epic 1
238
+ - 遵循功能依赖关系
239
+ - 每个Epic交付独立可测试的功能增量
240
+
241
+ **Epic分组策略**:
242
+ 1. 从分析报告.功能清单提取所有功能
243
+ 2. 按优先级排序:P0 > P1 > P2
244
+ 3. 分析依赖关系,确定Epic边界
245
+ 4. 每个Epic包含相关联的功能集
246
+
247
+ 展示Epic列表,请用户确认分组是否合理。
248
+ elicit: true
249
+ sections:
250
+ - id: epic-overview
251
+ title: Epic概览
252
+ type: table
253
+ columns: [Epic, 标题, 包含功能, 优先级, Story数量(预估)]
254
+ instruction: 展示所有Epic的概览表格
255
+
256
+ - id: epic-details
257
+ title: "Epic {{epic_number}}: {{epic_title}}"
258
+ repeatable: true
259
+ instruction: |
260
+ 为每个Epic生成详细内容,包含所有Story和验收标准。
261
+
262
+ **Epic内容来源**:
263
+ - 分析报告.功能清单 (对应功能)
264
+ - 分析报告.业务规则 (相关规则)
265
+ - docs/rag/business/ (详细业务知识)
266
+ - docs/rag/technical/ (技术实现参考)
267
+
268
+ **Story生成规则**:
269
+ - 每个Story是垂直切片
270
+ - 单个AI Agent会话可完成(2-4小时)
271
+ - 验收标准来源于分析报告中的业务规则
272
+ - 包含技术实现提示(来自技术知识)
273
+
274
+ **Story排序**:
275
+ - 遵循分析报告.功能依赖关系
276
+ - 基础设施和数据模型优先
277
+ - 核心流程优先于边缘场景
278
+ elicit: true
279
+ template: |
280
+ **Epic目标**: {{epic_goal}}
281
+
282
+ **包含功能**:
283
+ {{功能列表,来源于分析报告}}
284
+
285
+ **技术要点**:
286
+ {{技术实现要点,来源于技术知识库}}
287
+ sections:
288
+ - id: story
289
+ title: "Story {{epic_number}}.{{story_number}}: {{story_title}}"
290
+ repeatable: true
291
+ template: |
292
+ 作为一名 {{user_type}},
293
+ 我想要 {{action}},
294
+ 以便 {{benefit}}。
295
+ sections:
296
+ - id: acceptance-criteria
297
+ title: 验收标准
298
+ type: numbered-list
299
+ instruction: |
300
+ 从以下来源生成验收标准:
301
+ - 分析报告.业务规则 (对应规则)
302
+ - docs/rag/business/rules-*.md (详细规则)
303
+ - 分析报告.数据分析 (数据约束)
304
+
305
+ 每个标准必须:
306
+ - 可测试、可验证
307
+ - 明确无歧义
308
+ - 包含边界条件
309
+ item_template: "AC{{criterion_number}}: {{criteria}} (来源: {{source}})"
310
+ - id: technical-hints
311
+ title: 技术实现提示
312
+ instruction: |
313
+ 从技术知识库提取实现提示:
314
+ - 相关编码规范
315
+ - 中间件使用示例
316
+ - 数据模型参考
317
+ type: bullet-list
318
+ - id: knowledge-refs
319
+ title: 知识引用
320
+ instruction: 列出Story实现时需要参考的知识文档
321
+ type: bullet-list
322
+
323
+ - id: risks-and-open-items
324
+ title: 风险与待澄清事项
325
+ instruction: |
326
+ 从分析报告直接提取风险和待澄清事项。
327
+
328
+ **来源**:
329
+ - 分析报告.风险分析
330
+ - 分析报告.待澄清事项
331
+ sections:
332
+ - id: risks
333
+ title: 风险清单
334
+ type: table
335
+ columns: [风险ID, 风险描述, 等级, 缓解措施]
336
+ instruction: 从分析报告.风险清单直接映射
337
+ - id: open-questions
338
+ title: 待澄清事项
339
+ type: table
340
+ columns: [序号, 问题, 上下文, 建议选项, 状态]
341
+ instruction: |
342
+ 从分析报告.待澄清事项提取。
343
+ 标注状态:待确认/已确认/已关闭
344
+ 在PRD评审时需要逐一确认这些问题。
345
+
346
+ - id: knowledge-index
347
+ title: 知识引用索引
348
+ instruction: |
349
+ 列出本PRD引用的所有知识文档,便于追溯和维护。
350
+ sections:
351
+ - id: analysis-refs
352
+ title: 分析报告引用
353
+ type: table
354
+ columns: [章节, 引用位置, 用途]
355
+ - id: knowledge-refs
356
+ title: 知识库引用
357
+ type: table
358
+ columns: [文件路径, 引用位置, 用途]
359
+
360
+ - id: next-steps
361
+ title: 后续步骤
362
+ sections:
363
+ - id: ux-expert-prompt
364
+ title: UX专家交接
365
+ instruction: |
366
+ 生成给UX专家的交接提示,包含:
367
+ - 需要关注的用户角色
368
+ - 核心屏幕和交互
369
+ - 品牌和无障碍要求
370
+ - 相关知识文档路径
371
+ template: |
372
+ **交接给UX专家**
373
+
374
+ 请基于本PRD的用户分析部分设计UI/UX方案:
375
+
376
+ **关键输入**:
377
+ - PRD文档: docs/prd.md
378
+ - 用户分析: docs/rag/_analysis-report.md#用户分析
379
+ - 用户角色: {{user_roles}}
380
+ - 核心屏幕: {{core_screens}}
381
+
382
+ **设计重点**:
383
+ {{design_focus}}
384
+
385
+ **执行命令**: *create-ux-design docs/prd.md
386
+ - id: architect-prompt
387
+ title: 架构师交接
388
+ instruction: |
389
+ 生成给架构师的交接提示,包含:
390
+ - 技术栈约束
391
+ - 数据模型要点
392
+ - 集成需求
393
+ - 相关知识文档路径
394
+ template: |
395
+ **交接给架构师**
396
+
397
+ 请基于本PRD和技术知识库设计系统架构:
398
+
399
+ **关键输入**:
400
+ - PRD文档: docs/prd.md
401
+ - 技术分析: docs/rag/_analysis-report.md#技术分析
402
+ - 技术知识: docs/rag/technical/
403
+ - 数据模型: docs/rag/technical/data-model.md
404
+
405
+ **架构重点**:
406
+ - 技术栈: {{tech_stack}}
407
+ - 关键集成点: {{integration_points}}
408
+ - 性能要求: {{performance_requirements}}
409
+
410
+ **执行命令**: *create-architecture docs/prd.md