@openprd/cli 0.1.1 → 0.1.8
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 +344 -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 +399 -438
- package/README_CN.md +4 -578
- package/README_EN.md +850 -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 +46 -24
- package/skills/openprd-harness/references/workflow-gates.md +15 -0
- package/skills/openprd-quality/SKILL.md +10 -4
- 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 +265 -65
- 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 +639 -117
- 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 +1176 -75
- 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,285 @@
|
|
|
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
|
+
最近 30 天的 Codex 项目记录里,OpenPrd 反复出现在几类连续工作里:模糊需求澄清、
|
|
65
|
+
已有产品流程改造、发布与交付、线上问题闭环,以及把一次完成的工作整理成可复用学习资料。
|
|
66
|
+
|
|
67
|
+
| 场景 | 为什么这里更像 OpenPrd 的强项 | 主要产物 |
|
|
68
|
+
|------|--------------------------------|----------|
|
|
69
|
+
| 模糊产品需求,先别急着写代码 | 先澄清,再区分用户确认事实与 Agent 推断,最后把结果沉淀成稳定评审页。 | `clarify`、`capture`、`synthesize`、`review.html` |
|
|
70
|
+
| 已有流程或登录入口改造 | 先从仓库与运行态重建当前事实,再决定下一步 change,而不是直接拍脑袋改。 | `discovery`、`diagram`、`review.html`、`change` |
|
|
71
|
+
| 流程图、界面或架构确认 | 把理解差异放到图示和可评审产物里,而不是埋在聊天记录里。 | `diagram`、`visual-compare`、左右对比 JPG |
|
|
72
|
+
| 长程 Agent 执行链路 | 把确认后的工作拆成按依赖可执行的小任务,每次新会话只推进一个任务并带验证门禁。 | `tasks`、`loop`、任务提示词、进度日志、验证报告 |
|
|
73
|
+
| 发布、开源、交接前收口 | 让“现在能不能交付”变成有证据的显式判断,而不是靠感觉。 | `quality`、`run --verify`、`doctor`、`handoff` |
|
|
74
|
+
| 一次需求或修复做完后沉淀学习资料 | 把最终需求、过程判断和结果整理成新成员可以直接学习的资料。 | 学习阅读器、`.openprd/knowledge/skills/`、docs 同步 |
|
|
75
|
+
|
|
76
|
+
## HTML 优先协作产物
|
|
77
|
+
|
|
78
|
+
OpenPrd 会生成可以直接分享的 HTML 面板,让产品、研发和 Agent
|
|
79
|
+
围绕同一份稳定 artifact 协作,而不是各自回放聊天记录或命令输出。
|
|
67
80
|
|
|
68
81
|
### `review.html`
|
|
69
82
|
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
把当前需求版本整理成可评审页面,适合先给产品、研发或负责人确认“这次到底在做什么”。
|
|
84
|
+
如果项目已经启用 `release` 版本轨道,评审页顶部也会直接显示当前 `项目版本`。
|
|
72
85
|
|
|
73
86
|

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

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

|
|
88
99
|
|
|
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.
|
|
100
|
+
### 效果图与截图拼图对比,自动优化
|
|
94
101
|
|
|
95
|
-
|
|
102
|
+
把效果图和实现截图放进同一张左右对比图里,适合登录入口改造、条款页本地化、弹窗复刻这类阶段性评审。
|
|
96
103
|
|
|
97
|
-
|
|
104
|
+

|
|
98
105
|
|
|
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.
|
|
106
|
+
## 自我成长机制
|
|
103
107
|
|
|
104
|
-
|
|
108
|
+
OpenPrd 会沿着两条看得见的循环,越用越贴合你们的协作方式。一条循环把真实项目里反复验证过的做法沉淀成可复用的 `项目级 Skill`;另一条循环把不同场景下更合适的协作设置沉淀成 `动态参数配置`,让下次启动时直接带上更合适的默认做法。
|
|
105
109
|
|
|
106
|
-
|
|
110
|
+

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