@openprd/cli 0.1.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 (154) hide show
  1. package/.openprd/README.md +82 -0
  2. package/.openprd/benchmarks/evidence/milvus-io-ai-code-review-gets-better-when-models-debate-claude-vs-gemini-vs-code.md +14 -0
  3. package/.openprd/benchmarks/evidence/nolanlawson-com-using-ai-to-write-better-code-more-slowly.md +14 -0
  4. package/.openprd/benchmarks/index.md +37 -0
  5. package/.openprd/benchmarks/sources.yaml +56 -0
  6. package/.openprd/config.yaml +50 -0
  7. package/.openprd/discovery/config.json +21 -0
  8. package/.openprd/engagements/active/flows.md +30 -0
  9. package/.openprd/engagements/active/handoff.md +9 -0
  10. package/.openprd/engagements/active/intake.md +15 -0
  11. package/.openprd/engagements/active/prd.md +161 -0
  12. package/.openprd/engagements/active/review.html +61 -0
  13. package/.openprd/engagements/active/roles.md +21 -0
  14. package/.openprd/engagements/work-units/wu-20260524015648-6d33ded7.json +23 -0
  15. package/.openprd/exports/.gitkeep +0 -0
  16. package/.openprd/knowledge/index.json +7 -0
  17. package/.openprd/quality/config.json +229 -0
  18. package/.openprd/reviews/v0001.html +1256 -0
  19. package/.openprd/schema/diagram-architecture.schema.yaml +49 -0
  20. package/.openprd/schema/diagram-product-flow.schema.yaml +52 -0
  21. package/.openprd/schema/prd.schema.yaml +121 -0
  22. package/.openprd/sessions/.gitkeep +0 -0
  23. package/.openprd/standards/config.json +88 -0
  24. package/.openprd/standards/file-manual-template.md +28 -0
  25. package/.openprd/standards/folder-readme-template.md +28 -0
  26. package/.openprd/state/.gitkeep +0 -0
  27. package/.openprd/state/changes.json +12 -0
  28. package/.openprd/state/current.json +169 -0
  29. package/.openprd/state/version-index.json +15 -0
  30. package/.openprd/state/versions/.gitkeep +0 -0
  31. package/.openprd/state/versions/v0001.json +121 -0
  32. package/.openprd/state/versions/v0001.md +161 -0
  33. package/.openprd/templates/agent/intake.md +6 -0
  34. package/.openprd/templates/agent/prd.md +21 -0
  35. package/.openprd/templates/b2b/intake.md +6 -0
  36. package/.openprd/templates/b2b/prd.md +24 -0
  37. package/.openprd/templates/base/intake.md +18 -0
  38. package/.openprd/templates/base/prd.md +67 -0
  39. package/.openprd/templates/company/README.md +10 -0
  40. package/.openprd/templates/consumer/intake.md +6 -0
  41. package/.openprd/templates/consumer/prd.md +19 -0
  42. package/.openprd/templates/diagram/architecture.contract.json +53 -0
  43. package/.openprd/templates/diagram/product-flow.contract.json +76 -0
  44. package/.openprd/templates/industry/README.md +16 -0
  45. package/.openprd/templates/manifest.yaml +27 -0
  46. package/.openprd/templates/project/README.md +14 -0
  47. package/.openprd/templates/session/README.md +14 -0
  48. package/AGENTS.md +44 -0
  49. package/CONTRIBUTING.md +30 -0
  50. package/LICENSE +21 -0
  51. package/README.md +727 -0
  52. package/README_CN.md +583 -0
  53. package/SECURITY.md +23 -0
  54. package/bin/openprd.js +5 -0
  55. package/docs/assets/openprd-capability-overview-en.png +0 -0
  56. package/docs/assets/openprd-capability-overview-zh.png +0 -0
  57. package/docs/assets/openprd-learning-html.png +0 -0
  58. package/docs/assets/openprd-quality-html.png +0 -0
  59. package/docs/assets/openprd-review-html.png +0 -0
  60. package/docs/assets/openprd-scenario-overview.png +0 -0
  61. package/docs/assets/openprd-scenario-overview.svg +114 -0
  62. package/docs/assets/openprd-self-evolving-mechanisms-en.png +0 -0
  63. package/docs/assets/openprd-self-evolving-mechanisms-zh.png +0 -0
  64. package/docs/assets/openprd-visual-compare-case-study-en.png +0 -0
  65. package/docs/assets/openprd-visual-compare-case-study-zh.png +0 -0
  66. package/package.json +59 -0
  67. package/scripts/openprd-dev-check.mjs +5 -0
  68. package/scripts/openprd-review-presentation.mjs +82 -0
  69. package/skills/openprd-benchmark-router/SKILL.md +92 -0
  70. package/skills/openprd-benchmark-router/agents/openai.yaml +4 -0
  71. package/skills/openprd-benchmark-router/references/benchmark-sources.md +74 -0
  72. package/skills/openprd-benchmark-router/references/evaluation-lenses.md +66 -0
  73. package/skills/openprd-benchmark-router/references/source-policy.md +35 -0
  74. package/skills/openprd-diagram-review/SKILL.md +91 -0
  75. package/skills/openprd-diagram-review/agents/openai.yaml +4 -0
  76. package/skills/openprd-diagram-review/examples/architecture-zh.md +8 -0
  77. package/skills/openprd-diagram-review/examples/product-flow-zh.md +7 -0
  78. package/skills/openprd-diagram-review/references/cocoon-patterns.md +17 -0
  79. package/skills/openprd-diagram-review/references/diagram-contracts.md +126 -0
  80. package/skills/openprd-diagram-review/references/review-checklist.md +10 -0
  81. package/skills/openprd-discovery-loop/SKILL.md +196 -0
  82. package/skills/openprd-discovery-loop/agents/openai.yaml +3 -0
  83. package/skills/openprd-harness/SKILL.md +179 -0
  84. package/skills/openprd-harness/agents/openai.yaml +4 -0
  85. package/skills/openprd-harness/examples/full-workflow-zh.md +9 -0
  86. package/skills/openprd-harness/references/command-map.md +71 -0
  87. package/skills/openprd-harness/references/examples.md +26 -0
  88. package/skills/openprd-harness/references/usage-guide.md +335 -0
  89. package/skills/openprd-harness/references/workflow-gates.md +51 -0
  90. package/skills/openprd-learning-review/SKILL.md +75 -0
  91. package/skills/openprd-learning-review/agents/openai.yaml +4 -0
  92. package/skills/openprd-learning-review/references/content-contract.md +125 -0
  93. package/skills/openprd-learning-review/references/ebook-reader.md +46 -0
  94. package/skills/openprd-learning-review/references/evidence-manifest.md +55 -0
  95. package/skills/openprd-learning-review/references/genre-library.md +43 -0
  96. package/skills/openprd-learning-review/references/prompt-engineering.md +71 -0
  97. package/skills/openprd-learning-review/references/quality-rubric.md +28 -0
  98. package/skills/openprd-learning-review/references/retrieval-worked-example.md +40 -0
  99. package/skills/openprd-learning-review/references/style-packs/xianxia-cultivation.prompt.md +67 -0
  100. package/skills/openprd-quality/SKILL.md +101 -0
  101. package/skills/openprd-requirement-intake/SKILL.md +76 -0
  102. package/skills/openprd-requirement-intake/agents/openai.yaml +4 -0
  103. package/skills/openprd-requirement-intake/references/prd-template-lenses.md +105 -0
  104. package/skills/openprd-requirement-intake/references/routing-rubric.md +64 -0
  105. package/skills/openprd-router/SKILL.md +40 -0
  106. package/skills/openprd-shared/SKILL.md +142 -0
  107. package/skills/openprd-shared/agents/openai.yaml +4 -0
  108. package/skills/openprd-shared/references/language-and-review.md +50 -0
  109. package/skills/openprd-shared/references/operating-rules.md +65 -0
  110. package/skills/openprd-shared/references/skill-architecture.md +70 -0
  111. package/skills/openprd-standards/SKILL.md +79 -0
  112. package/skills/openprd-standards/agents/openai.yaml +4 -0
  113. package/src/agent-integration.js +1717 -0
  114. package/src/benchmark.js +873 -0
  115. package/src/cli/args.js +460 -0
  116. package/src/cli/print.js +1423 -0
  117. package/src/codex-hook-runner-template.mjs +2422 -0
  118. package/src/dev-standards.js +372 -0
  119. package/src/diagram-core.js +1047 -0
  120. package/src/diagram-workspace.js +262 -0
  121. package/src/discovery.js +709 -0
  122. package/src/fleet.js +531 -0
  123. package/src/fs-utils.js +83 -0
  124. package/src/growth.js +545 -0
  125. package/src/html-artifacts.js +3803 -0
  126. package/src/knowledge.js +668 -0
  127. package/src/language-policy.js +142 -0
  128. package/src/learning-review.js +1655 -0
  129. package/src/loop.js +1290 -0
  130. package/src/openprd.js +1136 -0
  131. package/src/openspec/change-lifecycle.js +359 -0
  132. package/src/openspec/change-validate.js +248 -0
  133. package/src/openspec/constants.js +12 -0
  134. package/src/openspec/execute.js +300 -0
  135. package/src/openspec/generate.js +692 -0
  136. package/src/openspec/paths.js +111 -0
  137. package/src/openspec/tasks.js +352 -0
  138. package/src/prd-core.js +656 -0
  139. package/src/quality-html-artifact.js +1414 -0
  140. package/src/quality-learning.js +658 -0
  141. package/src/quality.js +1262 -0
  142. package/src/review-presentation.js +240 -0
  143. package/src/run-harness.js +1470 -0
  144. package/src/self-update.js +329 -0
  145. package/src/session-binding.js +140 -0
  146. package/src/source-inventory.js +224 -0
  147. package/src/standards.js +914 -0
  148. package/src/time.js +33 -0
  149. package/src/visual-compare.js +216 -0
  150. package/src/work-unit-migration.js +232 -0
  151. package/src/work-unit.js +88 -0
  152. package/src/workspace-core.js +1706 -0
  153. package/src/workspace-registry.js +162 -0
  154. package/src/workspace-workflow.js +1797 -0
@@ -0,0 +1,121 @@
1
+ {
2
+ "versionNumber": 1,
3
+ "versionId": "v0001",
4
+ "createdAt": "2026-05-24 01:56:48",
5
+ "projectRoot": "/Users/chaojifeng/Projects/harness-engineer/openprd",
6
+ "workspaceRoot": "/Users/chaojifeng/Projects/harness-engineer/openprd/.openprd",
7
+ "schema": "prd-core",
8
+ "templatePack": "agent",
9
+ "productType": "agent",
10
+ "title": "Verify 边界与历史项目刷新",
11
+ "owner": "Codex",
12
+ "status": "synthesized",
13
+ "sections": {
14
+ "meta": {
15
+ "title": "Verify 边界与历史项目刷新",
16
+ "owner": "Codex",
17
+ "status": "classified",
18
+ "version": "v0001",
19
+ "productType": "agent",
20
+ "date": "2026-05-24"
21
+ },
22
+ "problem": {
23
+ "problemStatement": "修复 OpenPrd verify 边界,避免外部参考目录和 reference discovery 污染主验证,并刷新历史项目生成物。",
24
+ "whyNow": "历史项目的 verify 正在被参考目录噪音阻塞,需要尽快恢复 run/verify 的可信度。",
25
+ "evidence": []
26
+ },
27
+ "users": {
28
+ "primaryUsers": [
29
+ "维护 OpenPrd 的 Agent 工程师",
30
+ "使用 OpenPrd 管理历史项目的项目维护者"
31
+ ],
32
+ "secondaryUsers": [],
33
+ "stakeholders": []
34
+ },
35
+ "goals": {
36
+ "goals": [
37
+ "让主验证只关注当前项目源码和当前实现门禁",
38
+ "让历史项目刷新后默认获得更干净的 verify 体验"
39
+ ],
40
+ "successMetrics": [
41
+ "存在 reference discovery 时 openprd run . --context 不再默认展示它",
42
+ "仓库内常见外部参考目录在未人工归类前不再直接把 standards verify 阻塞成大面积说明书噪音",
43
+ "openprd fleet 更新后历史项目生成物包含这次修复"
44
+ ],
45
+ "acceptanceGoals": [
46
+ "run/verify 的默认结果不再把 reference discovery 或明显外部参考目录当成主门禁噪音",
47
+ "历史项目刷新后生成物能承接这次边界修复",
48
+ "对需要人工确认的 external reference 仍保留显式 classify-external 路径"
49
+ ]
50
+ },
51
+ "scope": {
52
+ "inScope": [
53
+ "调整 run context 与 run verify 对 discovery 的纳入规则",
54
+ "调整 standards/source-manual 默认对明显外部参考目录的处理策略",
55
+ "为历史项目执行 openprd fleet 更新与必要回填"
56
+ ],
57
+ "outOfScope": [
58
+ "不自动替每个历史项目猜测所有业务目录的 externalReferences 清单",
59
+ "不修改历史项目的业务代码或需求内容",
60
+ "不把人工确认 external reference 的能力删除"
61
+ ]
62
+ },
63
+ "scenarios": {
64
+ "primaryFlows": [
65
+ "维护者运行 openprd run . --context 或 openprd run . --verify 时,只看到当前项目主验证状态;仓库中存在 research、toolkit-sources、marketplace-candidates 等参考目录时,默认不会被当成本项目源码说明书缺口直接淹没结果;维护者可以继续按需显式 classify-external。"
66
+ ],
67
+ "edgeCases": [],
68
+ "failureModes": [
69
+ "reference discovery 仍然混入 run context 或 run verify",
70
+ "standards verify 继续被 research 或 toolkit-sources 之类参考目录的说明书缺口淹没",
71
+ "fleet 更新后历史项目仍保留旧的 verify 噪音行为"
72
+ ]
73
+ },
74
+ "requirements": {
75
+ "functional": [],
76
+ "nonFunctional": [],
77
+ "businessRules": []
78
+ },
79
+ "businessGuardrails": {
80
+ "costDrivers": [],
81
+ "usageLimits": [],
82
+ "abusePrevention": [],
83
+ "monitoringSignals": [],
84
+ "alertThresholds": [],
85
+ "stopLossActions": []
86
+ },
87
+ "constraints": {
88
+ "technical": [],
89
+ "compliance": [],
90
+ "dependencies": []
91
+ },
92
+ "risks": {
93
+ "assumptions": [],
94
+ "risks": [],
95
+ "openQuestions": [
96
+ "本次只收敛默认边界,不自动猜测每个历史项目全部 external reference 清单;如果某些项目还需要更细的目录级归类,仍由维护者显式确认和补充"
97
+ ]
98
+ },
99
+ "handoff": {
100
+ "owner": "Codex",
101
+ "nextStep": "评审已生成的 PRD,并准备交接。",
102
+ "targetSystem": "OpenSpec"
103
+ },
104
+ "typeSpecific": {
105
+ "kind": "agent",
106
+ "title": "Agent 专项",
107
+ "fields": {
108
+ "humanAgentContract": "Agent 可以识别并提示 reference discovery 与外部参考目录边界,但把目录正式归类为 external reference 仍需要人确认;批量刷新历史项目可以自动执行。",
109
+ "autonomyBoundary": "Agent 可以修改 OpenPrd CLI、补测试、更新文档、运行 fleet dry-run 与 update-openprd/backfill-work-units,并验证结果;不得静默把任意历史目录永久归类为 external reference。",
110
+ "toolBoundary": "使用本地代码检索、OpenPrd CLI、自带测试、fleet 更新、doctor 与 verify 完成实现和验证;本次不需要外部第三方文档调研。",
111
+ "stateModel": "需要保留三类状态:当前项目源码验证状态、reference discovery 状态、standards external reference 显式配置;主 run/verify 只默认消费第一类,其他两类按边界显式暴露。",
112
+ "evalPlan": "通过针对 run-harness、standards 和 fleet 的单测与集成验证评估;再用历史项目 dry-run 与 update-openprd/backfill-work-units 验证刷新结果。"
113
+ }
114
+ }
115
+ },
116
+ "reviewPresentation": null,
117
+ "workUnitId": "wu-20260524015648-6d33ded7",
118
+ "targetRoot": "/Users/chaojifeng/Projects/harness-engineer/openprd",
119
+ "content": "# Verify 边界与历史项目刷新\n> 语言规则:除 PRD、OpenPrd、OpenSpec、API、SDK、CLI、TypeScript、JSON、HTTP、WebSocket、字段 key、命令名、产品名和协议名等必要专有名词外,用户可见内容应使用简体中文。\n- 版本: v0001\n- 负责人: Codex\n- 产品类型: agent\n- 模板包: agent\n- 状态: synthesized\n- 生成时间: 2026-05-24 01:56:48\n## 元信息\n\n- 标题: Verify 边界与历史项目刷新\n- 负责人: Codex\n- 状态: classified\n- 版本: v0001\n- 产品类型: agent\n- 日期: 2026-05-24\n\n## 问题\n\n- 问题陈述: 修复 OpenPrd verify 边界,避免外部参考目录和 reference discovery 污染主验证,并刷新历史项目生成物。\n- 为什么是现在: 历史项目的 verify 正在被参考目录噪音阻塞,需要尽快恢复 run/verify 的可信度。\n- 证据:\n - 待补充\n\n## 用户与相关方\n\n- 主要用户:\n - 维护 OpenPrd 的 Agent 工程师\n - 使用 OpenPrd 管理历史项目的项目维护者\n- 次要用户:\n - 待补充\n- 相关方:\n - 待补充\n\n## 目标与成功标准\n\n- 目标:\n - 让主验证只关注当前项目源码和当前实现门禁\n - 让历史项目刷新后默认获得更干净的 verify 体验\n- 成功指标:\n - 存在 reference discovery 时 openprd run . --context 不再默认展示它\n - 仓库内常见外部参考目录在未人工归类前不再直接把 standards verify 阻塞成大面积说明书噪音\n - openprd fleet 更新后历史项目生成物包含这次修复\n- 验收目标:\n - run/verify 的默认结果不再把 reference discovery 或明显外部参考目录当成主门禁噪音\n - 历史项目刷新后生成物能承接这次边界修复\n - 对需要人工确认的 external reference 仍保留显式 classify-external 路径\n\n## 范围与非目标\n\n- 范围内:\n - 调整 run context 与 run verify 对 discovery 的纳入规则\n - 调整 standards/source-manual 默认对明显外部参考目录的处理策略\n - 为历史项目执行 openprd fleet 更新与必要回填\n- 范围外:\n - 不自动替每个历史项目猜测所有业务目录的 externalReferences 清单\n - 不修改历史项目的业务代码或需求内容\n - 不把人工确认 external reference 的能力删除\n\n## 场景与流程\n\n- 主流程:\n - 维护者运行 openprd run . --context 或 openprd run . --verify 时,只看到当前项目主验证状态;仓库中存在 research、toolkit-sources、marketplace-candidates 等参考目录时,默认不会被当成本项目源码说明书缺口直接淹没结果;维护者可以继续按需显式 classify-external。\n- 边界情况:\n - 待补充\n- 失败模式:\n - reference discovery 仍然混入 run context 或 run verify\n - standards verify 继续被 research 或 toolkit-sources 之类参考目录的说明书缺口淹没\n - fleet 更新后历史项目仍保留旧的 verify 噪音行为\n\n## 可视化图表\n\n### 产品流程\n\n```mermaid\nflowchart LR\n entry[\"入口触发<br/>维护者运行 openprd run . --context 或 openprd run . --verify 时,只看到当前项…\"]\n experience[\"产品内步骤<br/>修复 OpenPrd verify 边界,避免外部参考目录和 reference discovery 污染主验证,并刷新历史项…\"]\n decision{\"决策点<br/>边界情况仍需澄清\"}\n success([\"成功结果<br/>存在 reference discovery 时 openprd run . --context 不再默认展示它\"])\n failure[[\"失败与恢复<br/>reference discovery 仍然混入 run context 或 run verify\"]]\n entry -->|\"维护者运行 openprd run . --context 或 openprd r…\"| experience\n experience -->|\"系统处理请求\"| decision\n decision -->|\"让主验证只关注当前项目源码和当前实现门禁\"| success\n decision -.->|\"reference discovery 仍然混入 run context 或 ru…\"| failure\n```\n\n### 架构\n\n```mermaid\nflowchart LR\n users[\"主要用户<br/>维护 OpenPrd 的 Agent 工程师 · 使用 OpenPrd 管理历史项目的项目维护者\"]\n subgraph solution[\"方案边界\"]\n experience[\"Agent 运行层<br/>维护者运行 openprd run . --context 或 openprd run . --verify 时,只看到当前项…\"]\n core[\"核心产品逻辑<br/>修复 OpenPrd verify 边界,避免外部参考目录和 reference discovery 污染主验证,并刷新历史项…\"]\n integrations[\"依赖与集成<br/>暂无外部依赖记录\"]\n governance[[\"约束与可靠性<br/>暂无明确约束\"]]\n delivery[\"验证与交接<br/>存在 reference discovery 时 openprd run . --context 不再默认展示它 · 仓库内常…\"]\n end\n users -->|\"维护者运行 openprd run . --context 或 openprd…\"| experience\n experience -->|\"产品动作与编排\"| core\n core -->|\"依赖与外部服务\"| integrations\n core -.->|\"策略、可靠性与合规\"| governance\n core -->|\"成功标准与交接\"| delivery\n integrations -->|\"运营就绪\"| delivery\n governance -.->|\"评审与确认\"| delivery\n```\n\n## 需求\n\n- 功能需求:\n - 待补充\n- 非功能需求:\n - 待补充\n- 业务规则:\n - 待补充\n\n## 业务护栏\n\n- 成本来源:\n - 待补充\n- 额度与限制:\n - 待补充\n- 滥用防护:\n - 待补充\n- 监控信号:\n - 待补充\n- 报警阈值:\n - 待补充\n- 止损动作:\n - 待补充\n\n## 约束、依赖与风险\n\n- 技术约束:\n - 待补充\n- 合规要求:\n - 待补充\n- 依赖:\n - 待补充\n- 假设:\n - 待补充\n- 风险:\n - 待补充\n- 开放问题:\n - 本次只收敛默认边界,不自动猜测每个历史项目全部 external reference 清单;如果某些项目还需要更细的目录级归类,仍由维护者显式确认和补充\n\n## 类型专项模块\n\n- 类型: Agent 专项\n- humanAgentContract: Agent 可以识别并提示 reference discovery 与外部参考目录边界,但把目录正式归类为 external reference 仍需要人确认;批量刷新历史项目可以自动执行。\n- autonomyBoundary: Agent 可以修改 OpenPrd CLI、补测试、更新文档、运行 fleet dry-run 与 update-openprd/backfill-work-units,并验证结果;不得静默把任意历史目录永久归类为 external reference。\n- toolBoundary: 使用本地代码检索、OpenPrd CLI、自带测试、fleet 更新、doctor 与 verify 完成实现和验证;本次不需要外部第三方文档调研。\n- stateModel: 需要保留三类状态:当前项目源码验证状态、reference discovery 状态、standards external reference 显式配置;主 run/verify 只默认消费第一类,其他两类按边界显式暴露。\n- evalPlan: 通过针对 run-harness、standards 和 fleet 的单测与集成验证评估;再用历史项目 dry-run 与 update-openprd/backfill-work-units 验证刷新结果。\n\n## 交接\n\n- 负责人: Codex\n- 下一步: 评审已生成的 PRD,并准备交接。\n- 目标系统: OpenSpec\n",
120
+ "digest": "dc988d7a94c07d2a8070968a71ddacffb374eaeee12aa85eb93231e06dd7b077"
121
+ }
@@ -0,0 +1,161 @@
1
+ # Verify 边界与历史项目刷新
2
+ > 语言规则:除 PRD、OpenPrd、OpenSpec、API、SDK、CLI、TypeScript、JSON、HTTP、WebSocket、字段 key、命令名、产品名和协议名等必要专有名词外,用户可见内容应使用简体中文。
3
+ - 版本: v0001
4
+ - 负责人: Codex
5
+ - 产品类型: agent
6
+ - 模板包: agent
7
+ - 状态: synthesized
8
+ - 生成时间: 2026-05-24 01:56:48
9
+ ## 元信息
10
+
11
+ - 标题: Verify 边界与历史项目刷新
12
+ - 负责人: Codex
13
+ - 状态: classified
14
+ - 版本: v0001
15
+ - 产品类型: agent
16
+ - 日期: 2026-05-24
17
+
18
+ ## 问题
19
+
20
+ - 问题陈述: 修复 OpenPrd verify 边界,避免外部参考目录和 reference discovery 污染主验证,并刷新历史项目生成物。
21
+ - 为什么是现在: 历史项目的 verify 正在被参考目录噪音阻塞,需要尽快恢复 run/verify 的可信度。
22
+ - 证据:
23
+ - 待补充
24
+
25
+ ## 用户与相关方
26
+
27
+ - 主要用户:
28
+ - 维护 OpenPrd 的 Agent 工程师
29
+ - 使用 OpenPrd 管理历史项目的项目维护者
30
+ - 次要用户:
31
+ - 待补充
32
+ - 相关方:
33
+ - 待补充
34
+
35
+ ## 目标与成功标准
36
+
37
+ - 目标:
38
+ - 让主验证只关注当前项目源码和当前实现门禁
39
+ - 让历史项目刷新后默认获得更干净的 verify 体验
40
+ - 成功指标:
41
+ - 存在 reference discovery 时 openprd run . --context 不再默认展示它
42
+ - 仓库内常见外部参考目录在未人工归类前不再直接把 standards verify 阻塞成大面积说明书噪音
43
+ - openprd fleet 更新后历史项目生成物包含这次修复
44
+ - 验收目标:
45
+ - run/verify 的默认结果不再把 reference discovery 或明显外部参考目录当成主门禁噪音
46
+ - 历史项目刷新后生成物能承接这次边界修复
47
+ - 对需要人工确认的 external reference 仍保留显式 classify-external 路径
48
+
49
+ ## 范围与非目标
50
+
51
+ - 范围内:
52
+ - 调整 run context 与 run verify 对 discovery 的纳入规则
53
+ - 调整 standards/source-manual 默认对明显外部参考目录的处理策略
54
+ - 为历史项目执行 openprd fleet 更新与必要回填
55
+ - 范围外:
56
+ - 不自动替每个历史项目猜测所有业务目录的 externalReferences 清单
57
+ - 不修改历史项目的业务代码或需求内容
58
+ - 不把人工确认 external reference 的能力删除
59
+
60
+ ## 场景与流程
61
+
62
+ - 主流程:
63
+ - 维护者运行 openprd run . --context 或 openprd run . --verify 时,只看到当前项目主验证状态;仓库中存在 research、toolkit-sources、marketplace-candidates 等参考目录时,默认不会被当成本项目源码说明书缺口直接淹没结果;维护者可以继续按需显式 classify-external。
64
+ - 边界情况:
65
+ - 待补充
66
+ - 失败模式:
67
+ - reference discovery 仍然混入 run context 或 run verify
68
+ - standards verify 继续被 research 或 toolkit-sources 之类参考目录的说明书缺口淹没
69
+ - fleet 更新后历史项目仍保留旧的 verify 噪音行为
70
+
71
+ ## 可视化图表
72
+
73
+ ### 产品流程
74
+
75
+ ```mermaid
76
+ flowchart LR
77
+ entry["入口触发<br/>维护者运行 openprd run . --context 或 openprd run . --verify 时,只看到当前项…"]
78
+ experience["产品内步骤<br/>修复 OpenPrd verify 边界,避免外部参考目录和 reference discovery 污染主验证,并刷新历史项…"]
79
+ decision{"决策点<br/>边界情况仍需澄清"}
80
+ success(["成功结果<br/>存在 reference discovery 时 openprd run . --context 不再默认展示它"])
81
+ failure[["失败与恢复<br/>reference discovery 仍然混入 run context 或 run verify"]]
82
+ entry -->|"维护者运行 openprd run . --context 或 openprd r…"| experience
83
+ experience -->|"系统处理请求"| decision
84
+ decision -->|"让主验证只关注当前项目源码和当前实现门禁"| success
85
+ decision -.->|"reference discovery 仍然混入 run context 或 ru…"| failure
86
+ ```
87
+
88
+ ### 架构
89
+
90
+ ```mermaid
91
+ flowchart LR
92
+ users["主要用户<br/>维护 OpenPrd 的 Agent 工程师 · 使用 OpenPrd 管理历史项目的项目维护者"]
93
+ subgraph solution["方案边界"]
94
+ experience["Agent 运行层<br/>维护者运行 openprd run . --context 或 openprd run . --verify 时,只看到当前项…"]
95
+ core["核心产品逻辑<br/>修复 OpenPrd verify 边界,避免外部参考目录和 reference discovery 污染主验证,并刷新历史项…"]
96
+ integrations["依赖与集成<br/>暂无外部依赖记录"]
97
+ governance[["约束与可靠性<br/>暂无明确约束"]]
98
+ delivery["验证与交接<br/>存在 reference discovery 时 openprd run . --context 不再默认展示它 · 仓库内常…"]
99
+ end
100
+ users -->|"维护者运行 openprd run . --context 或 openprd…"| experience
101
+ experience -->|"产品动作与编排"| core
102
+ core -->|"依赖与外部服务"| integrations
103
+ core -.->|"策略、可靠性与合规"| governance
104
+ core -->|"成功标准与交接"| delivery
105
+ integrations -->|"运营就绪"| delivery
106
+ governance -.->|"评审与确认"| delivery
107
+ ```
108
+
109
+ ## 需求
110
+
111
+ - 功能需求:
112
+ - 待补充
113
+ - 非功能需求:
114
+ - 待补充
115
+ - 业务规则:
116
+ - 待补充
117
+
118
+ ## 业务护栏
119
+
120
+ - 成本来源:
121
+ - 待补充
122
+ - 额度与限制:
123
+ - 待补充
124
+ - 滥用防护:
125
+ - 待补充
126
+ - 监控信号:
127
+ - 待补充
128
+ - 报警阈值:
129
+ - 待补充
130
+ - 止损动作:
131
+ - 待补充
132
+
133
+ ## 约束、依赖与风险
134
+
135
+ - 技术约束:
136
+ - 待补充
137
+ - 合规要求:
138
+ - 待补充
139
+ - 依赖:
140
+ - 待补充
141
+ - 假设:
142
+ - 待补充
143
+ - 风险:
144
+ - 待补充
145
+ - 开放问题:
146
+ - 本次只收敛默认边界,不自动猜测每个历史项目全部 external reference 清单;如果某些项目还需要更细的目录级归类,仍由维护者显式确认和补充
147
+
148
+ ## 类型专项模块
149
+
150
+ - 类型: Agent 专项
151
+ - humanAgentContract: Agent 可以识别并提示 reference discovery 与外部参考目录边界,但把目录正式归类为 external reference 仍需要人确认;批量刷新历史项目可以自动执行。
152
+ - autonomyBoundary: Agent 可以修改 OpenPrd CLI、补测试、更新文档、运行 fleet dry-run 与 update-openprd/backfill-work-units,并验证结果;不得静默把任意历史目录永久归类为 external reference。
153
+ - toolBoundary: 使用本地代码检索、OpenPrd CLI、自带测试、fleet 更新、doctor 与 verify 完成实现和验证;本次不需要外部第三方文档调研。
154
+ - stateModel: 需要保留三类状态:当前项目源码验证状态、reference discovery 状态、standards external reference 显式配置;主 run/verify 只默认消费第一类,其他两类按边界显式暴露。
155
+ - evalPlan: 通过针对 run-harness、standards 和 fleet 的单测与集成验证评估;再用历史项目 dry-run 与 update-openprd/backfill-work-units 验证刷新结果。
156
+
157
+ ## 交接
158
+
159
+ - 负责人: Codex
160
+ - 下一步: 评审已生成的 PRD,并准备交接。
161
+ - 目标系统: OpenSpec
@@ -0,0 +1,6 @@
1
+ # Agent Intake
2
+
3
+ - What must the agent do autonomously?
4
+ - What must remain human-approved?
5
+ - Which tools and state are available?
6
+ - How do we evaluate success and failure?
@@ -0,0 +1,21 @@
1
+ # Agent PRD
2
+
3
+ ## Inherits
4
+
5
+ - `base/prd.md`
6
+
7
+ ## Agent 专项字段
8
+
9
+ - Human-Agent contract:
10
+ - 自主边界:
11
+ - 工具边界:
12
+ - 状态模型:
13
+ - 兜底路径:
14
+ - 评估计划:
15
+
16
+ ## Agent 备注
17
+
18
+ - 哪些事项必须由人确认?
19
+ - Agent 可以安全执行什么?
20
+ - 如何跨任务衡量成功?
21
+ - 失败后如何恢复?
@@ -0,0 +1,6 @@
1
+ # B2B Intake
2
+
3
+ - Who is the buyer?
4
+ - Who is the daily user?
5
+ - Who is the admin?
6
+ - What approval or compliance step can block rollout?
@@ -0,0 +1,24 @@
1
+ # B2B PRD
2
+
3
+ ## Inherits
4
+
5
+ - `base/prd.md`
6
+
7
+ ## B2B 专项字段
8
+
9
+ - 采购方:
10
+ - 使用者:
11
+ - 管理员:
12
+ - 运营者:
13
+ - 角色:
14
+ - 现状流程:
15
+ - 目标流程:
16
+ - 权限矩阵:
17
+ - 审批流程:
18
+
19
+ ## B2B 备注
20
+
21
+ - 哪个角色负责决策?
22
+ - 哪个角色执行工作?
23
+ - 哪个流程步骤需要可审计?
24
+ - 哪个依赖可能阻塞上线?
@@ -0,0 +1,18 @@
1
+ # Intake 模板
2
+
3
+ ## 发现
4
+
5
+ - 我们要解决什么问题?
6
+ - 主要用户是谁?
7
+ - 当前临时解决方式是什么?
8
+ - 成功指标是什么?
9
+ - 哪些内容不在范围内?
10
+ - 是否涉及免费用户、额度、用量、AI 调用、第三方服务或其他会产生成本的行为?
11
+
12
+ ## Freeze Check
13
+
14
+ - 产品类型是否已明确?
15
+ - 关键角色是否已明确?
16
+ - 是否已有成功指标?
17
+ - 若存在消耗型成本,是否已明确额度限制、滥用防护、监控报警和止损动作?
18
+ - 是否存在阻塞 freeze 的开放问题?
@@ -0,0 +1,67 @@
1
+ # PRD
2
+
3
+ ## 1. 元信息
4
+
5
+ - 标题:
6
+ - 负责人:
7
+ - 状态:
8
+ - 版本:
9
+ - 产品类型:
10
+ - 日期:
11
+
12
+ ## 2. 问题
13
+
14
+ - 问题陈述:
15
+ - 为什么现在做:
16
+ - 证据:
17
+
18
+ ## 3. 用户与相关方
19
+
20
+ - 主要用户:
21
+ - 次要用户:
22
+ - 相关方:
23
+
24
+ ## 4. 目标与成功标准
25
+
26
+ - 目标:
27
+ - 成功指标:
28
+ - 验收目标:
29
+
30
+ ## 5. 范围与非目标
31
+
32
+ - 范围内:
33
+ - 范围外:
34
+
35
+ ## 6. 场景与流程
36
+
37
+ - 主流程:
38
+ - 边界情况:
39
+ - 失败模式:
40
+
41
+ ## 7. 需求
42
+
43
+ - 功能需求:
44
+ - 非功能需求:
45
+ - 业务规则:
46
+
47
+ ## 8. 业务护栏
48
+
49
+ - 成本来源:
50
+ - 额度与限制:
51
+ - 滥用防护:
52
+ - 监控信号:
53
+ - 报警阈值:
54
+ - 止损动作:
55
+
56
+ ## 9. 约束、依赖与风险
57
+
58
+ - 技术约束:
59
+ - 依赖:
60
+ - 风险:
61
+ - 开放问题:
62
+
63
+ ## 10. 交接
64
+
65
+ - 下一步:
66
+ - 目标系统:
67
+ - 负责人:
@@ -0,0 +1,10 @@
1
+ # Company Template Layer
2
+
3
+ This layer captures company-specific PRD habits and terminology.
4
+
5
+ Rules:
6
+
7
+ - May rename section labels for display.
8
+ - May add company-only fields.
9
+ - May not delete canonical fields.
10
+ - May not change required semantics.
@@ -0,0 +1,6 @@
1
+ # Consumer Intake
2
+
3
+ - What moment triggers the need?
4
+ - What emotional or lifestyle value matters?
5
+ - What is the activation event?
6
+ - What keeps the user returning?
@@ -0,0 +1,19 @@
1
+ # Consumer PRD
2
+
3
+ ## Inherits
4
+
5
+ - `base/prd.md`
6
+
7
+ ## 消费端专项字段
8
+
9
+ - 用户画像:
10
+ - 用户分层:
11
+ - 用户旅程:
12
+ - 激活指标:
13
+ - 留存指标:
14
+
15
+ ## 消费端备注
16
+
17
+ - 这个产品创造什么情绪价值或生活方式价值?
18
+ - 用户的第一个成功时刻是什么?
19
+ - 什么会让用户持续回来?
@@ -0,0 +1,53 @@
1
+ {
2
+ "type": "architecture",
3
+ "locale": "zh-CN",
4
+ "title": "示例架构评审",
5
+ "subtitle": "说明预期系统形态,便于用户确认",
6
+ "components": [
7
+ {
8
+ "id": "frontend",
9
+ "name": "前端体验",
10
+ "type": "frontend",
11
+ "subtitle": "面向用户的层",
12
+ "details": [
13
+ "主要入口界面"
14
+ ]
15
+ },
16
+ {
17
+ "id": "backend",
18
+ "name": "核心产品逻辑",
19
+ "type": "backend",
20
+ "subtitle": "核心编排",
21
+ "details": [
22
+ "业务规则"
23
+ ]
24
+ }
25
+ ],
26
+ "flows": [
27
+ {
28
+ "source": "frontend",
29
+ "target": "backend",
30
+ "label": "主要交互",
31
+ "type": "standard"
32
+ }
33
+ ],
34
+ "summaryCards": [
35
+ {
36
+ "title": "范围",
37
+ "color": "frontend",
38
+ "items": [
39
+ "范围内包含什么",
40
+ "范围外排除什么"
41
+ ]
42
+ }
43
+ ],
44
+ "reviewInstructions": [
45
+ "确认缺失系统、边界和依赖。"
46
+ ],
47
+ "metadata": {
48
+ "versionId": "v0001",
49
+ "owner": "PM",
50
+ "targetSystem": "OpenPrd",
51
+ "reviewStatus": "pending-confirmation"
52
+ }
53
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "type": "product-flow",
3
+ "locale": "zh-CN",
4
+ "title": "示例产品流程评审",
5
+ "subtitle": "说明预期用户与系统顺序,便于确认",
6
+ "actors": [
7
+ "用户",
8
+ "系统"
9
+ ],
10
+ "steps": [
11
+ {
12
+ "id": "step-1",
13
+ "name": "用户进入流程",
14
+ "type": "user_action",
15
+ "lane": "用户",
16
+ "description": "流程从这里开始"
17
+ },
18
+ {
19
+ "id": "step-2",
20
+ "name": "系统处理请求",
21
+ "type": "system_process",
22
+ "lane": "系统",
23
+ "details": [
24
+ "核心系统响应"
25
+ ]
26
+ },
27
+ {
28
+ "id": "step-3",
29
+ "name": "决策点",
30
+ "type": "decision",
31
+ "lane": "系统",
32
+ "description": "根据结果分支"
33
+ },
34
+ {
35
+ "id": "step-4",
36
+ "name": "成功完成",
37
+ "type": "success",
38
+ "lane": "系统",
39
+ "description": "顺利路径结果"
40
+ }
41
+ ],
42
+ "transitions": [
43
+ {
44
+ "from_step_id": "step-1",
45
+ "to_step_id": "step-2",
46
+ "label": "开始"
47
+ },
48
+ {
49
+ "from_step_id": "step-2",
50
+ "to_step_id": "step-3",
51
+ "label": "继续"
52
+ },
53
+ {
54
+ "from_step_id": "step-3",
55
+ "to_step_id": "step-4",
56
+ "label": "成功",
57
+ "type": "standard"
58
+ }
59
+ ],
60
+ "summaryCards": [
61
+ {
62
+ "title": "评审重点",
63
+ "color": "decision",
64
+ "items": [
65
+ "确认步骤顺序",
66
+ "确认缺失的恢复路径"
67
+ ]
68
+ }
69
+ ],
70
+ "reviewInstructions": [
71
+ "确认缺失步骤、决策点和错误路径。"
72
+ ],
73
+ "metadata": {
74
+ "reviewStatus": "pending-confirmation"
75
+ }
76
+ }
@@ -0,0 +1,16 @@
1
+ # Industry Template Layer
2
+
3
+ This layer is where industry-specific defaults live.
4
+
5
+ Examples:
6
+
7
+ - SaaS
8
+ - E-commerce
9
+ - Fintech
10
+ - Internal tools
11
+
12
+ Rules:
13
+
14
+ - May add or reorder sections.
15
+ - May not remove core schema fields.
16
+ - Must keep validation compatible with `prd-core`.
@@ -0,0 +1,27 @@
1
+ version: 1
2
+
3
+ registry:
4
+ base:
5
+ path: base/prd.md
6
+ extends: []
7
+
8
+ consumer:
9
+ path: consumer/prd.md
10
+ extends:
11
+ - base
12
+
13
+ b2b:
14
+ path: b2b/prd.md
15
+ extends:
16
+ - base
17
+
18
+ agent:
19
+ path: agent/prd.md
20
+ extends:
21
+ - base
22
+
23
+ overrideLayers:
24
+ - industry
25
+ - company
26
+ - project
27
+ - session
@@ -0,0 +1,14 @@
1
+ # Project Template Layer
2
+
3
+ This layer captures project-specific PRD adjustments.
4
+
5
+ Use cases:
6
+
7
+ - Add rollout notes.
8
+ - Add project-specific assumptions.
9
+ - Add extra review gates.
10
+
11
+ Rules:
12
+
13
+ - Must inherit from company and core layers.
14
+ - Must remain freeze-compatible.