coding-agent-harness 1.0.1 → 1.0.4

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 (262) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/CONTRIBUTING.md +98 -0
  3. package/README.en-US.md +14 -0
  4. package/README.md +230 -80
  5. package/README.zh-CN.md +290 -0
  6. package/SKILL.md +132 -198
  7. package/docs-release/README.md +80 -9
  8. package/docs-release/architecture/overview.md +298 -28
  9. package/docs-release/architecture/overview.zh-CN.md +292 -0
  10. package/docs-release/assets/dashboard-overview.png +0 -0
  11. package/docs-release/assets/harness-architecture.svg +163 -0
  12. package/docs-release/assets/harness-workflow.svg +64 -0
  13. package/docs-release/guides/agent-installation.en-US.md +237 -0
  14. package/docs-release/guides/agent-installation.md +149 -27
  15. package/docs-release/guides/contributing.md +100 -0
  16. package/docs-release/guides/contributing.zh-CN.md +99 -0
  17. package/docs-release/guides/document-audience-and-surfaces.en-US.md +113 -0
  18. package/docs-release/guides/document-audience-and-surfaces.md +113 -0
  19. package/docs-release/guides/full-legacy-migration-subagent-strategy.md +334 -0
  20. package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +334 -0
  21. package/docs-release/guides/legacy-migration-agent-prompt.md +373 -0
  22. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +350 -0
  23. package/docs-release/guides/migration-playbook.en-US.md +324 -0
  24. package/docs-release/guides/migration-playbook.md +328 -0
  25. package/docs-release/guides/parent-control-repository-pattern.en-US.md +254 -0
  26. package/docs-release/guides/parent-control-repository-pattern.md +254 -0
  27. package/docs-release/guides/preset-development.md +214 -0
  28. package/docs-release/guides/repository-operating-models.en-US.md +197 -0
  29. package/docs-release/guides/repository-operating-models.md +197 -0
  30. package/docs-release/guides/task-state-machine.en-US.md +207 -0
  31. package/docs-release/guides/task-state-machine.md +214 -0
  32. package/docs-release/intl/README.md +15 -0
  33. package/docs-release/intl/de-DE.md +18 -0
  34. package/docs-release/intl/en-US.md +18 -0
  35. package/docs-release/intl/es-ES.md +18 -0
  36. package/docs-release/intl/fr-FR.md +18 -0
  37. package/docs-release/intl/ja-JP.md +18 -0
  38. package/docs-release/intl/ko-KR.md +18 -0
  39. package/docs-release/intl/zh-CN.md +18 -0
  40. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/brief.md +13 -0
  41. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/findings.md +7 -0
  42. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/lesson_candidates.md +24 -0
  43. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +1 -1
  44. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/task_plan.md +4 -2
  45. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/{visual_roadmap.md → visual_map.md} +9 -1
  46. package/package.json +10 -3
  47. package/presets/legacy-migration/checks/preset-check.mjs +3 -0
  48. package/presets/legacy-migration/preset.yaml +134 -0
  49. package/presets/legacy-migration/scripts/plan-work-queue.mjs +4 -0
  50. package/presets/legacy-migration/scripts/scaffold-task-contracts.mjs +4 -0
  51. package/presets/legacy-migration/templates/execution_strategy.append.md +18 -0
  52. package/presets/legacy-migration/templates/findings.seed.md +17 -0
  53. package/presets/legacy-migration/templates/review.seed.md +12 -0
  54. package/presets/legacy-migration/templates/task_plan.append.md +9 -0
  55. package/presets/legacy-migration/templates/visual_map.append.md +12 -0
  56. package/presets/legacy-migration/workbench/dashboard-panels.yaml +2 -0
  57. package/presets/legacy-migration/workbench/migration-queue.schema.json +23 -0
  58. package/presets/lesson-sedimentation/preset.yaml +23 -0
  59. package/presets/lesson-sedimentation/templates/prompt.md +23 -0
  60. package/presets/module/preset.yaml +25 -0
  61. package/presets/module/templates/execution_strategy.append.md +8 -0
  62. package/presets/module/templates/task_plan.append.md +17 -0
  63. package/presets/standard-task/preset.yaml +31 -0
  64. package/presets/standard-task/templates/task_plan.append.md +7 -0
  65. package/references/adversarial-review-standard.md +2 -2
  66. package/references/agents-md-pattern.md +5 -5
  67. package/references/delivery-operating-model-standard.md +3 -3
  68. package/references/docs-directory-standard.md +53 -10
  69. package/references/external-source-intake-standard.md +75 -0
  70. package/references/harness-ledger.md +53 -94
  71. package/references/legacy-12-phase-bootstrap.md +41 -0
  72. package/references/lessons-governance.md +100 -88
  73. package/references/module-parallel-standard.md +14 -14
  74. package/references/planning-loop.md +51 -7
  75. package/references/project-onboarding-audit.md +10 -0
  76. package/references/pull-request-standard.md +118 -0
  77. package/references/repo-governance-standard.md +12 -1
  78. package/references/review-routing-standard.md +7 -1
  79. package/references/ssot-governance.md +67 -59
  80. package/references/taskr-gap-analysis.md +600 -0
  81. package/references/testing-standard.md +50 -0
  82. package/references/walkthrough-closeout.md +10 -9
  83. package/scripts/check-harness.mjs +111 -331
  84. package/scripts/commands/dashboard-command.mjs +67 -0
  85. package/scripts/commands/migration-command.mjs +96 -0
  86. package/scripts/commands/preset-command.mjs +73 -0
  87. package/scripts/commands/task-command.mjs +327 -0
  88. package/scripts/harness.mjs +106 -20
  89. package/scripts/lib/capability-registry.mjs +591 -0
  90. package/scripts/lib/check-module-parallel.mjs +237 -0
  91. package/scripts/lib/check-profiles.mjs +418 -0
  92. package/scripts/lib/check-task-contracts.mjs +47 -0
  93. package/scripts/lib/core-shared.mjs +196 -0
  94. package/scripts/lib/dashboard-data.mjs +412 -0
  95. package/scripts/lib/dashboard-workbench.mjs +257 -0
  96. package/scripts/lib/dashboard-writer.mjs +107 -4
  97. package/scripts/lib/git-status-summary.mjs +46 -0
  98. package/scripts/lib/governance-index-generator.mjs +174 -0
  99. package/scripts/lib/governance-sync.mjs +514 -0
  100. package/scripts/lib/governance-table-boundary.mjs +175 -0
  101. package/scripts/lib/harness-core.mjs +15 -1318
  102. package/scripts/lib/lesson-maintenance.mjs +152 -0
  103. package/scripts/lib/markdown-utils.mjs +158 -0
  104. package/scripts/lib/migration-planner.mjs +478 -0
  105. package/scripts/lib/migration-support.mjs +312 -0
  106. package/scripts/lib/preset-audit-contracts.mjs +37 -0
  107. package/scripts/lib/preset-engine.mjs +497 -0
  108. package/scripts/lib/preset-registry.mjs +627 -0
  109. package/scripts/lib/preset-resource-contracts.mjs +83 -0
  110. package/scripts/lib/review-confirm-git-gate.mjs +248 -0
  111. package/scripts/lib/status-dashboard-renderer.mjs +102 -0
  112. package/scripts/lib/subagent-authorization-audit.mjs +196 -0
  113. package/scripts/lib/task-completion-consistency.mjs +16 -0
  114. package/scripts/lib/task-index.mjs +93 -0
  115. package/scripts/lib/task-lesson-candidates.mjs +242 -0
  116. package/scripts/lib/task-lesson-sedimentation.mjs +326 -0
  117. package/scripts/lib/task-lifecycle/review-confirm.mjs +101 -0
  118. package/scripts/lib/task-lifecycle/review-gates.mjs +70 -0
  119. package/scripts/lib/task-lifecycle/text-utils.mjs +24 -0
  120. package/scripts/lib/task-lifecycle.mjs +649 -0
  121. package/scripts/lib/task-review-model.mjs +469 -0
  122. package/scripts/lib/task-scanner.mjs +576 -0
  123. package/scripts/lib/task-tombstone-commands.mjs +140 -0
  124. package/scripts/postinstall.mjs +14 -0
  125. package/skills/preset-creator/SKILL.md +179 -0
  126. package/skills/preset-creator/references/complex-task-skeleton/README.md +31 -0
  127. package/skills/preset-creator/references/complex-task-skeleton/artifacts/INDEX.md +12 -0
  128. package/skills/preset-creator/references/complex-task-skeleton/brief.md +32 -0
  129. package/skills/preset-creator/references/complex-task-skeleton/execution_strategy.md +71 -0
  130. package/skills/preset-creator/references/complex-task-skeleton/findings.md +24 -0
  131. package/skills/preset-creator/references/complex-task-skeleton/lesson_candidates.md +70 -0
  132. package/skills/preset-creator/references/complex-task-skeleton/long-running-task-contract.md +76 -0
  133. package/skills/preset-creator/references/complex-task-skeleton/progress.md +33 -0
  134. package/skills/preset-creator/references/complex-task-skeleton/references/INDEX.md +13 -0
  135. package/skills/preset-creator/references/complex-task-skeleton/review.md +107 -0
  136. package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +111 -0
  137. package/{templates/planning/visual_roadmap.md → skills/preset-creator/references/complex-task-skeleton/visual_map.md} +24 -2
  138. package/skills/preset-creator/references/preset-package-skeleton.md +296 -0
  139. package/templates/AGENTS.md.template +51 -36
  140. package/templates/architecture/Architecture-SSoT.md +21 -0
  141. package/templates/architecture/README.md +49 -0
  142. package/templates/architecture/critical-flows.md +22 -0
  143. package/templates/architecture/local-repo-context.md +20 -0
  144. package/templates/architecture/service-catalog.md +17 -0
  145. package/templates/architecture/services/service-template.md +31 -0
  146. package/templates/architecture/system-map.md +22 -0
  147. package/templates/dashboard/assets/app-src/00-state.js +42 -0
  148. package/templates/dashboard/assets/app-src/10-router.js +77 -0
  149. package/templates/dashboard/assets/app-src/20-overview.js +241 -0
  150. package/templates/dashboard/assets/app-src/30-tasks.js +409 -0
  151. package/templates/dashboard/assets/app-src/35-task-detail.js +246 -0
  152. package/templates/dashboard/assets/app-src/40-modules.js +58 -0
  153. package/templates/dashboard/assets/app-src/45-review.js +347 -0
  154. package/templates/dashboard/assets/app-src/50-migration.js +183 -0
  155. package/templates/dashboard/assets/app-src/60-shared.js +61 -0
  156. package/templates/dashboard/assets/app-src/90-bindings.js +524 -0
  157. package/templates/dashboard/assets/app.css +3107 -300
  158. package/templates/dashboard/assets/app.css.manifest.json +9 -0
  159. package/templates/dashboard/assets/app.js +2068 -306
  160. package/templates/dashboard/assets/app.manifest.json +12 -0
  161. package/templates/dashboard/assets/css-src/00-foundation.css +342 -0
  162. package/templates/dashboard/assets/css-src/10-panels-flow.css +236 -0
  163. package/templates/dashboard/assets/css-src/20-briefs-controls.css +398 -0
  164. package/templates/dashboard/assets/css-src/30-task-index.css +739 -0
  165. package/templates/dashboard/assets/css-src/35-review-workspace.css +507 -0
  166. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +427 -0
  167. package/templates/dashboard/assets/css-src/50-responsive-overrides.css +551 -0
  168. package/templates/dashboard/assets/i18n.js +531 -44
  169. package/templates/dashboard/assets/mermaid-renderer.js +58 -8
  170. package/templates/development/README.md +52 -0
  171. package/templates/development/codebase-map.md +11 -0
  172. package/templates/development/cross-repo-debugging.md +18 -0
  173. package/templates/development/external-context/service-template.md +33 -0
  174. package/templates/development/external-source-packs/README.md +24 -0
  175. package/templates/development/external-source-packs/digest-template.md +28 -0
  176. package/templates/development/local-setup.md +16 -0
  177. package/templates/development/stubs-and-mocks.md +11 -0
  178. package/templates/integrations/README.md +40 -0
  179. package/templates/integrations/api-contract.md +42 -0
  180. package/templates/integrations/event-contract.md +46 -0
  181. package/templates/integrations/third-party/vendor-template.md +42 -0
  182. package/templates/integrations/webhook-contract.md +41 -0
  183. package/templates/ledger/Harness-Ledger.md +13 -25
  184. package/templates/lessons/lesson-arch-process-change.md +1 -1
  185. package/templates/lessons/lesson-new-doc.md +1 -1
  186. package/templates/lessons/lesson-ref-change.md +1 -1
  187. package/templates/planning/brief.md +32 -0
  188. package/templates/planning/execution_strategy.md +31 -0
  189. package/templates/planning/lesson_candidates.md +70 -0
  190. package/templates/planning/long-running-task-contract.md +7 -0
  191. package/templates/planning/module_brief.md +25 -0
  192. package/templates/planning/module_session_prompt.md +6 -0
  193. package/templates/planning/optional/artifacts/INDEX.md +3 -3
  194. package/templates/planning/optional/references/INDEX.md +3 -3
  195. package/templates/planning/review.md +59 -0
  196. package/templates/planning/task_plan.md +40 -15
  197. package/templates/planning/visual_map.md +50 -0
  198. package/templates/reference/docs-library-standard.md +31 -0
  199. package/templates/reference/execution-workflow-standard.md +5 -2
  200. package/templates/reference/external-source-intake-standard.md +82 -0
  201. package/templates/reference/harness-ledger-standard.md +1 -0
  202. package/templates/reference/pull-request-standard.md +80 -0
  203. package/templates/reference/repo-governance-standard.md +8 -5
  204. package/templates/reference/review-routing-standard.md +6 -0
  205. package/templates/reference/walkthrough-standard.md +3 -1
  206. package/templates/verifier/verifier-output.md +1 -1
  207. package/templates/walkthrough/walkthrough-template.md +2 -2
  208. package/templates-zh-CN/AGENTS.md.template +73 -70
  209. package/templates-zh-CN/architecture/Architecture-SSoT.md +21 -0
  210. package/templates-zh-CN/architecture/README.md +51 -0
  211. package/templates-zh-CN/architecture/critical-flows.md +24 -0
  212. package/templates-zh-CN/architecture/local-repo-context.md +20 -0
  213. package/templates-zh-CN/architecture/service-catalog.md +17 -0
  214. package/templates-zh-CN/architecture/services/service-template.md +31 -0
  215. package/templates-zh-CN/architecture/system-map.md +22 -0
  216. package/templates-zh-CN/development/README.md +54 -0
  217. package/templates-zh-CN/development/codebase-map.md +11 -0
  218. package/templates-zh-CN/development/cross-repo-debugging.md +18 -0
  219. package/templates-zh-CN/development/external-context/service-template.md +33 -0
  220. package/templates-zh-CN/development/external-source-packs/README.md +24 -0
  221. package/templates-zh-CN/development/external-source-packs/digest-template.md +28 -0
  222. package/templates-zh-CN/development/local-setup.md +16 -0
  223. package/templates-zh-CN/development/stubs-and-mocks.md +11 -0
  224. package/templates-zh-CN/integrations/README.md +42 -0
  225. package/templates-zh-CN/integrations/api-contract.md +42 -0
  226. package/templates-zh-CN/integrations/event-contract.md +46 -0
  227. package/templates-zh-CN/integrations/third-party/vendor-template.md +42 -0
  228. package/templates-zh-CN/integrations/webhook-contract.md +41 -0
  229. package/templates-zh-CN/ledger/Harness-Ledger.md +17 -40
  230. package/templates-zh-CN/planning/brief.md +32 -0
  231. package/templates-zh-CN/planning/execution_strategy.md +30 -0
  232. package/templates-zh-CN/planning/lesson_candidates.md +70 -0
  233. package/templates-zh-CN/planning/long-running-task-contract.md +1 -1
  234. package/templates-zh-CN/planning/module_brief.md +25 -0
  235. package/templates-zh-CN/planning/module_plan.md +2 -2
  236. package/templates-zh-CN/planning/module_session_prompt.md +4 -3
  237. package/templates-zh-CN/planning/review.md +59 -1
  238. package/templates-zh-CN/planning/task_plan.md +37 -11
  239. package/templates-zh-CN/planning/{visual_roadmap.md → visual_map.md} +21 -2
  240. package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
  241. package/templates-zh-CN/reference/docs-library-standard.md +36 -1
  242. package/templates-zh-CN/reference/execution-workflow-standard.md +10 -2
  243. package/templates-zh-CN/reference/external-source-intake-standard.md +82 -0
  244. package/templates-zh-CN/reference/harness-ledger-standard.md +7 -4
  245. package/templates-zh-CN/reference/pull-request-standard.md +106 -0
  246. package/templates-zh-CN/reference/repo-governance-standard.md +4 -1
  247. package/templates-zh-CN/reference/review-routing-standard.md +8 -1
  248. package/templates-zh-CN/reference/walkthrough-standard.md +6 -5
  249. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +2 -2
  250. package/templates-zh-CN/walkthrough/walkthrough-template.md +2 -2
  251. package/scripts/smoke-dashboard.mjs +0 -70
  252. package/scripts/test-harness.mjs +0 -483
  253. package/templates/ssot/Feature-SSoT.md +0 -43
  254. package/templates/ssot/Lessons-SSoT.md +0 -44
  255. package/templates-zh-CN/dashboard/assets/app.css +0 -399
  256. package/templates-zh-CN/dashboard/assets/app.js +0 -435
  257. package/templates-zh-CN/dashboard/assets/i18n.js +0 -47
  258. package/templates-zh-CN/dashboard/assets/markdown-reader.js +0 -116
  259. package/templates-zh-CN/dashboard/assets/mermaid-renderer.js +0 -59
  260. package/templates-zh-CN/dashboard/index.html +0 -18
  261. package/templates-zh-CN/ssot/Feature-SSoT.md +0 -49
  262. package/templates-zh-CN/ssot/Lessons-SSoT.md +0 -49
@@ -1,5 +1,7 @@
1
1
  # Agent 安装指南
2
2
 
3
+ English mirror: `docs-release/guides/agent-installation.en-US.md`
4
+
3
5
  这份指南写给在目标项目里执行安装或升级的 coding agent。README 只保留给人看的定位、
4
6
  快速开始和最小命令;安装细则放在这里和 `SKILL.md`。
5
7
 
@@ -9,15 +11,48 @@
9
11
  研究命令参数、模板目录或 capability 选择;这些决策必须在 Diagnose / Decide 阶段完成,
10
12
  并在交付 summary 中说明依据。
11
13
 
14
+ 本文命令默认写成已安装的 `harness`。Agent 开始前先检查 `command -v harness`。
15
+ 如果目标环境没有 `harness` 命令,不得静默全局安装;先询问用户是否允许运行
16
+ `npm install -g coding-agent-harness`。只有用户明确同意后才能修改全局 npm 环境。
17
+ 用户不同意或未回复时,用 `npx --yes coding-agent-harness <command>` 运行同一条 CLI。
18
+ 维护者在本源码仓调试时,可以把同一命令替换为 `node scripts/harness.mjs`。
19
+
20
+ `harness init` 不会把 npm 包写进目标项目依赖;它只写 Harness 文档、模板和 registry。
21
+ 因此 agent 交付时不能暗示目标项目已经安装了 npm dependency。`npx` 第一次运行会把包
22
+ 下载到 npm 缓存;这不是项目依赖,也不是全局命令安装。需要 CLI 时继续用
23
+ `npx --yes coding-agent-harness ...`、用户批准后的全局 `harness`,或源码仓的
24
+ `node scripts/harness.mjs`。
25
+
26
+ `npx skills add FairladyZ625/coding-agent-harness --skill coding-agent-harness`
27
+ 不是零写入操作。它会把 Skill 拷贝到目标项目的 `.agents/skills/coding-agent-harness/`
28
+ 并写入 `skills-lock.json`。如果用户要求严格只读扫描,先跳过 Skill 安装,用
29
+ `npx --yes coding-agent-harness status` / `migrate-plan` 完成扫描;等用户确认允许写入后
30
+ 再安装 Skill 或运行初始化/迁移写入命令。
31
+
32
+ 本仓库还发布嵌套的 `preset-creator` Skill,给需要制作可复用 Harness Preset 的 Agent
33
+ 使用。因为本仓库同时有根目录 `SKILL.md` 和嵌套 Skill,查看或安装它时要加
34
+ `--full-depth`:
35
+
36
+ ```bash
37
+ npx skills add FairladyZ625/coding-agent-harness --list --full-depth
38
+ npx skills add FairladyZ625/coding-agent-harness --skill preset-creator --full-depth
39
+ ```
40
+
41
+ `coding-agent-harness` 用于在目标项目中运行 Harness;`preset-creator` 只在 Agent
42
+ 需要为一类可重复任务设计 Preset 时使用,例如这些任务共享 Reference、Artifact、Evidence
43
+ 或 Complex Task 骨架叠加规则。
44
+
12
45
  使用 v1.0 六阶段流程:
13
46
 
14
- 1. Diagnose:扫描项目结构、语言、现有文档、CI、协作方式和风险面。
15
- 2. Decide:确定 locale、delivery modelcapability packs
47
+ 1. Diagnose:扫描项目结构、语言、现有文档、CI、协作方式、外部依赖和风险面。
48
+ 2. Decide:确定 locale、delivery modelcapability packs,以及是否需要外部资料摄取。
16
49
  3. Scaffold:运行 `harness init` 或 `harness add-capability`。
17
50
  4. Configure:把生成文档改成项目事实;不要把模板假装成已定制标准。
18
51
  5. Verify:运行 CLI 检查和项目原生证据。
19
52
  6. Deliver:输出 residual、owner 和下一步。
20
53
 
54
+ 如果 Diagnose 阶段发现项目属于微服务、多仓、前后端分仓、平台子系统,或代码里有外部服务、SDK、API gateway、message queue、webhook、contract、schema、mock,Agent 必须询问用户是否有外部资料。资料少时作为 `Source Evidence` 链接;资料多时按 `docs/11-REFERENCE/external-source-intake-standard.md` 建立 `docs/04-DEVELOPMENT/external-source-packs/<source-key>/`,再把稳定结论投影到 `03/04/06`。
55
+
21
56
  ## 语言规则
22
57
 
23
58
  - 用户在场时,先问 harness 文档使用中文还是英文。
@@ -32,7 +67,17 @@
32
67
  目标项目没有旧 harness 时使用这条路径:
33
68
 
34
69
  ```bash
35
- node scripts/harness.mjs init \
70
+ harness init \
71
+ --locale zh-CN \
72
+ --capabilities core,dashboard \
73
+ /path/to/project
74
+ ```
75
+
76
+ 如果目标环境没有 `harness` 命令,先询问用户是否允许全局安装;同意后运行
77
+ `npm install -g coding-agent-harness`。未获同意时使用:
78
+
79
+ ```bash
80
+ npx --yes coding-agent-harness init \
36
81
  --locale zh-CN \
37
82
  --capabilities core,dashboard \
38
83
  /path/to/project
@@ -43,7 +88,7 @@ Capability 要保守选择:
43
88
  | Capability | 默认 | 何时选择 |
44
89
  | --- | --- | --- |
45
90
  | `core` | 是 | 永远安装。这是 document kernel。 |
46
- | `dashboard` | 否 | 用户或 agent 需要本地只读状态页。 |
91
+ | `dashboard` | 否 | 用户或 agent 需要本地状态页、静态证据快照,或本机动态 workbench。 |
47
92
  | `safe-adoption` | 否 | 旧 harness 项目接入 v1.0,需要保留历史文档。 |
48
93
  | `adversarial-review` | 否 | 发布、架构、安全、数据或策略风险需要独立 review artifact。 |
49
94
  | `long-running-task` | 否 | Agent 需要连续多轮执行,不能每步都询问用户。 |
@@ -55,11 +100,33 @@ Capability 要保守选择:
55
100
  - locale
56
101
  - selected capabilities,以及每个可选 capability 的选择理由
57
102
  - created / skipped files
103
+ - nextCommands 中推荐的 `harness dev` 或 `npx --yes coding-agent-harness dev .` 日常入口
58
104
  - Configure 阶段做了哪些项目化改动
59
105
  - verification commands 和结果
60
106
  - residual owner / action / status
61
107
  - 是否提交;如果只是 dogfood 测试,是否已清理测试产物
62
108
 
109
+ `init` 默认不会修改 `package.json`。只有用户明确希望目标项目保留 npm script 时,才使用
110
+ `--add-npm-scripts`;该选项要求目标项目已经存在 `package.json`,并且不会覆盖已有
111
+ `harness:dev` 或 `harness:dashboard` script。
112
+
113
+ ## 外部资料摄取
114
+
115
+ 当项目依赖外部微服务、外部仓库或外部团队文档时,Agent 不应该把外部资料直接塞进 `03-ARCHITECTURE`、`04-DEVELOPMENT` 或 `06-INTEGRATIONS`。正确顺序是:
116
+
117
+ ```text
118
+ Inventory -> Classify -> Sanitize -> Digest -> Project -> Verify -> Residual
119
+ ```
120
+
121
+ 处理规则:
122
+
123
+ - 询问用户是否有外部架构文档、接口文档、流程图、会议纪要、链接或导出包。
124
+ - 确认资料是否能复制进仓;不能入仓的只保留路径、URL、owner、访问条件和 digest。
125
+ - 外部资料超过 5 份、跨多个主题或会持续增长时,创建 `docs/04-DEVELOPMENT/external-source-packs/<source-key>/`。
126
+ - `external-source-packs/` 只保存资料索引、digest 和投影状态。
127
+ - 稳定事实必须回写到 `03-ARCHITECTURE/services/<service-key>.md`、`04-DEVELOPMENT/external-context/<service-key>.md` 或 `06-INTEGRATIONS/<contract>.md`。
128
+ - 未确认或冲突的内容只能留在 source pack 或 `Do Not Assume`。
129
+
63
130
  ## 用户级注册
64
131
 
65
132
  如果用户已经通过 npm 或源码拿到了 `harness` CLI,可以把本 Skill 注册到用户级
@@ -70,6 +137,16 @@ harness install-user --agent codex --global
70
137
  harness doctor-user --agent codex
71
138
  ```
72
139
 
140
+ `npm install -g coding-agent-harness`、`harness install-user` 和 `harness init`
141
+ 都会 seed 内置 Preset:
142
+
143
+ - 用户级 Preset:`~/.coding-agent-harness/presets/<preset-id>/`
144
+ - 项目级 Preset:`<target>/.coding-agent-harness/presets/<preset-id>/`
145
+
146
+ Agent 初始化或接手任务前必须运行 `harness preset list --json [target]`,
147
+ 确认可用 Preset 后再选择 `--preset`。如需修复缺失的内置 Preset,运行
148
+ `harness preset seed` 或 `harness preset seed --project <target>`。
149
+
73
150
  支持的 agent target:
74
151
 
75
152
  | Agent | 用户级目录 |
@@ -86,54 +163,99 @@ harness doctor-user --agent codex
86
163
  - 默认交互确认;非交互场景必须传 `--yes` 或先用 `--dry-run`。
87
164
  - 默认不覆盖已有文件,只补缺失文件。
88
165
  - 需要强制更新时显式传 `--force`。
89
- - `doctor-user` 会检查 `SKILL.md`、模板、references、CLI scripts 和本指南是否存在。
166
+ - `doctor-user` 会检查 `SKILL.md`、模板、references、内置 Preset、CLI scripts、本指南,以及用户级 Preset seed 是否存在。
90
167
 
91
168
  ## 旧 Harness 迁移
92
169
 
93
- 目标项目已经有旧版 harness 时使用这条路径。不要把旧文档重建一遍:
170
+ 目标项目已经有旧版 harness 时使用这条路径。不要把旧文档重建一遍,也不要从
171
+ `add-capability` 手工拼流程;先用迁移轨道生成可验证 session:
94
172
 
95
173
  ```bash
96
- node scripts/harness.mjs add-capability safe-adoption \
174
+ harness migrate-run \
97
175
  --locale zh-CN \
176
+ --session-dir /tmp/cah-migration-project \
177
+ --out-dir /tmp/cah-migration-project/dashboard \
98
178
  /path/to/old-project
179
+
180
+ harness migrate-verify \
181
+ /tmp/cah-migration-project/session.json
99
182
  ```
100
183
 
101
184
  规则:
102
185
 
103
186
  - 不覆盖已有 `AGENTS.md`、`CLAUDE.md`、`docs/Harness-Ledger.md`、SSoT、
104
187
  walkthrough、task progress 和历史 task plan。
188
+ - 旧项目中英文混杂时,必须显式传 `--locale zh-CN` 或 `--locale en-US`。
105
189
  - 只补齐缺失的 v1.0 模板和 capability registry。
106
190
  - 已有项目事实只能 merge、append 或记录 residual;不能用泛化模板替换。
107
191
  - 历史合同缺口在普通模式下进入 `adoption-needed` warning。
108
192
  - `--strict` 必须仍然能因为旧 checker 失败或历史合同缺口而失败。
193
+ - 旧全局表和模块索引先归档,再用 `harness governance rebuild --archive --apply` 重新生成;这些表是 Agent 索引,人看状态优先用 Dashboard。
194
+ - `migrate-verify` 必须通过,才能报告迁移输出可用;dashboard 路径必须是 HTML。
195
+ - 详细迁移策略见 `docs-release/guides/migration-playbook.md` 或英文镜像
196
+ `docs-release/guides/migration-playbook.en-US.md`。如果用户要求证明旧项目已经完整迁移,
197
+ 还必须读取 `docs-release/guides/full-legacy-migration-subagent-strategy.md` 或中文镜像
198
+ `docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md`。Agent 应读取
199
+ `session.json` 和 `migrate-plan.json`,再逐步迁移活跃任务、当前 review、真实采用的 capability,
200
+ 并用 subagent 审查证明 dashboard brief 覆盖、strict check 和 final session 全部通过。
109
201
 
110
- ## 验证命令
202
+ ## 任务生命周期
111
203
 
112
- 安装或升级收口前,至少运行:
204
+ 初始化或迁移完成后,agent 不应手工复制任务目录。使用生命周期命令创建和推进任务:
113
205
 
114
206
  ```bash
115
- node scripts/harness.mjs check --profile target-project /path/to/project
116
- node scripts/harness.mjs status --json /path/to/project
117
- node scripts/harness.mjs dashboard --out /tmp/harness-dashboard.html /path/to/project
118
- ```
207
+ harness new-task phase-2-lifecycle \
208
+ --title "阶段二任务生命周期" \
209
+ --locale zh-CN \
210
+ /path/to/project
119
211
 
120
- 开发本仓 v1.0 kernel 时,release gate 是:
212
+ harness task-start phase-2-lifecycle \
213
+ --message "开始实现生命周期切片" \
214
+ /path/to/project
121
215
 
122
- ```bash
123
- npm test
124
- npm run smoke:dashboard
125
- node scripts/harness.mjs check --profile source-package .
126
- node scripts/harness.mjs check --profile private-harness .harness-private
127
- node scripts/harness.mjs check --profile target-project examples/minimal-project
216
+ harness task-log phase-2-lifecycle \
217
+ --message "完成 CLI 与模板更新" \
218
+ --evidence "command:TARGET:npm-test:passed" \
219
+ /path/to/project
220
+
221
+ harness review-confirm TASKS/phase-2-lifecycle \
222
+ --reviewer "Human Reviewer" \
223
+ --confirm phase-2-lifecycle \
224
+ /path/to/project
225
+
226
+ harness task-complete phase-2-lifecycle \
227
+ --message "验证闭环完成" \
228
+ /path/to/project
128
229
  ```
129
230
 
130
- ## 必跑回归路径
231
+ 规则:
131
232
 
132
- 任何 v1.0 kernel 改动都必须覆盖两条路径:
233
+ - 不要手工复制任务模板,也不要创建不完整任务目录。`harness check` 会按
234
+ `new-task` 创建的预算文件集校验。
235
+ - `new-task --budget simple` 创建 `brief.md`、`task_plan.md`、`visual_map.md`
236
+ 和 `progress.md`。
237
+ - `new-task` 默认 `standard`,创建 simple 文件,并额外创建
238
+ `execution_strategy.md`、`findings.md`、`lesson_candidates.md` 和 `review.md`。
239
+ - `new-task --budget complex` 创建 standard 文件,并额外创建
240
+ `references/INDEX.md` 和 `artifacts/INDEX.md`。
241
+ - 已存在的任务目录不会被覆盖;需要改名或继续旧任务时,由 coordinator 决定。
242
+ - `task-start`、`task-block`、`task-complete` 只更新 `progress.md` 的生命周期状态和日志。
243
+ - `task-log` 只追加执行记录;证据使用 `type:PATH:summary`,例如
244
+ `command:TARGET:npm-test:passed`。
245
+ - `review-confirm` 会向 `review.md` 追加人工审查确认,并向 `progress.md` 追加日志;如果存在 `Open: yes` 或 `Blocks Release: yes` 的开放 P0/P1/P2 finding,必须拒绝确认。
246
+ - CLI-owned lifecycle 和 lesson 命令会在干净 Git root 中自动提交 allowlisted 写入;dirty 状态会出现在 `status` / dashboard 的警告里,并阻塞这些机械化提交。Agent 手工改动仍要主动提交,不能提交时记录 no-commit reason、owner 和下一步。
247
+ - `status --json` 保留旧 `task.state` 用于兼容,并新增 `lifecycleState`、`reviewStatus`、`closeoutStatus` 和 `stateConflicts`。`done` 只表示实现完成,不等于 `closed`。
248
+ - 人工操作入口使用本地 HTML workbench:`harness dev /path/to/project`。它会启动只绑定 `127.0.0.1` 的动态页面、自动选择端口、打开浏览器并随 docs 变更刷新。无 GUI 或 CI 场景使用 `harness dev --no-open /path/to/project`。
249
+ - 底层兼容入口仍是 `harness dashboard --workbench --out-dir /tmp/harness-workbench /path/to/project`。静态 dashboard 文件仍然只读,不能承载人工确认动作。
250
+ - `task-list --json` 和 `status --json` 是 dashboard、reviewer 和后续 agent 的读取入口。
133
251
 
134
- | 路径 | 必须证明 |
135
- | --- | --- |
136
- | 新项目初始化 | 空项目 `init --locale zh-CN\|en-US --capabilities core,...` 后,模板语言一致、registry 正确、`status --json` 不误报 `safe-adoption`。 |
137
- | 旧 harness 迁移 | 旧项目 `add-capability safe-adoption --locale ...` 后,旧文件不被覆盖,缺失 v1.0 模板被补齐,普通模式 warning,strict 模式能阻塞历史缺口。 |
252
+ ## 验证命令
253
+
254
+ 安装或升级收口前,至少运行:
138
255
 
139
- 真实项目 dogfood 默认清理测试产物,除非用户明确要求保留并提交。
256
+ ```bash
257
+ harness check --profile target-project /path/to/project
258
+ harness status --json /path/to/project
259
+ harness dev --no-open --out-dir /tmp/harness-workbench /path/to/project
260
+ harness dashboard --out /tmp/harness-dashboard.html /path/to/project
261
+ ```
@@ -0,0 +1,100 @@
1
+ # Contributor Guide
2
+
3
+ This guide is for external contributors working on the public Coding Agent Harness repository.
4
+
5
+ ## Working Model
6
+
7
+ Coding Agent Harness is more than documentation. The public repository includes:
8
+
9
+ - CLI implementation under `scripts/`
10
+ - tests under `tests/`
11
+ - installable templates under `templates/` and `templates-zh-CN/`
12
+ - bundled presets under `presets/`
13
+ - public documentation under `docs-release/`
14
+ - examples under `examples/`
15
+ - an optional GUI submodule under `harness-gui/`
16
+
17
+ Keep pull requests focused on one change family when possible. Documentation, CLI behavior, target-project templates, presets, and GUI work have different verification paths.
18
+
19
+ ## Local Setup
20
+
21
+ Use Node.js 18 or newer. CI runs Node.js 20.
22
+
23
+ ```bash
24
+ npm install
25
+ ```
26
+
27
+ If your change touches the GUI submodule:
28
+
29
+ ```bash
30
+ cd harness-gui
31
+ npm ci
32
+ ```
33
+
34
+ ## Required Checks
35
+
36
+ Run the checks that match your change. For larger PRs or when you are unsure, run
37
+ the full root suite.
38
+
39
+ | Change type | Minimum local checks |
40
+ | --- | --- |
41
+ | Docs only | `git diff --check` |
42
+ | CLI/runtime | `npm test`, `npm run check`, `git diff --check` |
43
+ | Templates or examples | `npm test`, `node scripts/harness.mjs check --profile target-project examples/minimal-project`, `git diff --check` |
44
+ | Dashboard | `npm test`, `npm run smoke:dashboard`, `git diff --check` |
45
+ | Package surface | `npm test`, `npm run pack:dry-run`, `git diff --check` |
46
+ | GUI submodule | `cd harness-gui && npm ci && npm run typecheck && npm test && npm run build` |
47
+
48
+ Full root suite:
49
+
50
+ ```bash
51
+ npm test
52
+ npm run smoke:dashboard
53
+ npm run check
54
+ node scripts/harness.mjs check --profile target-project examples/minimal-project
55
+ npm run pack:dry-run
56
+ git diff --check
57
+ ```
58
+
59
+ GUI submodule setup and checks:
60
+
61
+ ```bash
62
+ cd harness-gui
63
+ npm ci
64
+ npm run typecheck
65
+ npm test
66
+ npm run build
67
+ ```
68
+
69
+ If a check cannot be run locally, say why in the PR.
70
+
71
+ ## PR Requirements
72
+
73
+ Use the repository PR template and fill in:
74
+
75
+ - summary
76
+ - what changed
77
+ - version impact
78
+ - verification evidence
79
+ - review evidence
80
+ - residual risk
81
+ - related issue, task, or design reference when available
82
+
83
+ For docs-only or CI-only changes, "no version change" is usually correct. Runtime, template, preset, or package-surface changes may need a version decision from a maintainer.
84
+
85
+ ## GUI Submodule Changes
86
+
87
+ `harness-gui/` is a Git submodule. GUI changes should be committed in the GUI repository first, then the parent repository should update the submodule pointer. A parent PR that updates the pointer should link to the GUI PR and include the GUI verification output.
88
+
89
+ ## CI
90
+
91
+ GitHub Actions runs the same broad gates contributors should run locally:
92
+
93
+ - root package tests
94
+ - source/package boundary check
95
+ - minimal target project check
96
+ - dashboard generation and smoke test
97
+ - npm package dry run
98
+ - GUI submodule typecheck, tests, and build
99
+
100
+ Repository owners manage branch protection and required checks in GitHub. Contributors only need to keep their PRs focused, documented, and verified.
@@ -0,0 +1,99 @@
1
+ # 贡献者指南
2
+
3
+ 这份指南面向参与公开 `coding-agent-harness` 仓库的外部贡献者。
4
+
5
+ ## 工作模型
6
+
7
+ Coding Agent Harness 不只是文档仓库。公开仓库包含:
8
+
9
+ - `scripts/` 下的 CLI 实现
10
+ - `tests/` 下的测试
11
+ - `templates/` 与 `templates-zh-CN/` 下的可安装模板
12
+ - `presets/` 下的内置 preset
13
+ - `docs-release/` 下的公开文档
14
+ - `examples/` 下的示例项目
15
+ - `harness-gui/` 下的可选 GUI 子模块
16
+
17
+ PR 尽量聚焦在一类改动上。文档、CLI 行为、目标项目模板、preset 和 GUI 有不同的验证路径。
18
+
19
+ ## 本地准备
20
+
21
+ 使用 Node.js 18 或更高版本。CI 当前使用 Node.js 20。
22
+
23
+ ```bash
24
+ npm install
25
+ ```
26
+
27
+ 如果改动涉及 GUI 子模块:
28
+
29
+ ```bash
30
+ cd harness-gui
31
+ npm ci
32
+ ```
33
+
34
+ ## 必要检查
35
+
36
+ 根据改动范围运行相关检查。较大的 PR 或不确定范围时,运行完整根仓检查。
37
+
38
+ | 改动类型 | 最小本地检查 |
39
+ | --- | --- |
40
+ | 仅文档 | `git diff --check` |
41
+ | CLI / runtime | `npm test`, `npm run check`, `git diff --check` |
42
+ | 模板或示例 | `npm test`, `node scripts/harness.mjs check --profile target-project examples/minimal-project`, `git diff --check` |
43
+ | Dashboard | `npm test`, `npm run smoke:dashboard`, `git diff --check` |
44
+ | Package surface | `npm test`, `npm run pack:dry-run`, `git diff --check` |
45
+ | GUI 子模块 | `cd harness-gui && npm ci && npm run typecheck && npm test && npm run build` |
46
+
47
+ 完整根仓检查:
48
+
49
+ ```bash
50
+ npm test
51
+ npm run smoke:dashboard
52
+ npm run check
53
+ node scripts/harness.mjs check --profile target-project examples/minimal-project
54
+ npm run pack:dry-run
55
+ git diff --check
56
+ ```
57
+
58
+ GUI 子模块安装和检查:
59
+
60
+ ```bash
61
+ cd harness-gui
62
+ npm ci
63
+ npm run typecheck
64
+ npm test
65
+ npm run build
66
+ ```
67
+
68
+ 如果某个检查无法在本地运行,请在 PR 中说明原因。
69
+
70
+ ## PR 要求
71
+
72
+ 使用仓库 PR 模板,并填写:
73
+
74
+ - 摘要
75
+ - 改动内容
76
+ - 版本影响
77
+ - 验证证据
78
+ - 审查证据
79
+ - 残余风险
80
+ - 如有相关 issue、任务或设计材料,附上链接
81
+
82
+ 文档或 CI-only 改动通常可以写“不改版本”。运行时、模板、preset 或 package surface 改动可能需要维护者决定版本策略。
83
+
84
+ ## GUI 子模块改动
85
+
86
+ `harness-gui/` 是 Git submodule。GUI 改动应先提交到 GUI 仓库,再由父仓更新 submodule pointer。更新 pointer 的父仓 PR 应链接 GUI PR,并附上 GUI 验证结果。
87
+
88
+ ## CI
89
+
90
+ GitHub Actions 会运行贡献者本地也应覆盖的主要 gate:
91
+
92
+ - 根包测试
93
+ - source/package boundary 检查
94
+ - minimal target project 检查
95
+ - dashboard 生成与 smoke test
96
+ - npm package dry run
97
+ - GUI 子模块 typecheck、测试和 build
98
+
99
+ GitHub branch protection 和 required checks 由仓库 owner 在 GitHub 上管理。贡献者只需要让 PR 聚焦、说明清楚并附上验证证据。
@@ -0,0 +1,113 @@
1
+ # Document Audiences And Surfaces
2
+
3
+ Chinese mirror: `docs-release/guides/document-audience-and-surfaces.md`
4
+
5
+ Coding Agent Harness documentation is not one uniform pile of Markdown. It serves three audiences:
6
+
7
+ - Humans who need to understand the product, architecture, migration path, and project state.
8
+ - Agents that need executable entrypoints, rules, task contracts, and evidence paths.
9
+ - Release systems that need to know which files can ship publicly and which files are only local operating state.
10
+
11
+ If these audiences are mixed, the documentation becomes unclear. Humans cannot find the decision, and agents cannot tell which file is authoritative.
12
+
13
+ ## Principle
14
+
15
+ Human-facing docs explain intent and judgment.
16
+
17
+ Agent-facing docs define facts, paths, gates, and next actions.
18
+
19
+ Release docs explain public methodology and product capability. They do not carry a team's private operating ledger.
20
+
21
+ ## Documentation Surfaces
22
+
23
+ | Surface | Primary reader | Contains | Does not contain |
24
+ | --- | --- | --- | --- |
25
+ | `README.md` | Humans | What the project is, how to start, key links | Long-running task state, private ledgers |
26
+ | `docs-release/` | Humans and evaluators | Public architecture, guides, patterns, migration tutorials | Private task plans, internal reviews, customer-specific operating state |
27
+ | `references/` | Agents and maintainers | Reusable standards such as testing, workflow, review, worktree rules | A project's current schedule |
28
+ | `templates/` | CLI and agents | Files generated into target projects | Evidence from completed work |
29
+ | Target `AGENTS.md` | Agents | Entrypoint, routing, hard rules, reading matrix | Long background essays |
30
+ | Target `docs/09-PLANNING/` and `docs/Harness-Ledger.md` | Agents and project owners | Task plans, generated task lifecycle index, current state | Generic marketing material |
31
+ | Target `docs/05-TEST-QA/` | Agents, QA, human reviewers | Regression SSoT, Cadence Ledger, quality gates | Requirement brainstorm drafts |
32
+ | Target `docs/10-WALKTHROUGH/` | Reviewers and handoff agents | Closeout evidence, residuals, human confirmation | Unverified plans |
33
+
34
+ ## Human-Facing Docs
35
+
36
+ Human-facing docs answer:
37
+
38
+ - What problem does this method solve?
39
+ - Which repository operating model should I choose?
40
+ - What are the risks when migrating an old project?
41
+ - What evidence should make me trust that the agent stayed on track?
42
+
43
+ Typical files:
44
+
45
+ - `docs-release/architecture/overview.md`
46
+ - `docs-release/guides/repository-operating-models.en-US.md`
47
+ - `docs-release/guides/parent-control-repository-pattern.en-US.md`
48
+ - `docs-release/guides/migration-playbook.en-US.md`
49
+
50
+ Human-facing docs may explain tradeoffs, examples, and decisions, but they should not be the only source of truth. Live project state belongs in SSoTs, task files, reviews, walkthroughs, and regression files.
51
+
52
+ ## Agent-Facing Docs
53
+
54
+ Agent-facing docs answer:
55
+
56
+ - Where do I start reading?
57
+ - Which files are authoritative?
58
+ - Which paths may I edit?
59
+ - Which checks must I run after editing?
60
+ - When must I stop and ask a human?
61
+
62
+ Typical files:
63
+
64
+ - `AGENTS.md`
65
+ - `docs/Harness-Ledger.md`
66
+ - `docs/09-PLANNING/TASKS/<task>/task_plan.md`
67
+ - `docs/09-PLANNING/TASKS/<task>/task_plan.md`
68
+ - `docs/09-PLANNING/TASKS/<task>/progress.md`
69
+ - `docs/05-TEST-QA/Regression-SSoT.md`
70
+ - `docs/10-WALKTHROUGH/<date>-<task>.md`
71
+ - `docs/11-REFERENCE/*.md`
72
+
73
+ Agent-facing docs should be concrete, path-oriented, and checkable. Do not turn them into essays, and do not make agents infer execution contracts from narrative prose.
74
+
75
+ ## Release Docs
76
+
77
+ Release docs explain the public capability of Coding Agent Harness. They should not record the maintainers' private development process.
78
+
79
+ Good release docs include:
80
+
81
+ - Architecture overviews.
82
+ - Installation and migration guides.
83
+ - Single-repo, multi-repo, and parent-control operating model guidance.
84
+ - Public migration prompts for agents.
85
+ - Reusable engineering methodology.
86
+
87
+ Do not publish:
88
+
89
+ - In-progress conclusions from private tasks.
90
+ - Private review drafts.
91
+ - Machine-local paths that only work for one maintainer.
92
+ - Customer or team internal state.
93
+ - Ledgers, handoffs, or walkthroughs that have not been sanitized for release.
94
+
95
+ ## Writing Rules
96
+
97
+ 1. Identify the reader before choosing the file.
98
+ 2. Human docs explain why; agent docs define how.
99
+ 3. Public docs may describe patterns and structures, but not private operating state.
100
+ 4. Task state belongs in SSoTs, task files, reviews, walkthroughs, and ledgers.
101
+ 5. If one document tries to be both a human explanation and an agent execution contract, split it into a public guide and an execution contract.
102
+
103
+ ## A Useful Test
104
+
105
+ Before writing a document, ask:
106
+
107
+ > Who reads this file, at what moment, and what action should they take after reading it?
108
+
109
+ If the answer is "a human uses it to understand," put it in a public guide or architecture doc.
110
+
111
+ If the answer is "an agent uses it to execute," put it in the target project's entrypoint, task, standard, or regression files.
112
+
113
+ If the answer is "a maintainer records how this source repository is being operated," it is not a public release document.