@openprd/cli 0.1.1 → 0.1.9
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/.openprd/README.md +43 -69
- package/.openprd/README_EN.md +84 -0
- package/.openprd/benchmarks/index.md +7 -0
- package/.openprd/benchmarks/sources.yaml +25 -3
- package/.openprd/discovery/config.json +16 -2
- package/.openprd/engagements/active/flows.md +19 -14
- package/.openprd/engagements/active/handoff.md +11 -4
- package/.openprd/engagements/active/prd.md +99 -71
- package/.openprd/engagements/active/review.html +4 -4
- package/.openprd/engagements/active/roles.md +9 -8
- package/.openprd/engagements/work-units/wu-20260524015648-6d33ded7.json +4 -4
- package/.openprd/engagements/work-units/wu-20260602113956-a99b5b88.json +18 -0
- package/.openprd/engagements/work-units/wu-20260602122244-78656aaf.json +18 -0
- package/.openprd/engagements/work-units/wu-20260602122442-e96489e2.json +18 -0
- package/.openprd/engagements/work-units/wu-20260602132835-695429e8.json +18 -0
- package/.openprd/knowledge/candidates/candidate-turn-1780116203372-5f266a79e968c758/candidate.json +78 -0
- package/.openprd/knowledge/candidates/candidate-turn-1780116203372-5f266a79e968c758/diagnostic-report.json +129 -0
- package/.openprd/knowledge/candidates/candidate-turn-1780116203372-5f266a79e968c758/root-cause-candidates.json +41 -0
- package/.openprd/knowledge/candidates/candidate-turn-1780116203372-5f266a79e968c758/timeline.json +14 -0
- package/.openprd/knowledge/drafts/openprd-experience-diagnostic-candidate-turn-1780116203372-5f266a79e968c758/SKILL.md +49 -0
- package/.openprd/knowledge/index.json +44 -4
- package/.openprd/reviews/v0001.html +195 -129
- package/.openprd/reviews/v0002.html +1150 -0
- package/.openprd/reviews/v0003.html +1150 -0
- package/.openprd/reviews/v0004.html +1150 -0
- package/.openprd/reviews/v0005.html +1150 -0
- package/.openprd/standards/config.json +12 -9
- package/.openprd/state/changes.json +17 -2
- package/.openprd/state/current.json +399 -63
- package/.openprd/state/release-ledger.json +387 -0
- package/.openprd/state/version-index.json +52 -0
- package/.openprd/state/versions/v0002.json +264 -0
- package/.openprd/state/versions/v0002.md +183 -0
- package/.openprd/state/versions/v0003.json +269 -0
- package/.openprd/state/versions/v0003.md +188 -0
- package/.openprd/state/versions/v0004.json +274 -0
- package/.openprd/state/versions/v0004.md +193 -0
- package/.openprd/state/versions/v0005.json +299 -0
- package/.openprd/state/versions/v0005.md +189 -0
- package/.openprd/templates/agent/intake.md +5 -4
- package/.openprd/templates/b2b/intake.md +5 -4
- package/.openprd/templates/base/intake.md +10 -4
- package/.openprd/templates/company/README.md +9 -7
- package/.openprd/templates/company/README_EN.md +12 -0
- package/.openprd/templates/consumer/intake.md +5 -4
- package/.openprd/templates/industry/README.md +12 -10
- package/.openprd/templates/industry/README_EN.md +18 -0
- package/.openprd/templates/project/README.md +11 -9
- package/.openprd/templates/project/README_EN.md +16 -0
- package/.openprd/templates/session/README.md +11 -9
- package/.openprd/templates/session/README_EN.md +16 -0
- package/AGENTS.md +12 -8
- package/README.md +419 -438
- package/README_CN.md +4 -578
- package/README_EN.md +870 -0
- package/docs/assets/openprd-requirement-routing-en.png +0 -0
- package/docs/assets/openprd-requirement-routing-en.svg +102 -0
- package/docs/assets/openprd-requirement-routing-zh-refined.png +0 -0
- package/docs/assets/openprd-requirement-routing-zh.png +0 -0
- package/docs/assets/openprd-requirement-routing-zh.svg +102 -0
- package/package.json +6 -2
- package/scripts/dev-check-wrapup-copy.mjs +110 -0
- package/scripts/openprd-github-release-notes.mjs +99 -0
- package/scripts/quality-perf-check.mjs +203 -0
- package/skills/openprd-benchmark-router/SKILL.md +1 -0
- package/skills/openprd-benchmark-router/references/benchmark-sources.md +1 -0
- package/skills/openprd-benchmark-router/references/source-policy.md +2 -0
- package/skills/openprd-discovery-loop/SKILL.md +2 -2
- package/skills/openprd-harness/SKILL.md +47 -25
- package/skills/openprd-harness/references/workflow-gates.md +15 -0
- package/skills/openprd-quality/SKILL.md +11 -5
- package/skills/openprd-requirement-intake/SKILL.md +31 -20
- package/skills/openprd-requirement-intake/references/prd-template-lenses.md +6 -6
- package/skills/openprd-requirement-intake/references/routing-rubric.md +10 -2
- package/skills/openprd-router/SKILL.md +2 -2
- package/skills/openprd-shared/SKILL.md +51 -23
- package/skills/openprd-standards/SKILL.md +2 -1
- package/src/agent-integration.js +271 -71
- package/src/benchmark/constants.js +107 -0
- package/src/benchmark/operations.js +235 -0
- package/src/benchmark/registry.js +64 -0
- package/src/benchmark/render.js +115 -0
- package/src/benchmark/source.js +617 -0
- package/src/benchmark/storage.js +121 -0
- package/src/benchmark/verify.js +235 -0
- package/src/benchmark.js +50 -851
- package/src/change-summary.js +339 -0
- package/src/cli/args.js +67 -6
- package/src/cli/basic-print.js +365 -0
- package/src/cli/benchmark-print.js +91 -0
- package/src/cli/change-print.js +221 -0
- package/src/cli/doctor-print.js +268 -0
- package/src/cli/growth-print.js +176 -0
- package/src/cli/print.js +73 -1384
- package/src/cli/quality-print.js +284 -0
- package/src/cli/run-print.js +297 -0
- package/src/cli/shared-print.js +127 -0
- package/src/cli/workflow-print.js +195 -0
- package/src/codex-hook-runner-template.mjs +659 -124
- package/src/codex-runtime.js +324 -0
- package/src/dev-standards.js +178 -5
- package/src/diagram-core.js +5 -5
- package/src/discovery.js +2 -1
- package/src/execution-strategy.js +369 -0
- package/src/fleet.js +4 -0
- package/src/github-release.js +156 -0
- package/src/growth.js +311 -13
- package/src/html-artifact-utils.js +25 -0
- package/src/html-artifacts.js +157 -1596
- package/src/knowledge.js +1321 -76
- package/src/language-policy.js +2 -112
- package/src/learning-html-artifact.js +1031 -0
- package/src/learning-review.js +3 -2
- package/src/loop.js +280 -9
- package/src/openprd.js +341 -38
- package/src/openspec/change-validate.js +0 -9
- package/src/openspec/execute.js +79 -3
- package/src/openspec/generate.js +33 -20
- package/src/openspec/tasks.js +33 -2
- package/src/prd-core.js +10 -9
- package/src/product-type-copy.js +69 -0
- package/src/quality-html-artifact.js +108 -9
- package/src/quality-learning.js +30 -0
- package/src/quality-visual-review.js +237 -0
- package/src/quality.js +329 -43
- package/src/registry-hygiene.js +54 -0
- package/src/release-ledger.js +413 -0
- package/src/review-presentation.js +12 -6
- package/src/run-harness.js +722 -48
- package/src/session-binding.js +40 -3
- package/src/session-registry.js +159 -0
- package/src/standards.js +5 -3
- package/src/test-strategy.js +386 -0
- package/src/visual-compare.js +915 -34
- package/src/work-unit-migration.js +5 -1
- package/src/workspace-core.js +343 -19
- package/src/workspace-workflow.js +538 -134
package/README.md
CHANGED
|
@@ -1,246 +1,305 @@
|
|
|
1
1
|
# OpenPrd
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
简体中文 | [English](./README_EN.md)
|
|
4
4
|
|
|
5
|
-
> AI
|
|
5
|
+
> 帮团队先把需求说清楚、确认清楚,再更稳地交付的 AI 原生 PRD 工作区与 CLI。
|
|
6
6
|
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
9
|
[](https://github.com/mileson/openprd)
|
|
10
10
|
|
|
11
|
-
OpenPrd
|
|
11
|
+
OpenPrd 是一个轻量但结构化的 **PRD harness**。你只需要先把问题说出来,它会帮团队和 Agent 把需求整理成:
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- 需求澄清
|
|
14
|
+
- 用户确认
|
|
15
|
+
- 图形化评审
|
|
16
|
+
- 冻结前关卡控制
|
|
17
|
+
- 面向执行系统的结构化交接
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
它把关键确认点沉淀成稳定的 HTML 产物,而不是把版本状态散落在聊天记录或终端输出里。
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+

|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
## 适合什么场景
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
- agent-assisted requirement drafting
|
|
23
|
-
- human confirmation at the right decision points before implementation
|
|
24
|
-
- structured handoff into execution systems
|
|
25
|
+
如果你希望:
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
- 在写 PRD 前先澄清需求
|
|
28
|
+
- 区分用户确认、项目已有事实和 Agent 推断
|
|
29
|
+
- 在 freeze 前插入架构图 / 流程图评审
|
|
30
|
+
- 让 Agent 遵循 repo 内置的协同规则
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
- **source-aware capture** so user-confirmed facts stay separate from repo-derived, agent-inferred, or agent-normalized context
|
|
30
|
-
- **policy-based review gates** that keep stable artifacts without forcing the same stop every time
|
|
31
|
-
- **agent-facing skills** shipped with the tool, not hidden in a local environment
|
|
32
|
+
那么 OpenPrd 就很适合你。
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
如果你的同事经常会说“我大概想做这个,但还没完全想清楚”,这通常就是 OpenPrd 最能发挥作用的时候。
|
|
34
35
|
|
|
35
|
-
OpenPrd
|
|
36
|
-
or only on coding execution.
|
|
36
|
+
## 一句话需求进来,OpenPrd 怎么接住
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|------|-------------------|----------------------------|----------|
|
|
40
|
-
| **OpenPrd** | Requirement clarification, HTML-first collaboration, and delivery gates | `review.html`, learning readers, quality reports, diagrams, structured change/task state | Teams that need humans and agents to stay aligned through planning, review, execution, and ship decisions |
|
|
41
|
-
| **OpenSpec** | Spec and change lifecycle | Markdown proposals, specs, design docs, tasks | Teams that want disciplined spec deltas and a clean change-management workflow |
|
|
42
|
-
| **Superpowers** | Skill-driven coding execution | Skills, plans, worktree/subagent flows, code-review checkpoints | Engineering-heavy teams optimizing how AI agents plan, code, review, and finish branches |
|
|
38
|
+
你不需要先判断自己提的是 `L0 / L1 / L2`,也不需要先想清楚技术方案。直接用业务语言说明:谁在什么场景下遇到了什么问题、你想先解决哪一块。OpenPrd 会先帮你整理,再选择合适的推进节奏。
|
|
43
39
|
|
|
44
|
-
OpenPrd
|
|
45
|
-
but "what should people confirm, what should stay visible, and what evidence is
|
|
46
|
-
enough to move forward."
|
|
40
|
+

|
|
47
41
|
|
|
48
|
-
|
|
42
|
+
- **快速修正**:问题已经很明确,影响小,验收也清楚。通常直接处理,改完告诉你改了什么、怎么验证。
|
|
43
|
+
- **现有功能优化**:目标明确,但会牵动几个页面、状态或用户动作。OpenPrd 会先用人话给你一版 mini-plan,方向对了再继续。
|
|
44
|
+
- **新功能 / 新流程方案**:范围更大,角色更多,或者业务风险还不清楚。先把用户场景、第一版、先不做什么和主要风险讲清楚,再进入完整方案和任务拆解。
|
|
49
45
|
|
|
50
|
-
|
|
51
|
-
product requests, existing-product redesigns, release/publish flows, production
|
|
52
|
-
incident closure, and reusable learning handoff.
|
|
46
|
+
如果更偏个人用户场景,OpenPrd 会更关注用户在什么时候会用、第一下有没有感受到价值、会不会愿意继续回来;如果更偏团队 / 企业流程,会更关注谁拍板、谁使用、谁要推进上线;如果更偏 Agent 协作,会更关注哪些环节可以自动做、哪里必须人工兜底。整个过程默认先讲结果、场景和风险,不先把内部术语丢给你。
|
|
53
47
|
|
|
54
|
-
|
|
55
|
-
|----------|-----------------------------|----------------|
|
|
56
|
-
| Fuzzy product request before anyone codes | Clarify first, separate user-confirmed facts from agent inference, then turn the result into a stable review surface. | `clarify`, `capture`, `synthesize`, `review.html` |
|
|
57
|
-
| Existing flow or auth-entry redesign | Reconstruct current behavior from repo and runtime evidence before proposing the next change. | `discovery`, `diagram`, `review.html`, `change` |
|
|
58
|
-
| Visual or product-flow confirmation | Keep architecture, product flow, or UI replication reviewable instead of burying decisions in chat. | `diagram`, `visual-compare`, side-by-side JPG reviews |
|
|
59
|
-
| Long-running agent implementation chain | Turn accepted work into dependency-ready tasks and run one focused agent session per task with verify gates. | `tasks`, `loop`, prompts, progress logs, verification reports |
|
|
60
|
-
| Release, publish, or handoff readiness | Make "ready to ship" a visible decision with standards, regression evidence, abuse/cost guardrails, and workspace health. | `quality`, `run --verify`, `doctor`, `handoff` |
|
|
61
|
-
| Learning handoff after a fix or project | Package the final requirement, reasoning, and outcome into something new collaborators can actually study. | learning reader, `.openprd/knowledge/skills/`, docs sync |
|
|
48
|
+
## OpenPrd 和 OpenSpec / Superpowers 有什么不一样
|
|
62
49
|
|
|
63
|
-
|
|
50
|
+
OpenPrd 解决的问题,不只是“把 spec 写出来”,也不只是“把代码跑起来”,而是让
|
|
51
|
+
人和 Agent 在需求、评审、执行、交付这些关键节点上始终对齐。
|
|
64
52
|
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
| 工具 | 重心 | 用户主要看到的产物 | 更适合什么 |
|
|
54
|
+
|------|------|--------------------|------------|
|
|
55
|
+
| **OpenPrd** | 需求澄清、HTML 优先协作、交付门禁 | `review.html`、学习阅读器、质量报告、图示、结构化 change/task 状态 | 需要把人机协同、评审确认、执行推进和交付判断串起来的团队 |
|
|
56
|
+
| **OpenSpec** | spec / change 生命周期 | Markdown proposal、spec、design、tasks | 更关注 spec 增量治理和变更编排的团队 |
|
|
57
|
+
| **Superpowers** | skill 驱动的编码执行流 | skills、plans、worktree / subagent 流程、代码评审检查点 | 更关注 AI Agent 如何规划、编码、review、收尾的工程团队 |
|
|
58
|
+
|
|
59
|
+
OpenPrd 最有特色的地方,在于它把“这次到底在做什么、谁来确认、凭什么继续往下走”
|
|
60
|
+
做成稳定可见的协作面,而不是只留在 spec 文件或 prompt 流程里。
|
|
61
|
+
|
|
62
|
+
## 内置最佳实践与默认增强能力
|
|
63
|
+
|
|
64
|
+
OpenPrd 不只负责把需求流程排好。对于“先参考什么更靠谱”这件事,它也内置了一层最佳实践路由,先帮 Agent 找对证据源,再继续改设计、写文案或动代码。
|
|
65
|
+
|
|
66
|
+
- **公开仓库架构理解**:需要看 GitHub 公开仓库的整体结构、关键流程和实现线索时,默认优先 `DeepWiki`
|
|
67
|
+
- **第三方技术文档**:需要确认库、框架、API、CLI、MCP 的用法、配置、限制、版本差异或迁移路径时,默认优先 `Context7`
|
|
68
|
+
- **图标与视觉资源**:需要选 UI 图标、AI 品牌图标、技术栈图标、3D 素材或功能图标时,会先按用途路由到更合适的来源,而不是让 Agent 临时乱找
|
|
69
|
+
- **项目级长期参考**:被反复采纳的外部来源可以沉淀成项目自己的最佳实践清单,后面类似任务会优先复用
|
|
70
|
+
|
|
71
|
+
这层能力的目的不是堆资料链接,而是把“先查哪里、为什么查这里、查到什么程度就够”变成稳定协作的一部分。对于 AI 编程来说,这会直接影响方案质量、技术判断和最终实现的稳定性。
|
|
72
|
+
|
|
73
|
+
目前 OpenPrd 内置的常见增强方向包括:
|
|
74
|
+
|
|
75
|
+
- `DeepWiki`:理解 GitHub 公开仓库的架构、模块关系和关键流程
|
|
76
|
+
- `Context7`:获取最新的第三方技术文档、配置说明、版本差异和迁移信息
|
|
77
|
+
- 图标与视觉资源路由:按场景优先参考 `Phosphor Icons`、`LobeHub Icons`、`Tech Icons`、`Thiings`、`iconfont`
|
|
78
|
+
- 图标实现库建议:真正落到前端代码时,再按项目情况选择 `Lucide`、`Tabler`、`React Icons`
|
|
79
|
+
|
|
80
|
+
## 典型真实场景
|
|
81
|
+
|
|
82
|
+
最近 30 天的 Codex 项目记录里,OpenPrd 反复出现在几类连续工作里:模糊需求澄清、
|
|
83
|
+
已有产品流程改造、发布与交付、线上问题闭环,以及把一次完成的工作整理成可复用学习资料。
|
|
84
|
+
|
|
85
|
+
| 场景 | 为什么这里更像 OpenPrd 的强项 | 主要产物 |
|
|
86
|
+
|------|--------------------------------|----------|
|
|
87
|
+
| 模糊产品需求,先别急着写代码 | 先澄清,再区分用户确认事实与 Agent 推断,最后把结果沉淀成稳定评审页。 | `clarify`、`capture`、`synthesize`、`review.html` |
|
|
88
|
+
| 已有流程或登录入口改造 | 先从仓库与运行态重建当前事实,再决定下一步 change,而不是直接拍脑袋改。 | `discovery`、`diagram`、`review.html`、`change` |
|
|
89
|
+
| 流程图、界面或架构确认 | 把理解差异放到图示和可评审产物里,而不是埋在聊天记录里。 | `diagram`、`visual-compare`、左右对比 JPG |
|
|
90
|
+
| 长程 Agent 执行链路 | 把确认后的工作拆成按依赖可执行的小任务,每次新会话只推进一个任务并带验证门禁。 | `tasks`、`loop`、任务提示词、进度日志、验证报告 |
|
|
91
|
+
| 发布、开源、交接前收口 | 让“现在能不能交付”变成有证据的显式判断,而不是靠感觉。 | `quality`、`run --verify`、`doctor`、`handoff` |
|
|
92
|
+
| 一次需求或修复做完后沉淀学习资料 | 把最终需求、过程判断和结果整理成新成员可以直接学习的资料。 | 学习阅读器、`.openprd/knowledge/skills/`、docs 同步 |
|
|
93
|
+
|
|
94
|
+
## HTML 优先协作产物
|
|
95
|
+
|
|
96
|
+
OpenPrd 会生成可以直接分享的 HTML 面板,让产品、研发和 Agent
|
|
97
|
+
围绕同一份稳定 artifact 协作,而不是各自回放聊天记录或命令输出。
|
|
67
98
|
|
|
68
99
|
### `review.html`
|
|
69
100
|
|
|
70
|
-
|
|
71
|
-
|
|
101
|
+
把当前需求版本整理成可评审页面,适合先给产品、研发或负责人确认“这次到底在做什么”。
|
|
102
|
+
如果项目已经启用 `release` 版本轨道,评审页顶部也会直接显示当前 `项目版本`。
|
|
72
103
|
|
|
73
104
|

|
|
74
105
|
|
|
75
|
-
###
|
|
106
|
+
### 学习阅读器
|
|
76
107
|
|
|
77
|
-
|
|
78
|
-
that new collaborators can study without replaying the whole thread.
|
|
108
|
+
把一次需求、修复或协作方法整理成图文学习资料,方便新成员理解“这套流程为什么这样设计”。
|
|
79
109
|
|
|
80
110
|

|
|
81
111
|
|
|
82
|
-
###
|
|
112
|
+
### 质量回归报告
|
|
83
113
|
|
|
84
|
-
|
|
85
|
-
one human-readable quality surface before handoff, release, or publish.
|
|
114
|
+
把准备就绪状态、必需门禁、验证材料和仍需人工判断的点放到一个可读页面里,再决定是否继续交付或发布。
|
|
86
115
|
|
|
87
116
|

|
|
88
117
|
|
|
89
|
-
###
|
|
90
|
-
|
|
91
|
-
Put the reference and implementation into one side-by-side artifact for staged
|
|
92
|
-
UI review, especially for auth-entry redesign, localized legal pages, and modal
|
|
93
|
-
replication work.
|
|
118
|
+
### 效果图与截图拼图对比,自动优化
|
|
94
119
|
|
|
95
|
-
|
|
120
|
+
把效果图和实现截图放进同一张左右对比图里,适合登录入口改造、条款页本地化、弹窗复刻这类阶段性评审。
|
|
96
121
|
|
|
97
|
-
|
|
122
|
+

|
|
98
123
|
|
|
99
|
-
|
|
100
|
-
keeps proven team habits as reusable `Project-Level Skill`s. The other keeps
|
|
101
|
-
`Dynamic Parameter Config` adaptive, so different project situations start with
|
|
102
|
-
different collaboration defaults instead of the same generic checklist.
|
|
124
|
+
## 自我成长机制
|
|
103
125
|
|
|
104
|
-
|
|
126
|
+
OpenPrd 会沿着两条看得见的循环,越用越贴合你们的协作方式。一条循环把真实项目里反复验证过的做法沉淀成可复用的 `项目级 Skill`;另一条循环把不同场景下更合适的协作设置沉淀成 `动态参数配置`,让下次启动时直接带上更合适的默认做法。
|
|
105
127
|
|
|
106
|
-
|
|
128
|
+

|
|
107
129
|
|
|
108
|
-
|
|
109
|
-
can keep that conclusion close to the project instead of leaving it buried in
|
|
110
|
-
chat.
|
|
130
|
+
### 场景一:项目级 Skill
|
|
111
131
|
|
|
112
|
-
|
|
113
|
-
- What gets reused next time: related page checks, release review points, and the preferred path through similar requests.
|
|
114
|
-
- Why it matters: the next similar request starts from a shared playbook, and new teammates can follow the same steps without retelling the whole history.
|
|
132
|
+
当团队在真实工作里反复确认同一种判断,OpenPrd 不会让它继续散落在聊天记录里,而是把它留在项目身边。
|
|
115
133
|
|
|
116
|
-
|
|
134
|
+
- 例子:一次登录入口改造里,团队确认“登录、注册、找回密码都走官网”。
|
|
135
|
+
- 下次能直接复用什么:相关页面要一起检查、发布前要核对哪些入口和文案、类似需求应该沿着什么路径推进。
|
|
136
|
+
- 为什么有用:下一次类似需求不会再从零开始,新成员接手也能直接照着做。
|
|
117
137
|
|
|
118
|
-
|
|
119
|
-
collaboration defaults for different situations and bring them back
|
|
120
|
-
automatically.
|
|
138
|
+
### 场景二:动态参数配置
|
|
121
139
|
|
|
122
|
-
|
|
123
|
-
- What changes automatically: what to ask first, what to inspect first, and what proof to gather before handoff.
|
|
124
|
-
- Why it matters: teams spend less time re-explaining how this kind of project should run and more time moving with the right setup from the start.
|
|
140
|
+
不是每个项目都该用同一套起手方式。OpenPrd 会把不同场景下更合适的协作设置留住,并在下次自动带回来。
|
|
125
141
|
|
|
126
|
-
|
|
142
|
+
- 例子:一个新项目会先澄清目标和范围,一个接手中的旧项目会先还原现状和改动边界。
|
|
143
|
+
- 下次会自动带上什么:先问什么、先看什么、交付前先收什么材料。
|
|
144
|
+
- 为什么有用:团队不用每次重新解释“这类项目该怎么开场”,而是直接从更合适的默认方式开始。
|
|
127
145
|
|
|
128
|
-
|
|
129
|
-
- **Scenario-aware collaboration**: distinguish greenfield cold start, existing-project cold start, and continuing workspaces
|
|
130
|
-
- **Self-evolving collaboration**: turn confirmed project habits into reusable `Project-Level Skill`s and adapt `Dynamic Parameter Config` by scenario
|
|
131
|
-
- **Source-aware capture**: mark inputs as `user-confirmed`, `project-derived`, `agent-inferred`, or `agent-normalized`
|
|
132
|
-
- **Diagram review artifacts**: generate both architecture and product-flow diagrams
|
|
133
|
-
- **UI visual comparison artifacts**: combine reference images and implementation screenshots into side-by-side JPG reviews for visual replication work
|
|
134
|
-
- **Contract-driven diagrams**: render from validated JSON contracts
|
|
135
|
-
- **Review status tracking**: use `pending-confirmation`, `confirmed`, and `needs-revision`
|
|
136
|
-
- **OpenPrd discovery mode**: initialize durable coverage runs for existing projects, reference projects, or unclear requirements
|
|
137
|
-
- **Project standards**: initialize and verify `docs/basic/`, file manual templates, and folder README templates as part of execution quality gates
|
|
138
|
-
- **Quality Regression Reports**: review overall regression status, per-requirement module status, test-block results, observability, business cost and abuse guardrails, smoke coverage, performance baselines, and project knowledge through HTML reports
|
|
139
|
-
- **Project knowledge skills**: turn verified fixes and recurring diagnosis patterns into reusable `.openprd/knowledge/skills/` experience skills
|
|
140
|
-
- **OpenPrd change and task execution**: materialize PRD snapshots into change files, validate them, apply accepted specs, archive changes, and advance structured tasks by dependency order
|
|
141
|
-
- **Long-running agent loop**: turn accepted change tasks into one-task-per-session Codex or Claude execution prompts with verification, progress logs, and optional task commits
|
|
142
|
-
- **Default agent integration**: generate Codex, Claude, and Cursor guidance from one OpenPrd source, including Codex hooks with `codex_hooks = true`
|
|
143
|
-
- **Agent harness skills**: repo-local skills for shared rules, workflow control, and diagram review
|
|
146
|
+
## 功能
|
|
144
147
|
|
|
145
|
-
|
|
148
|
+
- **Clarification-first**:`clarify -> capture -> classify -> interview -> synthesize -> diagram -> freeze -> handoff`
|
|
149
|
+
- **场景感知协同**:区分空项目冷启动、已有项目首次接入、持续推进中的 workspace
|
|
150
|
+
- **自我成长机制**:把真实项目里确认过的做法沉淀成可复用的 `项目级 Skill`,并按场景沉淀 `动态参数配置`
|
|
151
|
+
- **来源感知采集**:支持 `user-confirmed` / `project-derived` / `agent-inferred` / `agent-normalized`
|
|
152
|
+
- **最佳实践路由**:在公开仓库理解、第三方技术文档、图标资源和协作方式优化这类任务里,先把请求路由到更合适的证据源
|
|
153
|
+
- **项目级 benchmark registry**:支持 `benchmark add / observe / approve / verify`,把被反复采纳的外部来源沉淀成项目自己的长期参考
|
|
154
|
+
- **图形评审工件**:支持 `architecture` 和 `product-flow`
|
|
155
|
+
- **界面视觉对比工件**:把效果图与实现截图合成左右对比 JPG,用于阶段性复刻评审
|
|
156
|
+
- **Contract 驱动图渲染**:支持从 JSON contract 显式渲染
|
|
157
|
+
- **Review status**:支持 `pending-confirmation` / `confirmed` / `needs-revision`
|
|
158
|
+
- **用户视角变化摘要**:`loop commit`、`handoff` / 版本说明、`review` 摘要默认优先使用 `新增 / 修复 / 优化 / 调整 / 移除` 这类短标签
|
|
159
|
+
- **项目级版本轨道**:可选维护 `0.1.23` 这类项目版本号、版本内变化条目,以及与本地 git tag 的协同,不和内部 PRD `v000x` 混用
|
|
160
|
+
- **策略化评审门禁**:PRD review 记录和执行意图分离;不能把“可以开做”当成任意评审稿的 `review --mark confirmed`
|
|
161
|
+
- **OpenPrd 发现模式**:为已有项目、参考项目或不清晰需求初始化可持续推进的覆盖状态
|
|
162
|
+
- **项目标准化**:初始化并验证 `docs/basic/`、文件说明书模板和文件夹 README 模板
|
|
163
|
+
- **OpenPrd change 与任务执行**:从 PRD 快照生成 change 文件,校验结构,沉淀 accepted specs,归档变更,并按依赖顺序推进结构化任务
|
|
164
|
+
- **长程 Agent Loop**:把 change 任务转成“一次新会话只做一个任务”的 Codex / Claude 执行提示词,并沉淀验证、进度日志和可选任务 commit
|
|
165
|
+
- **默认 Agent 接入**:从一套 OpenPrd 源生成 Codex、Claude、Cursor 三端规则,并默认开启 Codex hooks
|
|
166
|
+
- **Repo 内置 skills**:工具和 Agent 协同约束一起发布
|
|
146
167
|
|
|
147
|
-
|
|
148
|
-
|-------|------------|
|
|
149
|
-
| Runtime | Node.js 20+ |
|
|
150
|
-
| CLI | Native Node ESM |
|
|
151
|
-
| Config / state | JSON + YAML |
|
|
152
|
-
| Diagram renderer | Self-contained HTML + inline SVG |
|
|
153
|
-
| Image processing | `sharp` for JPG / PNG / WebP visual comparison artifacts |
|
|
154
|
-
| Testing | `node --test` |
|
|
155
|
-
| Agent guidance | Repo-local `skills/` + `AGENTS.md` + Codex / Claude / Cursor generated adapters |
|
|
168
|
+
## 一句话安装
|
|
156
169
|
|
|
157
|
-
|
|
170
|
+
```bash
|
|
171
|
+
npm install -g @openprd/cli
|
|
172
|
+
```
|
|
158
173
|
|
|
159
|
-
|
|
174
|
+
如果你只是想先跑起来,或者 Windows 里刚装完 CLI 但 `openprd` 还没出现在 `PATH`,也可以直接用 `npx`:
|
|
160
175
|
|
|
161
176
|
```bash
|
|
162
|
-
|
|
177
|
+
npx @openprd/cli@latest --help
|
|
178
|
+
npx @openprd/cli@latest init . --template-pack agent
|
|
163
179
|
```
|
|
164
180
|
|
|
165
|
-
|
|
181
|
+
安装后验证:
|
|
166
182
|
|
|
167
183
|
```bash
|
|
168
184
|
openprd --help
|
|
169
185
|
```
|
|
170
186
|
|
|
171
|
-
|
|
187
|
+
### Windows 排查
|
|
188
|
+
|
|
189
|
+
如果全局安装成功后依然提示找不到 `openprd`,先检查:
|
|
190
|
+
|
|
191
|
+
```powershell
|
|
192
|
+
where openprd
|
|
193
|
+
npm config get prefix
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
如果 `where openprd` 没有结果,把 npm global prefix 加到 `PATH` 后再重新打开终端。Windows 下这个目录通常是 `%AppData%\npm`,不是 Unix 常见的 `{prefix}/bin`。
|
|
197
|
+
|
|
198
|
+
之后更新 CLI 时先预演,再执行:
|
|
172
199
|
|
|
173
200
|
```bash
|
|
174
201
|
openprd self-update --dry-run
|
|
175
202
|
openprd self-update
|
|
176
203
|
```
|
|
177
204
|
|
|
178
|
-
##
|
|
205
|
+
## 快速开始
|
|
179
206
|
|
|
180
|
-
### 1.
|
|
207
|
+
### 1. 初始化
|
|
181
208
|
|
|
182
209
|
```bash
|
|
183
210
|
openprd init /path/to/project --template-pack agent
|
|
184
211
|
```
|
|
185
212
|
|
|
186
|
-
`
|
|
213
|
+
如果 `openprd` 还没进 `PATH`,直接把同一条命令前面换成 `npx @openprd/cli@latest` 即可:
|
|
187
214
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
215
|
+
```bash
|
|
216
|
+
npx @openprd/cli@latest init /path/to/project --template-pack agent
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
`init` 会创建 `.openprd/`、`docs/basic/`、`AGENTS.md`,并生成 Codex / Claude / Cursor 三端引导。Codex 项目会同时写入 `.codex/config.toml`、`.codex/hooks.json`、`.codex/hooks/openprd-hook.mjs`,并开启用户级 Codex `codex_hooks = true`。
|
|
220
|
+
|
|
221
|
+
Codex hooks 默认使用 `lite` 模式:安装 `UserPromptSubmit`、轻量
|
|
222
|
+
`PreToolUse` 写入门禁,以及轻量 `Stop` 收工回顾。明确提到 OpenPrd、PRD、深度调研、深度对标、复刻、
|
|
223
|
+
standards、fleet、文档标准化,或看起来像新产品 / 模块 / 流程需求的提示词都会
|
|
224
|
+
注入上下文;`lite` 写入门禁只匹配直接编辑工具,让只读 shell 探查保持安静;`Stop`
|
|
225
|
+
会在本轮结束前回顾是否值得沉淀项目经验。
|
|
226
|
+
需要连 shell 命令也进入写入门禁时使用 `guarded`,只有临时深度诊断才使用
|
|
227
|
+
`full`。
|
|
228
|
+
如果用户给出报错、日志、复现、根因排查等明确故障证据,并要求直接修复,
|
|
229
|
+
hook 会按小型 bugfix 处理,不开启需求入口;“确认修复”这类确认词也会关闭
|
|
230
|
+
已打开的需求入口。
|
|
231
|
+
|
|
232
|
+
`init` 还会顺手做一层非阻断式可选能力检测,并把结果写进
|
|
233
|
+
`.openprd/harness/install-manifest.json` 的 `optionalCapabilities`。例如:
|
|
234
|
+
|
|
235
|
+
- `Context7`:帮助 Agent 获取最新的第三方技术文档、配置、版本差异、迁移路径和高质量实现信息
|
|
236
|
+
- `DeepWiki`:帮助 Agent 用对话方式理解 GitHub 公开仓库的架构、关键流程和实现线索
|
|
199
237
|
|
|
200
|
-
|
|
238
|
+
如果这些能力尚未配置,初始化不会失败;OpenPrd 只会把它记录成后续建议,并附上官方文档、GitHub 地址和 MCP 地址,方便后面按当前客户端补配置。
|
|
239
|
+
|
|
240
|
+
### 2. 查看当前协同节奏
|
|
201
241
|
|
|
202
242
|
```bash
|
|
203
243
|
openprd status /path/to/project
|
|
204
244
|
openprd next /path/to/project
|
|
205
245
|
```
|
|
206
246
|
|
|
207
|
-
|
|
247
|
+
如果项目已经启用版本轨道,`status` 也会直接显示当前项目版本和该版本累计了多少条变化项。
|
|
248
|
+
|
|
249
|
+
### 2b. 可选:设置项目版本轨道
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
openprd release /path/to/project --set 0.1.23
|
|
253
|
+
openprd release /path/to/project --notes "新增版本说明入口"
|
|
254
|
+
openprd release /path/to/project
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
`release` 维护的是项目级版本账本,不是 OpenPrd 内部 PRD 的 `v0004` 这类版本号。启用后,后续 handoff、版本说明和 `loop --finish --commit` 的本地 tag 协同都会优先复用这里的版本信息。
|
|
258
|
+
|
|
259
|
+
如果 OpenPrd 自身要把新版本发布到 GitHub,默认还要推送匹配的版本 tag,并配套 GitHub Release。可以先用 `node scripts/openprd-github-release-notes.mjs /path/to/project --version 0.1.23 --tag v0.1.23 --out /tmp/openprd-release.md` 预览发布文案;仓库内的 `github-release` workflow 会在 tag push 或手动触发时,基于同一份 `release-ledger` 自动创建或更新 GitHub Release。
|
|
260
|
+
|
|
261
|
+
### 3. 先向用户澄清
|
|
208
262
|
|
|
209
263
|
```bash
|
|
210
264
|
openprd clarify /path/to/project
|
|
211
265
|
```
|
|
212
266
|
|
|
213
|
-
|
|
267
|
+
澄清阶段只在对话里输出提纲或简短清单;正式 HTML 评审统一留给合成后的 `review.html`。
|
|
268
|
+
|
|
269
|
+
OpenPrd 会先按用户可见的需求类型接住这句话,而不是先让你填一堆表单:
|
|
270
|
+
|
|
271
|
+
- **快速修正**:通常直接做,做完告诉你改了什么、怎么验。
|
|
272
|
+
- **现有功能优化**:先给一版 mini-plan,你确认方向后再继续。
|
|
273
|
+
- **新功能 / 新流程方案**:先把场景、范围、第一版和风险说清楚,再进入 `review`、`change` 和 `tasks`。
|
|
214
274
|
|
|
215
|
-
### 4.
|
|
275
|
+
### 4. 写回答案
|
|
216
276
|
|
|
217
|
-
|
|
277
|
+
单条写回:
|
|
218
278
|
|
|
219
279
|
```bash
|
|
220
280
|
openprd capture /path/to/project \
|
|
221
281
|
--field problem.problemStatement \
|
|
222
|
-
--value "
|
|
282
|
+
--value "移动端缺少高效的 Agent 会话与节点管理入口" \
|
|
223
283
|
--source user-confirmed
|
|
224
284
|
```
|
|
225
285
|
|
|
226
|
-
|
|
286
|
+
批量写回:
|
|
227
287
|
|
|
228
288
|
```bash
|
|
229
289
|
openprd capture /path/to/project --json-file answers.json
|
|
230
290
|
```
|
|
231
291
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
`--source agent-normalized` before recording the current `review.html` artifact.
|
|
292
|
+
`--source agent-normalized` 只用于 `capture` 之后的纯内部措辞整理,
|
|
293
|
+
这类没有语义变化的润色不应重开当前 `review.html` 的确认。
|
|
235
294
|
|
|
236
|
-
### 5.
|
|
295
|
+
### 5. 生成草稿与图
|
|
237
296
|
|
|
238
297
|
```bash
|
|
239
298
|
openprd synthesize /path/to/project \
|
|
240
299
|
--title "Moticlaw Mobile" \
|
|
241
300
|
--owner "Moticlaw" \
|
|
242
|
-
--problem "
|
|
243
|
-
--why-now "
|
|
301
|
+
--problem "移动端用户缺少直连优先的节点选择与 Agent 会话入口。" \
|
|
302
|
+
--why-now "控制面已经具备,当前缺少的是移动端入口。"
|
|
244
303
|
|
|
245
304
|
openprd review-presentation /path/to/project --template
|
|
246
305
|
openprd review-presentation /path/to/project \
|
|
@@ -254,52 +313,49 @@ openprd review /path/to/project --open
|
|
|
254
313
|
openprd review /path/to/project --mark confirmed --version <id> --digest <sha256> --work-unit <id>
|
|
255
314
|
```
|
|
256
315
|
|
|
257
|
-
`review.html`
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
do not treat review recording as execution authorization. After the current
|
|
266
|
-
artifact is recorded, generate the OpenPrd change and task breakdown. If the
|
|
267
|
-
user originally asked to implement, execution can continue once tasks are ready;
|
|
268
|
-
otherwise wait for an explicit execution request:
|
|
316
|
+
`review.html` 是当前 PRD 的稳定评审稿,但默认 approval policy 是
|
|
317
|
+
`decision-points`,不是“每次都必须停在这里”。常规 lane 下,用户先看稳定
|
|
318
|
+
artifact,再用页面复制出来的精确 `--version`、`--digest`、`--work-unit`
|
|
319
|
+
记录确认;`silent-record` lane 只有在用户一开始已经明确要求直接做、并显式
|
|
320
|
+
表示不需要额外评审或确认时,才允许直接记录当前这份精确 artifact。不要把
|
|
321
|
+
实现授权当成给任意评审稿补确认,也不要把评审记录当成实现授权。当前 artifact
|
|
322
|
+
记录完成后,再生成 OpenPrd change 和任务拆解;如果用户原始意图已明确要求
|
|
323
|
+
实现,tasks 就绪后即可直接执行,否则等待一句明确的执行指令:
|
|
269
324
|
|
|
270
325
|
```bash
|
|
271
326
|
openprd change /path/to/project --generate --change <change-id>
|
|
272
327
|
openprd tasks /path/to/project --change <change-id>
|
|
273
328
|
```
|
|
274
329
|
|
|
275
|
-
### 6. Freeze
|
|
330
|
+
### 6. Freeze 与 handoff
|
|
276
331
|
|
|
277
332
|
```bash
|
|
278
333
|
openprd freeze /path/to/project
|
|
279
334
|
openprd handoff /path/to/project --target openprd
|
|
280
335
|
```
|
|
281
336
|
|
|
282
|
-
|
|
337
|
+
`handoff` 导出的 `handoff.json` 和 `handoff.md` 会同时带上用户视角的变化摘要 / 版本说明片段,默认按 `新增 / 修复 / 优化 / 调整 / 移除` 组织,方便直接扫读或复用。若项目已启用 `release` 版本轨道,handoff 会优先导出当前项目版本下累计的变化条目,并额外写出 `项目版本: 0.1.23` 这类信息。
|
|
283
338
|
|
|
284
|
-
|
|
339
|
+
### 7. 启动 OpenPrd 发现模式
|
|
340
|
+
|
|
341
|
+
用户可以直接用自然语言说:
|
|
285
342
|
|
|
286
343
|
```text
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
344
|
+
用 OpenPrd 深度补全这个项目。
|
|
345
|
+
用 OpenPrd 全面复刻这个参考项目的产品逻辑。
|
|
346
|
+
继续深挖这个需求,直到 OpenPrd 覆盖完整。
|
|
290
347
|
```
|
|
291
348
|
|
|
292
|
-
Discovery
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
coverage or launching loop tasks.
|
|
349
|
+
Discovery 和 loop 执行需要明确的深度或执行意图。用户只是说“看看、规划、
|
|
350
|
+
梳理、分析、预计动哪些文件、怎么改”时,Agent 应只读检查状态和代码后回答,
|
|
351
|
+
不得推进 coverage,也不得启动 loop 任务。
|
|
296
352
|
|
|
297
|
-
|
|
353
|
+
Agent 会在内部完成路由。底层命令是:
|
|
298
354
|
|
|
299
355
|
```bash
|
|
300
356
|
openprd discovery /path/to/project --mode brownfield
|
|
301
357
|
openprd discovery /path/to/project --resume
|
|
302
|
-
openprd discovery /path/to/project --advance --claim "
|
|
358
|
+
openprd discovery /path/to/project --advance --claim "用户可以从工作台发起会话" --evidence src/app.ts
|
|
303
359
|
openprd discovery /path/to/project --verify
|
|
304
360
|
openprd change /path/to/project --generate --change <change-id>
|
|
305
361
|
openprd change /path/to/project --validate --change <change-id>
|
|
@@ -312,20 +368,18 @@ openprd specs /path/to/project
|
|
|
312
368
|
openprd changes /path/to/project
|
|
313
369
|
```
|
|
314
370
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
`taskSharding.maxItemsPerFile`.
|
|
371
|
+
持续发现的校验也会检查当前 OpenPrd change 结构、spec delta、`docs/basic/`
|
|
372
|
+
标准化文档和长程任务文件。保留 `tasks.md` 作为第一个入口,每个任务文件最多放
|
|
373
|
+
25 个实质 checkbox 任务;超过后继续使用 `tasks-002.md`、`tasks-003.md`。
|
|
374
|
+
每个非最终任务文件的最后一个 checkbox 应指向下一个任务文件,方便 Agent 按顺序
|
|
375
|
+
继续。项目也可以通过 `.openprd/discovery/config.json` 的
|
|
376
|
+
`taskSharding.maxItemsPerFile` 使用更细的本地限制。
|
|
322
377
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
section labels like "primary flow", "requirement", or "acceptance goal".
|
|
378
|
+
这里的 25 只是分片上限,不是拆解目标。任务标题应优先描述可直接落地的实现单元、
|
|
379
|
+
接线边界、页面入口、集成闭环和回归项,而不是把“主流程 / 功能需求 / 验收目标 /
|
|
380
|
+
非功能需求”这些 PRD 小节逐条平移成 checkbox。
|
|
327
381
|
|
|
328
|
-
|
|
382
|
+
如果任务需要稳定编号来支撑长程执行,只保留最小元数据:
|
|
329
383
|
|
|
330
384
|
```md
|
|
331
385
|
- [ ] T009.07 Port legacy database import preview
|
|
@@ -333,28 +387,36 @@ When a task needs a stable id for long-running execution, keep the metadata smal
|
|
|
333
387
|
- deps: T001.14, T007.06
|
|
334
388
|
- done: preview shows counts, conflicts, skipped items, warnings
|
|
335
389
|
- verify: npm run test -- migration
|
|
336
|
-
-
|
|
390
|
+
- test-layer: unit, integration
|
|
391
|
+
- test-size: medium
|
|
392
|
+
- test-scope: cli-contract
|
|
393
|
+
- evidence-plan: 单元测试覆盖导入解析,命令行契约输出留下证据
|
|
337
394
|
```
|
|
338
395
|
|
|
339
|
-
|
|
340
|
-
`governance`
|
|
341
|
-
`
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
396
|
+
`type` 用来区分 `implementation`、`verification`、`documentation` 和
|
|
397
|
+
`governance`。`deps` 只在依赖前置任务时填写;`done` 写完成条件;`verify`
|
|
398
|
+
写验证命令或审查步骤。生成的 `implementation` 和 `verification` 任务默认使用
|
|
399
|
+
`openprd tasks . --change <id> --item <task-id> --evidence-required`:Agent 先运行本任务最小足够测试或审查,再通过
|
|
400
|
+
`--evidence <路径或摘要>` 传入证据,或在任务 metadata 写入 `evidence:` /
|
|
401
|
+
`waiver-reason:`;文档任务仍使用 standards 校验。`openprd run . --verify`
|
|
402
|
+
保留给阶段或最终门禁,不作为每个任务的默认验证;也不能只用
|
|
403
|
+
`openprd change . --validate` 代替真实落地证据。旧版生成任务如果仍写着
|
|
404
|
+
`verify: openprd run . --verify`,通过 `openprd tasks --verify` 执行时也会
|
|
405
|
+
按本任务 evidence 门处理,不会继续反复生成 workspace quality 报告。
|
|
406
|
+
|
|
407
|
+
任务也可以包含测试策略元数据。`test-layer`、`test-size`、`test-scope`
|
|
408
|
+
和 `evidence-plan` 用来帮助 OpenPrd 按风险选择最小足够证据:局部逻辑优先单元测试,
|
|
409
|
+
触达 CLI/API/Agent 契约或跨模块状态时使用集成/契约验证,触达用户主路径、视觉、小程序、
|
|
410
|
+
性能、安全或成本风险时升级到端到端或专项验证。这些字段是证据分流,不是固定 70/20/10
|
|
411
|
+
比例门禁。
|
|
349
412
|
|
|
350
|
-
`tasks`
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
stays small.
|
|
413
|
+
`tasks` 默认列出下一个依赖已满足的任务。`--advance` 会勾选完成任务;
|
|
414
|
+
同时传 `--verify` 时,会先运行该任务的 `verify` 命令,通过后再勾选。执行记录
|
|
415
|
+
写在任务文件外,避免把 `tasks.md` 元数据变复杂。
|
|
354
416
|
|
|
355
|
-
##
|
|
417
|
+
## 项目标准化
|
|
356
418
|
|
|
357
|
-
`openprd init`
|
|
419
|
+
`openprd init` 会创建项目标准化契约:
|
|
358
420
|
|
|
359
421
|
- `docs/basic/file-structure.md`
|
|
360
422
|
- `docs/basic/app-flow.md`
|
|
@@ -365,29 +427,31 @@ stays small.
|
|
|
365
427
|
- `.openprd/standards/file-manual-template.md`
|
|
366
428
|
- `.openprd/standards/folder-readme-template.md`
|
|
367
429
|
|
|
368
|
-
|
|
430
|
+
当项目已经存在源码文件时,`openprd standards --verify` 不只检查文件是否存在,还会阻断以下情况:
|
|
431
|
+
|
|
432
|
+
- `docs/basic/` 仍停留在“待补充”等模板占位内容。
|
|
433
|
+
- 源码文件头部缺少文件说明书。
|
|
434
|
+
- 承载源码的文件夹缺少 `[项目名]_[文件夹名]_README.md` 文件夹说明书。
|
|
435
|
+
|
|
436
|
+
检查命令:
|
|
369
437
|
|
|
370
438
|
```bash
|
|
371
439
|
openprd standards /path/to/project --verify
|
|
372
440
|
```
|
|
373
441
|
|
|
374
|
-
OpenPrd
|
|
375
|
-
|
|
376
|
-
`docs/basic/`.
|
|
442
|
+
OpenPrd 生成的 change 会包含标准化维护任务,change 校验也会检查这套契约。
|
|
443
|
+
项目基础文档的唯一标准路径是 `docs/basic/`。
|
|
377
444
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
behavior. If no documentation update is needed, agents should say the check was
|
|
384
|
-
performed and why the existing docs still match the code.
|
|
445
|
+
实现阶段的标准化维护是明确的影响判定,不是最后顺手清理。每次新增或修改源码
|
|
446
|
+
文件时,Agent 都要检查 `docs/basic/`、文件说明书、所在文件夹 README 是否缺失
|
|
447
|
+
或已因本次变更过期。缺失的必须补齐;已有文档如果受到职责、流程、结构、依赖
|
|
448
|
+
或产品行为变化影响,也必须同步更新。如果无需更新,应说明已经完成影响判定以及
|
|
449
|
+
为什么现有文档仍然准确。
|
|
385
450
|
|
|
386
|
-
##
|
|
451
|
+
## 效果图与截图拼图对比,自动优化
|
|
387
452
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
UI and generate a side-by-side review image before claiming visual completion:
|
|
453
|
+
当界面任务已经有效果图、设计稿、用户给图或 Agent 自己生成的 mock 时,Agent
|
|
454
|
+
在阶段性完成后应先截实现图,再生成左右对比图,不能只靠主观印象判断是否一致:
|
|
391
455
|
|
|
392
456
|
```bash
|
|
393
457
|
openprd visual-compare /path/to/project \
|
|
@@ -395,10 +459,20 @@ openprd visual-compare /path/to/project \
|
|
|
395
459
|
--actual implementation-screenshot.jpg
|
|
396
460
|
```
|
|
397
461
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
462
|
+
默认会在 `.openprd/harness/visual-reviews/` 下输出体积较小的 JPG。左侧标注
|
|
463
|
+
`效果图`,右侧标注 `实现截图`。输入可以是 `sharp` 支持的常见图片格式。
|
|
464
|
+
|
|
465
|
+
如果界面任务没有明确效果图,Agent 应先截修改前截图,完成改动后用同一入口、
|
|
466
|
+
视口、账号和数据状态再截修改后截图:
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
openprd visual-compare /path/to/project \
|
|
470
|
+
--before before-screenshot.png \
|
|
471
|
+
--after after-screenshot.jpg
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
修改前后模式会把左侧标注为 `修改前`、右侧标注为 `修改后`,帮助 Agent 检查
|
|
475
|
+
预期变化是否出现,以及未改区域是否有布局、颜色、密度或状态漂移。输出也可以按需要调整:
|
|
402
476
|
|
|
403
477
|
```bash
|
|
404
478
|
openprd visual-compare /path/to/project \
|
|
@@ -410,52 +484,40 @@ openprd visual-compare /path/to/project \
|
|
|
410
484
|
--max-panel-width 1180
|
|
411
485
|
```
|
|
412
486
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
should include the generated review image path and note whether differences
|
|
416
|
-
remain.
|
|
487
|
+
Agent 必须查看生成图并继续对标,直到没有明显视觉差异。最终回复里应给出本次
|
|
488
|
+
生成的对比图路径,并说明对比后是否仍有差异。
|
|
417
489
|
|
|
418
|
-
##
|
|
490
|
+
## 回归测试与质量评估报告
|
|
419
491
|
|
|
420
|
-
`openprd init`
|
|
492
|
+
`openprd init` 同时会创建质量契约:
|
|
421
493
|
|
|
422
494
|
- `.openprd/quality/config.json`
|
|
423
495
|
- `.openprd/quality/reports/`
|
|
424
496
|
- `.openprd/knowledge/`
|
|
425
497
|
|
|
426
|
-
|
|
498
|
+
检查命令:
|
|
427
499
|
|
|
428
500
|
```bash
|
|
429
501
|
openprd quality /path/to/project --verify
|
|
430
502
|
```
|
|
431
503
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
`openprd
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
every required test block is either passing with evidence or explicitly out of
|
|
450
|
-
scope for the scenario.
|
|
451
|
-
|
|
452
|
-
For UI work with an existing reference image, visual readiness also requires a
|
|
453
|
-
current `openprd visual-compare` artifact under `.openprd/harness/visual-reviews/`.
|
|
454
|
-
If the combined image still shows obvious differences, the task should return to
|
|
455
|
-
implementation instead of treating the gap as ready.
|
|
456
|
-
|
|
457
|
-
After a fix has been verified and reviewed, promote the abstract pattern into
|
|
458
|
-
project knowledge:
|
|
504
|
+
该命令会在 `.openprd/quality/reports/` 下同时写入 JSON 和 HTML。HTML 回归测试报告
|
|
505
|
+
是阶段性质量查看的主要产物,优先展示整体回归结果、逐需求模块结果、测试块通过情况、
|
|
506
|
+
分层测试策略矩阵、未通过项和需要确认是否属于本期的遗漏。EVO 是 OpenPrd 内部对
|
|
507
|
+
“质量评估/验证层”的简称;用户可见报告不要求理解这个缩写。脚本、依赖或 fixture
|
|
508
|
+
存在只代表项目具备能力,不能替代本次运行证据。
|
|
509
|
+
|
|
510
|
+
当需求涉及免费用户、额度、AI 调用、第三方 API、生成、存储、下载或其他消耗型成本时,
|
|
511
|
+
`quality --verify` 会额外检查是否存在成本来源、用户级限制、负向验证、用量/成本监控、
|
|
512
|
+
报警阈值和止损动作,避免免费额度或高成本路径在上线后才暴露。
|
|
513
|
+
|
|
514
|
+
`openprd quality --verify` 默认会在本期必测块未 production-ready 时返回失败;
|
|
515
|
+
`openprd run --verify` 会再次执行这个质量门禁。Agent 不得在本期必测块缺证据或需关注时宣称就绪。
|
|
516
|
+
如果界面任务已有参考图,视觉就绪还需要 `.openprd/harness/visual-reviews/`
|
|
517
|
+
下存在本次 `openprd visual-compare --reference/--actual` 产物;如果没有参考图但改动界面,
|
|
518
|
+
还需要存在 `openprd visual-compare --before/--after` 修改前后产物。对比图仍有明显差异或漂移时,应回到实现继续调整。
|
|
519
|
+
|
|
520
|
+
当一个问题已经修复并完成验证后,可以把抽象模式沉淀为项目级经验:
|
|
459
521
|
|
|
460
522
|
```bash
|
|
461
523
|
openprd quality /path/to/project --learn --review --from .openprd/harness/turn-state.json
|
|
@@ -463,21 +525,17 @@ openprd quality /path/to/project --learn --from <report-id-or-json>
|
|
|
463
525
|
openprd quality /path/to/project --learn --from ./diagnostics/incident-2026-05-24
|
|
464
526
|
```
|
|
465
527
|
|
|
466
|
-
`--learn --review`
|
|
467
|
-
`.openprd/knowledge/
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
`diagnostic-report`, `runtime-events`, `timeline`, or `root-cause-candidates`
|
|
474
|
-
artifacts, so a verified fix can be promoted directly into a reusable
|
|
475
|
-
troubleshooting skill.
|
|
528
|
+
`--learn --review` 会先在 `.openprd/knowledge/candidates/` 生成待确认
|
|
529
|
+
knowledge candidate,并在 `.openprd/knowledge/drafts/` 生成 draft skill。
|
|
530
|
+
确认值得长期保留后,再用 `--learn --from` promote 为 `.openprd/knowledge/`
|
|
531
|
+
下的 incident、pattern 和经验 Skill,让后续任务能提前触发同类经验,而不是重新排查一遍。`--from`
|
|
532
|
+
现在既可以接质量报告 JSON,也可以直接接已经导出的诊断目录 / 证据文件;
|
|
533
|
+
只要里面已经有 `diagnostic-report`、`runtime-events`、`timeline`、
|
|
534
|
+
`root-cause-candidates` 这些结构化诊断产物,就能直接沉淀成可复用的排查 Skill。
|
|
476
535
|
|
|
477
|
-
## Agent
|
|
536
|
+
## Agent 自动接入
|
|
478
537
|
|
|
479
|
-
OpenPrd
|
|
480
|
-
need to remember which skill, command, or hook to invoke:
|
|
538
|
+
OpenPrd 会把协同规则装进项目,让用户不需要记住具体 skill、命令或 hook:
|
|
481
539
|
|
|
482
540
|
```bash
|
|
483
541
|
openprd setup /path/to/project
|
|
@@ -491,76 +549,62 @@ openprd upgrade /path/to/project
|
|
|
491
549
|
openprd upgrade /path/to/projects --fleet --dry-run
|
|
492
550
|
openprd fleet /path/to/projects --dry-run
|
|
493
551
|
openprd fleet /path/to/projects --sync-registry
|
|
494
|
-
openprd fleet /path/to/projects --backfill-work-units
|
|
495
552
|
openprd run /path/to/project --context
|
|
496
553
|
openprd run /path/to/project --verify
|
|
497
554
|
openprd loop /path/to/project --plan --change <change-id>
|
|
498
555
|
openprd loop /path/to/project --run --agent codex --dry-run
|
|
499
556
|
```
|
|
500
557
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
-
|
|
508
|
-
-
|
|
509
|
-
-
|
|
510
|
-
- `.
|
|
511
|
-
- `.
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
`
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
`self-update`
|
|
520
|
-
`upgrade`
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
`--dry-run
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
review the side-by-side JPG before finishing the task.
|
|
552
|
-
|
|
553
|
-
`openprd run --context` may surface loop commands as execution commands, but they
|
|
554
|
-
are not automatic instructions. Agents should run `openprd loop --run`,
|
|
555
|
-
`openprd tasks --advance`, `openprd discovery --advance`, or commit commands only
|
|
556
|
-
when the current user message explicitly asks for development, implementation,
|
|
557
|
-
task continuation, deep research/benchmarking, replication, or commit. Read-only
|
|
558
|
-
planning and review turns should stop at the module/file plan.
|
|
559
|
-
|
|
560
|
-
Loop is recommended from the substantive implementation task count, not from every
|
|
561
|
-
checkbox. When a change has 10 or more pending/total `implementation` tasks,
|
|
562
|
-
`run --context` recommends an isolated worktree or equivalent environment plus a
|
|
563
|
-
single-task Loop session.
|
|
558
|
+
仅安装 CLI 不会直接改写项目或用户配置。用户在项目里运行 `openprd init` 或
|
|
559
|
+
`openprd setup` 时,才会安装完整的 Codex / Claude / Cursor 适配配置。
|
|
560
|
+
|
|
561
|
+
`setup` 与 `init` 会生成:
|
|
562
|
+
|
|
563
|
+
- `AGENTS.md` 中的 OpenPrd 管理规则
|
|
564
|
+
- `.codex/skills/`、`.codex/prompts/`、`.codex/config.toml`、`.codex/hooks.json` 和 `.codex/hooks/openprd-hook.mjs`
|
|
565
|
+
- 用户级 Codex config 的 `features.codex_hooks = true`
|
|
566
|
+
- `.claude/skills/`、`.claude/commands/openprd/` 和 `CLAUDE.md`
|
|
567
|
+
- `.cursor/rules/openprd.mdc` 和 `.cursor/commands/`
|
|
568
|
+
- `.openprd/harness/install-manifest.json`、`hook-state.json`、`events.jsonl`、`drift-report.json` 和 `visual-reviews/`
|
|
569
|
+
|
|
570
|
+
`setup`、`init`、`update` 和 `doctor` 还会维护 `.openprd/harness/install-manifest.json`
|
|
571
|
+
里的 `optionalCapabilities` 建议。它们只用于提示“配上会更好”的能力,不会把
|
|
572
|
+
初始化、诊断或当前任务变成失败。
|
|
573
|
+
|
|
574
|
+
`doctor` 会检查三端引导、Codex hooks 开关、项目标准化和 OpenPrd 工作区验证是否健康,同时展示像 Context7 / DeepWiki 这类可选增强建议。`update` 会从 OpenPrd 的统一源刷新这些生成文件,并保留用户自己已有的 hook 分组。
|
|
575
|
+
|
|
576
|
+
`self-update` 只更新 OpenPrd CLI 自身,默认使用公开 npm 包。
|
|
577
|
+
`upgrade` 会编排两层更新:先执行 `self-update`,再重新解析安装后的
|
|
578
|
+
`openprd` 可执行文件,然后执行 `update <project>`;加 `--fleet` 时会执行
|
|
579
|
+
`fleet <root> --update-openprd`,只刷新已有 `.openprd/` 的历史项目。两个入口都支持
|
|
580
|
+
`--dry-run`,预演时只打印安装和刷新命令,不修改 CLI、项目、registry 或 harness 状态。
|
|
581
|
+
|
|
582
|
+
这套 harness 是有状态的,但 hook 重量由 profile 控制。默认 `lite` 保留轻量
|
|
583
|
+
PreToolUse 写入门禁,并把匹配范围限制在直接编辑工具上,同时在 `Stop` 做一轮轻量项目经验回顾,避免只读 shell 噪声和完整工具级遥测;`guarded` 会额外覆盖 shell 工具,`full` 只建议用于临时深度诊断。`freeze`、`handoff`、accepted spec apply/archive、commit、push、release、publish 等高风险动作会先经过 `openprd run . --verify`,覆盖标准化、工作区校验、激活 change 校验和激活 discovery 校验。
|
|
584
|
+
|
|
585
|
+
`openprd run . --context` 是类似 Ralph 的循环控制面。它会从激活 change 任务、discovery coverage 或普通 OpenPrd 工作流状态里选择下一项可执行单元,并把 hook turn 记录到 `.openprd/harness/iterations.jsonl`。
|
|
586
|
+
|
|
587
|
+
### 长程 Agent Loop
|
|
588
|
+
|
|
589
|
+
如果进入真正的开发落地阶段,建议使用 `openprd loop`。它比 `run --context`
|
|
590
|
+
更严格:先生成稳定的 feature list,再为每个任务写出单独提示词,启动一个新的
|
|
591
|
+
Codex 或 Claude 会话只处理这一个任务。每个任务完成后必须先自测,失败就修复并
|
|
592
|
+
重新自测;前端界面任务在 Codex 客户端优先用 Computer Use,在 Codex CLI 和
|
|
593
|
+
Claude Code 中优先用 Playwright、MCP 浏览器自动化或项目已有 e2e 工具。验证
|
|
594
|
+
通过后,`loop --finish` 会写入阶段性测试报告,并可为该任务生成独立 commit。
|
|
595
|
+
界面任务完成前必须运行 `openprd visual-compare`:已有参考图时截实现图并走
|
|
596
|
+
`--reference/--actual`,没有参考图但改动界面时先留修改前截图、完成后留修改后截图并走
|
|
597
|
+
`--before/--after`,查看左右对比 JPG 后才能完成任务。
|
|
598
|
+
|
|
599
|
+
`openprd run --context` 可能展示 loop 相关执行命令,但它不是自动执行指令。
|
|
600
|
+
只有当用户当前明确要求开发、实现、继续任务、深度调研、深度对标、复刻落地或
|
|
601
|
+
提交时,Agent 才能运行 `openprd loop --run`、`openprd tasks --advance`、
|
|
602
|
+
`openprd discovery --advance` 或 commit 命令。规划和审查类对话应止步于模块 /
|
|
603
|
+
文件清单和证据说明。
|
|
604
|
+
|
|
605
|
+
Loop 建议按实质实现任务数触发,而不是按所有 checkbox 触发。当一个 change 的
|
|
606
|
+
`implementation` 任务总数或待处理数达到 10 个时,`run --context` 会建议使用
|
|
607
|
+
独立 worktree 或等价隔离环境,并通过单任务 Loop 会话推进。
|
|
564
608
|
|
|
565
609
|
```bash
|
|
566
610
|
openprd loop . --init
|
|
@@ -570,78 +614,65 @@ openprd loop . --prompt --agent codex
|
|
|
570
614
|
openprd loop . --run --agent codex --dry-run
|
|
571
615
|
openprd loop . --run --agent claude --dry-run
|
|
572
616
|
openprd loop . --verify --item T001.01
|
|
573
|
-
openprd loop . --finish --item T001.01 --commit --message "
|
|
617
|
+
openprd loop . --finish --item T001.01 --commit --message "新增版本说明入口"
|
|
574
618
|
```
|
|
575
619
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
- `feature-list.json` is the ordered implementation task list.
|
|
579
|
-
- Each loop task carries a human-readable `taskHandle` such as
|
|
580
|
-
`change-id:T001.01:task-title`, so another conversation can continue the same
|
|
581
|
-
task without relying on a chat-specific UUID.
|
|
582
|
-
- `progress.md` is the human-readable progress log.
|
|
583
|
-
- `failed-approaches.md` is the dead-end ledger for mismatches, rejected fixes,
|
|
584
|
-
and why they failed, so the next session does not retry the same path.
|
|
585
|
-
- `agent-sessions.jsonl` records each prompt/run/finish event, including the
|
|
586
|
-
task handle and task title for cross-session lookup.
|
|
587
|
-
- `bootstrap.sh` is the startup check each fresh agent session runs.
|
|
588
|
-
- `loop-state.json` stores the current task id, task handle, task title, and
|
|
589
|
-
the last agent session metadata.
|
|
590
|
-
- `loop-prompts/` stores generated single-task prompts for audit and reuse.
|
|
591
|
-
|
|
592
|
-
Use `--dry-run` first when you want OpenPrd to prepare the prompt and exact command
|
|
593
|
-
without launching an agent. Use `--agent codex` or `--agent claude` for the default
|
|
594
|
-
CLI integrations. Use `--agent-command "<custom command>"` only when you want to
|
|
595
|
-
pipe the OpenPrd prompt into a project-specific wrapper.
|
|
596
|
-
|
|
597
|
-
For historical projects, use `fleet` instead of hand-writing shell loops. By
|
|
598
|
-
default it scans and reports only, while also telling you how many known
|
|
599
|
-
OpenPrd workspaces already exist in the global registry and how many are outside
|
|
600
|
-
the current root. `--sync-registry` backfills initialized `.openprd/`
|
|
601
|
-
workspaces into `~/.openprd/registry/workspaces.jsonl`. `--update-openprd`
|
|
602
|
-
refreshes projects that already contain `.openprd/` and also backfills
|
|
603
|
-
historical PRD work unit bindings. Project standards or validation gaps are
|
|
604
|
-
reported as health items, but they do not block generated guidance updates. Use
|
|
605
|
-
`--backfill-work-units` when you only want to refresh versioned review artifacts
|
|
606
|
-
and identity bindings, while agent-only or plain projects stay untouched unless
|
|
607
|
-
explicitly selected with `--setup-missing`.
|
|
608
|
-
|
|
609
|
-
## How to Read `status` and `next`
|
|
610
|
-
|
|
611
|
-
OpenPrd is not just a command runner. It exposes collaboration state.
|
|
620
|
+
如果项目启用了 `release` 版本轨道,`loop --finish --commit` 会在成功提交后把当前任务的短文案累计到当前项目版本下,并尝试把同名本地 tag(例如 `0.1.23`)移动到最新 commit。若远端已存在同名 tag,OpenPrd 会提示风险并跳过本地 tag 改写,不会静默覆盖远端历史。
|
|
612
621
|
|
|
613
|
-
|
|
622
|
+
Loop 状态会沉淀在 `.openprd/harness/`:
|
|
614
623
|
|
|
615
|
-
|
|
624
|
+
- `feature-list.json`:按依赖排序的执行任务列表
|
|
625
|
+
- `feature-list.json`:每个任务都会带一个人类可读的 `taskHandle`,例如
|
|
626
|
+
`change-id:T001.01:task-title`,方便跨对话继续同一任务,而不是只靠聊天 UUID
|
|
627
|
+
- `progress.md`:给人看的进度记录
|
|
628
|
+
- `agent-sessions.jsonl`:每次 prompt / run / finish 的结构化事件,也会记录任务句柄和任务标题
|
|
629
|
+
- `bootstrap.sh`:每个新会话启动时执行的检查脚本
|
|
630
|
+
- `loop-state.json`:当前任务 id、任务句柄、任务标题,以及最近一次 Agent 会话状态
|
|
631
|
+
- `loop-prompts/`:生成过的单任务提示词,便于审计和复用
|
|
632
|
+
- `test-reports/`:每个任务的阶段性测试报告,会和任务改动一起提交
|
|
616
633
|
|
|
617
|
-
-
|
|
618
|
-
|
|
619
|
-
-
|
|
620
|
-
- upcoming gate
|
|
634
|
+
建议先用 `--dry-run`,让 OpenPrd 生成提示词和准确执行命令,但不直接启动 Agent。
|
|
635
|
+
`--agent codex` / `--agent claude` 会使用默认 CLI 集成;只有需要接入团队自定义
|
|
636
|
+
包装器时,才使用 `--agent-command "<custom command>"`。
|
|
621
637
|
|
|
622
|
-
|
|
638
|
+
OpenPrd 面向用户的时间统一使用上海时区的 `YYYY-MM-DD HH:mm:ss` 格式,不输出
|
|
639
|
+
`T`、`Z` 或毫秒后缀。除命令、字段名、文件路径、API 名称、品牌名和产品名等必要
|
|
640
|
+
专有术语外,生成文档、进度日志、proposal、prompt、测试报告,以及 Agent 产出的
|
|
641
|
+
`spec.md` 与 tasks 默认使用简体中文。结构字段优先使用“新增需求”“需求”“场景”
|
|
642
|
+
“当”“则”等中文表达,同时继续兼容历史 OpenSpec 英文结构字段。
|
|
623
643
|
|
|
624
|
-
- `
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
644
|
+
历史项目不要手写 shell 循环批量改。使用 `fleet` 先扫描报告;它现在会顺带提示全局 registry 里已经登记了多少 OpenPrd 工作区、当前 root 外还有多少已知项目。`--sync-registry` 用来把当前 root 下已初始化的 `.openprd/` 工作区回填到 `~/.openprd/registry/workspaces.jsonl`。`--update-openprd` 只刷新已经有 `.openprd/` 的项目,项目自身 standards 或 validate 缺口会作为“项目健康需关注”报告,但不阻断生成引导更新;只有 agent 配置或普通项目默认保持不变,除非显式用 `--setup-missing` 接管。
|
|
645
|
+
|
|
646
|
+
## 怎么看 `status` / `next`
|
|
647
|
+
|
|
648
|
+
### `openprd status`
|
|
649
|
+
|
|
650
|
+
重点看:
|
|
651
|
+
|
|
652
|
+
- `Scenario`
|
|
653
|
+
- `User participation mode`
|
|
654
|
+
- `Current gate`
|
|
655
|
+
- `Upcoming gate`
|
|
656
|
+
- `项目版本`(如果已启用 release 版本轨道)
|
|
628
657
|
|
|
629
658
|
### `openprd next`
|
|
630
659
|
|
|
631
|
-
|
|
660
|
+
重点看:
|
|
632
661
|
|
|
633
|
-
-
|
|
634
|
-
-
|
|
635
|
-
-
|
|
662
|
+
- `Next action`
|
|
663
|
+
- `Current gate`
|
|
664
|
+
- `Upcoming gate`
|
|
665
|
+
- `Suggested command`
|
|
666
|
+
- `Suggested questions`
|
|
636
667
|
|
|
637
|
-
##
|
|
668
|
+
## 图 Contract
|
|
638
669
|
|
|
639
|
-
OpenPrd
|
|
670
|
+
OpenPrd 支持:
|
|
640
671
|
|
|
641
672
|
- `architecture`
|
|
642
673
|
- `product-flow`
|
|
643
674
|
|
|
644
|
-
|
|
675
|
+
也支持从显式 contract 渲染:
|
|
645
676
|
|
|
646
677
|
```bash
|
|
647
678
|
openprd diagram /path/to/project \
|
|
@@ -649,79 +680,29 @@ openprd diagram /path/to/project \
|
|
|
649
680
|
--input ./product-flow-contract.json
|
|
650
681
|
```
|
|
651
682
|
|
|
652
|
-
The diagram contract is validated against built-in schema files in `.openprd/schema/`.
|
|
653
|
-
|
|
654
683
|
## Agent Skills
|
|
655
684
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
- `skills/openprd-shared/` — shared guardrails and language/review rules
|
|
659
|
-
- `skills/openprd-harness/` — main OpenPrd workflow sequencing
|
|
660
|
-
- `skills/openprd-standards/` — project docs, file manual, and folder README standards
|
|
661
|
-
- `skills/openprd-diagram-review/` — diagram generation and review loop guidance
|
|
662
|
-
- `skills/openprd-discovery-loop/` — sustained OpenPrd coverage discovery
|
|
663
|
-
|
|
664
|
-
Agents entering this repository should read:
|
|
665
|
-
|
|
666
|
-
- `AGENTS.md`
|
|
667
|
-
|
|
668
|
-
## Project Structure
|
|
669
|
-
|
|
670
|
-
```text
|
|
671
|
-
.
|
|
672
|
-
├── AGENTS.md
|
|
673
|
-
├── bin/
|
|
674
|
-
├── src/
|
|
675
|
-
├── skills/
|
|
676
|
-
├── test/
|
|
677
|
-
├── docs/
|
|
678
|
-
│ └── basic/
|
|
679
|
-
├── openprd/
|
|
680
|
-
│ ├── changes/
|
|
681
|
-
│ ├── specs/
|
|
682
|
-
│ └── archive/
|
|
683
|
-
└── .openprd/
|
|
684
|
-
├── schema/
|
|
685
|
-
├── templates/
|
|
686
|
-
├── engagements/
|
|
687
|
-
├── state/
|
|
688
|
-
└── exports/
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
Key directories:
|
|
692
|
-
|
|
693
|
-
- `src/` — CLI logic, PRD core, diagram rendering
|
|
694
|
-
- `docs/basic/` — project-level baseline docs maintained by OpenPrd standards
|
|
695
|
-
- `skills/` — repo-local agent skill system
|
|
696
|
-
- `.openprd/` — shipped workspace seed
|
|
697
|
-
- `test/` — regression coverage for clarify / capture / diagram / gate logic
|
|
698
|
-
|
|
699
|
-
## Agent Prompt Examples
|
|
700
|
-
|
|
701
|
-
You can steer agents with prompts like:
|
|
702
|
-
|
|
703
|
-
```text
|
|
704
|
-
Use $openprd-harness to initialize and advance an OpenPrd workspace for this product idea.
|
|
705
|
-
```
|
|
706
|
-
|
|
707
|
-
```text
|
|
708
|
-
Use $openprd-diagram-review to generate a product-flow review artifact before freeze.
|
|
709
|
-
```
|
|
685
|
+
仓库内自带:
|
|
710
686
|
|
|
711
|
-
|
|
687
|
+
- `skills/openprd-shared/`
|
|
688
|
+
- `skills/openprd-harness/`
|
|
689
|
+
- `skills/openprd-standards/`
|
|
690
|
+
- `skills/openprd-diagram-review/`
|
|
691
|
+
- `skills/openprd-discovery-loop/`
|
|
712
692
|
|
|
713
|
-
|
|
693
|
+
配合顶层 `AGENTS.md` 使用,可以让 Agent 更稳定地按照 OpenPrd 的协同方式工作。
|
|
714
694
|
|
|
715
|
-
##
|
|
695
|
+
## 贡献与安全
|
|
716
696
|
|
|
717
|
-
|
|
697
|
+
- 贡献说明:见 [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
698
|
+
- 安全披露:见 [SECURITY.md](./SECURITY.md)
|
|
718
699
|
|
|
719
|
-
##
|
|
700
|
+
## 许可证
|
|
720
701
|
|
|
721
|
-
MIT —
|
|
702
|
+
MIT — 见 [LICENSE](./LICENSE)
|
|
722
703
|
|
|
723
|
-
##
|
|
704
|
+
## 作者
|
|
724
705
|
|
|
725
706
|
- X: [Mileson07](https://x.com/Mileson07)
|
|
726
|
-
-
|
|
727
|
-
-
|
|
707
|
+
- 小红书: [超级峰](https://xhslink.com/m/4LnJ9aB1f97)
|
|
708
|
+
- 抖音: [超级峰](https://v.douyin.com/rH645q7trd8/)
|