coding-agent-harness 1.0.4 → 1.0.6

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 (279) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/CONTRIBUTING.md +2 -2
  3. package/LICENSE +661 -21
  4. package/LICENSE-EXCEPTION.md +37 -0
  5. package/README.md +96 -4
  6. package/README.zh-CN.md +75 -4
  7. package/SKILL.md +52 -51
  8. package/dist/build-dist.mjs +189 -0
  9. package/dist/check-dist-observation.mjs +428 -0
  10. package/dist/check-harness.mjs +489 -0
  11. package/dist/check-import-graph.mjs +511 -0
  12. package/dist/check-runtime-emit.mjs +304 -0
  13. package/dist/check-type-boundaries.mjs +139 -0
  14. package/dist/commands/dashboard-command.mjs +80 -0
  15. package/dist/commands/migration-command.mjs +152 -0
  16. package/dist/commands/preset-command.mjs +91 -0
  17. package/dist/commands/task-command.mjs +324 -0
  18. package/dist/harness.mjs +304 -0
  19. package/dist/lib/capability-registry.mjs +643 -0
  20. package/dist/lib/check-module-parallel.mjs +227 -0
  21. package/dist/lib/check-profiles.mjs +414 -0
  22. package/dist/lib/check-task-contracts.mjs +54 -0
  23. package/dist/lib/core-shared.mjs +254 -0
  24. package/dist/lib/dashboard-data.mjs +608 -0
  25. package/dist/lib/dashboard-workbench.mjs +334 -0
  26. package/dist/lib/dashboard-writer.mjs +200 -0
  27. package/dist/lib/git-status-summary.mjs +45 -0
  28. package/dist/lib/governance-index-generator.mjs +236 -0
  29. package/dist/lib/governance-sync.mjs +617 -0
  30. package/dist/lib/governance-table-boundary.mjs +161 -0
  31. package/{scripts → dist}/lib/harness-core.mjs +3 -0
  32. package/dist/lib/harness-paths.mjs +338 -0
  33. package/dist/lib/lesson-maintenance.mjs +139 -0
  34. package/dist/lib/markdown-utils.mjs +193 -0
  35. package/dist/lib/migration-planner.mjs +439 -0
  36. package/dist/lib/migration-support.mjs +317 -0
  37. package/dist/lib/phase-kind.mjs +46 -0
  38. package/dist/lib/preset-audit-contracts.mjs +40 -0
  39. package/dist/lib/preset-engine.mjs +516 -0
  40. package/dist/lib/preset-registry.mjs +831 -0
  41. package/dist/lib/preset-resource-contracts.mjs +83 -0
  42. package/dist/lib/review-confirm-git-gate.mjs +244 -0
  43. package/dist/lib/status-builder.mjs +87 -0
  44. package/{scripts → dist}/lib/status-dashboard-renderer.mjs +48 -47
  45. package/dist/lib/structure-migration.mjs +404 -0
  46. package/dist/lib/subagent-authorization-audit.mjs +198 -0
  47. package/dist/lib/task-audit-metadata.mjs +376 -0
  48. package/dist/lib/task-audit-migration.mjs +355 -0
  49. package/dist/lib/task-completion-consistency.mjs +29 -0
  50. package/dist/lib/task-index.mjs +133 -0
  51. package/dist/lib/task-lesson-candidates.mjs +239 -0
  52. package/dist/lib/task-lesson-sedimentation.mjs +300 -0
  53. package/dist/lib/task-lifecycle/create-task-helpers.mjs +84 -0
  54. package/dist/lib/task-lifecycle/phase-sync.mjs +82 -0
  55. package/dist/lib/task-lifecycle/review-confirm.mjs +93 -0
  56. package/dist/lib/task-lifecycle/review-gates.mjs +62 -0
  57. package/dist/lib/task-lifecycle/review-submission.mjs +52 -0
  58. package/dist/lib/task-lifecycle/scaffold-provenance.mjs +54 -0
  59. package/dist/lib/task-lifecycle/template-files.mjs +52 -0
  60. package/dist/lib/task-lifecycle/text-utils.mjs +26 -0
  61. package/dist/lib/task-lifecycle.mjs +611 -0
  62. package/dist/lib/task-metadata.mjs +116 -0
  63. package/dist/lib/task-review-model.mjs +474 -0
  64. package/dist/lib/task-scanner.mjs +439 -0
  65. package/dist/lib/task-tombstone-commands.mjs +125 -0
  66. package/dist/postinstall.mjs +14 -0
  67. package/dist/run-built-tests.mjs +84 -0
  68. package/docs-release/README.md +1 -0
  69. package/docs-release/architecture/overview.md +13 -13
  70. package/docs-release/architecture/overview.zh-CN.md +13 -13
  71. package/docs-release/architecture/system-explainer/01-system-overview.md +218 -0
  72. package/docs-release/architecture/system-explainer/02-module-dependency.md +257 -0
  73. package/docs-release/architecture/system-explainer/03-task-lifecycle.md +304 -0
  74. package/docs-release/architecture/system-explainer/04-check-and-governance.md +241 -0
  75. package/docs-release/architecture/system-explainer/05-data-flow.md +276 -0
  76. package/docs-release/architecture/system-explainer/06-preset-and-migration.md +300 -0
  77. package/docs-release/architecture/system-explainer/README.md +67 -0
  78. package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +227 -0
  79. package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +263 -0
  80. package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +319 -0
  81. package/docs-release/architecture/system-explainer/en-US/04-check-and-governance.md +252 -0
  82. package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +290 -0
  83. package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +320 -0
  84. package/docs-release/architecture/system-explainer/en-US/README.md +70 -0
  85. package/docs-release/guides/agent-installation.en-US.md +22 -15
  86. package/docs-release/guides/agent-installation.md +23 -15
  87. package/docs-release/guides/contributing.md +3 -3
  88. package/docs-release/guides/contributing.zh-CN.md +3 -3
  89. package/docs-release/guides/document-audience-and-surfaces.en-US.md +10 -10
  90. package/docs-release/guides/document-audience-and-surfaces.md +10 -10
  91. package/docs-release/guides/legacy-migration-agent-prompt.md +25 -2
  92. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +25 -2
  93. package/docs-release/guides/migration-playbook.en-US.md +63 -1
  94. package/docs-release/guides/migration-playbook.md +59 -1
  95. package/docs-release/guides/parent-control-repository-pattern.en-US.md +25 -25
  96. package/docs-release/guides/parent-control-repository-pattern.md +25 -25
  97. package/docs-release/guides/preset-development.md +28 -4
  98. package/docs-release/guides/repository-operating-models.en-US.md +21 -21
  99. package/docs-release/guides/repository-operating-models.md +21 -21
  100. package/docs-release/guides/task-state-machine.en-US.md +35 -18
  101. package/docs-release/guides/task-state-machine.md +35 -18
  102. package/docs-release/guides/typescript-runtime-migration-closeout.md +96 -0
  103. package/examples/minimal-project/AGENTS.md +2 -2
  104. package/examples/minimal-project/coding-agent-harness/harness.yaml +14 -0
  105. package/examples/minimal-project/coding-agent-harness/planning/tasks/demo-task/INDEX.md +60 -0
  106. package/examples/minimal-project/coding-agent-harness/planning/tasks/demo-task/progress.md +11 -0
  107. package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/review.md +1 -1
  108. package/package.json +22 -13
  109. package/presets/legacy-migration/preset.yaml +5 -5
  110. package/presets/legacy-migration/templates/execution_strategy.append.md +1 -1
  111. package/presets/lesson-sedimentation/preset.yaml +3 -3
  112. package/presets/module/preset.yaml +2 -2
  113. package/presets/module/templates/execution_strategy.append.md +1 -1
  114. package/presets/module/templates/task_plan.append.md +3 -3
  115. package/presets/standard-task/preset.yaml +2 -2
  116. package/references/adversarial-review-standard.md +2 -2
  117. package/references/agents-md-pattern.md +14 -14
  118. package/references/cadence-ledger.md +1 -1
  119. package/references/ci-cd-standard.md +1 -1
  120. package/references/delivery-operating-model-standard.md +4 -4
  121. package/references/docs-directory-standard.md +65 -159
  122. package/references/external-source-intake-standard.md +10 -10
  123. package/references/harness-ledger.md +6 -6
  124. package/references/legacy-12-phase-bootstrap.md +2 -2
  125. package/references/lessons-governance.md +15 -15
  126. package/references/long-running-task-standard.md +6 -6
  127. package/references/module-parallel-standard.md +34 -34
  128. package/references/planning-loop.md +6 -6
  129. package/references/project-onboarding-audit.md +4 -4
  130. package/references/regression-system.md +2 -2
  131. package/references/repo-governance-standard.md +4 -4
  132. package/references/review-routing-standard.md +1 -1
  133. package/references/ssot-governance.md +19 -19
  134. package/references/taskr-gap-analysis.md +5 -5
  135. package/references/walkthrough-closeout.md +14 -14
  136. package/references/worktree-parallel.md +3 -3
  137. package/skills/preset-creator/references/complex-task-skeleton/brief.md +11 -0
  138. package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +1 -1
  139. package/skills/preset-creator/references/preset-package-skeleton.md +5 -5
  140. package/templates/AGENTS.md.template +31 -29
  141. package/templates/architecture/README.md +4 -4
  142. package/templates/architecture/service-catalog.md +2 -2
  143. package/templates/architecture/services/service-template.md +1 -1
  144. package/templates/dashboard/assets/app-src/00-state.js +12 -0
  145. package/templates/dashboard/assets/app-src/10-router.js +3 -0
  146. package/templates/dashboard/assets/app-src/20-overview.js +13 -3
  147. package/templates/dashboard/assets/app-src/35-task-detail.js +46 -6
  148. package/templates/dashboard/assets/app-src/40-modules.js +1 -1
  149. package/templates/dashboard/assets/app-src/55-presets.js +375 -0
  150. package/templates/dashboard/assets/app-src/60-shared.js +3 -1
  151. package/templates/dashboard/assets/app-src/90-bindings.js +131 -0
  152. package/templates/dashboard/assets/app.css +583 -0
  153. package/templates/dashboard/assets/app.css.manifest.json +1 -0
  154. package/templates/dashboard/assets/app.js +585 -11
  155. package/templates/dashboard/assets/app.manifest.json +1 -0
  156. package/templates/dashboard/assets/css-src/00-foundation.css +4 -0
  157. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +62 -0
  158. package/templates/dashboard/assets/css-src/45-presets.css +516 -0
  159. package/templates/dashboard/assets/i18n.js +144 -4
  160. package/templates/development/README.md +10 -10
  161. package/templates/development/cross-repo-debugging.md +3 -3
  162. package/templates/development/external-context/service-template.md +2 -2
  163. package/templates/development/external-source-packs/README.md +4 -4
  164. package/templates/integrations/README.md +4 -4
  165. package/templates/integrations/api-contract.md +2 -2
  166. package/templates/integrations/event-contract.md +2 -2
  167. package/templates/integrations/third-party/vendor-template.md +2 -2
  168. package/templates/integrations/webhook-contract.md +2 -2
  169. package/templates/ledger/Harness-Ledger.md +1 -1
  170. package/templates/planning/INDEX.md +88 -0
  171. package/templates/planning/brief.md +1 -1
  172. package/templates/planning/module_session_prompt.md +2 -1
  173. package/templates/planning/review.md +0 -18
  174. package/templates/planning/task_plan.md +5 -44
  175. package/templates/planning/visual_map.md +13 -9
  176. package/templates/planning/visual_map.simple.md +52 -0
  177. package/templates/planning/walkthrough.md +47 -0
  178. package/templates/reference/docs-library-standard.md +8 -8
  179. package/templates/reference/execution-workflow-standard.md +29 -2
  180. package/templates/reference/external-source-intake-standard.md +15 -15
  181. package/templates/reference/repo-governance-standard.md +1 -1
  182. package/templates/ssot/Module-Registry.md +1 -1
  183. package/templates/walkthrough/walkthrough-template.md +2 -2
  184. package/templates-zh-CN/AGENTS.md.template +31 -29
  185. package/templates-zh-CN/CLAUDE.md.template +1 -1
  186. package/templates-zh-CN/architecture/README.md +4 -4
  187. package/templates-zh-CN/architecture/service-catalog.md +2 -2
  188. package/templates-zh-CN/architecture/services/service-template.md +1 -1
  189. package/templates-zh-CN/development/README.md +10 -10
  190. package/templates-zh-CN/development/cross-repo-debugging.md +3 -3
  191. package/templates-zh-CN/development/external-context/service-template.md +2 -2
  192. package/templates-zh-CN/development/external-source-packs/README.md +4 -4
  193. package/templates-zh-CN/integrations/README.md +4 -4
  194. package/templates-zh-CN/integrations/api-contract.md +2 -2
  195. package/templates-zh-CN/integrations/event-contract.md +2 -2
  196. package/templates-zh-CN/integrations/third-party/vendor-template.md +2 -2
  197. package/templates-zh-CN/integrations/webhook-contract.md +2 -2
  198. package/templates-zh-CN/ledger/Harness-Ledger.md +1 -1
  199. package/templates-zh-CN/lessons/lesson-arch-process-change.md +1 -1
  200. package/templates-zh-CN/lessons/lesson-new-doc.md +3 -3
  201. package/templates-zh-CN/lessons/lesson-ref-change.md +4 -4
  202. package/templates-zh-CN/planning/INDEX.md +87 -0
  203. package/templates-zh-CN/planning/brief.md +1 -1
  204. package/templates-zh-CN/planning/module_session_prompt.md +12 -11
  205. package/templates-zh-CN/planning/review.md +0 -18
  206. package/templates-zh-CN/planning/task_plan.md +3 -63
  207. package/templates-zh-CN/planning/visual_map.md +14 -7
  208. package/templates-zh-CN/planning/visual_map.simple.md +48 -0
  209. package/templates-zh-CN/planning/walkthrough.md +47 -0
  210. package/templates-zh-CN/reference/adversarial-review-standard.md +2 -2
  211. package/templates-zh-CN/reference/delivery-operating-model-standard.md +3 -3
  212. package/templates-zh-CN/reference/docs-library-standard.md +28 -28
  213. package/templates-zh-CN/reference/execution-workflow-standard.md +32 -7
  214. package/templates-zh-CN/reference/external-source-intake-standard.md +16 -16
  215. package/templates-zh-CN/reference/harness-ledger-standard.md +6 -6
  216. package/templates-zh-CN/reference/regression-ssot-governance.md +2 -2
  217. package/templates-zh-CN/reference/repo-governance-standard.md +1 -1
  218. package/templates-zh-CN/reference/review-routing-standard.md +1 -1
  219. package/templates-zh-CN/reference/walkthrough-standard.md +7 -7
  220. package/templates-zh-CN/reference/worktree-standard.md +1 -1
  221. package/templates-zh-CN/regression/Cadence-Ledger.md +2 -2
  222. package/templates-zh-CN/ssot/Delivery-SSoT.md +3 -3
  223. package/templates-zh-CN/ssot/Module-Registry.md +3 -3
  224. package/templates-zh-CN/ssot/Regression-SSoT.md +2 -2
  225. package/templates-zh-CN/walkthrough/walkthrough-template.md +5 -5
  226. package/tsconfig.dist.json +16 -0
  227. package/tsconfig.json +25 -0
  228. package/tsconfig.runtime.json +24 -0
  229. package/examples/minimal-project/.harness-capabilities.json +0 -8
  230. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +0 -11
  231. package/scripts/check-harness.mjs +0 -508
  232. package/scripts/commands/dashboard-command.mjs +0 -67
  233. package/scripts/commands/migration-command.mjs +0 -96
  234. package/scripts/commands/preset-command.mjs +0 -73
  235. package/scripts/commands/task-command.mjs +0 -327
  236. package/scripts/harness.mjs +0 -287
  237. package/scripts/lib/capability-registry.mjs +0 -591
  238. package/scripts/lib/check-module-parallel.mjs +0 -237
  239. package/scripts/lib/check-profiles.mjs +0 -418
  240. package/scripts/lib/check-task-contracts.mjs +0 -47
  241. package/scripts/lib/core-shared.mjs +0 -196
  242. package/scripts/lib/dashboard-data.mjs +0 -412
  243. package/scripts/lib/dashboard-workbench.mjs +0 -257
  244. package/scripts/lib/dashboard-writer.mjs +0 -198
  245. package/scripts/lib/git-status-summary.mjs +0 -46
  246. package/scripts/lib/governance-index-generator.mjs +0 -174
  247. package/scripts/lib/governance-sync.mjs +0 -514
  248. package/scripts/lib/governance-table-boundary.mjs +0 -175
  249. package/scripts/lib/lesson-maintenance.mjs +0 -152
  250. package/scripts/lib/markdown-utils.mjs +0 -158
  251. package/scripts/lib/migration-planner.mjs +0 -478
  252. package/scripts/lib/migration-support.mjs +0 -312
  253. package/scripts/lib/preset-audit-contracts.mjs +0 -37
  254. package/scripts/lib/preset-engine.mjs +0 -497
  255. package/scripts/lib/preset-registry.mjs +0 -627
  256. package/scripts/lib/preset-resource-contracts.mjs +0 -83
  257. package/scripts/lib/review-confirm-git-gate.mjs +0 -248
  258. package/scripts/lib/subagent-authorization-audit.mjs +0 -196
  259. package/scripts/lib/task-completion-consistency.mjs +0 -16
  260. package/scripts/lib/task-index.mjs +0 -93
  261. package/scripts/lib/task-lesson-candidates.mjs +0 -242
  262. package/scripts/lib/task-lesson-sedimentation.mjs +0 -326
  263. package/scripts/lib/task-lifecycle/review-confirm.mjs +0 -101
  264. package/scripts/lib/task-lifecycle/review-gates.mjs +0 -70
  265. package/scripts/lib/task-lifecycle/text-utils.mjs +0 -24
  266. package/scripts/lib/task-lifecycle.mjs +0 -649
  267. package/scripts/lib/task-review-model.mjs +0 -469
  268. package/scripts/lib/task-scanner.mjs +0 -576
  269. package/scripts/lib/task-tombstone-commands.mjs +0 -140
  270. package/scripts/postinstall.mjs +0 -14
  271. package/templates/walkthrough/Closeout-SSoT.md +0 -43
  272. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +0 -42
  273. /package/examples/minimal-project/{docs → coding-agent-harness/governance/generated}/Harness-Ledger.md +0 -0
  274. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/brief.md +0 -0
  275. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/execution_strategy.md +0 -0
  276. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/findings.md +0 -0
  277. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/lesson_candidates.md +0 -0
  278. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/task_plan.md +0 -0
  279. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/visual_map.md +0 -0
@@ -0,0 +1,37 @@
1
+ # Additional Permission for Generated Harness Materials
2
+
3
+ Copyright (c) 2026 ZeyuLi (FairladyZ)
4
+
5
+ Coding Agent Harness is licensed under the GNU Affero General Public License
6
+ version 3 or any later version (`AGPL-3.0-or-later`). This file grants an
7
+ additional permission under section 7 of the AGPL.
8
+
9
+ ## Generated Harness Materials
10
+
11
+ For the purposes of this permission, "Generated Harness Materials" means files
12
+ created, copied, rendered, scaffolded, or installed into a target project by
13
+ Coding Agent Harness from bundled or user-provided templates, presets, skills,
14
+ reference packs, examples, or documentation skeletons. This includes generated
15
+ or installed project governance files such as `AGENTS.md`, `CLAUDE.md`, task
16
+ plans, review files, ledgers, walkthroughs, generated dashboard data, and other
17
+ target-project harness documents.
18
+
19
+ ## Permission
20
+
21
+ You may use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ Generated Harness Materials under the license terms of the target project or
23
+ under any other terms chosen by that target project's copyright holder.
24
+
25
+ The AGPL does not apply to a target project, to that target project's source
26
+ code, or to Generated Harness Materials solely because Coding Agent Harness was
27
+ used to create, copy, render, scaffold, install, or update those materials.
28
+
29
+ ## Limits
30
+
31
+ This additional permission does not apply to Coding Agent Harness itself,
32
+ including its CLI/runtime source code, dashboard implementation, package source,
33
+ or the bundled templates, presets, skills, reference packs, examples, and
34
+ documentation as distributed in this repository or package.
35
+
36
+ This permission does not grant trademark rights or remove any third-party
37
+ license obligations that may apply independently.
package/README.md CHANGED
@@ -67,6 +67,35 @@ Harness covers the continuity layer of real development: task lifecycle, Brief,
67
67
 
68
68
  It gives each agent step context, evidence, and a finish condition.
69
69
 
70
+ ### Reusable Presets For Task Families
71
+
72
+ A preset is a versioned, declarative task method package. It does not install a
73
+ new agent and it does not replace the Harness. It tells `harness new-task` how
74
+ to create a task for a repeatable work type: what task kind to set, which inputs
75
+ to ask for, which shared references or artifacts to copy into the task, which
76
+ files the agent must read first, and what audit/evidence files should prove the
77
+ task was created correctly.
78
+
79
+ Use presets when a group of tasks share the same setup. For example, several
80
+ interface tasks may all depend on the same upstream microservice contract,
81
+ fixture packet, runbook, and verification checklist. Instead of repeating that
82
+ context in every prompt, put it in a preset and create each task with
83
+ `harness new-task --preset <preset-id> ...`.
84
+
85
+ Harness ships bundled presets, `harness init` seeds them into the target project,
86
+ and teams can add project-local presets under `.coding-agent-harness/presets/`.
87
+ This dotdir is a preset overlay exception: operational task state lives under
88
+ `coding-agent-harness/`, while preset packages keep their existing overlay root
89
+ so user and project preset precedence remains stable across upgrades.
90
+ The `preset-creator` Skill is for authoring these preset packages; the Harness
91
+ CLI is what checks, installs, lists, and applies them.
92
+
93
+ Default task and module templates come from the installed npm package at command
94
+ runtime. Target projects should not treat `planning/**/_task-template` or
95
+ `planning/**/_module-template` directories as active state; v2 structure
96
+ migration removes those generated legacy template directories when it finds
97
+ them.
98
+
70
99
  ### Safe Migration For Existing Projects
71
100
 
72
101
  Legacy project migration starts with a scan, a migration plan, a recommended migration mode, and user confirmation. Only then should the agent write files. Final status is proven with a dashboard and checks.
@@ -140,9 +169,47 @@ The npm install seeds bundled presets into `~/.coding-agent-harness/presets/`.
140
169
  `harness init` also seeds those presets into the target project at
141
170
  `.coding-agent-harness/presets/`, so agents can discover stable task methods
142
171
  with `harness preset list --json`.
172
+ The `.coding-agent-harness/presets/` location is intentionally retained for
173
+ preset overlays; it is not a legacy task-state directory.
143
174
 
144
175
  Agents must not silently run a global install. They may run `npm install -g coding-agent-harness` only after the user explicitly approves changing the global npm environment. Without that approval, keep using `npx --yes coding-agent-harness ...`.
145
176
 
177
+ ### Harness State Location
178
+
179
+ By default, `harness init` and `harness migrate-structure --apply` write active
180
+ Harness state under `coding-agent-harness/` in the target project:
181
+
182
+ ```text
183
+ coding-agent-harness/harness.yaml
184
+ coding-agent-harness/planning/tasks/
185
+ coding-agent-harness/governance/
186
+ ```
187
+
188
+ Checks and dashboards are not tied to that exact folder name. A project can keep
189
+ Harness state in a custom project-relative directory by placing `harness.yaml`
190
+ there and declaring the same path in `structure.harnessRoot`. For example:
191
+
192
+ ```yaml
193
+ version: 2
194
+ locale: zh-CN
195
+ capabilities:
196
+ - core
197
+ - dashboard
198
+ structure:
199
+ harnessRoot: .project-control/harness-state
200
+ planningRoot: .project-control/harness-state/planning
201
+ tasksRoot: .project-control/harness-state/planning/tasks
202
+ governanceRoot: .project-control/harness-state/governance
203
+ generatedRoot: .project-control/harness-state/governance/generated
204
+ ```
205
+
206
+ After that, these are equivalent when the manifest is unique under the project:
207
+
208
+ ```bash
209
+ npx --yes coding-agent-harness status --json /path/to/project
210
+ npx --yes coding-agent-harness status --json /path/to/project/.project-control/harness-state
211
+ ```
212
+
146
213
  ### Commands For Humans
147
214
 
148
215
  Initialize a Chinese Harness:
@@ -157,6 +224,10 @@ Start the local dynamic Workbench:
157
224
  npx --yes coding-agent-harness dev .
158
225
  ```
159
226
 
227
+ The Workbench includes a Presets view for checking, installing, seeding, and
228
+ uninstalling project or user presets. Static dashboards show the same preset
229
+ catalog as read-only evidence.
230
+
160
231
  Generate a static Dashboard that can be opened offline:
161
232
 
162
233
  ```bash
@@ -198,7 +269,7 @@ Use Chinese templates by default. If the project is clearly an English team or E
198
269
 
199
270
  First diagnose the project structure, then give me an initialization plan.
200
271
  If this is a microservice, multi-repo, split frontend/backend, or externally integrated project, proactively ask me whether I have external architecture docs, API docs, diagrams, meeting notes, links, source paths, or exported packets.
201
- If the external material is large, create an external-source-packs index and digests first, then project stable conclusions into 03-ARCHITECTURE / 04-DEVELOPMENT / 06-INTEGRATIONS.
272
+ If the external material is large, create an external-source-packs index and digests first, then project stable conclusions into coding-agent-harness/context/{architecture,development,integrations}.
202
273
  After confirmation, execute Diagnose → Decide → Scaffold → Configure → Verify → Deliver.
203
274
  When initializing, run:
204
275
  npx --yes coding-agent-harness init --locale zh-CN --capabilities core,dashboard .
@@ -239,7 +310,7 @@ This project already has an older Harness. Do not edit files yet.
239
310
 
240
311
  First run a detailed scan and give me a migration plan:
241
312
  1. Check git status, Harness status, task count, brief coverage, visual_map coverage, warnings/actions/residuals, strict status, and dashboard usability.
242
- 2. If this is a microservice, multi-repo, split frontend/backend, or externally integrated project, proactively ask me for external source material; when the material is large, create an external-source-packs index and digests before projecting facts into 03/04/06.
313
+ 2. If this is a microservice, multi-repo, split frontend/backend, or externally integrated project, proactively ask me for external source material; when the material is large, create an external-source-packs index and digests before projecting facts into context/{architecture,development,integrations}.
243
314
  3. Recommend the migration mode from project evidence:
244
315
  - baseline-preserve: safe adoption first; only add necessary structure and visibility.
245
316
  - status-aware-rewrite: rewrite current or reopened tasks from SSoT, Ledger, progress, review, and git evidence.
@@ -250,6 +321,19 @@ First run a detailed scan and give me a migration plan:
250
321
  During the scan phase, run at least:
251
322
  npx --yes coding-agent-harness status --json .
252
323
  npx --yes coding-agent-harness migrate-plan --json --limit 1000 .
324
+ npx --yes coding-agent-harness migrate-structure --plan --json .
325
+
326
+ After I confirm the migration mode, first migrate the directory structure to the
327
+ v2 manifest layout, then run the migration rail and verify it:
328
+ npx --yes coding-agent-harness migrate-structure --apply --json .
329
+ npx --yes coding-agent-harness check --profile target-project .
330
+ npx --yes coding-agent-harness migrate-run --locale zh-CN --session-dir /tmp/cah-migration-project --out-dir /tmp/cah-migration-project/dashboard .
331
+ npx --yes coding-agent-harness migrate-verify /tmp/cah-migration-project/session.json
332
+
333
+ Then create the controlled migration task with the bundled preset:
334
+ npx --yes coding-agent-harness new-task --budget complex --preset legacy-migration --from-session /tmp/cah-migration-project/session.json .
335
+
336
+ Do not skip the `legacy-migration` preset task. It records the migration session, evidence bundle, preset audit, and follow-up work queue in the project Harness. It does not automatically rewrite historical task bodies.
253
337
 
254
338
  When the migration is complete, report the dynamic workbench URL or static dashboard HTML, session.json, normal/strict checks, migrate-plan summary, and whether full-cutover verification passes. If human review confirmation is required, expose that action in the local web workbench; static dashboards are read-only evidence snapshots.
255
339
  ```
@@ -267,7 +351,7 @@ Start from the latest main branch and create a new feature branch. Read README.m
267
351
 
268
352
  Keep the change scoped. Use only public repository files and do not rely on maintainer-local state, hidden workflows, credentials, generated dashboards, temporary files, or ignored local-only files.
269
353
 
270
- Run the checks that match the change. For docs-only changes, run git diff --check. For root package changes, run npm install, npm test, npm run smoke:dashboard, npm run check, node scripts/harness.mjs check --profile target-project examples/minimal-project, npm run pack:dry-run, and git diff --check as relevant. If the change touches harness-gui, also run cd harness-gui && npm ci && npm run typecheck && npm test && npm run build.
354
+ Run the checks that match the change. For docs-only changes, run git diff --check. For root package changes, run npm install, npm test, npm run smoke:dashboard, npm run check, node dist/harness.mjs check --profile target-project examples/minimal-project, npm run pack:dry-run, and git diff --check as relevant. If the change touches harness-gui, also run cd harness-gui && npm ci && npm run typecheck && npm test && npm run build.
271
355
 
272
356
  When done, summarize what changed, list verification results, call out any skipped checks with reasons, and prepare the PR using the repository template.
273
357
  ```
@@ -281,6 +365,8 @@ When done, summarize what changed, list verification results, call out any skipp
281
365
  - Legacy migration playbook: [`docs-release/guides/migration-playbook.en-US.md`](docs-release/guides/migration-playbook.en-US.md)
282
366
  - Full legacy migration strategy: [`docs-release/guides/full-legacy-migration-subagent-strategy.md`](docs-release/guides/full-legacy-migration-subagent-strategy.md)
283
367
  - Architecture overview: [`docs-release/architecture/overview.md`](docs-release/architecture/overview.md)
368
+ - Deep architecture explainer (zh-CN): [`docs-release/architecture/system-explainer/`](docs-release/architecture/system-explainer/) — system design, module dependencies, task lifecycle, check system, data flow, and preset/migration engine with design rationale
369
+ - Deep architecture explainer (en-US): [`docs-release/architecture/system-explainer/en-US/`](docs-release/architecture/system-explainer/en-US/)
284
370
 
285
371
  ## Star History
286
372
 
@@ -288,4 +374,10 @@ When done, summarize what changed, list verification results, call out any skipp
288
374
 
289
375
  ## License
290
376
 
291
- MIT
377
+ AGPL-3.0-or-later with an additional permission for Generated Harness
378
+ Materials.
379
+
380
+ See [`LICENSE`](LICENSE) and [`LICENSE-EXCEPTION.md`](LICENSE-EXCEPTION.md).
381
+ The additional permission keeps files generated or installed into a target
382
+ project from becoming AGPL-covered solely because Coding Agent Harness created
383
+ or updated them.
package/README.zh-CN.md CHANGED
@@ -67,6 +67,25 @@ Harness 覆盖长程开发里的持续性问题:任务生命周期、Brief、E
67
67
 
68
68
  它让 Agent 每一步都有上下文、证据和收口标准。
69
69
 
70
+ ### 面向任务族的可复用 Preset
71
+
72
+ Preset 是一个可版本化、声明式的任务方法包。它不是安装一个新 Agent,也不是替代
73
+ Harness;它告诉 `harness new-task` 如何为某一类可重复工作创建任务:应该设置什么
74
+ Task Kind、需要询问哪些输入、要把哪些共享 Reference 或 Artifact 复制进任务、Agent
75
+ 必须先读哪些文件,以及要生成哪些 audit / evidence 文件来证明任务创建正确。
76
+
77
+ 当一组任务共享同一套启动上下文时,就适合用 Preset。比如多个接口任务都依赖同一个
78
+ 上游微服务 contract、fixture packet、runbook 和验证清单,就不应该每次都把这些内容塞进
79
+ prompt;应该把它们放进 Preset,然后用
80
+ `harness new-task --preset <preset-id> ...` 创建每个任务。
81
+
82
+ Harness 自带内置 Preset,`harness init` 会把它们 seed 到目标项目,团队也可以在
83
+ `.coding-agent-harness/presets/` 下维护项目级 Preset。`preset-creator` Skill 用来制作
84
+ 这些 Preset 包;真正检查、安装、列出和应用 Preset 的是 Harness CLI。
85
+
86
+ 默认任务模板和模块模板来自当前安装的 npm 包,在命令运行时读取。目标项目不应该把
87
+ `planning/**/_task-template` 或 `planning/**/_module-template` 当作活跃状态;v2 结构迁移发现这些旧生成模板目录时会直接清理。
88
+
70
89
  ### 旧项目也能迁移
71
90
 
72
91
  旧项目迁移不是直接套模板。标准流程是:先扫描项目,生成迁移计划,推荐迁移模式,向用户提问确认,再执行迁移,最后用 Dashboard 和检查结果证明迁移状态。
@@ -142,6 +161,40 @@ npm 安装会把内置 Preset seed 到 `~/.coding-agent-harness/presets/`。
142
161
 
143
162
  Agent 不应静默执行全局安装。只有用户明确同意修改全局 npm 环境后,Agent 才能运行 `npm install -g coding-agent-harness`;否则继续使用 `npx --yes coding-agent-harness ...`。
144
163
 
164
+ ### Harness 状态目录
165
+
166
+ 默认情况下,`harness init` 和 `harness migrate-structure --apply` 会把活跃
167
+ Harness 状态写到目标项目里的 `coding-agent-harness/`:
168
+
169
+ ```text
170
+ coding-agent-harness/harness.yaml
171
+ coding-agent-harness/planning/tasks/
172
+ coding-agent-harness/governance/
173
+ ```
174
+
175
+ 检查和 Dashboard 不绑定这个固定目录名。项目可以把 Harness 状态放在自定义的项目相对目录里,只要在那个目录放 `harness.yaml`,并在 `structure.harnessRoot` 里声明同一个路径。例如:
176
+
177
+ ```yaml
178
+ version: 2
179
+ locale: zh-CN
180
+ capabilities:
181
+ - core
182
+ - dashboard
183
+ structure:
184
+ harnessRoot: .project-control/harness-state
185
+ planningRoot: .project-control/harness-state/planning
186
+ tasksRoot: .project-control/harness-state/planning/tasks
187
+ governanceRoot: .project-control/harness-state/governance
188
+ generatedRoot: .project-control/harness-state/governance/generated
189
+ ```
190
+
191
+ 只要项目里只有一个这样的 manifest,下面两种写法等价:
192
+
193
+ ```bash
194
+ npx --yes coding-agent-harness status --json /path/to/project
195
+ npx --yes coding-agent-harness status --json /path/to/project/.project-control/harness-state
196
+ ```
197
+
145
198
  ### 人看的常用命令
146
199
 
147
200
  初始化一个中文 Harness:
@@ -197,7 +250,7 @@ npx --yes coding-agent-harness <command>
197
250
 
198
251
  请先诊断项目结构,再给出初始化计划。
199
252
  如果项目是微服务、多仓、前后端分仓,或依赖外部系统,请主动询问我是否有外部架构文档、接口文档、流程图、会议纪要、链接或导出包。
200
- 外部资料很多时,请先建立 external-source-packs 索引和摘要,再把稳定结论投影到 03-ARCHITECTURE / 04-DEVELOPMENT / 06-INTEGRATIONS
253
+ 外部资料很多时,请先建立 external-source-packs 索引和摘要,再把稳定结论投影到 coding-agent-harness/context/{architecture,development,integrations}
201
254
  确认后,按照 Diagnose → Decide → Scaffold → Configure → Verify → Deliver 六阶段执行。
202
255
  执行初始化时使用:
203
256
  npx --yes coding-agent-harness init --locale zh-CN --capabilities core,dashboard .
@@ -238,7 +291,7 @@ npx --yes coding-agent-harness <command>
238
291
 
239
292
  请先执行详尽扫描,并给我一个迁移计划:
240
293
  1. 检查当前 git 状态、Harness 状态、任务数量、brief 覆盖、visual_map 覆盖、warning/action/residual、strict 状态和 dashboard 可用性。
241
- 2. 如果项目是微服务、多仓、前后端分仓,或依赖外部系统,主动询问我是否有外部资料;资料很多时先建立 external-source-packs 索引和摘要,再投影到 03/04/06
294
+ 2. 如果项目是微服务、多仓、前后端分仓,或依赖外部系统,主动询问我是否有外部资料;资料很多时先建立 external-source-packs 索引和摘要,再投影到 context/{architecture,development,integrations}
242
295
  3. 根据项目证据主动推荐迁移模式:
243
296
  - baseline-preserve:先安全接入,只补必要结构和可见性。
244
297
  - status-aware-rewrite:按 SSoT、Ledger、progress、review、git 证据重写当前或重新打开的任务。
@@ -249,6 +302,18 @@ npx --yes coding-agent-harness <command>
249
302
  扫描阶段至少运行:
250
303
  npx --yes coding-agent-harness status --json .
251
304
  npx --yes coding-agent-harness migrate-plan --json --limit 1000 .
305
+ npx --yes coding-agent-harness migrate-structure --plan --json .
306
+
307
+ 等我确认迁移模式后,先把目录结构迁到 v2 manifest 布局,再执行迁移轨道并验证:
308
+ npx --yes coding-agent-harness migrate-structure --apply --json .
309
+ npx --yes coding-agent-harness check --profile target-project .
310
+ npx --yes coding-agent-harness migrate-run --locale zh-CN --session-dir /tmp/cah-migration-project --out-dir /tmp/cah-migration-project/dashboard .
311
+ npx --yes coding-agent-harness migrate-verify /tmp/cah-migration-project/session.json
312
+
313
+ 然后用内置 preset 创建受控迁移任务:
314
+ npx --yes coding-agent-harness new-task --budget complex --preset legacy-migration --from-session /tmp/cah-migration-project/session.json .
315
+
316
+ 不要跳过 `legacy-migration` preset 任务。它会把 migration session、证据包、preset audit 和后续 work queue 记录进项目 Harness;它不会自动重写历史任务正文。
252
317
 
253
318
  最终迁移完成时,必须给出动态 workbench 入口或静态 dashboard HTML、session.json、normal/strict check、migrate-plan summary,以及 full-cutover 验证是否通过。需要人工确认审查时,必须通过本地网页 workbench 暴露确认操作;静态 dashboard 只作为只读证据快照。
254
319
  ```
@@ -266,7 +331,7 @@ npx --yes coding-agent-harness migrate-plan --json --limit 1000 .
266
331
 
267
332
  改动要保持聚焦。只使用公开仓库文件;不要依赖维护者本地状态、隐藏工作流、凭据、生成的 Dashboard、临时文件或被 ignore 的本地专用文件。
268
333
 
269
- 根据改动范围运行检查。仅文档改动至少运行 git diff --check。根包相关改动按需运行 npm install、npm test、npm run smoke:dashboard、npm run check、node scripts/harness.mjs check --profile target-project examples/minimal-project、npm run pack:dry-run 和 git diff --check。如果改到 harness-gui,还要运行 cd harness-gui && npm ci && npm run typecheck && npm test && npm run build。
334
+ 根据改动范围运行检查。仅文档改动至少运行 git diff --check。根包相关改动按需运行 npm install、npm test、npm run smoke:dashboard、npm run check、node dist/harness.mjs check --profile target-project examples/minimal-project、npm run pack:dry-run 和 git diff --check。如果改到 harness-gui,还要运行 cd harness-gui && npm ci && npm run typecheck && npm test && npm run build。
270
335
 
271
336
  完成后,请总结改了什么,列出验证结果,说明任何未运行检查及原因,并按仓库 PR 模板准备 PR。
272
337
  ```
@@ -280,6 +345,8 @@ npx --yes coding-agent-harness migrate-plan --json --limit 1000 .
280
345
  - 旧项目迁移指南:[`docs-release/guides/migration-playbook.md`](docs-release/guides/migration-playbook.md)
281
346
  - 完整旧项目迁移策略:[`docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md`](docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md)
282
347
  - 架构说明:[`docs-release/architecture/overview.md`](docs-release/architecture/overview.md)
348
+ - 深度架构解析(中文):[`docs-release/architecture/system-explainer/`](docs-release/architecture/system-explainer/) — 系统设计、模块依赖、任务生命周期、检查体系、数据流、Preset 与迁移引擎,含设计决策背景
349
+ - Deep architecture explainer (en-US): [`docs-release/architecture/system-explainer/en-US/`](docs-release/architecture/system-explainer/en-US/)
283
350
 
284
351
  ## Star History
285
352
 
@@ -287,4 +354,8 @@ npx --yes coding-agent-harness migrate-plan --json --limit 1000 .
287
354
 
288
355
  ## License
289
356
 
290
- MIT
357
+ AGPL-3.0-or-later,并附带 Generated Harness Materials 额外许可。
358
+
359
+ 详见 [`LICENSE`](LICENSE) 和 [`LICENSE-EXCEPTION.md`](LICENSE-EXCEPTION.md)。
360
+ 该额外许可确保 Harness 生成或安装到目标项目里的文件,不会仅仅因为由
361
+ Coding Agent Harness 创建或更新,就自动变成 AGPL 覆盖范围。
package/SKILL.md CHANGED
@@ -3,9 +3,9 @@ name: coding-agent-harness
3
3
  description: >
4
4
  Coding Agent Harness 工程方法论。为使用 Coding Agent(Codex、Claude Code、Gemini CLI 等)
5
5
  做长程项目开发的团队,在用户的项目上构建一套完整的 harness 工程体系。
6
- 包括:项目诊断、AGENTS.md + CLAUDE.md 入口文件生成、docs/ 目录搭建、Planning Loop、SSoT 治理、
6
+ 包括:项目诊断、AGENTS.md + CLAUDE.md 入口文件生成、coding-agent-harness/ 目录搭建、Planning Loop、SSoT 治理、
7
7
  Delivery Operating Model、Repository Governance、CI/CD、Long-Running Task Protocol、Adversarial Review Report、Review Routing、Worktree 并行开发、
8
- Regression SSoT 与 Evidence Depth 分级回归、Walkthrough / Closeout SSoT 收口、Cadence Ledger、任务本地 lesson 候选与 promoted lesson 详情文档、
8
+ Regression SSoT 与 Evidence Depth 分级回归、Walkthrough / Closeout Index 收口、Cadence Ledger、任务本地 lesson 候选与 promoted lesson 详情文档、
9
9
  Harness Ledger 全局上下文回写总账。
10
10
  当用户要求设置 coding agent 的开发流程、建立回归测试体系、设计 AGENTS.md / CLAUDE.md、
11
11
  规划长程 agent 任务的执行框架、子代理审查循环、对抗性 review 报告、搭建 harness、或者提到 harness engineering 时,使用此技能。
@@ -24,7 +24,7 @@ description: >
24
24
  - **单元测试只是底线,不是保障。** 真正的保障需要多层证据(Evidence Depth)。
25
25
  - **先识别交付组织,再设计 harness。** 一人多 agent、多人团队、前后端分仓、program 多仓、敏捷/瀑布,对应的 SSoT 和冲突治理不同。
26
26
  - **Repo 护栏是地基。** CI/CD、PR policy、branch protection、required checks、worktree concurrency 必须项目级定制,不能停留在模板。
27
- - **外部资料先摄取,再投影。** 微服务或多仓项目的外部文档不能直接塞进执行文档;先建 source pack、digest、验证,再投影到 `03/04/06`。
27
+ - **外部资料先摄取,再投影。** 微服务或多仓项目的外部文档不能直接塞进执行文档;先建 source pack、digest、验证,再投影到 `context/{architecture,development,integrations}`。
28
28
  - **长程任务先设计合同,再开放执行。** 连续跑数小时的前提是 Goal、Scope、Review Loop、Evidence、Stop Condition 都清楚。
29
29
  - **审查必须落盘。** 对抗性 review 是独立交付物,不应只留在对话、progress 或 walkthrough 里;reviewer 必须用 Confidence Challenge 反复挑战方案,直到没有 open material finding。
30
30
  - **Worker handoff 必须 commit-backed。** 可写 subagent 不是 reviewer;它必须在独立 worktree / branch 内实现、验证并提交,再由 coordinator 集成。
@@ -39,7 +39,7 @@ description: >
39
39
  coding-agent-harness",不要重新 bootstrap 覆盖整个项目。先执行增量更新流程:
40
40
 
41
41
  1. 读取本 Skill 的最新版 `SKILL.md`、相关 `references/`、`templates/`。
42
- 2. 扫描目标项目现有 `AGENTS.md`、`CLAUDE.md`、`docs/` 和 SSoT / Ledger 文件。
42
+ 2. 扫描目标项目现有 `AGENTS.md`、`CLAUDE.md`、`coding-agent-harness/` 和 SSoT / Ledger 文件。
43
43
  3. 输出 delta plan:哪些 harness 骨架、reference、template、SSoT、Ledger 项缺失或过期。
44
44
  4. 只补齐新增标准和缺失结构;不得用模板覆盖已有业务事实、历史 walkthrough、
45
45
  task progress、generated ledger、Regression SSoT 或 lesson detail docs。
@@ -48,8 +48,8 @@ coding-agent-harness",不要重新 bootstrap 覆盖整个项目。先执行增
48
48
  7. 收口时写 walkthrough,必须包含 Lessons Reflection;新任务先写并审查
49
49
  `lesson_candidates.md`。如人工标记值得沉淀,默认先用 dry-run 或后续
50
50
  lesson sedimentation 任务完成分类、冲突检查和建议 diff;只有人工明确批准后,
51
- 维护命令才写 `docs/01-GOVERNANCE/lessons/` 详情文档;最后在
52
- `docs/Harness-Ledger.md` 与 `docs/10-WALKTHROUGH/Closeout-SSoT.md` 记录本次 harness update 的 delta 和 Lessons Check。
51
+ 维护命令才写 `coding-agent-harness/governance/lessons/` 详情文档;最后在
52
+ `coding-agent-harness/governance/generated/Harness-Ledger.md` 与 `coding-agent-harness/governance/generated/Closeout-Index.md` 记录本次 harness update 的 delta 和 Lessons Check。
53
53
 
54
54
  一句话:harness update 是 delta merge,不是重新搭一遍。
55
55
 
@@ -64,7 +64,7 @@ CLI 示例默认使用目标项目可调用的 `harness` 命令。执行前先
64
64
  `command -v harness`;如果没有,不要静默全局安装,按安装指南询问用户是否
65
65
  允许 `npm install -g coding-agent-harness`。未获明确同意时,用
66
66
  `npx --yes coding-agent-harness <command>` 执行同一条命令。只有维护本源码
67
- checkout 时,才把 `harness` 替换为 `node scripts/harness.mjs`。
67
+ checkout 时,才把 `harness` 替换为 `node dist/harness.mjs`。
68
68
 
69
69
  ### Agent 安装合同
70
70
 
@@ -78,7 +78,7 @@ checkout 时,才把 `harness` 替换为 `node scripts/harness.mjs`。
78
78
  明确配置中推断 locale,并显式传 `--locale`。如果无法判断,先暂停询问。
79
79
  - 中文用户或中文项目默认选择 `zh-CN`;英文团队、英文代码库或用户明确要求英文时选择
80
80
  `en-US`。
81
- - scaffold 后必须检查 `.harness-capabilities.json` 的 `locale`,并确认 dashboard、
81
+ - scaffold 后必须检查 `coding-agent-harness/harness.yaml` 的 `locale`,并确认 dashboard、
82
82
  task template、review template 来自同一套模板树。
83
83
  - `templates/` 和 `templates-zh-CN/` 是两套完整模板树。不要在目标项目里混拷两套模板;
84
84
  只允许保留 schema 字段、文件名、状态枚举、命令和跨工具协议 token 的英文。
@@ -105,9 +105,10 @@ SDK、API gateway、message queue、webhook、contract、schema、mock,必须
105
105
  split-repo-contract、program-multi-repo、waterfall-stage-gate 或
106
106
  kanban-continuous。
107
107
  3. Capability Packs:core 必装;按需选择 module-parallel、subagent-worker、
108
- adversarial-review、long-running-task、dashboard、safe-adoption。
108
+ adversarial-review、long-running-task、dashboard。旧项目先用
109
+ `migrate-structure --plan/--apply` 迁到 v2,不再通过兼容 capability 长期运行。
109
110
  4. External Source Intake:如果外部资料超过 5 份、跨多个主题或会持续增长,
110
- 决定是否创建 `docs/04-DEVELOPMENT/external-source-packs/<source-key>/`。
111
+ 决定是否创建 `coding-agent-harness/context/development/external-source-packs/<source-key>/`。
111
112
 
112
113
  Capability 选择规则必须按表执行,不得凭感觉多装:
113
114
 
@@ -115,7 +116,6 @@ Capability 选择规则必须按表执行,不得凭感觉多装:
115
116
  | --- | --- |
116
117
  | `core` | 永远安装。它是任务计划、回归、walkthrough、Lessons 和 Harness Ledger 的最小内核。 |
117
118
  | `dashboard` | 用户或 agent 需要本地只读状态页时安装。它不写目标项目文件。 |
118
- | `safe-adoption` | 只在已有旧 harness 项目接入 v1.0、且需要保留历史文档时安装。新项目默认不装。 |
119
119
  | `adversarial-review` | 发布、架构、安全、数据、策略风险需要独立 review artifact 时安装。 |
120
120
  | `long-running-task` | 用户允许 agent 多轮连续执行、不能每步都询问时安装。 |
121
121
  | `module-parallel` | 项目有 2 个以上可独立演进模块,且需要模块 owner / registry / 同步规则时安装。 |
@@ -127,7 +127,7 @@ Capability 选择规则必须按表执行,不得凭感觉多装:
127
127
 
128
128
  运行或模拟 `harness init --locale zh-CN|en-US --capabilities ...`。面向 agent 的安装
129
129
  必须显式传 `--locale`;只有人直接在终端运行且未传 `--locale` 时,CLI 才交互询问。CLI 只创建
130
- 目录、模板、空表、索引和 `.harness-capabilities.json`,不得把项目级 reference
130
+ 目录、模板、空表、索引和 `coding-agent-harness/harness.yaml`,不得把项目级 reference
131
131
  伪装成已经定制完成的标准。
132
132
 
133
133
  CLI 会在 JSON 输出中返回 `report`。Agent 必须读取这份 report,并把其中的
@@ -144,33 +144,34 @@ worktree/subagent handoff 规则。已有项目事实只能 merge/append/residua
144
144
  如果用户提供了外部资料,Configure 阶段必须按
145
145
  `external-source-intake-standard.md` 执行:Inventory、Classify、Sanitize、Digest、
146
146
  Project、Verify、Residual。`external-source-packs/` 只保存资料索引、摘要和投影状态;
147
- 稳定事实必须回写到 `03-ARCHITECTURE`、`04-DEVELOPMENT/external-context` 或
148
- `06-INTEGRATIONS`。
147
+ 稳定事实必须回写到 `coding-agent-harness/context/architecture`、`coding-agent-harness/context/development/external-context` 或
148
+ `coding-agent-harness/context/integrations`。
149
149
 
150
150
  ### Phase 4b: Task Lifecycle / 任务生命周期
151
151
 
152
152
  初始化或迁移完成后,活跃任务必须通过 CLI 创建和推进,避免 agent 手工复制模板造成漂移:
153
153
 
154
154
  ```bash
155
- harness new-task <task-id> --title "<title>" --locale zh-CN|en-US /path/to/project
156
- harness task-start <task-id> --message "<what started>" /path/to/project
157
- harness task-log <task-id> --message "<what changed>" --evidence "command:TARGET:path:summary" /path/to/project
158
- harness task-block <task-id> --message "<blocker>" /path/to/project
159
- harness task-review <task-id> --message "<ready for review>" /path/to/project
160
- harness review-confirm <task-id> --message "<human confirmation>" /path/to/project
161
- harness task-complete <task-id> --message "<closeout>" /path/to/project
162
- harness lesson-promote <task-id> <candidate-id> --dry-run /path/to/project
155
+ harness new-task --title "<title>" --locale zh-CN|en-US /path/to/project
156
+ harness task-start <task-id-from-new-task-output> --message "<what started>" /path/to/project
157
+ harness task-log <task-id-from-new-task-output> --message "<what changed>" --evidence "command:TARGET:path:summary" /path/to/project
158
+ harness task-block <task-id-from-new-task-output> --message "<blocker>" /path/to/project
159
+ harness task-review <task-id-from-new-task-output> --message "<ready for review>" /path/to/project
160
+ harness review-confirm <task-id-from-new-task-output> --confirm <task-id-from-new-task-output> --message "<human confirmation>" /path/to/project
161
+ harness task-complete <task-id-from-new-task-output> --message "<closeout>" /path/to/project
162
+ harness lesson-promote <task-id-from-new-task-output> <candidate-id> --dry-run /path/to/project
163
163
  harness task-list --json /path/to/project
164
164
  ```
165
165
 
166
166
  - `new-task --budget simple` 创建轻量任务目录:`brief.md`、`task_plan.md`、`visual_map.md`、`progress.md`。
167
167
  - `new-task` 默认 `standard`,创建完整任务目录,包括 `brief.md`、计划、策略、路线图、进度、发现和审查文件。
168
168
  - `new-task --budget complex` 在完整任务文件之外创建 optional references/artifacts 索引。
169
+ - `new-task --title "<title>"` 默认生成 `YYYY-MM-DD-<title-slug>-<8hex>` 任务 ID,降低多人和多 agent 同仓创建任务时的重名概率;只有 coordinator 需要固定兼容 ID 时才传显式 `<task-id>`。
169
170
  - 已存在任务不会被覆盖;旧项目迁移时先 `task-list --json`,再决定复用旧任务还是开新任务。
170
171
  - 状态推进只写 `progress.md`,不得重写历史 `task_plan.md`。
171
172
  - `simple` 任务可以直接 `in_progress -> done`;`standard` / `complex` 必须 `in_progress -> review -> done`,不能跳过 `task-review`。
172
173
  - `task-review` 只表示 Agent Review Submission:agent/coordinator 认为材料包已准备好并提交待审。它不是人工确认。
173
- - `review-confirm` 是唯一的 Human Review Confirmation 门禁。它只确认人工 review evidence / findings,不代表 closeout;closeout 仍走 walkthrough / Closeout SSoT
174
+ - `review-confirm` 是唯一的 Human Review Confirmation 门禁。它只确认人工 review evidence / findings,不代表 closeout;closeout 仍走 walkthrough / Closeout Index
174
175
  - Review queue 只收录已提交 review packet、材料齐全、无 blocker、等待人工确认的任务。
175
176
  - 缺文件、缺章节、缺证据、缺 lesson decision 或未执行 `task-review` 的任务进入 Missing Materials 队列,不进入 Review queue。
176
177
  - open blocking finding、状态矛盾、审计失败或需要 human waiver 的任务进入 Blocked 队列,不进入 Review queue。
@@ -192,8 +193,8 @@ harness status --json /path/to/project
192
193
 
193
194
  | 回归路径 | 必须证明 |
194
195
  | --- | --- |
195
- | 新项目初始化 | 空项目 `init --locale zh-CN|en-US --capabilities core,...` 后,模板语言一致、registry 正确、`status --json` 不误报 `safe-adoption`。 |
196
- | 老项目迁移 | 已有旧 harness 文档的项目 `add-capability safe-adoption --locale ...` 后,旧 `AGENTS.md`、`CLAUDE.md`、`Harness-Ledger` 和历史 task 不被覆盖;缺失 v1.0 模板被补齐;普通检查只给 `adoption-needed` warning;`--strict` 仍可阻塞历史合同缺口。 |
196
+ | 新项目初始化 | 空项目 `init --locale zh-CN|en-US --capabilities core,...` 后,模板语言一致、v2 manifest 正确、`status --json` 通过。 |
197
+ | 老项目迁移 | 已有旧 harness 文档的项目先 `migrate-structure --plan`,再 `migrate-structure --apply`;旧 `coding-agent-harness/` legacy registry active root 移走或归档;迁移后 `status/check/dashboard` 只读 v2 路径。 |
197
198
 
198
199
  检查失败时不能声称 harness complete;必须修复或记录 owner/action/status 明确的
199
200
  residual。
@@ -236,33 +237,33 @@ harness bootstrap 完成后,项目中至少应存在以下文件:
236
237
 
237
238
  - [ ] `AGENTS.md`,默认 80-160 行,宪章 + 阅读矩阵,不承载安装教程
238
239
  - [ ] `CLAUDE.md`,Claude Code 兼容 shim,指向 `AGENTS.md`(不复制完整规范)
239
- - [ ] `docs/11-REFERENCE/` 下至少 3 个标准文件
240
- - [ ] `docs/09-PLANNING/TASKS/_task-template/` 包含 task plan / findings / progress / review 模板
241
- - [ ] `docs/11-REFERENCE/delivery-operating-model-standard.md`
242
- - [ ] `docs/11-REFERENCE/repo-governance-standard.md`
243
- - [ ] `docs/11-REFERENCE/ci-cd-standard.md`
244
- - [ ] `docs/11-REFERENCE/long-running-task-standard.md`
245
- - [ ] `docs/11-REFERENCE/adversarial-review-standard.md`
246
- - [ ] `docs/11-REFERENCE/review-routing-standard.md`
247
- - [ ] `docs/09-PLANNING/TASKS/_task-template/long-running-task-contract.md`
248
- - [ ] `docs/09-PLANNING/TASKS/_task-template/review.md`
249
- - [ ] `docs/05-TEST-QA/Regression-SSoT.md`
250
- - [ ] `docs/05-TEST-QA/Cadence-Ledger.md`
251
- - [ ] `docs/10-WALKTHROUGH/_walkthrough-template.md`
252
- - [ ] `docs/10-WALKTHROUGH/Closeout-SSoT.md`
253
- - [ ] `docs/01-GOVERNANCE/lessons/`(空目录 + .gitkeep)
254
- - [ ] `docs/01-GOVERNANCE/_archive/`(空目录 + .gitkeep)
255
- - [ ] `docs/Harness-Ledger.md`
256
- - [ ] `docs/11-REFERENCE/external-source-intake-standard.md`
257
- - [ ] `docs/11-REFERENCE/harness-ledger-standard.md`
240
+ - [ ] `coding-agent-harness/governance/standards/` 下至少 3 个标准文件
241
+ - [ ] `coding-agent-harness/planning/tasks/_task-template/` 包含 task plan / findings / progress / review 模板
242
+ - [ ] `coding-agent-harness/governance/standards/delivery-operating-model-standard.md`
243
+ - [ ] `coding-agent-harness/governance/standards/repo-governance-standard.md`
244
+ - [ ] `coding-agent-harness/governance/standards/ci-cd-standard.md`
245
+ - [ ] `coding-agent-harness/governance/standards/long-running-task-standard.md`
246
+ - [ ] `coding-agent-harness/governance/standards/adversarial-review-standard.md`
247
+ - [ ] `coding-agent-harness/governance/standards/review-routing-standard.md`
248
+ - [ ] `coding-agent-harness/planning/tasks/_task-template/long-running-task-contract.md`
249
+ - [ ] `coding-agent-harness/planning/tasks/_task-template/review.md`
250
+ - [ ] `coding-agent-harness/governance/regression/Regression-SSoT.md`
251
+ - [ ] `coding-agent-harness/governance/regression/Cadence-Ledger.md`
252
+ - [ ] `coding-agent-harness/governance/standards/walkthrough-template.md`
253
+ - [ ] `coding-agent-harness/governance/generated/Closeout-Index.md`
254
+ - [ ] `coding-agent-harness/governance/lessons/`(空目录 + .gitkeep)
255
+ - [ ] `coding-agent-harness/governance/_archive/`(空目录 + .gitkeep)
256
+ - [ ] `coding-agent-harness/governance/generated/Harness-Ledger.md`
257
+ - [ ] `coding-agent-harness/governance/standards/external-source-intake-standard.md`
258
+ - [ ] `coding-agent-harness/governance/standards/harness-ledger-standard.md`
258
259
  - [ ] `.github/pull_request_template.md` 或 platform-specific PR template / residual
259
260
  - [ ] CI workflow 或 `ci-cd-standard.md` 中的 blocked-with-owner residual
260
261
  - [ ] Branch protection plan 和 required checks 状态
261
262
  - [ ] Worktree concurrency policy
262
- - [ ] Delivery operating model 已选择;多人/多仓模式下有 `docs/09-PLANNING/Delivery-SSoT.md`
263
- - [ ] 如启用模块并行:`docs/09-PLANNING/Module-Registry.md`
264
- - [ ] 如启用模块并行:`docs/09-PLANNING/MODULES/Session-Prompt-Pack.md` 或每模块 `session_prompt.md`
265
- - [ ] 如启用模块并行:每个 active module 有 `docs/09-PLANNING/MODULES/<key>/module_plan.md`
263
+ - [ ] Delivery operating model 已选择;多人/多仓模式下有 `coding-agent-harness/planning/Delivery-SSoT.md`
264
+ - [ ] 如启用模块并行:`coding-agent-harness/planning/modules/Module-Registry.md`
265
+ - [ ] 如启用模块并行:`coding-agent-harness/planning/modules/Session-Prompt-Pack.md` 或每模块 `session_prompt.md`
266
+ - [ ] 如启用模块并行:每个 active module 有 `coding-agent-harness/planning/modules/<key>/module_plan.md`
266
267
  - [ ] 如启用模块并行:模块 task template / shared lock / dependency readiness 规则已落地
267
268
  - [ ] Harness checker 已通过,或 residual 写明 owner/action/status
268
269
  - [ ] Bootstrap Summary 已输出给用户
@@ -285,7 +286,7 @@ harness 搭建完成后,每个 feature 从想法到代码的标准流程:
285
286
  10. **Review Routing** — planned task 收口前自动触发 subagent / reviewer 审查,或记录 skip reason;Review queue 只等待 Human Review Confirmation,缺材料和 blocker 分别进入 Missing Materials / Blocked 队列
286
287
  11. **Merge + 自动回归** — Cadence Ledger 触发对应回归面;coordinator 只集成 worker commit,不混合多个 worker 的未提交改动
287
288
  12. **Walkthrough 收口** — 写收口记录并引用 review report
288
- 13. **Closeout SSoT 回写** — 每个 closed 任务必须记录 walkthrough 路径或受控 skip reason
289
+ 13. **Closeout Index 回写** — 每个 closed 任务必须记录 walkthrough 路径或受控 skip reason
289
290
  14. **Lessons Reflection** — 写 walkthrough 时主动反思共性/反复问题;新任务用 `lesson_candidates.md` 承载人工判定,`queued-promotion` 进入 Lessons 队列;默认先 dry-run 或创建沉淀任务,不直接写共享 Lessons 表;`checked-created` 必须有 promoted lesson 详情文档,旧任务兼容的 `checked-none` 必须写明原因
290
291
  15. **Generated Ledger 刷新** — 由 lifecycle CLI 或 `harness governance rebuild` 生成任务生命周期总索引
291
292
  16. **Worktree 清理** — 删除已 merge 的 worktree
@@ -315,7 +316,7 @@ harness 搭建完成后,每个 feature 从想法到代码的标准流程:
315
316
  | Harness Ledger | `references/harness-ledger.md` | 理解 generated task lifecycle ledger 与非任务治理表边界时 |
316
317
  | Regression | `references/regression-system.md` | 设计或更新回归面、evidence depth 和 gate 时 |
317
318
  | Cadence Ledger | `references/cadence-ledger.md` | 根据改动类型触发回归批次时 |
318
- | Walkthrough | `references/walkthrough-closeout.md` | 收口、Closeout SSoT 和交付说明时 |
319
+ | Walkthrough | `references/walkthrough-closeout.md` | 收口、Closeout Index 和交付说明时 |
319
320
  | Worktree | `references/worktree-parallel.md` | 并行开发、worker handoff 或隔离分支时 |
320
321
 
321
322
  ## Template 索引
@@ -338,7 +339,7 @@ harness 搭建完成后,每个 feature 从想法到代码的标准流程:
338
339
  | Long-Running Task Contract | `templates/planning/long-running-task-contract.md` | 长程任务授权、review loop 和停止条件 |
339
340
  | Module Session Prompt | `templates/planning/module_session_prompt.md` | 模块并行开发会话冷启动 |
340
341
  | Walkthrough | `templates/walkthrough/walkthrough-template.md` | 任务收口记录 |
341
- | Closeout SSoT | `templates/walkthrough/Closeout-SSoT.md` | closed task 索引和收口证据 |
342
+ | Closeout Index | `templates/walkthrough/walkthrough-template.md` | closed task 索引和收口证据 |
342
343
  | Testing Standard | `templates/reference/testing-standard.md` | 测试、冒烟和回归规范 |
343
344
  | Execution Workflow | `templates/reference/execution-workflow-standard.md` | 执行、提交、PR 和证据记录 |
344
345
  | Delivery Operating Model Standard | `templates/reference/delivery-operating-model-standard.md` | 交付组织模型选择 |