@zeyue0329/xiaoma-cli 1.12.0 → 1.13.0

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.
Files changed (56) hide show
  1. package/.playwright-cli/console-2026-05-13T06-36-26-793Z.log +2 -0
  2. package/.playwright-cli/page-2026-05-13T06-36-27-725Z.yml +1 -0
  3. package/CLAUDE.md +1 -0
  4. package/XiaoMa-CLI-2026H2-/350/277/255/344/273/243/350/247/204/345/210/222.pptx +0 -0
  5. package/demo/xiaoma-bug-circle-resolve/SKILL.md +1 -1
  6. package/demo/xiaoma-bug-circle-resolve/workflow.md +72 -30
  7. package/demo/xiaoma-prd-saas-zh/README.md +57 -0
  8. package/demo/xiaoma-prd-saas-zh/domain-research.md +128 -0
  9. package/demo/xiaoma-prd-saas-zh/epics.md +303 -0
  10. package/demo/xiaoma-prd-saas-zh/market-research-2026-q1.md +183 -0
  11. package/demo/xiaoma-prd-saas-zh/prd-bad-examples.md +268 -0
  12. package/demo/xiaoma-prd-saas-zh/prd.md +409 -0
  13. package/demo/xiaoma-prd-saas-zh/product-brief.md +97 -0
  14. package/demo/xiaoma-prd-saas-zh/validation-report.md +279 -0
  15. package/media/doc1_fig1.png +0 -0
  16. package/media/doc1_fig2.png +0 -0
  17. package/media/doc1_fig3.png +0 -0
  18. package/media/doc1_fig4.png +0 -0
  19. package/media/doc2_fig1.png +0 -0
  20. package/media/doc2_fig2.png +0 -0
  21. package/media/doc2_fig3.png +0 -0
  22. package/media/doc2_fig4.png +0 -0
  23. package/media/doc3_fig1.png +0 -0
  24. package/media/doc3_fig2.png +0 -0
  25. package/media/doc3_fig3.png +0 -0
  26. package/media/doc3_fig4.png +0 -0
  27. package/media/doc4_fig1.png +0 -0
  28. package/media/doc4_fig2.png +0 -0
  29. package/media/doc4_fig3.png +0 -0
  30. package/media/doc5_fig1.png +0 -0
  31. package/media/doc5_fig2.png +0 -0
  32. package/media/doc5_fig3.png +0 -0
  33. package/package.json +1 -1
  34. package/patent-disclosure-optimized/SKILL.md +135 -17
  35. package/patent-disclosure-optimized/references/docx-format-spec.md +183 -0
  36. package/patent-disclosure-optimized/scripts/md2docx.js +777 -0
  37. package/src/core/tasks/xiaoma-create-prd/data/prd-purpose.md +157 -0
  38. package/src/core/tasks/xiaoma-create-prd/data/upstream-input-contract.md +168 -0
  39. package/src/core/tasks/xiaoma-create-prd/templates/prd-skeleton-reference.md +428 -0
  40. package/src/core/tasks/xiaoma-create-prd/templates/prd-template.md +101 -3
  41. package/src/xmc/agents/sm.agent.yaml +4 -0
  42. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/prd-quality-rubric.csv +14 -0
  43. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/SKILL.md +6 -0
  44. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/checklist.md +43 -0
  45. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-01-init-and-validate.md +155 -0
  46. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-02-create-epics.md +156 -0
  47. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-03-bridge-sprint-planning.md +143 -0
  48. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-04-batch-create-stories.md +309 -0
  49. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-05-finalize.md +311 -0
  50. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/workflow.md +105 -0
  51. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/xiaoma-skill-manifest.yaml +3 -0
  52. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_1_/351/235/242/345/220/221AI/346/231/272/350/203/275/344/275/223/347/232/204/345/244/232/351/200/232/351/201/223/344/276/235/350/265/226_20260318.md +483 -0
  53. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_2_/345/237/272/344/272/216/351/205/215/347/275/256/351/251/261/345/212/250/347/232/204/350/267/250/345/271/263/345/217/260IDE/346/231/272/350/203/275_20260318.md +592 -0
  54. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_3_AI/346/231/272/350/203/275/344/275/223/345/243/260/346/230/216/345/274/217/345/256/232/344/271/211/347/232/204/347/274/226/350/257/221/346/265/201/346/260/264_20260318.md +624 -0
  55. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_4_/345/237/272/344/272/216/345/223/210/345/270/214/346/214/207/347/272/271/347/232/204/346/231/272/350/203/275/344/275/223/351/231/204/345/261/236/350/265/204/346/272/220/351/200/211_20260318.md +628 -0
  56. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_5_AI/346/231/272/350/203/275/344/275/223/350/247/246/345/217/221/346/214/207/344/273/244/347/232/204/345/244/215/345/220/210/346/240/274/345/274/217/346/240/241_20260318.md +652 -0
@@ -0,0 +1,428 @@
1
+ # PRD Skeleton Reference
2
+
3
+ > **Audience:** PM agent (xiaochan / 小蝉) and human reviewers.
4
+ > **Role:** Design reference and quality bar — what each PRD section "looks like done well".
5
+ > **Not:** Copied to the output PRD. Loaded into agent context during `xiaoma-create-prd` and
6
+ > used as the side-by-side standard during `xiaoma-validate-prd`.
7
+
8
+ For density rules, SMART criteria, anti-pattern catalog (AP-01..AP-05), FR-to-Story
9
+ heuristics, NFR industry baselines, and dual-audience checklist, read:
10
+ `../data/prd-purpose.md`.
11
+
12
+ For Analyst → PM upstream input expectations and field-to-section mapping, read:
13
+ `../data/upstream-input-contract.md`.
14
+
15
+ ---
16
+
17
+ ## How to Use This Reference
18
+
19
+ 1. **Per-section guidance.** For each of the 9 required sections, this file provides:
20
+ purpose, fields, a good Chinese example, an anti-pattern Chinese example, and self-check questions.
21
+ 2. **Workflow alignment.** Each section maps to one or more `step-c` files; that step is the
22
+ primary author of the section. PM agent should read the relevant subsection of this reference
23
+ immediately before generating content for the corresponding step.
24
+ 3. **Validation alignment.** Each section's quality bar maps to one or more `step-v` validation
25
+ dimensions (D01..D13). The reference's "self-check questions" are the lightweight version of
26
+ those validations.
27
+ 4. **Skip rules.** Sections 5, 6, 7 may be marked "N/A" when not applicable — see the project-type
28
+ matrix at the end of this file.
29
+
30
+ ---
31
+
32
+ ## Section 1 — Executive Summary
33
+
34
+ **Step source:** `steps-c/step-02c-executive-summary.md`
35
+ **Validation refs:** D04 Brief Coverage · D06 Traceability · D11 Holistic Quality
36
+
37
+ ### Purpose
38
+
39
+ Anchor the entire PRD in one screen. A reader who skims only this section must come away knowing:
40
+ **what we are building, for whom, what problem it solves, and why it wins.**
41
+
42
+ ### Required fields
43
+
44
+ | Field | Required | Length |
45
+ | ---------------------- | -------- | ------------------ |
46
+ | Vision statement | yes | 1-2 sentences |
47
+ | Problem statement | yes | 1-2 sentences |
48
+ | Target users (primary) | yes | bullet list, 2-4 |
49
+ | Value proposition | yes | 2-4 bullets |
50
+ | Differentiation | yes | 1-3 bullets |
51
+ | Project classification | auto | 1 line (from CSVs) |
52
+
53
+ ### Good example (中文)
54
+
55
+ > **愿景:** 让中型企业的客户成功团队在统一画布上看见、解读并干预客户旅程,把流失预警的发现到触达从平均 7 天压到 24 小时内。
56
+ >
57
+ > **目标用户:** 客户成功经理(CSM)· 客服主管 · 数据分析师。
58
+ >
59
+ > **价值主张:**
60
+ > - 跨系统聚合的客户旅程视图,单页可视化 ≥ 12 个月历史
61
+ > - LLM 自动摘要近 30 天高风险对话,CSM 平均处理时间从 18 分钟降至 6 分钟
62
+ > - 风险评分与触达建议同源,CSM 单人服务客户数提升 30%
63
+
64
+ ### Anti-pattern example (AP-01 口号化目标)
65
+
66
+ > ❌ "打造业界领先的、智能化、一站式客户成功平台,赋能企业数字化转型。"
67
+ >
68
+ > 问题:无可测量目标、无主语、无差异化、纯营销话术。
69
+
70
+ ### Self-check
71
+
72
+ - 愿景是否能被翻译成至少 1 条 Success Criteria 量化指标?
73
+ - 目标用户是否唯一?没有"所有人"或"企业"这种泛主语?
74
+ - 差异化点是否能与至少 1 个竞品对比?
75
+
76
+ ---
77
+
78
+ ## Section 2 — Success Criteria
79
+
80
+ **Step source:** `steps-c/step-03-success.md`
81
+ **Validation refs:** D05 Measurability · D06 Traceability · D10 SMART
82
+
83
+ ### Purpose
84
+
85
+ Define what "success" means in numbers. Every metric must be testable post-launch.
86
+
87
+ ### Required fields per metric
88
+
89
+ | Field | Required | Example |
90
+ | ----------------- | -------- | -------------------------------------- |
91
+ | Metric name | yes | 流失预警触达率 |
92
+ | Baseline | yes | 当前 30%(来自 2025 Q4 客服日志抽样) |
93
+ | Target | yes | 上线后 6 个月内 ≥ 95% |
94
+ | Measurement | yes | 工单系统标签 `risk_alert_acknowledged` |
95
+ | Time window | yes | 滚动 30 天 |
96
+ | Linked to vision? | yes | §1 愿景"24 小时内触达" |
97
+
98
+ ### Good example (中文)
99
+
100
+ > **SC-01 流失预警触达率**
101
+ > Baseline 30%(2025 Q4 客服日志抽样)→ 上线后 6 个月内 ≥ 95%。
102
+ > 测量:工单系统标签 `risk_alert_acknowledged` ÷ 同期生成的 `risk_alert` 数。
103
+ > 滚动窗口 30 天。对应愿景"24 小时内触达"。
104
+
105
+ ### Anti-pattern example (AP-05 量词缺失)
106
+
107
+ > ❌ "客户满意度显著提升,流失率明显下降。"
108
+ >
109
+ > 问题:无 baseline、无 target、无测量方法、无时间窗。"显著"/"明显"是反模式。
110
+
111
+ ### Self-check
112
+
113
+ - 每条指标是否可在产品上线 + 1 个完整测量周期内被验证?
114
+ - 每条指标是否与 §1 中至少一项愿景或价值主张存在可追溯链接?
115
+ - 是否避免了"提升用户体验"这类不可量化指标?
116
+
117
+ ---
118
+
119
+ ## Section 3 — Product Scope
120
+
121
+ **Step source:** `steps-c/step-08-scoping.md`
122
+ **Validation refs:** D04 Brief Coverage · D12 Completeness
123
+
124
+ ### Purpose
125
+
126
+ 明确写出"做什么、不做什么、之后做什么"。out-of-scope 与 in-scope 同等重要 — 它阻止后续无声扩张。
127
+
128
+ ### Required fields
129
+
130
+ - **MVP(必须):** 列表,按 capability area 分组
131
+ - **Out-of-Scope(必须):** 列表,每条附"为什么不做"一句话
132
+ - **Growth Phase(推荐):** 列表 + 大致时间窗
133
+ - **Vision Phase(可选):** 列表
134
+
135
+ ### Good example (中文)
136
+
137
+ > **MVP(2026 H2 上线)**
138
+ > - 客户档案管理:多源聚合 · 标签 · 检索
139
+ > - 旅程画布:单租户 · 12 个月历史 · 时间轴视图
140
+ > - 风险预警:3 类规则引擎 · 工单系统单向集成
141
+ >
142
+ > **Out-of-Scope**
143
+ > - 海外多语:首期客户均为国内中型企业,海外需求量 < 5%
144
+ > - 自营客服坐席系统:与现有合作伙伴 Salesforce/钉钉客服重叠
145
+ >
146
+ > **Growth Phase(2027 Q1)**
147
+ > - 客户健康度模型可调校
148
+ > - 移动端 PWA
149
+
150
+ ### Anti-pattern
151
+
152
+ > ❌ "MVP 包含核心功能,后续根据需求迭代。"
153
+ >
154
+ > 问题:无具体功能列表,"核心"/"根据需求"全是占位词。
155
+
156
+ ### Self-check
157
+
158
+ - Out-of-Scope 是否覆盖了至少 1 个"显然会被问到但本期不做"的场景?
159
+ - MVP 列表是否能 1:1 映射到 §8 的 capability areas?
160
+
161
+ ---
162
+
163
+ ## Section 4 — User Journeys
164
+
165
+ **Step source:** `steps-c/step-04-journeys.md`
166
+ **Validation refs:** D04 Brief Coverage · D06 Traceability
167
+
168
+ ### Purpose
169
+
170
+ For each primary persona from §1, capture an end-to-end journey. Journeys are the bridge from
171
+ target users to functional requirements — every FR in §8 must trace back to at least one journey
172
+ step.
173
+
174
+ ### Required fields per journey
175
+
176
+ - Persona (与 §1 一致)
177
+ - Trigger(旅程触发点)
178
+ - 5-9 steps,每步含:动作 · 触点(系统/页面)· 情绪 · 痛点(如有)
179
+ - Outcome(成功/失败两种结局)
180
+
181
+ ### Good example (中文)
182
+
183
+ > **CSM 日检视旅程**
184
+ >
185
+ > 触发:上午 9:00 进入工作台。
186
+ >
187
+ > | # | 动作 | 触点 | 情绪 | 痛点 |
188
+ > | - | -------------------------- | ----------------- | ------- | ------------------- |
189
+ > | 1 | 打开客户旅程画布 | Web 工作台首页 | 期望 | - |
190
+ > | 2 | 查看高风险客户列表 | 风险预警面板 | 警觉 | 当前需手动多系统切换 |
191
+ > | 3 | 点击客户卡片查看 30 天摘要 | 客户档案 · 摘要 Tab | 专注 | - |
192
+ > | 4 | 决定干预动作 | 触达建议面板 | 紧迫 | - |
193
+ > | 5 | 一键创建工单并触达客户 | 工单 + IM 集成 | 满足 | - |
194
+ >
195
+ > 结局:成功路径 = 触达后 24h 内客户回复;失败路径 = 工单进入超时队列。
196
+
197
+ ### Anti-pattern
198
+
199
+ > ❌ "用户登录后查看数据并采取行动。"
200
+ >
201
+ > 问题:步骤过粗(无法映射到 FR)、无触点、无情绪、无失败路径。
202
+
203
+ ### Self-check
204
+
205
+ - 每个 §1 中列出的 persona 是否至少有一条旅程?
206
+ - 每个旅程步骤是否能追溯到至少 1 个 FR(即将在 §8 中出现)?
207
+ - 是否包含了至少 1 条失败路径?
208
+
209
+ ---
210
+
211
+ ## Section 5 — Domain Requirements
212
+
213
+ **Step source:** `steps-c/step-05-domain.md`
214
+ **Driver:** `../data/domain-complexity.csv`
215
+ **Validation ref:** D08 Domain Compliance
216
+
217
+ ### Purpose
218
+
219
+ Industry-mandatory requirements (HIPAA, PCI-DSS, 等保, etc). Auto-detected from project signals;
220
+ the PM agent expands `special_sections` from `domain-complexity.csv` into actual requirements.
221
+
222
+ ### When to write "N/A"
223
+
224
+ - `domain` 检测为 `general` 且 `complexity` 为 `low`
225
+ - 团队明确无合规外部约束
226
+
227
+ ### Good example (中文 — SaaS B2B 内部企业服务)
228
+
229
+ > **5.1 数据合规**
230
+ > - 等保二级(要求:访问控制 · 审计日志 · 数据备份 · 安全管理制度)
231
+ > - 个人信息保护法:客户对话内容仅在租户内可见,跨租户隔离强制启用
232
+ > - 数据本地化:客户数据仅存储于中国大陆 IDC
233
+ >
234
+ > **5.2 行业术语表**
235
+ > - 客户健康度(Customer Health Score):0-100 综合评分
236
+ > - 流失预警(Churn Risk Alert):触发条件参见 FR-RISK-01
237
+ >
238
+ > **5.3 外部依赖**
239
+ > - 钉钉开放平台 API(v2,限流 100 QPS)
240
+ > - Salesforce REST API(v55.0,OAuth 2.0 授权)
241
+
242
+ ### Anti-pattern
243
+
244
+ > ❌ "系统满足相关法规要求,符合行业标准。"
245
+ >
246
+ > 问题:未列出具体法规、未列出可验证条款。
247
+
248
+ ---
249
+
250
+ ## Section 6 — Innovation Analysis
251
+
252
+ **Step source:** `steps-c/step-06-innovation.md`
253
+ **Validation ref:** D11 Holistic Quality
254
+
255
+ ### Purpose
256
+
257
+ 差异化与新颖度分析,避免"做一个市场已有的产品"。
258
+
259
+ ### When to write "N/A"
260
+
261
+ - 项目为既有产品的复刻或维护性扩展
262
+ - 内部工具,不与外部产品对比
263
+
264
+ ### Good example (中文)
265
+
266
+ > **6.1 核心差异化**
267
+ > - 唯一同时整合"客户旅程画布 + LLM 摘要 + 风险评分"三能力的国内 SaaS
268
+ > - 国内同类产品(如 X、Y)只覆盖其中 1-2 项
269
+ >
270
+ > **6.2 技术新颖度**
271
+ > - LLM 摘要质量基线 ≥ 4.2/5(人工标注 100 样本)
272
+ > - 风险评分模型可解释性:每条预警附 top-3 触发因子
273
+ >
274
+ > **6.3 风险**
275
+ > - LLM 输出稳定性 — 缓解:引入提示词回归测试集 + 摘要重生成机制
276
+ > - 国内 LLM 厂商策略变化 — 缓解:抽象 LLM 适配层,支持 ≥ 2 家厂商
277
+
278
+ ---
279
+
280
+ ## Section 7 — Project-Type Requirements
281
+
282
+ **Step source:** `steps-c/step-07-project-type.md`
283
+ **Driver:** `../data/project-types.csv`
284
+ **Validation ref:** D09 Project-Type Fit
285
+
286
+ ### Purpose
287
+
288
+ Platform-specific 需求清单。从 `project-types.csv.required_sections` 展开,跳过 `skip_sections`
289
+ 中列出的章节。
290
+
291
+ ### Good example (saas_b2b)
292
+
293
+ > - 多租户模型:行级数据隔离 + 租户级配置覆盖
294
+ > - RBAC 矩阵:4 种角色(Admin / Manager / Operator / Viewer)× 8 类资源
295
+ > - 订阅层级:Starter(≤ 10 人)/ Team(≤ 50 人)/ Business(≤ 200 人)
296
+ > - 集成清单:钉钉 · 飞书 · Salesforce · Slack · Webhook
297
+ > - 合规需求:等保二级 · ISO 27001(未来)
298
+
299
+ ---
300
+
301
+ ## Section 8 — Functional Requirements
302
+
303
+ **Step source:** `steps-c/step-09-functional.md`
304
+ **Validation refs:** D05 Measurability · D06 Traceability · D07 Implementation Leakage · D10 SMART
305
+
306
+ ### Format
307
+
308
+ ```
309
+ ### 8.x [Capability Area Name — 名词短语,非动词]
310
+
311
+ - FR-AREA-NN: [Actor] can [capability]
312
+ ```
313
+
314
+ - FR# 全局唯一,按 capability area 缩写编号(如 FR-PROFILE-01, FR-RISK-01)
315
+ - 总量 20-50 条,按 5-8 个 capability area 分组
316
+ - Capability area = **名词短语**("客户档案管理"),不是动词短语("管理客户档案")
317
+
318
+ ### Good FR examples (中文)
319
+
320
+ > ### 8.1 客户档案管理
321
+ >
322
+ > - **FR-PROFILE-01:** CSM 可以按公司名 · 标签 · 客户健康度区间检索客户档案
323
+ > - **FR-PROFILE-02:** CSM 可以查看客户的 12 个月聚合活动时间轴
324
+ > - **FR-PROFILE-03:** Admin 可以为客户档案添加自定义标签(最多 20 个/客户)
325
+ >
326
+ > ### 8.2 风险预警
327
+ >
328
+ > - **FR-RISK-01:** 系统可以基于规则引擎对客户产生风险评分(0-100)
329
+ > - **FR-RISK-02:** CSM 可以接收 24 小时内未触达的高风险客户提醒
330
+
331
+ ### FR Anti-patterns (per AP-03 implementation leakage / AP-04 复合需求)
332
+
333
+ > ❌ "**FR-X:** 系统使用 PostgreSQL 存储客户档案并通过 Redis 缓存查询结果"
334
+ > 修复:剔除技术名词 → "FR-PROFILE-04: 客户档案查询 p95 < 200ms"(这条本应放 §9 NFR)
335
+ >
336
+ > ❌ "**FR-Y:** CSM 可以查询客户、添加标签并导出 Excel"
337
+ > 修复:拆为 3 条 FR,每条单一动作
338
+
339
+ ### Self-check (per FR)
340
+
341
+ - 单一 Actor?
342
+ - 不含技术栈名词、库名、协议名?
343
+ - 不含主观形容词("快速"/"易用")?
344
+ - 能映射到 §4 中至少一个 journey 步骤?
345
+ - 1 条 FR 能拆出 1-3 个 user story?(参见 prd-purpose.md "FR-to-Story Heuristics")
346
+
347
+ ---
348
+
349
+ ## Section 9 — Non-Functional Requirements
350
+
351
+ **Step source:** `steps-c/step-10-nonfunctional.md`
352
+ **Profile driver:** `prd-purpose.md "NFR Industry Baselines"`
353
+ **Validation refs:** D05 Measurability · D10 SMART
354
+
355
+ ### 6 dimensions
356
+
357
+ Performance · Availability · Security · Scalability · Observability · Compliance.
358
+
359
+ 每条 NFR 必须含:metric · threshold · condition · measurement method · profile reference。
360
+
361
+ ### Format
362
+
363
+ ```
364
+ - **NFR-PERF-01:** [metric] [condition] [threshold] (measured by [method])
365
+ ```
366
+
367
+ ### Good NFR examples (SaaS B2B profile)
368
+
369
+ > - **NFR-PERF-01:** API 接口在正常负载下 p95 < 500ms(APM 监控统计)
370
+ > - **NFR-AVAIL-01:** 工作时间(工作日 8:00-22:00)月度 SLA ≥ 99.9%(云厂商 SLA 监控)
371
+ > - **NFR-SEC-01:** 客户对话数据传输强制 TLS 1.2+,静态加密 AES-256(架构评审条目)
372
+ > - **NFR-SCALE-01:** 单租户支持并发 1000 用户,横向扩容时间 ≤ 5 分钟(压测报告)
373
+ > - **NFR-OBS-01:** 关键链路 trace 覆盖率 ≥ 95%,错误率告警延迟 < 5 分钟(Grafana SLO)
374
+ > - **NFR-COMP-01:** 审计日志保留 ≥ 180 天(数据归档策略)
375
+
376
+ ### NFR Anti-pattern
377
+
378
+ > ❌ "**NFR-X:** 系统应具备良好的扩展性和稳定性"
379
+ >
380
+ > 修复:拆出 NFR-SCALE-01(横向扩容 ≤ 5 分钟)+ NFR-AVAIL-01(SLA ≥ 99.9%),各带阈值。
381
+
382
+ ---
383
+
384
+ ## Traceability Matrix
385
+
386
+ **Built by:** `steps-c/step-11-polish.md`
387
+
388
+ A table with one row per FR. Columns:
389
+
390
+ | FR ID | Capability Area | Maps to Vision | Maps to Success Criteria | Maps to Journey Step |
391
+ | ---------------- | --------------- | -------------- | ------------------------ | -------------------- |
392
+ | FR-PROFILE-01 | 客户档案管理 | §1 价值主张 1 | SC-03 检索效率 | §4.CSM日检视 step 2 |
393
+
394
+ A FR with empty "Maps to" cells is a validation D06 Traceability failure.
395
+
396
+ ---
397
+
398
+ ## FR Numbering & Capability Area Naming
399
+
400
+ - Capability area names: 名词短语(中英均可,与 `{document_output_language}` 一致)
401
+ - Suggested prefixes: `PROFILE`, `JOURNEY`, `RISK`, `SUMMARY`, `TICKET`, `TENANT`, `AUTH`, ...
402
+ - FR ID format: `FR-<AREA>-<NN>`,编号从 01 起,**不复用**已删除的编号
403
+ - 跨章节引用 FR 时使用全 ID(避免歧义)
404
+
405
+ ---
406
+
407
+ ## When to Skip Sections
408
+
409
+ | Project type | Skip | Mark as "N/A" |
410
+ | ---------------- | ------------- | -------------------- |
411
+ | api_backend | - | §4 (replace with API consumer scenarios), §6 if internal |
412
+ | cli_tool | - | §4 (replace with CLI usage scenarios) |
413
+ | internal_tool | - | §6 if no external competition |
414
+ | general / low complexity | - | §5, §6 |
415
+
416
+ 详见 `../data/project-types.csv` 的 `skip_sections` 列。
417
+
418
+ ---
419
+
420
+ ## Dual-Audience Writing Tips
421
+
422
+ - **Section headers must be `## Level 2`** — used by LLMs as anchors
423
+ - **One concept per paragraph** — LLMs chunk on paragraph boundaries
424
+ - **Tables for matrices, lists for enumerations** — never inline lists in prose
425
+ - **Cross-references use `§N` or full FR ID** — keeps anchor stable
426
+ - **Avoid forward references** — every section should be self-contained
427
+
428
+ For the full dual-audience checklist, see `../data/prd-purpose.md` "Dual-Audience Checklist".
@@ -2,9 +2,107 @@
2
2
  stepsCompleted: []
3
3
  inputDocuments: []
4
4
  workflowType: 'prd'
5
+ templateVersion: '2.0-m1'
6
+ densityLevel: ''
7
+ domainTier: ''
8
+ projectType: ''
9
+ version: '0.1.0'
5
10
  ---
6
11
 
7
- # Product Requirements Document - {{project_name}}
12
+ # 产品需求文档(PRD) {{project_name}}
8
13
 
9
- **Author:** {{user_name}}
10
- **Date:** {{date}}
14
+ **作者:** {{user_name}} **日期:** {{date}} **版本:** {{version}}
15
+
16
+ <!--
17
+ ================================================================================
18
+ PRD STRUCTURE — 9 required sections (per prd-purpose.md)
19
+
20
+ Each section is a placeholder ({{xxx_body}}) to be filled by the create-prd
21
+ workflow (steps-c/step-02c through step-10). Section-level guidance, good/bad
22
+ examples, and naming conventions live in:
23
+
24
+ ./prd-skeleton-reference.md
25
+
26
+ For PRD philosophy, density rules, SMART criteria, FR/NFR anti-patterns,
27
+ NFR industry baselines, and Chinese-language patterns, see:
28
+
29
+ ../data/prd-purpose.md
30
+
31
+ For upstream input expectations (Analyst → PM contract), see:
32
+
33
+ ../data/upstream-input-contract.md
34
+
35
+ Transitional note (M1):
36
+ step-c steps still append at end-of-file. Until step-c migrates to
37
+ placeholder-replacement semantics (M3), step-11-polish must scan for any
38
+ residual {{...}} markers and resolve them before completion.
39
+ ================================================================================
40
+ -->
41
+
42
+ ## 1. Executive Summary
43
+ <!-- Purpose: Vision · Problem · Target Users · Value Prop · Differentiation
44
+ Length: 3-5 short paragraphs (≤120 chars each)
45
+ Source: step-02c (synthesized from steps 2 + 2b)
46
+ Anti: 口号化目标 (AP-01) · 模糊主语 (AP-02) -->
47
+ {{executive_summary_body}}
48
+
49
+ ## 2. Success Criteria
50
+ <!-- Purpose: 3-7 SMART metrics
51
+ Each: baseline · target · measurement method · time window
52
+ Source: step-03
53
+ Anti: 量词缺失 (AP-05) -->
54
+ {{success_criteria_body}}
55
+
56
+ ## 3. Product Scope
57
+ <!-- Purpose: In-Scope · Out-of-Scope · Future Phases (MVP → Growth → Vision)
58
+ Format: list-only, no slogans
59
+ Source: step-08 -->
60
+ {{product_scope_body}}
61
+
62
+ ## 4. User Journeys
63
+ <!-- Purpose: per-persona end-to-end journey
64
+ Each: 5-9 steps · touchpoints · emotion notes
65
+ Source: step-04 -->
66
+ {{user_journeys_body}}
67
+
68
+ ## 5. Domain Requirements
69
+ <!-- Purpose: mandatory compliance · industry terms · external dependencies
70
+ Driver: domain-complexity.csv (auto-detected in step-02-discovery)
71
+ Empty: write "N/A — general domain"
72
+ Source: step-05 -->
73
+ {{domain_requirements_body}}
74
+
75
+ ## 6. Innovation Analysis
76
+ <!-- Purpose: differentiation · novelty · competitive risk
77
+ Empty: write "N/A"
78
+ Source: step-06 -->
79
+ {{innovation_body}}
80
+
81
+ ## 7. Project-Type Requirements
82
+ <!-- Purpose: platform-specific needs (saas_b2b / api_backend / mobile_app / ...)
83
+ Driver: project-types.csv (required_sections · skip_sections)
84
+ Source: step-07 -->
85
+ {{project_type_body}}
86
+
87
+ ## 8. Functional Requirements
88
+ <!-- Purpose: 20-50 FRs grouped into 5-8 capability areas
89
+ Format: FR-AREA-NN: [Actor] can [capability]
90
+ Anti: implementation leakage (AP-03) · 复合需求 (AP-04) · subjective adjectives
91
+ Source: step-09 -->
92
+ {{functional_requirements_body}}
93
+
94
+ ## 9. Non-Functional Requirements
95
+ <!-- Purpose: 6 dimensions — Performance · Availability · Security · Scalability · Observability · Compliance
96
+ Each: quantitative threshold + measurement method
97
+ Profile: SaaS B2B / Internal Tool / High-concurrency C-end (see prd-purpose.md "NFR Industry Baselines")
98
+ Source: step-10
99
+ Anti: unmeasurable claim · missing context -->
100
+ {{nonfunctional_requirements_body}}
101
+
102
+ ---
103
+
104
+ ## Traceability Matrix
105
+ <!-- Built by step-11-polish:
106
+ Vision (§1) → Success Criteria (§2) → User Journey (§4) → FR (§8) → Capability Area
107
+ Format: table with one row per FR -->
108
+ {{traceability_matrix}}
@@ -47,3 +47,7 @@ agent:
47
47
  - trigger: AFP or fuzzy match on auto-full
48
48
  exec: "skill:auto-full-pipeline"
49
49
  description: "[AFP] Auto Full Pipeline: End-to-end automated requirements-to-delivery — from requirements analysis through PRD, epics, architecture, sprint planning, and story development"
50
+
51
+ - trigger: APS or fuzzy match on auto-prd-to-stories
52
+ exec: "skill:auto-prd-to-stories"
53
+ description: "[APS] Auto PRD-to-Stories: From an existing prd.md, generate epics + per-story detailed files. STOPS before dev/review/test so business architects can evaluate user-story quality"
@@ -0,0 +1,14 @@
1
+ dimension_id,dimension_name,validation_step_ref,weight,pass_criteria,partial_criteria,fail_criteria,gate_threshold,evidence_required,detection_signals,auto_check_hint,severity_on_fail,remediation_hint
2
+ D01,Discovery Completeness,step-v-01-discovery,5,"All inputDocuments loaded; PRD format detected (XiaoMa or Legacy); workflow state confirmed","PRD found but format detection ambiguous; one or more inputDocuments unloadable","No PRD file found OR workflow state unrecognizable","pass=any non-fail","PRD path; inputDocuments list; format detection result","missing inputDocuments frontmatter; missing workflowType field","frontmatter has inputDocuments[] non-empty; workflowType=='prd'",minor,"Re-run xiaoma-create-prd step-01 discovery; verify {planning_artifacts} path"
3
+ D02,Format & Parity,step-v-02-format-detection + step-v-02b-parity-check,6,"Document follows XiaoMa 9-section structure OR legacy version passes parity check vs canonical","Section order non-standard but all 9 sections present; or legacy with ≤2 parity gaps","≥1 required section missing OR section names misaligned with prd-purpose.md canonical","80% of weight (4.8/6)","section header list with line numbers; parity diff if legacy","missing ## Level-2 section header; out-of-order sections; renamed canonical sections","regex /^## (\d+\.\s)?(Executive Summary|Success Criteria|Product Scope|User Journeys|Domain|Innovation|Project-Type|Functional|Non-Functional|产品|用户旅程|功能需求|非功能需求)/; expect 9 matches",major,"See prd-skeleton-reference.md for canonical section names; legacy → run xiaoma-edit-prd legacy-conversion"
4
+ D03,Information Density,step-v-03-density-validation,10,"<3 fluff phrases per 100 lines; no slogan-style Executive Summary; FR/NFR bullets dense","3-7 fluff phrases per 100 lines","≥8 fluff phrases per 100 lines OR slogan-driven §1 (matches AP-01 signals)","70% of weight (7/10)","fluff phrase count; sample line numbers per phrase","打造|业界领先|一站式|赋能|数字化转型|智能化|全方位|the system will allow|it is important to note|in order to","grep -ciE '<signals>' prd.md; ratio = matches / non-blank-lines",major,"See prd-purpose.md Anti-Patterns + AP-01 口号化目标; rewrite Executive Summary with concrete metrics"
5
+ D04,Brief Coverage,step-v-04-brief-coverage-validation,8,"All upstream-input-contract.md §3 'required: yes' fields mapped to PRD §; contract-check.json passed=true","≤3 TBDs unresolved; missing_required.length == 0","missing_required.length > 0 OR tbds.length > 3","75% of weight (6/8)","contract-check.json; PRD section diff vs brief fields list","TBD: <field> from <artifact>; missing source heading; brief field absent from mapped PRD §","load contract-check.json from {planning_artifacts}; count missing_required and tbds arrays",major,"See upstream-input-contract.md missing-field strategy; complete required fields or resolve TBD markers"
6
+ D05,Measurability,step-v-05-measurability-validation,12,"All FRs follow '[Actor] can [capability]'; all NFRs carry metric+threshold+measurement+window; total violations <5","5-10 violations across FR+NFR; format compliant but some context missing",">10 violations OR any NFR without measurement method OR ≥1 NFR with subjective adjective only","80% of weight (9.6/12)","violation list per FR/NFR with line numbers; severity tally","easy|fast|simple|intuitive|user-friendly|responsive|quick|efficient|快速|易用|简单|高效|流畅|稳定|良好|显著|明显|多个|若干|各种","grep FR/NFR sections for signals; count FRs not matching '[Actor] can' pattern; count NFRs missing numeric threshold",blocker,"See prd-purpose.md SMART rules + AP-05 量词缺失; add baseline+target+measurement+window per NFR; rewrite subjective FRs with metrics"
7
+ D06,Traceability,step-v-06-traceability-validation,12,"Vision (§1) → Success Criteria (§2) → User Journey (§4) → FR (§8) chain complete; Traceability Matrix populated with row per FR","Matrix exists but ≤20% FRs have empty 'Maps to' cells","Matrix missing OR >20% FRs have empty mappings OR ≥1 FR with no journey/success linkage","80% of weight (9.6/12)","Traceability Matrix table; FR list with link verification per FR","FR without §1/§2/§4 reference; capability area absent from §3 scope; orphan FR","for each FR-AREA-NN: search Traceability Matrix row presence; verify all 4 mapping cells non-empty",blocker,"Run/rebuild Traceability Matrix in step-11-polish; ensure each FR maps to vision + success criterion + journey step"
8
+ D07,Implementation Leakage,step-v-07-implementation-leakage-validation,8,"Zero technology proper nouns in §1, §2, §4, §8; library/framework names absent from capability descriptions","1-3 leakages, all confined to §7 Project-Type Requirements (acceptable in tech context)",">3 leakages OR any leakage in §1, §2, §4, §8","80% of weight (6.4/8)","leaked terms list with §section + line numbers","Redis|PostgreSQL|MongoDB|MySQL|Kafka|RabbitMQ|JWT|OAuth|WebSocket|React|Vue|Angular|Spring|Django|Express|Docker|Kubernetes|AWS|GCP|Azure|gRPC|GraphQL|REST(?!\sAPI)","grep -nE '<signals>' in §1-§4 and §8 sections only",major,"See prd-purpose.md AP-03 实现泄漏; restate as capability or relocate quantitative facts to §9 NFR"
9
+ D08,Domain Compliance,step-v-08-domain-compliance-validation,10,"All special_sections from domain-complexity.csv for detected domain are present and substantive (>200 chars each)","1 special section missing OR present as stub (<200 chars)","≥2 special sections missing for high-complexity domain (healthcare/fintech/govtech/aerospace/automotive/etc.)","80% of weight (8/10)","domain detected from frontmatter or §1 signals; required special_sections from CSV; PRD §5 content","domain ∈ high-complexity AND §5 missing OR labeled N/A; missing regulatory mention; absent industry terminology table","load domain-complexity.csv; resolve detected domain; cross-check special_sections column tokens vs §5 H3 headers",blocker,"Expand §5 per domain-complexity.csv special_sections column; consult domain-research.md for regulatory landscape"
10
+ D09,Project-Type Fit,step-v-09-project-type-validation,7,"All project-types.csv required_sections for detected project_type are covered in §7; skip_sections marked N/A explicitly","1 required_section thin (<150 chars) or missing","≥2 required_sections missing","75% of weight (5.25/7)","project_type detected; required_sections coverage matrix","project_type detected AND §7 missing required area; required area present but <100 chars","load project-types.csv; verify required_sections (e.g., tenant_model for saas_b2b) appear as H3 in §7",major,"Expand §7 per project-types.csv required_sections; consult technical-research.md"
11
+ D10,SMART (FR/NFR),step-v-10-smart-validation,12,"Every FR and NFR passes Specific/Measurable/Attainable/Relevant/Traceable; zero AP-04 复合需求 patterns","1-3 FRs/NFRs fail one S/M/A/R/T criterion (but not Measurability which is D05)",">3 FRs/NFRs fail OR ≥1 compound FR with multiple verbs / connectives (且|并|同时|and...and)","80% of weight (9.6/12)","per-FR/NFR SMART scorecard; compound-FR list","且|并|同时|以及|并且|FR with >1 action verb; NFR without baseline; capability spans 2+ data objects","for each FR: tokenize verbs and check connectives; for each NFR: regex for numeric threshold and measurement method",blocker,"See prd-purpose.md FR-to-Story Heuristics rules 1-4 + AP-04 复合需求; split compound FRs by Actor/Verb/Object/Channel axes"
12
+ D11,Holistic Quality,step-v-11-holistic-quality-validation,5,"Cross-section consistency; §3 scope items each represented as ≥1 FR; tone uniform; no contradictions","1-2 minor inconsistencies (e.g., MVP item without explicit FR but capability implied)","Major contradictions: feature in MVP scope with no corresponding FR/NFR; vision claims unsupported by §2","60% of weight (3/5)","cross-reference consistency checks; scope-to-FR coverage matrix","scope item not represented as FR; FR with no scope phase tag; vision claim without §2 metric","for each §3 MVP scope item: search §8 for matching capability area or FR; flag uncovered items",minor,"Reconcile §3 with §8 — every MVP scope item must be at least one FR; every vision claim must have ≥1 success criterion"
13
+ D12,Completeness,step-v-12-completeness-validation,5,"All 9 required sections present and non-trivial (>200 chars or explicit N/A justification); frontmatter fields complete (densityLevel/domainTier/projectType/version)","Sections present but 1-2 are stubs (<200 chars without justification)","Required section missing OR ≥3 stubs OR frontmatter missing required field","80% of weight (4/5)","section length statistics; frontmatter audit","H2 section header followed by <200 chars before next H2; missing frontmatter key; empty placeholder ({{...}}) remains","for each H2 in PRD: count chars until next H2 or EOF; verify frontmatter has templateVersion/projectType/etc.",major,"Expand stub sections; if section is N/A, write 1-sentence justification; resolve any residual {{...}} placeholders via step-11-polish"
14
+ D13,Dual-Audience Readiness,step-v-13-report-complete (fused — informational),0,"Skim/Skip/Scan + Chunk/Anchor/Cite checklist (8 items in prd-purpose.md) all green","1-2 checklist items fail","≥3 checklist items fail","informational; not gating","checklist results per item with line numbers","section without summary opener; cross-ref using vague descriptor instead of FR-AREA-NN; forward references; inline lists in prose","scan for cross-refs not matching FR-[A-Z]+-\\d{2,}; check each H2 opener length and self-containedness",minor,"See prd-purpose.md Dual-Audience Writing Checklist; rewrite cross-references with full FR IDs; ensure each section opens with 1-2 sentence summary"
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: xiaoma-auto-prd-to-stories
3
+ description: "Automated PRD-to-Stories pipeline (NO development): prd.md → epics → sprint-status → per-story detailed files. Stops before dev/review/QA so business architects can evaluate user-story quality. Use when the user says 'PRD 转故事', 'auto prd to stories', or 'APS'"
4
+ ---
5
+
6
+ Follow the instructions in [workflow.md](workflow.md).
@@ -0,0 +1,43 @@
1
+ # Auto PRD-to-Stories Pipeline Completion Checklist
2
+
3
+ Use this checklist to validate the PRD-to-Stories pipeline completed successfully. This pipeline stops BEFORE development, so only planning + sprint-status + per-story files are in scope.
4
+
5
+ ## Phase 1 — Epics Creation Validation
6
+
7
+ - [ ] **Input PRD Present** — `{planning_artifacts}/prd.md` exists and was readable at pipeline start
8
+ - [ ] **Epics Created** — `{planning_artifacts}/epics.md` exists with full epic/story breakdown
9
+ - [ ] **PRD Coverage** — Every major functional requirement in `prd.md` is covered by at least one epic
10
+ - [ ] **Story Granularity** — Every epic contains at least one user story
11
+ - [ ] **Acceptance Criteria Present** — Every story has BDD-formatted acceptance criteria (Given/When/Then)
12
+
13
+ ## Phase 2 — Sprint Planning Bridge Validation
14
+
15
+ - [ ] **Sprint Status Generated** — `{implementation_artifacts}/sprint-status.yaml` exists with valid YAML
16
+ - [ ] **All Epics Represented** — Every epic from `epics.md` has an `epic-N` entry in sprint status
17
+ - [ ] **All Stories Represented** — Every story from `epics.md` has a `N-N-kebab-name` entry in sprint status
18
+
19
+ ## Phase 3 — Per-Story File Generation Validation
20
+
21
+ - [ ] **One File Per Story** — Every story key in sprint-status.yaml has a corresponding `{implementation_artifacts}/{story_key}.md` file (excluding failed keys)
22
+ - [ ] **Top-Level Sections Present** — Every story file contains: `Status`, `Story`, `Acceptance Criteria`, `Tasks / Subtasks`, `Dev Notes`
23
+ - [ ] **Dev Notes Detailed-Design Subsections Present** — Every story file's `Dev Notes` contains these three mandatory subsections (per the step-04 Detailed Design Output Contract):
24
+ - [ ] `Functional Requirements Addressed` — lists FR/feature references from prd.md or epics.md
25
+ - [ ] `Data Model & Database Design` — concrete tables/fields/constraints/indexes OR an explicit `TBD by architect` line with reason
26
+ - [ ] `Implementation Logic` — concrete interface signatures / algorithm / state machine / error handling OR an explicit `TBD by architect` line with reason
27
+ - [ ] **No Silent Omissions** — No story file contains a Dev Notes subsection that is only a heading with no body content
28
+ - [ ] **Story Status Correct** — Every successfully created story file has `Status: ready-for-dev`
29
+ - [ ] **No Stories Beyond ready-for-dev** — No story file shows status `in-progress`, `review`, or `done` (this pipeline never enters those states)
30
+ - [ ] **Failed Stories Documented** — Any story key in `failed_story_keys` has its failure recorded in the final report with an error reason
31
+
32
+ ## Cross-Phase Traceability Validation
33
+
34
+ - [ ] **FR Coverage Map Filled** — `epics.md` contains a `### FR Coverage Map` section with concrete `FR-N → Epic X / Story X.Y` mappings (not raw `{{placeholder}}`)
35
+ - [ ] **FR Reverse Traceability** — Every functional requirement extracted from `prd.md` is referenced by at least one story file (verified by step-05's reverse-traceability check). Uncovered FRs are documented in Structural Warnings.
36
+
37
+ ## Pipeline-Level Validation
38
+
39
+ - [ ] **All 5 Master Steps Executed** — Steps 1–5 completed without HALT (or HALT properly reported)
40
+ - [ ] **No Dev/Review/Test Side Effects** — No code files modified outside `{planning_artifacts}` and `{implementation_artifacts}`
41
+ - [ ] **Phase Boundary Summaries Output** — End-of-phase state snapshots logged for context-recovery
42
+ - [ ] **Final Report Generated** — step-05 produced a unified completion report listing all artifacts and counts
43
+ - [ ] **Artifact Consistency** — `sprint-status.yaml` story keys match story files on disk one-to-one (allowing for documented failures)