hunter-harness 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +11 -0
  3. package/dist/bin.js +1540 -491
  4. package/package.json +9 -7
  5. package/resources/harness/general/.harness-build.json +0 -5
  6. package/resources/harness/general/CONTEXT.md +0 -65
  7. package/resources/harness/general/README.md +0 -478
  8. package/resources/harness/general/agents/harness-evaluator.md +0 -96
  9. package/resources/harness/general/agents/harness-explorer.md +0 -72
  10. package/resources/harness/general/agents/harness-reviewer.md +0 -69
  11. package/resources/harness/general/harness-archive/SKILL.md +0 -215
  12. package/resources/harness/general/harness-archive/checklist.md +0 -52
  13. package/resources/harness/general/harness-archive/reference.md +0 -103
  14. package/resources/harness/general/harness-archive/scripts/gen-manifest.ps1 +0 -31
  15. package/resources/harness/general/harness-archive/templates/render-summary.mjs +0 -171
  16. package/resources/harness/general/harness-archive/templates/summary-data-template.json +0 -128
  17. package/resources/harness/general/harness-codebase-map/SKILL.md +0 -112
  18. package/resources/harness/general/harness-codebase-map/checklist.md +0 -126
  19. package/resources/harness/general/harness-codebase-map/reference.md +0 -364
  20. package/resources/harness/general/harness-codebase-map/templates/ARCHITECTURE.md +0 -57
  21. package/resources/harness/general/harness-codebase-map/templates/CONCERNS.md +0 -49
  22. package/resources/harness/general/harness-codebase-map/templates/CONVENTIONS.md +0 -57
  23. package/resources/harness/general/harness-codebase-map/templates/INTEGRATIONS.md +0 -52
  24. package/resources/harness/general/harness-codebase-map/templates/STACK.md +0 -55
  25. package/resources/harness/general/harness-codebase-map/templates/STRUCTURE.md +0 -69
  26. package/resources/harness/general/harness-codebase-map/templates/TESTING.md +0 -64
  27. package/resources/harness/general/harness-codebase-map/templates/map-manifest.schema.json +0 -73
  28. package/resources/harness/general/harness-codebase-map/templates/map-summary.md +0 -64
  29. package/resources/harness/general/harness-knowledge-ingest/SKILL.md +0 -246
  30. package/resources/harness/general/harness-knowledge-ingest/design.md +0 -842
  31. package/resources/harness/general/harness-knowledge-ingest/evaluations/harness_knowledge_evaluation.xml +0 -42
  32. package/resources/harness/general/harness-knowledge-ingest/mcp-config.example.json +0 -10
  33. package/resources/harness/general/harness-knowledge-ingest/reference.md +0 -309
  34. package/resources/harness/general/harness-knowledge-ingest/scripts/harness_knowledge.py +0 -4082
  35. package/resources/harness/general/harness-knowledge-ingest/scripts/harness_knowledge_mcp.py +0 -273
  36. package/resources/harness/general/harness-knowledge-query/SKILL.md +0 -164
  37. package/resources/harness/general/harness-plan/SKILL.md +0 -127
  38. package/resources/harness/general/harness-plan/checklist.md +0 -243
  39. package/resources/harness/general/harness-plan/protocols.md +0 -124
  40. package/resources/harness/general/harness-plan/reference.md +0 -376
  41. package/resources/harness/general/harness-review/SKILL.md +0 -156
  42. package/resources/harness/general/harness-review/checklist.md +0 -124
  43. package/resources/harness/general/harness-review/protocols.md +0 -68
  44. package/resources/harness/general/harness-review/reference.md +0 -86
  45. package/resources/harness/general/harness-run/SKILL.md +0 -132
  46. package/resources/harness/general/harness-run/checklist.md +0 -259
  47. package/resources/harness/general/harness-run/protocols.md +0 -78
  48. package/resources/harness/general/harness-run/reference.md +0 -834
  49. package/resources/harness/general/harness-submit/SKILL.md +0 -159
  50. package/resources/harness/general/harness-submit/checklist.md +0 -407
  51. package/resources/harness/general/harness-submit/reference.md +0 -152
  52. package/resources/harness/general/harness-sync/SKILL.md +0 -82
  53. package/resources/harness/general/harness-sync/reference.md +0 -153
  54. package/resources/harness/general/harness-test/SKILL.md +0 -180
  55. package/resources/harness/general/harness-test/checklist.md +0 -319
  56. package/resources/harness/general/harness-test/pitfalls.md +0 -260
  57. package/resources/harness/general/harness-test/reference.md +0 -791
  58. package/resources/harness/general/protocols/archive-report-protocol.md +0 -175
  59. package/resources/harness/general/protocols/evidence-based-reporting-protocol.md +0 -134
  60. package/resources/harness/general/protocols/ledger-protocol.md +0 -270
  61. package/resources/harness/general/protocols/powershell-protocol.md +0 -181
  62. package/resources/harness/general/protocols/report-pipeline-protocol.md +0 -150
  63. package/resources/harness/general/protocols/sensitive-info-protocol.md +0 -92
  64. package/resources/harness/general/protocols/state-layout-protocol.md +0 -131
  65. package/resources/harness/general/protocols/submit-protocol.md +0 -78
  66. package/resources/harness/general/scripts/harness_archive.py +0 -2319
  67. package/resources/harness/general/scripts/harness_deploy.py +0 -613
  68. package/resources/harness/general/scripts/harness_events.py +0 -680
  69. package/resources/harness/general/scripts/harness_ledger.py +0 -671
  70. package/resources/harness/general/scripts/harness_preflight.py +0 -780
  71. package/resources/harness/general/scripts/harness_service.py +0 -1331
  72. package/resources/harness/java/.harness-build.json +0 -5
  73. package/resources/harness/java/CONTEXT.md +0 -65
  74. package/resources/harness/java/README.md +0 -478
  75. package/resources/harness/java/agents/harness-evaluator.md +0 -96
  76. package/resources/harness/java/agents/harness-explorer.md +0 -72
  77. package/resources/harness/java/agents/harness-reviewer.md +0 -69
  78. package/resources/harness/java/harness-apidoc/SKILL.md +0 -86
  79. package/resources/harness/java/harness-apidoc/checklist.md +0 -142
  80. package/resources/harness/java/harness-apidoc/reference.md +0 -233
  81. package/resources/harness/java/harness-archive/SKILL.md +0 -215
  82. package/resources/harness/java/harness-archive/checklist.md +0 -52
  83. package/resources/harness/java/harness-archive/reference.md +0 -103
  84. package/resources/harness/java/harness-archive/scripts/gen-manifest.ps1 +0 -31
  85. package/resources/harness/java/harness-archive/templates/render-summary.mjs +0 -171
  86. package/resources/harness/java/harness-archive/templates/summary-data-template.json +0 -128
  87. package/resources/harness/java/harness-codebase-map/SKILL.md +0 -112
  88. package/resources/harness/java/harness-codebase-map/checklist.md +0 -126
  89. package/resources/harness/java/harness-codebase-map/reference.md +0 -364
  90. package/resources/harness/java/harness-codebase-map/templates/ARCHITECTURE.md +0 -57
  91. package/resources/harness/java/harness-codebase-map/templates/CONCERNS.md +0 -49
  92. package/resources/harness/java/harness-codebase-map/templates/CONVENTIONS.md +0 -57
  93. package/resources/harness/java/harness-codebase-map/templates/INTEGRATIONS.md +0 -52
  94. package/resources/harness/java/harness-codebase-map/templates/STACK.md +0 -55
  95. package/resources/harness/java/harness-codebase-map/templates/STRUCTURE.md +0 -69
  96. package/resources/harness/java/harness-codebase-map/templates/TESTING.md +0 -64
  97. package/resources/harness/java/harness-codebase-map/templates/map-manifest.schema.json +0 -73
  98. package/resources/harness/java/harness-codebase-map/templates/map-summary.md +0 -64
  99. package/resources/harness/java/harness-knowledge-ingest/SKILL.md +0 -246
  100. package/resources/harness/java/harness-knowledge-ingest/design.md +0 -842
  101. package/resources/harness/java/harness-knowledge-ingest/evaluations/harness_knowledge_evaluation.xml +0 -42
  102. package/resources/harness/java/harness-knowledge-ingest/mcp-config.example.json +0 -10
  103. package/resources/harness/java/harness-knowledge-ingest/reference.md +0 -309
  104. package/resources/harness/java/harness-knowledge-ingest/scripts/harness_knowledge.py +0 -4082
  105. package/resources/harness/java/harness-knowledge-ingest/scripts/harness_knowledge_mcp.py +0 -273
  106. package/resources/harness/java/harness-knowledge-query/SKILL.md +0 -164
  107. package/resources/harness/java/harness-package/SKILL.md +0 -87
  108. package/resources/harness/java/harness-package/checklist.md +0 -322
  109. package/resources/harness/java/harness-package/reference.md +0 -210
  110. package/resources/harness/java/harness-plan/SKILL.md +0 -127
  111. package/resources/harness/java/harness-plan/checklist.md +0 -243
  112. package/resources/harness/java/harness-plan/protocols.md +0 -124
  113. package/resources/harness/java/harness-plan/reference.md +0 -376
  114. package/resources/harness/java/harness-review/SKILL.md +0 -156
  115. package/resources/harness/java/harness-review/checklist.md +0 -124
  116. package/resources/harness/java/harness-review/protocols.md +0 -68
  117. package/resources/harness/java/harness-review/reference.md +0 -86
  118. package/resources/harness/java/harness-run/SKILL.md +0 -148
  119. package/resources/harness/java/harness-run/checklist.md +0 -250
  120. package/resources/harness/java/harness-run/protocols.md +0 -78
  121. package/resources/harness/java/harness-run/reference.md +0 -814
  122. package/resources/harness/java/harness-submit/SKILL.md +0 -166
  123. package/resources/harness/java/harness-submit/checklist.md +0 -407
  124. package/resources/harness/java/harness-submit/reference.md +0 -152
  125. package/resources/harness/java/harness-sync/SKILL.md +0 -82
  126. package/resources/harness/java/harness-sync/reference.md +0 -153
  127. package/resources/harness/java/harness-test/SKILL.md +0 -192
  128. package/resources/harness/java/harness-test/checklist.md +0 -317
  129. package/resources/harness/java/harness-test/pitfalls-java.md +0 -16
  130. package/resources/harness/java/harness-test/pitfalls.md +0 -260
  131. package/resources/harness/java/harness-test/reference.md +0 -788
  132. package/resources/harness/java/protocols/archive-report-protocol.md +0 -175
  133. package/resources/harness/java/protocols/evidence-based-reporting-protocol.md +0 -134
  134. package/resources/harness/java/protocols/ledger-protocol.md +0 -270
  135. package/resources/harness/java/protocols/powershell-protocol.md +0 -181
  136. package/resources/harness/java/protocols/report-pipeline-protocol.md +0 -150
  137. package/resources/harness/java/protocols/sensitive-info-protocol.md +0 -92
  138. package/resources/harness/java/protocols/state-layout-protocol.md +0 -131
  139. package/resources/harness/java/protocols/submit-protocol.md +0 -78
  140. package/resources/harness/java/scripts/harness_archive.py +0 -2319
  141. package/resources/harness/java/scripts/harness_deploy.py +0 -613
  142. package/resources/harness/java/scripts/harness_events.py +0 -680
  143. package/resources/harness/java/scripts/harness_ledger.py +0 -671
  144. package/resources/harness/java/scripts/harness_preflight.py +0 -780
  145. package/resources/harness/java/scripts/harness_service.py +0 -1331
  146. package/resources/harness/manifests/general.json +0 -276
  147. package/resources/harness/manifests/java.json +0 -304
  148. package/resources/harness/migrations/0.1.1/general.json +0 -358
  149. package/resources/harness/migrations/0.1.1/java.json +0 -398
@@ -1,243 +0,0 @@
1
- ---
2
- description: harness-plan 的阶段检查清单和覆盖检查列表。仅在执行完整需求规划时读取。
3
- ---
4
-
5
- # harness-plan 检查清单
6
-
7
- ## 阶段 0:工作区变更检查 ⚠️ 强制检查
8
-
9
- > 有未提交业务变更(排除 `.harness/`)→ **默认 baseline 隔离**,append `decision` 事件,**不 AskUserQuestion**,继续规划。PowerShell 失败 → ❌ 停止。
10
-
11
- **固定命令**:`powershell.exe -Command "git -C '<项目路径>' status --porcelain"`
12
-
13
- **判定**:stdout 为空 → ✅ 继续;stdout 非空 → baseline 隔离 + `decision`(note 含变更文件列表);Bash 被拒 → PowerShell 重试。
14
-
15
- ## 阶段 2:Worktree 决策(并入设计审批包)
16
-
17
- > worktree 不再单独询问。阶段 5 **设计审批包** 一次 AskUserQuestion 含 worktree 选项(推荐值读 `harness.json` `defaultWorktree`)。确认后写入 `meta/worktree.json`。
18
-
19
- - [ ] 审批包确认后写入 worktree.json(`requested` true/false)
20
- - [ ] 阶段 8 检查 worktree.json 存在
21
-
22
- ## 阶段 3:代码探索确认(含 Agent/CodeGraph 降级记录)
23
-
24
- 阶段 3 执行完成后,确认以下事项:
25
-
26
- ```
27
- □ 是通过 Agent 工具委派 subagent 执行的(不是主会话直接调用 codegraph)
28
- □ subagent 返回了结构化设计概要(涉及模块、接口变更、关键决策)
29
- □ 委派前已运行 `harness_preflight.py check-agents --agent harness-explorer`
30
- □ `usable=false` 或未返回有效输出 → 主会话探索,**不 retry 委派**
31
- □ 主会话未被代码探索的中间结果污染
32
- □ 在执行日志中记录了 Agent 调用状态:
33
- - 是否成功调用
34
- - 使用的 agent 名称
35
- - 是否只读
36
- - 子代理实际 tool uses 计数
37
- - 返回的核心结论
38
- ```
39
-
40
- > 如果 Agent 工具不可用,或子代理被委派但未返回有效输出(0 tool uses / 空返回 / 仅 "Done"),必须显式降级并记录:
41
- > - 在执行日志中写明降级原因:🟡 阶段3降级:Agent 不可用 / 子代理未返回有效输出,改为主会话只读探索
42
- > - 主会话直接使用 codegraph MCP 工具(`mcp__codegraph__codegraph_explore`)和 Read 探索代码(只读,不执行写操作)
43
- > - 不得在主会话中执行任何写操作
44
- > - CodeGraph 如通过 MCP 调用,必须优先用 MCP 工具,不允许通过普通 Bash 调 codegraph 命令
45
- > - 禁止把子代理未经工具验证的文本结论当作"详尽报告"或代码证据采纳
46
-
47
- ## 阶段 5:设计审批包 ⚠️ 强制阻断(一次 AskUserQuestion)
48
-
49
- > 合并原「设计审核 + worktree + 场景表预览 + change-name」。推荐 worktree 读 `harness.json` `defaultWorktree`。
50
-
51
- **展示内容**:
52
-
53
- 1. 设计摘要 + 关键证据 + 风险 + 变更清单
54
- 2. 测试场景表摘要 + 8 维度覆盖检查
55
- 3. worktree 选项(是/否,含推荐理由)
56
- 4. change-name(自动生成,可修改)
57
- 5. 确认进入任务拆分
58
-
59
- 确认后写入 `spec/<change>-design.md`(含 frontmatter)和 `meta/worktree.json`。
60
-
61
- 设计文档必须包含 frontmatter:
62
- ```yaml
63
- ---
64
- change-name: <change-name>
65
- created: YYYY-MM-DD HH:mm
66
- status: approved
67
- source: harness-plan
68
- ---
69
- ```
70
-
71
- 展示可审核包后,使用 `AskUserQuestion` 询问用户:
72
- - **确认**:设计方向正确,继续任务拆分
73
- - **修改**:某个部分需要调整,修改后再审核
74
- - **取消**:方向不对,回到需求澄清阶段
75
-
76
- ### 设计文档自审清单
77
-
78
- 写完设计文档后,用以下清单自检,**并将自审结果展示给用户**:
79
-
80
- ```
81
- □ 无"TBD"/"TODO"/未完成章节
82
- □ 各节之间无矛盾
83
- □ 范围聚焦,无不相关内容
84
- □ 无歧义需求(可被两种方式解读的,已选一种并明确说明)
85
- □ 自审结果已展示给用户
86
- ```
87
-
88
- > 展示格式示例:
89
- > ```
90
- > ### 设计文档自审
91
- > - ✅ 无 TBD/TODO/未完成章节
92
- > - ✅ 各节之间无矛盾
93
- > - ✅ 范围聚焦,无不相关内容
94
- > - ⚠️ 第3.2节"枚举删除"与第4节变更清单中"标记@Deprecated"有矛盾,已修正为"删除"
95
- > ```
96
-
97
- ## 测试场景覆盖检查表(8 维度覆盖检查表,强制输出)
98
-
99
- > 注意:覆盖检查表是 8 维度,与 4 维度场景表(单元/接口/数据兼容/集成)是两个不同制品。
100
-
101
- 生成场景表后,逐项确认是否覆盖,**必须输出覆盖检查表展示给用户确认**。未覆盖的维度必须标记为缺口(⚠️ 缺口),不得全部标记为 ✅:
102
-
103
- | 覆盖维度 | 状态 | 说明 |
104
- |---|---|---|
105
- | 正常路径 | ✅/🟡/❌ | 每个接口 ≥ 1 个正常场景 |
106
- | 参数校验 | ✅/🟡/❌ | 必填缺失、格式非法、类型错误 |
107
- | 业务规则 | ✅/🟡/❌ | 唯一性、范围约束、状态机 |
108
- | 权限/组织边界 | ✅/🟡/❌ | 无权限、跨组织、角色限制 |
109
- | 数据兼容 | ✅/🟡/❌ | 旧数据无新字段 |
110
- | 错误码 | ✅/🟡/❌ | 每个异常对应明确错误码 |
111
- | 集成影响 | ✅/🟡/❌ | 跨模块调用、端到端流程 |
112
- | 并发/幂等 | ✅/🟡/❌ | 重复提交、并发修改 |
113
-
114
- > 展示格式示例:
115
- > ```
116
- > ### 场景覆盖检查表
117
- > | 覆盖维度 | 状态 | 说明 |
118
- > |---|---|---|
119
- > | 正常路径 | ✅ | 5 个接口各 ≥ 1 个正常场景 |
120
- > | 参数校验 | ✅ | 必填缺失、格式非法已覆盖 |
121
- > | 业务规则 | ✅ | 唯一性、状态机已覆盖 |
122
- > | 权限/组织边界 | 🟡 | ⚠️ 缺口:未覆盖跨组织场景,需补充 |
123
- > | 数据兼容 | ✅ | 旧数据 scene_code 迁移场景已覆盖 |
124
- > | 错误码 | ✅ | 3 个错误码均有对应场景 |
125
- > | 集成影响 | 🟡 | ⚠️ 缺口:未覆盖端到端流程,需部署后验证 |
126
- > | 并发/幂等 | ❌ | ⚠️ 缺口:未覆盖重复提交场景,需补充 |
127
- > ```
128
-
129
- ## 阶段 7.5:计划对抗评审(可选)确认
130
-
131
- > 仅在用户选择启用对抗评审时执行本节检查。默认不启用(高风险构建 auth/支付/迁移/并发 才启用)。
132
-
133
- 阶段 7.5 执行完成后,确认以下事项:
134
-
135
- ```
136
- □ 已用 **设计审批包** 一次 AskUserQuestion(设计 + 场景表摘要 + worktree + change-name)
137
- □ **未**单独询问 worktree 或对抗评审(对抗评审仅 `--adversarial`)
138
- □ 用户同意后,已用 Agent 工具委派 harness-evaluator(haiku, context:fork, plan 模式只读, maxTurns:8)
139
- □ 已用 context:fork 隔离上下文(evaluator 未参与规划,破除确认偏误)
140
- □ 已校验子代理 tool uses > 0(0/空/Done 视为未返回有效输出,已降级为主会话自审并记录)
141
- □ evaluator 返回了 VERDICT(APPROVED/REVISE) + 结构化问题清单(RED/YELLOW)
142
- □ 评审报告已写入 .harness/changes/<change-name>/reports/plan-review/plan-review-YYYYMMDD-HHmm.md
143
- □ VERDICT 和问题清单已展示给用户(不得仅记"已评审")
144
- □ REVISE 时已询问用户是否修订;修订后可选再审
145
- □ 评审为参考性,未阻塞阶段8
146
- □ 执行日志记录了 evaluator 调用状态(委派成功/降级原因)+ VERDICT 摘要
147
- □ 如为主会话自审降级,已标注"⚠️ 同会话自审,回音壁风险"
148
- ```
149
-
150
- ## 原生规划协议检查
151
-
152
- ### 阶段 4:clarification + decision-grilling
153
-
154
- 阶段 4 执行完成后,确认以下事项:
155
-
156
- ```
157
- □ 已读取 protocols.md,并按 clarification-protocol / decision-grilling-protocol 执行
158
- □ 输入包含需求摘要 + 阶段0.5 context pack(如有)+ 阶段3代码探索结果 + 项目架构约束
159
- □ 已在 execution-log 中记录五类输出:风险识别 / 复用机会 / 替代方案 / 推荐方案 / 关键决策
160
- □ 已叠加项目架构约束(分层规范、数据模型、接口规范)
161
- □ 需求澄清结论已写入 .harness/changes/<change-name>/logs/execution-log.md,并在 events.ndjson 记录 decision
162
- □ 用户问题未超预算:普通需求 1-3 问,高风险需求 5-7 问;无必须裁决事项时 0 问
163
- □ 提问遵循"一次一问、等答再继续";能由 context pack / 阶段3代码探索 / CodeGraph 自答的问题已自答,未打扰用户
164
- □ 每个需要用户决策的问题,AI 先给出了推荐答案、理由和取舍,用户仅确认或修正
165
- □ 高风险/业务语义决策(范围、权限、安全、支付、迁移、删除、API契约、用户可见行为)已显式等待用户确认
166
- ```
167
-
168
- > 不再检查 Superpowers brainstorming 是否安装或调用;阶段 4 是 harness 原生协议,不存在外部 skill 降级分支。
169
-
170
- ### 阶段 6:implementation-planning
171
-
172
- 阶段 6 执行完成后,确认以下事项:
173
-
174
- ```
175
- □ 已读取 protocols.md,并按 implementation-planning-protocol 执行
176
- □ 输入为阶段5已审核设计文档
177
- □ 已生成基础任务列表,并在 execution-log 记录任务拆分摘要
178
- □ 已叠加项目层序依赖(数据/契约→业务层→接口层)
179
- □ 已生成 4 维度场景表(单元/接口/数据兼容/集成)
180
- □ 已确定变更名(kebab-case)
181
- □ 产物已写入 .harness/changes/<change-name>/plans/:
182
- - <change-name>-plan.md(简洁任务表)
183
- - <change-name>-implementation-detail.md(自适应详细执行参考)
184
- - <change-name>-test-scenarios.md(测试场景表)
185
- □ implementation-detail.md 按复杂度自适应:简单任务不过度展开,复杂任务写清接口/数据/顺序/风险/测试策略
186
- □ plan / implementation-detail / test-scenarios 三件套互相引用一致,无 TBD/TODO/空泛占位
187
- ```
188
-
189
- > 不再检查 Superpowers writing-plans 是否安装或调用;阶段 6 是 harness 原生协议,不存在 `docs/superpowers/` 同步分支。
190
-
191
- ## 阶段 8:结束前产物完整性检查 ⚠️ 强制
192
-
193
- > **缺任一文件 → ❌FAIL,不得宣称 plan 完成。**
194
-
195
- | 文件 | 必须存在 | 检查结果 |
196
- |------|:---:|:---:|
197
- | `.harness/changes/<change>/spec/<change>-design.md` | ✅ | □ |
198
- | `.harness/changes/<change>/plans/<change>-plan.md` | ✅ | □ |
199
- | `.harness/changes/<change>/plans/<change>-implementation-detail.md` | ✅ | □ |
200
- | `.harness/changes/<change>/plans/<change>-test-scenarios.md` | ✅ | □ |
201
- | `.harness/changes/<change>/meta/worktree.json` | ✅ | □ |
202
- | `.harness/changes/<change>/logs/execution-log.md` | ✅ | □ |
203
- | `.harness/changes/<change>/events.ndjson` | ✅ | □ |
204
-
205
- ### Plan 结束行为检查
206
-
207
- ```
208
- □ 未询问 Subagent-Driven / Inline Execution 等执行模式
209
- □ 最终输出只提示了产出物路径和下一步 /harness-run
210
- □ 未将 docs/superpowers/ 列为最终产物路径
211
- ```
212
-
213
- ### Legacy Frontmatter 兼容
214
-
215
- ```
216
- □ 已确认 plan 文件 frontmatter 存在
217
- □ 如不存在 → 已从路径推断 change-name 和 plan-name
218
- □ 如不存在 → 执行日志中已标记 🟡 legacy-plan
219
- □ 旧 plan 不因 frontmatter 缺失而 FAIL
220
- ```
221
-
222
- ## 关键原则
223
-
224
- - **产物路径唯一性**:`.harness/changes/<change-name>/` 是唯一真相源,plan 产物必须直接写入此目录
225
- - **原生规划协议**:阶段 4/6 使用 clarification、decision-grilling、implementation-planning 三段内置协议,不运行时依赖 Superpowers/grill-me/writing-plans
226
- - **阶段 2 是强制阻断检查点**——必须停下来问用户,收到回复后才能继续。不要跳过
227
- - 代码探索只读不写——这个阶段的目标是理解,不是修改
228
- - 场景表是后续所有步骤的真相源——宁可多花时间打磨,不要草草了事
229
- - 如果需求不明确,优先提问而不是猜测后继续设计
230
- - 任务拆分粒度按复杂度调整——plan 简表保持可追踪,implementation-detail 按风险和复杂度自适应展开
231
- - **Plan 结束禁止询问执行模式**:Subagent-Driven / Inline Execution 属于 /harness-run 阶段
232
-
233
- ## 事件记录(前置规则)
234
-
235
- - [ ] 确定 change-name 后立即 append `phase.start` 事件;各阶段用 `harness_events.py append` 写入 `decision` / `issue` / `artifact`
236
- - [ ] 阶段 0 在 change-name 确定前可不写事件;阶段 1 确定 change-name 后必须开始记录
237
-
238
- ## 需求范围缩减后的 change-name 检查 ⚠️
239
-
240
- - [ ] 阶段 4 澄清后,检查最终需求范围是否和 change-name 一致
241
- - [ ] 如果用户取消某个需求,但 change-name 仍包含该需求关键词,必须建议重命名
242
- - [ ] 重命名后同步目录名、spec/plan/scenarios 文件名、frontmatter、logs/execution-log、events.ndjson、meta/worktree.json
243
- - [ ] 如果用户选择不重命名,记录 🟡WARN 到 events.ndjson(`issue` 或 `decision` 事件)
@@ -1,124 +0,0 @@
1
- ---
2
- description: harness-plan 的原生规划协议。吸收 brainstorming、grill-me、writing-plans 的方法论精华,但不运行时依赖外部 skill。
3
- ---
4
-
5
- # harness-plan 原生规划协议
6
-
7
- 本文件定义 `/harness-plan` 的内置 planning kernel。它吸收外部 skill 的有效做法,但正式流程不调用 Superpowers、grill-me 或 writing-plans,也不读取或同步 `docs/superpowers/` 作为计划产物。
8
-
9
- 核心原则:**流程更轻,质量门槛更硬**。删掉外部 skill 检查、Adapter Mode、降级和草稿同步;保留需求澄清、逐问决策、方案对比、任务自检和测试优先。
10
-
11
- ## 协议一:clarification-protocol
12
-
13
- 用于阶段 4,目标是把需求从“用户意图”收敛成可审核设计输入。
14
-
15
- 必须输出以下五类结论,并写入 `logs/execution-log.md`,关键决策同步追加到 `events.ndjson`:
16
-
17
- | 输出 | 要求 |
18
- |------|------|
19
- | 风险识别 | 列出会影响实现、测试、数据、兼容性或交付判断的风险 |
20
- | 复用机会 | 明确可复用的既有模块、接口、测试、迁移脚本或历史知识 |
21
- | 替代方案 | 给出 2-3 个可行方案;简单需求可给 1 个主方案 + 1 个不选方案 |
22
- | 推荐方案 | 明确推荐选项和理由,不让用户从空白处决策 |
23
- | 用户确认的关键决策 | 只记录真正影响范围、行为、兼容性或风险的决策 |
24
-
25
- 执行纪律:
26
-
27
- 1. 先消费阶段 0.5 的 context pack、阶段 3 的代码探索结果和项目规则。
28
- 2. 能由代码、历史知识、配置、现有文档回答的问题,不问用户。
29
- 3. 需要用户裁决时,交给 `decision-grilling-protocol`。
30
- 4. 影响面检查必须覆盖用户未显式提到的参数、数据、接口、权限、兼容性、模块引用和测试影响。
31
- 5. 低风险工程判断可由 AI 推荐并记录后继续;高风险或业务语义判断必须等待用户确认。
32
-
33
- ## 协议二:decision-grilling-protocol
34
-
35
- 用于阶段 4 的用户澄清问题。它借鉴 grill-me 的逐问决策树,但采用有限问题预算,避免仪式化盘问。
36
-
37
- ### 问题预算
38
-
39
- | 场景 | 用户问题上限 |
40
- |------|:---:|
41
- | 信息充分、无必须裁决的问题 | 0 |
42
- | 普通需求 | 1-3 |
43
- | 高风险需求(auth、支付、数据迁移、并发、安全、不可逆删除、用户可见行为变化) | 5-7 |
44
-
45
- 超过预算仍无法收敛时,不要继续追问;必须输出“未决决策清单”,标记阻塞项,并请用户裁决是否缩小范围或暂停。
46
-
47
- ### 提问格式
48
-
49
- 每次只问一个问题,且必须包含推荐答案:
50
-
51
- ```markdown
52
- ### 需要确认:<决策主题>
53
-
54
- 我的推荐:<推荐答案>
55
-
56
- 理由:<为什么这个选择更适合当前代码、历史上下文和风险约束>
57
-
58
- 取舍:<代价、风险、未来扩展限制>
59
-
60
- 请确认是否采用该推荐,或指出要调整的方向。
61
- ```
62
-
63
- ### 自动采用与必须确认
64
-
65
- 可自动采用推荐并记录:
66
- - 文件组织、命名、任务顺序、测试拆分
67
- - 是否复用现有 helper、adapter、测试 fixture
68
- - 不改变用户可见行为的内部实现细节
69
-
70
- 必须用户确认:
71
- - 需求范围增删、延期或拆分
72
- - 权限、安全、支付、审计、数据迁移、删除行为
73
- - API 契约、错误码、前端兼容、用户可见行为变化
74
- - 不可逆操作或可能影响历史数据的方案
75
-
76
- 不确定归类时,按“必须确认”处理。
77
-
78
- ## 协议三:implementation-planning-protocol
79
-
80
- 用于阶段 6,目标是把已审核设计转成 harness 可执行计划,而不是生成外部超细步骤文档。
81
-
82
- ### 产物分工
83
-
84
- | 产物 | 定位 | 详细度 |
85
- |------|------|--------|
86
- | `<change-name>-plan.md` | 任务真相源 | 简洁任务表:任务、涉及文件、依赖 |
87
- | `<change-name>-implementation-detail.md` | 执行参考 | 按复杂度自适应:关键接口、顺序、坑点、测试策略 |
88
- | `<change-name>-test-scenarios.md` | 测试真相源 | 4 维度测试场景 + 覆盖检查 |
89
-
90
- `implementation-detail.md` 必须存在,但不再强制写成 2-5 分钟粒度、逐行代码片段或逐 commit 指令。简单任务可以短,复杂任务必须细。
91
-
92
- ### 计划质量门槛
93
-
94
- 任务拆分必须满足:
95
-
96
- - 每个任务有明确目标、涉及文件和依赖。
97
- - 不出现 `TBD`、`TODO`、`稍后实现`、`补充测试`、`适当处理错误` 等占位表达。
98
- - 不引用尚未定义的类型、函数、接口或迁移文件。
99
- - 层序依赖清晰:数据/契约先于业务实现,业务实现先于接口暴露,验证场景覆盖关键路径。
100
- - 测试方向明确:单元、接口、数据兼容、集成至少说明适用与不适用原因。
101
- - 如果设计范围发生收缩,先按 `change-name` 同步规则处理名称和路径。
102
-
103
- ### implementation-detail 自适应规则
104
-
105
- | 复杂度 | 内容要求 |
106
- |--------|----------|
107
- | 简单修复 | 关键文件、修改点、验证命令、容易误判的边界 |
108
- | 中等功能 | 模块顺序、接口/数据约束、测试策略、回滚/兼容注意事项 |
109
- | 高风险构建 | 迁移顺序、失败恢复、权限/安全边界、并发/幂等、评审关注点 |
110
-
111
- 禁止为了“看起来完整”生成机械微步骤;也禁止因为“只是参考”而写空泛描述。
112
-
113
- ## 自检
114
-
115
- 阶段 4 和阶段 6 完成后,必须自检:
116
-
117
- ```markdown
118
- ### 原生规划协议自检
119
- - clarification-protocol:风险 / 复用 / 替代方案 / 推荐方案 / 关键决策均已记录
120
- - decision-grilling-protocol:用户问题未超预算;每问包含推荐答案;能自查的问题未打扰用户
121
- - implementation-planning-protocol:plan 简表、implementation-detail、test-scenarios 三件套一致,无占位符
122
- ```
123
-
124
- 该自检写入 execution-log;关键结论写入 events.ndjson。