hunter-harness 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/dist/bin.js +3356 -0
  4. package/package.json +34 -0
  5. package/resources/bootstrap-ir/manifest.json +19 -0
  6. package/resources/bootstrap-ir/skills/harness-apidoc.yaml +24 -0
  7. package/resources/bootstrap-ir/skills/harness-archive.yaml +24 -0
  8. package/resources/bootstrap-ir/skills/harness-codebase-map.yaml +24 -0
  9. package/resources/bootstrap-ir/skills/harness-knowledge-ingest.yaml +24 -0
  10. package/resources/bootstrap-ir/skills/harness-package.yaml +24 -0
  11. package/resources/bootstrap-ir/skills/harness-plan.yaml +24 -0
  12. package/resources/bootstrap-ir/skills/harness-review.yaml +24 -0
  13. package/resources/bootstrap-ir/skills/harness-run.yaml +24 -0
  14. package/resources/bootstrap-ir/skills/harness-skill-optimizer.yaml +28 -0
  15. package/resources/bootstrap-ir/skills/harness-submit.yaml +24 -0
  16. package/resources/bootstrap-ir/skills/harness-sync.yaml +24 -0
  17. package/resources/bootstrap-ir/skills/harness-test.yaml +24 -0
  18. package/resources/bootstrap-ir/templates/claude-code-skill.md +12 -0
  19. package/resources/harness/general/.harness-build.json +5 -0
  20. package/resources/harness/general/CONTEXT.md +65 -0
  21. package/resources/harness/general/README.md +478 -0
  22. package/resources/harness/general/agents/harness-evaluator.md +96 -0
  23. package/resources/harness/general/agents/harness-explorer.md +72 -0
  24. package/resources/harness/general/agents/harness-reviewer.md +69 -0
  25. package/resources/harness/general/harness-archive/SKILL.md +215 -0
  26. package/resources/harness/general/harness-archive/checklist.md +52 -0
  27. package/resources/harness/general/harness-archive/reference.md +103 -0
  28. package/resources/harness/general/harness-archive/scripts/gen-manifest.ps1 +31 -0
  29. package/resources/harness/general/harness-archive/templates/render-summary.mjs +171 -0
  30. package/resources/harness/general/harness-archive/templates/summary-data-template.json +128 -0
  31. package/resources/harness/general/harness-codebase-map/SKILL.md +112 -0
  32. package/resources/harness/general/harness-codebase-map/checklist.md +126 -0
  33. package/resources/harness/general/harness-codebase-map/reference.md +364 -0
  34. package/resources/harness/general/harness-codebase-map/templates/ARCHITECTURE.md +57 -0
  35. package/resources/harness/general/harness-codebase-map/templates/CONCERNS.md +49 -0
  36. package/resources/harness/general/harness-codebase-map/templates/CONVENTIONS.md +57 -0
  37. package/resources/harness/general/harness-codebase-map/templates/INTEGRATIONS.md +52 -0
  38. package/resources/harness/general/harness-codebase-map/templates/STACK.md +55 -0
  39. package/resources/harness/general/harness-codebase-map/templates/STRUCTURE.md +69 -0
  40. package/resources/harness/general/harness-codebase-map/templates/TESTING.md +64 -0
  41. package/resources/harness/general/harness-codebase-map/templates/map-manifest.schema.json +73 -0
  42. package/resources/harness/general/harness-codebase-map/templates/map-summary.md +64 -0
  43. package/resources/harness/general/harness-knowledge-ingest/SKILL.md +246 -0
  44. package/resources/harness/general/harness-knowledge-ingest/design.md +842 -0
  45. package/resources/harness/general/harness-knowledge-ingest/evaluations/harness_knowledge_evaluation.xml +42 -0
  46. package/resources/harness/general/harness-knowledge-ingest/mcp-config.example.json +10 -0
  47. package/resources/harness/general/harness-knowledge-ingest/reference.md +309 -0
  48. package/resources/harness/general/harness-knowledge-ingest/scripts/harness_knowledge.py +4082 -0
  49. package/resources/harness/general/harness-knowledge-ingest/scripts/harness_knowledge_mcp.py +273 -0
  50. package/resources/harness/general/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/archive/2026-01-10-ledger-reconciliation/reports/final/summary-data.json +43 -0
  51. package/resources/harness/general/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/archive/2026-02-14-ledger-snapshot-followup/reports/final/summary-data.json +38 -0
  52. package/resources/harness/general/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/archive/2026-03-05-webhook-contract/reports/final/summary-data.json +36 -0
  53. package/resources/harness/general/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/project.yaml +1 -0
  54. package/resources/harness/general/harness-knowledge-ingest/tests/test_harness_knowledge.py +1792 -0
  55. package/resources/harness/general/harness-knowledge-query/SKILL.md +164 -0
  56. package/resources/harness/general/harness-plan/SKILL.md +127 -0
  57. package/resources/harness/general/harness-plan/checklist.md +243 -0
  58. package/resources/harness/general/harness-plan/protocols.md +124 -0
  59. package/resources/harness/general/harness-plan/reference.md +376 -0
  60. package/resources/harness/general/harness-review/SKILL.md +156 -0
  61. package/resources/harness/general/harness-review/checklist.md +124 -0
  62. package/resources/harness/general/harness-review/protocols.md +68 -0
  63. package/resources/harness/general/harness-review/reference.md +86 -0
  64. package/resources/harness/general/harness-run/SKILL.md +132 -0
  65. package/resources/harness/general/harness-run/checklist.md +259 -0
  66. package/resources/harness/general/harness-run/protocols.md +78 -0
  67. package/resources/harness/general/harness-run/reference.md +834 -0
  68. package/resources/harness/general/harness-submit/SKILL.md +159 -0
  69. package/resources/harness/general/harness-submit/checklist.md +407 -0
  70. package/resources/harness/general/harness-submit/reference.md +152 -0
  71. package/resources/harness/general/harness-sync/SKILL.md +82 -0
  72. package/resources/harness/general/harness-sync/reference.md +153 -0
  73. package/resources/harness/general/harness-test/SKILL.md +180 -0
  74. package/resources/harness/general/harness-test/checklist.md +319 -0
  75. package/resources/harness/general/harness-test/pitfalls.md +260 -0
  76. package/resources/harness/general/harness-test/reference.md +791 -0
  77. package/resources/harness/general/protocols/archive-report-protocol.md +175 -0
  78. package/resources/harness/general/protocols/evidence-based-reporting-protocol.md +134 -0
  79. package/resources/harness/general/protocols/ledger-protocol.md +270 -0
  80. package/resources/harness/general/protocols/powershell-protocol.md +181 -0
  81. package/resources/harness/general/protocols/report-pipeline-protocol.md +150 -0
  82. package/resources/harness/general/protocols/sensitive-info-protocol.md +92 -0
  83. package/resources/harness/general/protocols/state-layout-protocol.md +131 -0
  84. package/resources/harness/general/protocols/submit-protocol.md +78 -0
  85. package/resources/harness/general/scripts/harness_archive.py +2319 -0
  86. package/resources/harness/general/scripts/harness_deploy.py +613 -0
  87. package/resources/harness/general/scripts/harness_events.py +680 -0
  88. package/resources/harness/general/scripts/harness_ledger.py +671 -0
  89. package/resources/harness/general/scripts/harness_preflight.py +780 -0
  90. package/resources/harness/general/scripts/harness_service.py +1331 -0
  91. package/resources/harness/java/.harness-build.json +5 -0
  92. package/resources/harness/java/CONTEXT.md +65 -0
  93. package/resources/harness/java/README.md +478 -0
  94. package/resources/harness/java/agents/harness-evaluator.md +96 -0
  95. package/resources/harness/java/agents/harness-explorer.md +72 -0
  96. package/resources/harness/java/agents/harness-reviewer.md +69 -0
  97. package/resources/harness/java/harness-apidoc/SKILL.md +86 -0
  98. package/resources/harness/java/harness-apidoc/checklist.md +142 -0
  99. package/resources/harness/java/harness-apidoc/reference.md +233 -0
  100. package/resources/harness/java/harness-archive/SKILL.md +215 -0
  101. package/resources/harness/java/harness-archive/checklist.md +52 -0
  102. package/resources/harness/java/harness-archive/reference.md +103 -0
  103. package/resources/harness/java/harness-archive/scripts/gen-manifest.ps1 +31 -0
  104. package/resources/harness/java/harness-archive/templates/render-summary.mjs +171 -0
  105. package/resources/harness/java/harness-archive/templates/summary-data-template.json +128 -0
  106. package/resources/harness/java/harness-codebase-map/SKILL.md +112 -0
  107. package/resources/harness/java/harness-codebase-map/checklist.md +126 -0
  108. package/resources/harness/java/harness-codebase-map/reference.md +364 -0
  109. package/resources/harness/java/harness-codebase-map/templates/ARCHITECTURE.md +57 -0
  110. package/resources/harness/java/harness-codebase-map/templates/CONCERNS.md +49 -0
  111. package/resources/harness/java/harness-codebase-map/templates/CONVENTIONS.md +57 -0
  112. package/resources/harness/java/harness-codebase-map/templates/INTEGRATIONS.md +52 -0
  113. package/resources/harness/java/harness-codebase-map/templates/STACK.md +55 -0
  114. package/resources/harness/java/harness-codebase-map/templates/STRUCTURE.md +69 -0
  115. package/resources/harness/java/harness-codebase-map/templates/TESTING.md +64 -0
  116. package/resources/harness/java/harness-codebase-map/templates/map-manifest.schema.json +73 -0
  117. package/resources/harness/java/harness-codebase-map/templates/map-summary.md +64 -0
  118. package/resources/harness/java/harness-knowledge-ingest/SKILL.md +246 -0
  119. package/resources/harness/java/harness-knowledge-ingest/design.md +842 -0
  120. package/resources/harness/java/harness-knowledge-ingest/evaluations/harness_knowledge_evaluation.xml +42 -0
  121. package/resources/harness/java/harness-knowledge-ingest/mcp-config.example.json +10 -0
  122. package/resources/harness/java/harness-knowledge-ingest/reference.md +309 -0
  123. package/resources/harness/java/harness-knowledge-ingest/scripts/harness_knowledge.py +4082 -0
  124. package/resources/harness/java/harness-knowledge-ingest/scripts/harness_knowledge_mcp.py +273 -0
  125. package/resources/harness/java/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/archive/2026-01-10-ledger-reconciliation/reports/final/summary-data.json +43 -0
  126. package/resources/harness/java/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/archive/2026-02-14-ledger-snapshot-followup/reports/final/summary-data.json +38 -0
  127. package/resources/harness/java/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/archive/2026-03-05-webhook-contract/reports/final/summary-data.json +36 -0
  128. package/resources/harness/java/harness-knowledge-ingest/tests/fixtures/mcp-eval-project/.harness/project.yaml +1 -0
  129. package/resources/harness/java/harness-knowledge-ingest/tests/test_harness_knowledge.py +1792 -0
  130. package/resources/harness/java/harness-knowledge-query/SKILL.md +164 -0
  131. package/resources/harness/java/harness-package/SKILL.md +87 -0
  132. package/resources/harness/java/harness-package/checklist.md +322 -0
  133. package/resources/harness/java/harness-package/reference.md +210 -0
  134. package/resources/harness/java/harness-plan/SKILL.md +127 -0
  135. package/resources/harness/java/harness-plan/checklist.md +243 -0
  136. package/resources/harness/java/harness-plan/protocols.md +124 -0
  137. package/resources/harness/java/harness-plan/reference.md +376 -0
  138. package/resources/harness/java/harness-review/SKILL.md +156 -0
  139. package/resources/harness/java/harness-review/checklist.md +124 -0
  140. package/resources/harness/java/harness-review/protocols.md +68 -0
  141. package/resources/harness/java/harness-review/reference.md +86 -0
  142. package/resources/harness/java/harness-run/SKILL.md +148 -0
  143. package/resources/harness/java/harness-run/checklist.md +250 -0
  144. package/resources/harness/java/harness-run/protocols.md +78 -0
  145. package/resources/harness/java/harness-run/reference.md +814 -0
  146. package/resources/harness/java/harness-submit/SKILL.md +166 -0
  147. package/resources/harness/java/harness-submit/checklist.md +407 -0
  148. package/resources/harness/java/harness-submit/reference.md +152 -0
  149. package/resources/harness/java/harness-sync/SKILL.md +82 -0
  150. package/resources/harness/java/harness-sync/reference.md +153 -0
  151. package/resources/harness/java/harness-test/SKILL.md +192 -0
  152. package/resources/harness/java/harness-test/checklist.md +317 -0
  153. package/resources/harness/java/harness-test/pitfalls-java.md +16 -0
  154. package/resources/harness/java/harness-test/pitfalls.md +260 -0
  155. package/resources/harness/java/harness-test/reference.md +788 -0
  156. package/resources/harness/java/protocols/archive-report-protocol.md +175 -0
  157. package/resources/harness/java/protocols/evidence-based-reporting-protocol.md +134 -0
  158. package/resources/harness/java/protocols/ledger-protocol.md +270 -0
  159. package/resources/harness/java/protocols/powershell-protocol.md +181 -0
  160. package/resources/harness/java/protocols/report-pipeline-protocol.md +150 -0
  161. package/resources/harness/java/protocols/sensitive-info-protocol.md +92 -0
  162. package/resources/harness/java/protocols/state-layout-protocol.md +131 -0
  163. package/resources/harness/java/protocols/submit-protocol.md +78 -0
  164. package/resources/harness/java/scripts/harness_archive.py +2319 -0
  165. package/resources/harness/java/scripts/harness_deploy.py +613 -0
  166. package/resources/harness/java/scripts/harness_events.py +680 -0
  167. package/resources/harness/java/scripts/harness_ledger.py +671 -0
  168. package/resources/harness/java/scripts/harness_preflight.py +780 -0
  169. package/resources/harness/java/scripts/harness_service.py +1331 -0
  170. package/resources/harness/manifests/general.json +296 -0
  171. package/resources/harness/manifests/java.json +324 -0
  172. package/resources/manifest.json +19 -0
  173. package/resources/skills/harness-apidoc/SKILL.md +50 -0
  174. package/resources/skills/harness-archive/SKILL.md +48 -0
  175. package/resources/skills/harness-codebase-map/SKILL.md +53 -0
  176. package/resources/skills/harness-knowledge-ingest/SKILL.md +48 -0
  177. package/resources/skills/harness-package/SKILL.md +48 -0
  178. package/resources/skills/harness-plan/SKILL.md +51 -0
  179. package/resources/skills/harness-review/SKILL.md +50 -0
  180. package/resources/skills/harness-run/SKILL.md +48 -0
  181. package/resources/skills/harness-skill-optimizer/SKILL.md +54 -0
  182. package/resources/skills/harness-submit/SKILL.md +47 -0
  183. package/resources/skills/harness-sync/SKILL.md +48 -0
  184. package/resources/skills/harness-test/SKILL.md +50 -0
@@ -0,0 +1,124 @@
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。
@@ -0,0 +1,376 @@
1
+ ---
2
+ description: harness-plan 的需求提取模板、任务拆分规则、测试场景4维度详细格式。仅在执行规划需要参考详细格式时读取。
3
+ ---
4
+
5
+ # harness-plan
6
+
7
+ ## Worktree 决策文件模板
8
+
9
+ 阶段 2 必须生成 `.harness/changes/<change-name>/meta/worktree.json`。这是后续 `/harness-run` 是否创建/切换 worktree 的唯一机器可读依据。
10
+
11
+ ### 使用 Worktree
12
+
13
+ ```json
14
+ {
15
+ "requested": true,
16
+ "created": false,
17
+ "path": ".claude/worktrees/<change-name>",
18
+ "branch": "worktree/<change-name>",
19
+ "decisionBy": "user",
20
+ "decisionAt": "YYYY-MM-DD HH:mm",
21
+ "ownerSkill": "harness-run"
22
+ }
23
+ ```
24
+
25
+ ### 不使用 Worktree
26
+
27
+ ```json
28
+ {
29
+ "requested": false,
30
+ "created": false,
31
+ "path": null,
32
+ "branch": null,
33
+ "decisionBy": "user",
34
+ "decisionAt": "YYYY-MM-DD HH:mm",
35
+ "ownerSkill": null
36
+ }
37
+ ```
38
+
39
+ ### execution-log 记录示例
40
+
41
+ ```md
42
+ ## 阶段 2:Worktree 决策
43
+ - 用户选择:使用 Worktree
44
+ - 决策文件:.harness/changes/<change-name>/meta/worktree.json
45
+ - requested=true, created=false
46
+ - 创建责任:harness-run
47
+ ```
48
+
49
+ ## 参考 — 详细格式
50
+
51
+ ## 阶段 1:需求接收
52
+
53
+ 接收用户输入(文字描述或文档路径),提取关键信息:
54
+ - 功能范围(要做什么、不做什么)
55
+ - 业务规则(校验逻辑、权限约束)
56
+ - 数据模型变更(新表、新字段)
57
+ - 接口变更(新增/修改的端点)
58
+
59
+ 如果需求不明确(如"做一个指标管理功能"),列出具体疑问向用户澄清——不要猜测后直接设计。
60
+
61
+ ### 影响面检查
62
+
63
+ 方案汇总后(阶段 4 末尾),主动列出可能受影响但用户未提及的点,让用户一次性确认:
64
+
65
+ ```markdown
66
+ ### 影响面检查
67
+
68
+ 基于代码探索,以下点可能受本次变更影响但尚未讨论:
69
+
70
+ | # | 影响点 | 说明 | 需要处理? |
71
+ |:--:|--------|------|:----------:|
72
+ | 1 | 请求参数变更 | 数据契约删除字段后,前端请求格式变化 | 是/否 |
73
+ | 2 | 数据库迁移 | 字段删除前需迁移历史数据 | 是/否 |
74
+ | 3 | 其他模块引用 | 其他业务模块引用了该字段 | 是/否 |
75
+ | 4 | 前端兼容性 | 旧前端传已删除字段会报错 | 是/否 |
76
+ ```
77
+
78
+ > 这一检查的目的是减少设计文档生成后的迭代轮次——提前发现用户可能提出的修改。
79
+
80
+ ## 阶段 3:代码探索(只读)输出格式
81
+
82
+ ```markdown
83
+ ## 设计概要 — <功能名>
84
+
85
+ ### 涉及模块
86
+ - 接口层: xxx-server/.../xxx/
87
+ - 业务层: 同上
88
+ - 新增表: xxx
89
+ - 修改表: xxx (新增 N 字段)
90
+
91
+ ### 接口变更
92
+ | 方法 | 路径 | 类型 |
93
+ |------|------|:----:|
94
+ | GET | /xxx | 新增 |
95
+ | POST | /xxx | 修改 |
96
+
97
+ ### 关键决策
98
+ - 决策1: 说明
99
+ - 决策2: 说明
100
+ ```
101
+
102
+ ## 阶段 5:生成设计文档 ⚠️ 用户审核
103
+
104
+ 基于代码探索和需求澄清的结果,撰写设计文档并展示给用户审核。
105
+
106
+ > **本阶段是强制检查点。** 设计文档生成后必须展示给用户,收到确认后才能进入阶段 6(任务拆分)。设计文档确保方向正确后再细化任务——避免基于错误理解拆分出无效任务。
107
+
108
+ **用户确认后必须立即写入** `.harness/changes/<change-name>/spec/<change-name>-design.md`。如果此文件不存在,harness-plan 不得进入阶段 6。
109
+
110
+ **设计文档路径规则**:设计文档必须保存到 `.harness/changes/<change-name>/spec/<change-name>-design.md`。禁止保存到 `docs/superpowers/specs/` 作为正式产物;`/harness-plan` 不运行时调用 Superpowers。
111
+
112
+ ### 设计文档模板
113
+
114
+ ```markdown
115
+ ---
116
+ change-name: <change-name>
117
+ created: YYYY-MM-DD HH:mm
118
+ status: approved
119
+ source: harness-plan
120
+ ---
121
+
122
+ # <功能名> 设计文档
123
+
124
+ > 日期:YYYY-MM-DD
125
+ > 状态:待审核
126
+ > 范围:<简述改动范围>
127
+
128
+ ---
129
+
130
+ ## 1. 背景与动机
131
+
132
+ <为什么做这个改动?现有代码有什么问题或缺失?这个改动解决什么痛点?>
133
+
134
+ <如果涉及差距分析,用表格对比现状与目标:>
135
+
136
+ | 维度 | 现状 | 目标 | 差距级别 |
137
+ |------|------|------|---------|
138
+ | ... | ... | ... | 🔴/🟡/🟠 |
139
+
140
+ ---
141
+
142
+ ## 2. 方案概述
143
+
144
+ <选定方案的核心思路,2-3句话概括>
145
+
146
+ ---
147
+
148
+ ## 3. 详细设计
149
+
150
+ <按改动涉及的维度分节展示,每节包含:>
151
+ - 具体做法
152
+ - 配置变更
153
+ - 关键设计决策及原因
154
+
155
+ ---
156
+
157
+ ## 4. 变更清单
158
+
159
+ | 类别 | 文件路径 | 说明 |
160
+ |------|---------|------|
161
+ | 新增 | `exact/path/to/file` | ... |
162
+ | 修改 | `exact/path/to/file` | ... |
163
+
164
+ ---
165
+
166
+ ## 5. 验证方式
167
+
168
+ <如何测试这些改动?列出关键验证步骤>
169
+ ```
170
+
171
+ ### 设计文档自审
172
+
173
+ 写完设计文档后,用以下清单自检:
174
+ - □ 无"TBD"/"TODO"/未完成章节
175
+ - □ 各节之间无矛盾
176
+ - □ 范围聚焦,无不相关内容
177
+ - □ 无歧义需求(可被两种方式解读的,已选一种并明确说明)
178
+
179
+ ## 阶段 6:任务拆分
180
+
181
+ 将设计拆分为可追踪的任务,标注涉及文件和依赖关系。任务拆分执行 `protocols.md` 的 `implementation-planning-protocol`:plan 简表保持精炼,implementation-detail 按复杂度自适应展开。
182
+
183
+ ### 产物结构
184
+
185
+ 推荐结构:
186
+
187
+ ```
188
+ .harness/changes/<change-name>/plans/
189
+ ├── <change-name>-plan.md # harness 简洁任务表,run 默认读取
190
+ ├── <change-name>-implementation-detail.md # 原生自适应详细执行参考,run 补充读取
191
+ └── <change-name>-test-scenarios.md # 测试场景表
192
+ ```
193
+
194
+ ### 计划文件 frontmatter(必须)
195
+
196
+ ```yaml
197
+ ---
198
+ change-name: <change-name>
199
+ plan-name: <change-name>
200
+ created: YYYY-MM-DD HH:mm
201
+ source-spec: ../spec/<change-name>-design.md
202
+ implementation-detail: ./<change-name>-implementation-detail.md
203
+ test-scenarios: ./<change-name>-test-scenarios.md
204
+ status: approved
205
+ ---
206
+ ```
207
+
208
+ ### 简洁任务表格式(`<change-name>-plan.md`)
209
+
210
+ ```markdown
211
+ | # | 任务 | 涉及文件 | 依赖 |
212
+ |:--:|------|----------|:----:|
213
+ | 1 | 新建枚举类 | 2 个枚举 | - |
214
+ | 2 | 扩展错误码 | 错误码定义文件 | - |
215
+ | 3 | 编写数据库迁移脚本 | 1 个迁移脚本 | - |
216
+ | 4 | 新建数据模型 | 2 个数据模型 | 3 |
217
+ | ... | ... | ... | ... |
218
+ ```
219
+
220
+ ## 阶段 7:测试场景表 4 维度格式
221
+
222
+ 场景表覆盖 **4 个维度**:
223
+
224
+ ```markdown
225
+ ## 测试场景 — <功能名>
226
+ > 生成日期:YYYY-MM-DD | 对应需求:xxx.md | 对应计划:xxx-plan.md
227
+
228
+ ### 一、单元测试场景
229
+
230
+ #### 1.1 <类名.方法名>
231
+
232
+ | # | 分类 | 场景描述 | 输入 | 预期 |
233
+ |:--:|:----:|----------|------|------|
234
+ | UT-001 | 正常 | ... | ... | ... |
235
+ | UT-002 | 异常 | ... | ... | 抛 xxxException |
236
+ | UT-003 | 边界 | ... | ... | ... |
237
+
238
+ ### 二、接口测试场景
239
+
240
+ #### 2.1 POST /xxx
241
+
242
+ | # | 分类 | 场景描述 | 关键字段 | HTTP | code | message |
243
+ |:--:|:----:|----------|----------|:----:|:----:|--------|
244
+ | API-001 | 正常 | ... | ... | 200 | 0 | 成功 |
245
+ | API-002 | 校验 | ... | ... | 200 | xxx | ... |
246
+
247
+ ### 三、数据兼容场景
248
+
249
+ | # | 分类 | 场景描述 | 操作 | 数据特征 | 预期 |
250
+ |:--:|:----:|----------|:----:|----------|------|
251
+ | COM-001 | 旧数据 | ... | ... | ... | ... |
252
+
253
+ ### 四、集成场景
254
+
255
+ | # | 分类 | 场景描述 | 前置条件 | 步骤 | 预期 |
256
+ |:--:|:----:|----------|----------|------|------|
257
+ | INT-001 | 端到端 | ... | ... | N 步操作 | ... |
258
+ ```
259
+
260
+ ## 产物保存规则(跨阶段:阶段1/5/6/8)
261
+
262
+ 1. **自动确定变更名**:基于需求描述自动生成变更名(kebab-case),无需用户确认
263
+
264
+ 变更名命名规则:
265
+ - **kebab-case**(小写字母,单词间连字符)
266
+ - 从需求/功能描述中提取核心关键词
267
+ - 示例:`contribution-module`、`fix-duplicate-submit`
268
+ - 变更名一旦确定即为最终值,后续所有 skill 自动引用
269
+
270
+ > **与 Worktree 的关系**:如果阶段 2 用户选择了 worktree,变更名在创建 worktree 时随分支名确定(worktree 名即变更名)。如果未使用 worktree,变更名在阶段 1 自动生成。
271
+
272
+ 2. **创建产出目录**:用 Write 工具创建以下目录结构(Write 会自动创建中间目录):
273
+ ```
274
+ .harness/changes/<change-name>/meta/
275
+ .harness/changes/<change-name>/logs/
276
+ .harness/changes/<change-name>/spec/
277
+ .harness/changes/<change-name>/plans/
278
+ .harness/changes/<change-name>/evidence/
279
+ .harness/changes/<change-name>/reports/
280
+ .harness/changes/<change-name>/sqls/
281
+ .harness/changes/<change-name>/scripts/
282
+ .harness/changes/<change-name>/runtime/
283
+ .harness/changes/<change-name>/backups/
284
+ ```
285
+
286
+ 3. **保存设计文档**:将阶段 5 生成的设计文档保存到:
287
+ - `.harness/changes/<change-name>/spec/<change-name>-design.md`
288
+
289
+ 设计文档 frontmatter 格式:
290
+ ```yaml
291
+ ---
292
+ change-name: <change-name>
293
+ created: YYYY-MM-DD HH:mm
294
+ status: approved
295
+ source: harness-plan
296
+ ---
297
+ ```
298
+
299
+ > 如果 frontmatter 缺失,后续 run/test/review/submit/archive 不得依赖模型猜测 change-name。
300
+
301
+ 4. **初始化执行日志和结构化事件**:创建 `.harness/changes/<change-name>/logs/execution-log.md` 与 `.harness/changes/<change-name>/events.ndjson`,写入变更开始记录和 `phase.start` 事件:
302
+
303
+ ```markdown
304
+ # 执行日志 — <change-name>
305
+
306
+ > 变更创建时间:YYYY-MM-DD HH:MM | 变更名:<change-name>
307
+
308
+ ---
309
+ ```
310
+
311
+ 5. **保存计划文件**:计划文件包含 YAML frontmatter(含 change-name),保存到:
312
+ - `.harness/changes/<change-name>/plans/<change-name>-plan.md`(简洁任务表)
313
+ - `.harness/changes/<change-name>/plans/<change-name>-implementation-detail.md`(自适应详细执行参考)
314
+ - `.harness/changes/<change-name>/plans/<change-name>-test-scenarios.md`(测试场景表)
315
+
316
+ 计划文件 frontmatter 格式:
317
+ ```yaml
318
+ ---
319
+ change-name: <change-name>
320
+ plan-name: <change-name>
321
+ created: YYYY-MM-DD HH:mm
322
+ source-spec: ../spec/<change-name>-design.md
323
+ implementation-detail: ./<change-name>-implementation-detail.md
324
+ test-scenarios: ./<change-name>-test-scenarios.md
325
+ status: approved
326
+ ---
327
+ ```
328
+
329
+ > 如果 frontmatter 缺失,后续 run 不得依赖模型猜测 change-name 或关联文件路径。
330
+
331
+ 6. **等待用户确认后**,提示下一步:运行 `/harness-run`
332
+
333
+ > 后续 skill(run/test/review)启动时,会扫描 `.harness/changes/*/plans/`(排除 `.harness/archive/*/`)自动定位变更名目录,无需手动指定路径。同一时间最多一个未归档变更。
334
+
335
+ ## 阶段 8:结束前产物完整性检查 ⚠️ 强制
336
+
337
+ > **缺任一文件 → ❌FAIL,不得宣称 plan 完成。**
338
+
339
+ | 文件 | 必须存在 |
340
+ |------|:---:|
341
+ | `.harness/changes/<change>/spec/<change>-design.md` | ✅ |
342
+ | `.harness/changes/<change>/plans/<change>-plan.md` | ✅ |
343
+ | `.harness/changes/<change>/plans/<change>-implementation-detail.md` | ✅ |
344
+ | `.harness/changes/<change>/plans/<change>-test-scenarios.md` | ✅ |
345
+ | `.harness/changes/<change>/meta/worktree.json` | ✅ |
346
+ | `.harness/changes/<change>/logs/execution-log.md` | ✅ |
347
+ | `.harness/changes/<change>/events.ndjson` | ✅ |
348
+
349
+ ### Plan 结束行为规则
350
+
351
+ - **禁止询问执行模式**:Subagent-Driven / Inline Execution 属于 /harness-run 阶段
352
+ - 最终输出只提示产出物路径和下一步 `/harness-run`
353
+ - `docs/superpowers/` 不得作为最终产物路径出现在输出中
354
+
355
+ ## C2 升级口:Codex 跨 provider 评审(可选,未实现)
356
+
357
+ 阶段 7.5 的 harness-evaluator 是同 provider(Claude)评审,基于"上下文隔离 + 档位差异"。如需真正跨 provider 对抗(高风险构建:auth/支付/数据迁移/并发),可在 evaluator 返回 REVISE 后,可选调 Codex CLI 做二次确认。
358
+
359
+ ### 前置
360
+ - Codex CLI ≥ 0.130:`npm install -g @openai/codex@latest`(现 0.142.3)
361
+ - Codex 已登录:`codex login`(ChatGPT 账号即可)
362
+ - Windows + bridge 环境未实测,TODO(review)
363
+
364
+ ### 执行(示例)
365
+ ```powershell
366
+ powershell.exe -NoProfile -Command "codex exec -s read-only '$(Get-Content .harness/changes/<cn>/spec/<cn>-design.md -Raw)'"
367
+ ```
368
+
369
+ ### 安全线 ⚠️
370
+ - 首次 `codex exec -s read-only` 强制只读沙箱
371
+ - resume 必须加 `-c sandbox_mode="read-only"`(`resume` 不接受 `-s`,漏写会继承 config 默认,可能 `danger-full-access`)——这是最关键安全线
372
+ - Codex 全程只读,从不写文件
373
+ - 不 pin `-m` 模型(ChatGPT 账号鉴权会拒 `gpt-5.x-codex` 变体并 400 报错)
374
+
375
+ ### 状态
376
+ 本节为**升级口**,当前 harness-plan 阶段 7.5 默认走 harness-evaluator(C1),不自动触发 Codex。需手动启用,且建议先验证 Codex CLI 在当前环境可用。详见 grill-me 文档的 grill-me-codex Act 2(技术知识库/02-Skills与扩展/Skills合集/grill-me.md)。
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: harness-review
3
+ description: "6维度代码审查(架构/安全/规范/兼容/测试/性能),对照.claude/rules/和测试场景表,在隔离上下文运行。使用场景:代码审查、提交前检查、合并评审"
4
+ argument-hint: "变更名或留空自动检测"
5
+ effort: high
6
+ allowed-tools: [Read, Write, Edit, Glob, Grep, Agent, Bash(powershell.exe:*)]
7
+ disallowed-tools:
8
+ - Bash(git *)
9
+ - Bash(mvn *)
10
+ - Bash(ls *)
11
+ - Bash(find *)
12
+ - Bash(grep *)
13
+ - Bash(cat *)
14
+ - Bash(cp *)
15
+ - Bash(mv *)
16
+ - Bash(rm *)
17
+ - Bash(mkdir *)
18
+ - Bash(touch *)
19
+ - Bash(sed *)
20
+ - Bash(awk *)
21
+ - Bash(curl *)
22
+ - Bash(codegraph *)
23
+ ---
24
+ <!-- generated by harness_deploy.py; core=8917528f7dfdc5ca; overlay=java; do not edit -->
25
+ # harness-review — 代码审查
26
+
27
+ ## Purpose
28
+
29
+ 对 git diff 进行6维度审查,对照项目规则和测试场景表,输出分级报告。**审查结果仅供参考,默认不阻塞后续 submit/archive 流程。**
30
+
31
+ ## When to Use
32
+
33
+ 使用此 Skill 当:
34
+ - 代码变更完成后需要审查
35
+ - 提交前需要质量检查
36
+ - 合并评审时需要系统性检查
37
+ - 用户说"审查代码"、"review"、"检查代码质量"
38
+
39
+ ## Inputs
40
+
41
+ - `$ARGUMENTS`:变更名(可选,留空时自动扫描 `.harness/changes/*/plans/` 确定)
42
+ - 相关文件:`.harness/changes/*/plans/*-plan.md`、`.claude/rules/`、测试场景表
43
+
44
+ ## 前置条件
45
+
46
+ - `.harness/changes/<change-name>/plans/<change-name>-plan.md` 存在(任务真相源)
47
+ - 必须读取 `.harness/changes/<change-name>/meta/worktree.json`:`requested=true` 且 worktree 已创建 → 在 worktree 目录中执行审查;`requested=true` 但 worktree 不存在 → 停止,提示先修复 `harness-run`,不得静默回主目录
48
+ - **review 不阻塞后续流程**:test 报告缺失或未运行不阻止 review(review 是参考性阶段),但应在报告中标注 test 状态供参考
49
+
50
+ ## 统一读取协议
51
+
52
+ 1. **`.harness/changes/<change-name>/` 是唯一真相源** — 所有输入从该目录读取,产物写入对应子目录
53
+ 2. **change-name 优先从 frontmatter 读取** — `spec/*-design.md`、`plans/*-plan.md` 的 YAML `change-name`
54
+ 3. **frontmatter 缺失时兼容旧格式** — 从路径推断,标记 `🟡 legacy-plan`,不失败
55
+ 4. **spec** — 设计真相源:`spec/<change>-design.md`
56
+ 5. **plan** — 任务真相源:`plans/<change>-plan.md`
57
+ 6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
58
+ 7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
59
+ 8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
60
+
61
+ 状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
62
+
63
+ ## Workflow
64
+
65
+ 0. **启动准备** — 确定变更名(Glob `.harness/changes/*/plans/*-plan.md`,排除 `.harness/archive/*/`,读 frontmatter 提取 change-name);**append `phase.start` 事件**(不得等审查完成才补)
66
+ 1. **读取 worktree 状态(门禁检查)** — 读 `.harness/changes/<change-name>/meta/worktree.json`:`requested=true` 但 worktree 不存在 → 停止并提示先修复 `harness-run`,不得静默回主目录(否则 git diff 为空);`requested=true` 且 worktree 已创建 → spawned agent 用该 worktree 路径执行 `git diff`(确保审查 worktree 变更而非主目录);`requested=false` → 审查主目录变更
67
+ 2. **委派 harness-reviewer** — 先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-reviewer --json`。`usable=false` → **直接主会话审查**,记 `decision` 事件,**不委派**。`usable=true` 时用 Agent spawn `harness-reviewer`(只读, 6 维度)。返回空 / 无报告正文 → **不 retry**,降级主会话审查。
68
+ 3. **持久化报告(强制,主会话)** — Agent 返回后主会话 Write 到 `reports/review/review-report-*.md`。未 Write → 🟡WARN,不得宣称 review 完成。
69
+ 4. **生成修复反馈(原生协议)** — 若报告存在 RED/YELLOW 问题,执行 `protocols.md` 的 `review-fixback-protocol`,将问题转化为结构化 fixback 清单并落盘到 `.harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md`。若无 RED/YELLOW,记录 `review-fixback-protocol: skipped(no findings)`。不调用 Superpowers `receiving-code-review`,也不记录外部 skill 降级。
70
+ 5. **收尾** — append `phase.end` / `artifact` 事件;控制台输出摘要
71
+
72
+ ## Review 定位(重要)
73
+
74
+ **harness-review 是参考性代码审查阶段,不是硬门禁。**
75
+
76
+ | 等级 | 含义 | 后续影响 |
77
+ |:----:|------|----------|
78
+ | RED | 高风险建议,强烈建议处理 | 不阻塞后续流程 |
79
+ | YELLOW | 中低风险建议 | 不阻塞后续流程 |
80
+ | OK | 无问题 | 不阻塞后续流程 |
81
+
82
+ - 审查结果默认只作为参考,不阻塞 `/harness-submit`、`/harness-archive`
83
+ - 除非用户显式要求"review 结果阻塞提交",否则 review 不参与硬门禁
84
+ - Review 报告中**禁止写**:阻塞 submit / 必须修复后才能继续
85
+ - Review 报告中**应写**:建议优先处理 / 建议在 submit 前人工确认 / 建议补充测试 / 仅供参考,不阻塞后续 harness 流程
86
+
87
+ ### 可选 strict-review-gate 配置
88
+
89
+ 如果团队希望 review 结果阻塞提交,可在 `.harness/config/harness-test-config.md` 中设置:
90
+
91
+ ```yaml
92
+ review:
93
+ strict-review-gate: true # 默认 false
94
+ ```
95
+
96
+ 当且仅当 `strict-review-gate: true` 时,review RED 才阻塞 submit。默认行为是 `strict-review-gate: false`。
97
+
98
+ ## Output Format
99
+
100
+ 审查报告保存到 `.harness/changes/<change-name>/reports/review/review-report-YYYYMMDD-HHmm.md`(时间戳区分多次运行),同时在控制台输出摘要。报告格式详见 `reference.md` 的「输出报告完整模板」。
101
+
102
+ ## 渐进披露
103
+
104
+ - **Read `checklist.md`** 仅在执行完整6维度审查时 — 含6维度检查项详细列表 + 输出格式 + 执行日志记录模板
105
+ - **Read `reference.md`** 仅在需要理解审查标准或生成详细报告时 — 含"为什么需要审查"概述 + 严重级别判定标准 + 输出报告完整模板
106
+ - **Read `protocols.md`** 仅在 RED/YELLOW 问题需要转化为修复反馈时 — 含 `review-fixback-protocol` 的结构化 fixback 字段与落盘要求
107
+
108
+ ## 原生修复反馈协议
109
+
110
+ `/harness-review` 不再运行时调用 Superpowers `receiving-code-review`。审查后的修复反馈能力内化为 `protocols.md` 的 `review-fixback-protocol`:
111
+
112
+ 1. RED/YELLOW 问题转成 fixback 条目:严重级别、位置、风险、建议、验证方式、对 submit 的影响。
113
+ 2. fixback 落盘到 `.harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md`。
114
+ 3. 无 RED/YELLOW 时记录跳过原因,不制造空修复任务。
115
+
116
+ ## P0 执行可信度规则
117
+
118
+ - 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
119
+ - 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
120
+ - 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
121
+
122
+ ## 关键规则(硬门禁速查)
123
+
124
+ > 每条规则的详细判定、检查项见 `checklist.md` 对应章节;Shell 执行安全见 `../protocols/powershell-protocol.md`,敏感信息见 `../protocols/sensitive-info-protocol.md`,证据化报告见 `../protocols/evidence-based-reporting-protocol.md`,状态目录见 `../protocols/state-layout-protocol.md`,结构化报告事件见 `../protocols/report-pipeline-protocol.md`。
125
+
126
+ ### 一、只审查 git diff 变更部分
127
+
128
+ 只审查本次 `git diff` 中的变更,不审查已有代码;diff 为空 → 直接返回"无变更可审查"。每个问题给出具体修复建议(文件:行号 + 建议做法)。
129
+
130
+ ### 二、严重级别三态
131
+
132
+ RED=高风险建议(强烈建议处理),YELLOW=中低风险建议,OK=无问题。6维度逐文件审查(架构/安全/规范/兼容/测试/性能)—— 检查项见 `checklist.md`。判定标准见 `reference.md`「严重级别判定标准」。
133
+
134
+ ### 三、review 结果仅供参考(不阻塞后续流程)
135
+
136
+ review 结果默认只作参考,不阻塞 submit/archive;报告措辞遵循 `## Review 定位(重要)` 的“禁止写/应写”清单,不得出现“阻塞 submit / 必须修复后才能继续”。
137
+
138
+ ### 四、Shell 安全 / 敏感信息 / 证据化报告 / CodeGraph 探索
139
+
140
+ git diff/log 命令通过 `powershell.exe -Command "..."` 执行;review-report 中如发现明文 token/密码/密钥,必须列入 RED 问题并在报告中以 `<TOKEN_REDACTED>` 等占位符引用;RED/YELLOW/OK 结论必须基于实际 diff 内容,不得凭印象判断。代码探索必须优先使用 CodeGraph MCP 工具(`mcp__codegraph__codegraph_explore`),不允许通过普通 Bash 调 codegraph 命令(已列入 `disallowed-tools`);MCP 不可用时降级为 Grep/Glob + Read,并在执行日志记录降级原因。遵循 `../protocols/powershell-protocol.md` / `sensitive-info-protocol.md` / `evidence-based-reporting-protocol.md`。
141
+
142
+ ## 交互白名单
143
+
144
+ **无** AskUserQuestion(审查全自动)。委派失败 → 主会话审查 + `decision` 事件。
145
+
146
+ ## 执行日志
147
+
148
+ `events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止手工 Edit**。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
149
+
150
+ ```powershell
151
+ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
152
+ ```
153
+
154
+ > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
155
+
156
+ > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。