repo-harness 0.4.0 → 0.4.2

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 (139) hide show
  1. package/AGENTS.md +4 -4
  2. package/CLAUDE.md +4 -4
  3. package/README.es.md +37 -2
  4. package/README.fr.md +38 -2
  5. package/README.ja.md +35 -2
  6. package/README.md +69 -38
  7. package/README.zh-CN.md +61 -23
  8. package/SKILL.md +24 -20
  9. package/assets/AGENTS.md +1 -1
  10. package/assets/CLAUDE.md +1 -1
  11. package/assets/hooks/AGENTS.md +36 -0
  12. package/assets/hooks/CLAUDE.md +36 -0
  13. package/assets/hooks/codex.hooks.template.json +6 -0
  14. package/assets/hooks/hook-input.sh +17 -1
  15. package/assets/hooks/lib/session-state.sh +19 -2
  16. package/assets/hooks/lib/workflow-state.sh +11 -20
  17. package/assets/hooks/post-edit-guard.sh +4 -4
  18. package/assets/hooks/post-tool-observer.sh +5 -103
  19. package/assets/hooks/prompt-guard.sh +3 -3
  20. package/assets/hooks/session-start-context.sh +36 -38
  21. package/assets/hooks/settings.template.json +6 -0
  22. package/assets/hooks/subagent-return-channel-guard.sh +107 -0
  23. package/assets/partials/04-project-structure.partial.md +4 -4
  24. package/assets/partials/05-workflow.partial.md +8 -8
  25. package/assets/partials/07-footer.partial.md +1 -1
  26. package/assets/partials/08-orchestration.partial.md +7 -6
  27. package/assets/partials-agents/02-operating-mode.partial.md +5 -5
  28. package/assets/partials-agents/03-orchestration.partial.md +6 -5
  29. package/assets/partials-agents/04-task-protocol.partial.md +8 -8
  30. package/assets/partials-agents/06-quality-safety.partial.md +2 -2
  31. package/assets/partials-agents/08-deep-docs.partial.md +1 -1
  32. package/assets/reference-configs/agentic-development-flow.md +10 -8
  33. package/assets/reference-configs/development-protocol.md +1 -1
  34. package/assets/reference-configs/document-generation.md +3 -2
  35. package/assets/reference-configs/external-tooling.md +11 -10
  36. package/assets/reference-configs/handoff-protocol.md +5 -9
  37. package/assets/reference-configs/harness-overview.md +8 -7
  38. package/assets/reference-configs/heartbeat-triage.md +5 -5
  39. package/assets/reference-configs/hook-operations.md +10 -8
  40. package/assets/reference-configs/sprint-contracts.md +11 -9
  41. package/assets/skill-commands/manifest.json +9 -2
  42. package/assets/skill-commands/repo-harness-architecture/SKILL.md +1 -1
  43. package/assets/skill-commands/repo-harness-check/SKILL.md +7 -7
  44. package/assets/skill-commands/repo-harness-deploy/SKILL.md +1 -1
  45. package/assets/skill-commands/repo-harness-handoff/SKILL.md +1 -1
  46. package/assets/skill-commands/repo-harness-init/SKILL.md +1 -1
  47. package/assets/skill-commands/repo-harness-plan/SKILL.md +4 -4
  48. package/assets/skill-commands/repo-harness-prd/SKILL.md +35 -0
  49. package/assets/skill-commands/repo-harness-repair/SKILL.md +1 -1
  50. package/assets/skill-commands/repo-harness-ship/SKILL.md +3 -3
  51. package/assets/skill-commands/repo-harness-sprint/SKILL.md +22 -13
  52. package/assets/skill-version.json +10 -2
  53. package/assets/skills/claude-review/SKILL.md +8 -1
  54. package/assets/skills/codex-review/SKILL.md +8 -1
  55. package/assets/templates/contract.template.md +3 -3
  56. package/assets/templates/helpers/architecture-event.ts +1 -1
  57. package/assets/templates/helpers/archive-workflow.sh +15 -9
  58. package/assets/templates/helpers/capture-plan.sh +9 -3
  59. package/assets/templates/helpers/check-agent-tooling.sh +11 -5
  60. package/assets/templates/helpers/check-brain-manifest.sh +12 -1
  61. package/assets/templates/helpers/check-skill-version.ts +3 -1
  62. package/assets/templates/helpers/check-task-sync.sh +1 -1
  63. package/assets/templates/helpers/check-task-workflow.sh +164 -41
  64. package/assets/templates/helpers/codex-handoff-resume.sh +1 -4
  65. package/assets/templates/helpers/context-contract-sync.sh +1 -1
  66. package/assets/templates/helpers/contract-worktree.sh +2 -0
  67. package/assets/templates/helpers/ensure-task-workflow.sh +191 -34
  68. package/assets/templates/helpers/heartbeat-triage.sh +51 -7
  69. package/assets/templates/helpers/inspect-project-state.ts +15 -1
  70. package/assets/templates/helpers/migrate-workflow-docs.ts +54 -7
  71. package/assets/templates/helpers/new-plan.sh +8 -2
  72. package/assets/templates/helpers/new-spec.sh +7 -1
  73. package/assets/templates/helpers/new-sprint.sh +11 -8
  74. package/assets/templates/helpers/plan-to-todo.sh +20 -14
  75. package/assets/templates/helpers/prepare-codex-handoff.sh +3 -23
  76. package/assets/templates/helpers/prepare-handoff.sh +7 -1
  77. package/assets/templates/helpers/refresh-current-status.sh +2 -1
  78. package/assets/templates/helpers/ship-worktrees.sh +3 -1
  79. package/assets/templates/helpers/sprint-backlog.sh +30 -14
  80. package/assets/templates/helpers/switch-plan.sh +8 -2
  81. package/assets/templates/helpers/verify-sprint.sh +7 -1
  82. package/assets/templates/helpers/workflow-contract.ts +10 -1
  83. package/assets/templates/helpers/workstream-sync.sh +1 -1
  84. package/assets/templates/plan.template.md +3 -3
  85. package/assets/templates/prd.template.md +165 -0
  86. package/assets/templates/sprint.template.md +8 -5
  87. package/assets/workflow-contract.v1.json +138 -53
  88. package/docs/reference-configs/agentic-development-flow.md +10 -8
  89. package/docs/reference-configs/development-protocol.md +1 -1
  90. package/docs/reference-configs/document-generation.md +3 -2
  91. package/docs/reference-configs/external-tooling.md +11 -10
  92. package/docs/reference-configs/handoff-protocol.md +5 -9
  93. package/docs/reference-configs/harness-overview.md +8 -7
  94. package/docs/reference-configs/heartbeat-triage.md +5 -5
  95. package/docs/reference-configs/hook-operations.md +10 -8
  96. package/docs/reference-configs/sprint-contracts.md +11 -9
  97. package/package.json +1 -1
  98. package/scripts/architecture-event.ts +1 -1
  99. package/scripts/archive-workflow.sh +15 -9
  100. package/scripts/capture-plan.sh +9 -3
  101. package/scripts/check-agent-tooling.sh +11 -5
  102. package/scripts/check-brain-manifest.sh +12 -1
  103. package/scripts/check-skill-version.ts +3 -1
  104. package/scripts/check-task-sync.sh +1 -1
  105. package/scripts/check-task-workflow.sh +164 -41
  106. package/scripts/codex-handoff-resume.sh +1 -4
  107. package/scripts/context-contract-sync.sh +1 -1
  108. package/scripts/contract-worktree.sh +2 -0
  109. package/scripts/create-project-dirs.sh +7 -54
  110. package/scripts/ensure-task-workflow.sh +191 -34
  111. package/scripts/heartbeat-triage.sh +51 -7
  112. package/scripts/init-project.sh +7 -26
  113. package/scripts/inspect-project-state.ts +15 -1
  114. package/scripts/lib/project-init-lib.sh +389 -86
  115. package/scripts/migrate-project-template.sh +231 -30
  116. package/scripts/migrate-workflow-docs.ts +54 -7
  117. package/scripts/new-plan.sh +8 -2
  118. package/scripts/new-spec.sh +7 -1
  119. package/scripts/new-sprint.sh +11 -8
  120. package/scripts/plan-to-todo.sh +20 -14
  121. package/scripts/prepare-codex-handoff.sh +3 -23
  122. package/scripts/prepare-handoff.sh +7 -1
  123. package/scripts/refresh-current-status.sh +2 -1
  124. package/scripts/ship-worktrees.sh +3 -1
  125. package/scripts/sprint-backlog.sh +30 -14
  126. package/scripts/switch-plan.sh +8 -2
  127. package/scripts/sync-codex-installed-copies.sh +0 -3
  128. package/scripts/verify-sprint.sh +7 -1
  129. package/scripts/workflow-contract.ts +10 -1
  130. package/scripts/workstream-sync.sh +1 -1
  131. package/src/cli/commands/global-runtime.ts +3 -0
  132. package/src/cli/commands/status.ts +1 -1
  133. package/src/cli/hook/route-registry.ts +7 -1
  134. package/src/cli/hook/runtime.ts +6 -2
  135. package/src/cli/index.ts +1 -1
  136. package/src/cli/installer/targets/claude.ts +1 -1
  137. package/src/cli/installer/targets/codex.ts +1 -1
  138. package/assets/templates/helpers/context-budget.ts +0 -463
  139. package/scripts/context-budget.ts +0 -463
package/AGENTS.md CHANGED
@@ -5,8 +5,8 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
5
5
  ## Canonical Workflow Files
6
6
 
7
7
  - `tasks/current.md` for the tracked current-status snapshot derived from workflow artifacts
8
- - `tasks/todo.md` for deferred medium/long-term goals, not active execution checklists
9
- - `tasks/sprints/` for program-level sprint PRDs and ordered backlogs, operated by `scripts/sprint-backlog.sh` (Sprint = program layer; task contracts stay the execution slices)
8
+ - `tasks/todos.md` for deferred medium/long-term goals, not active execution checklists
9
+ - `plans/prds/` for upper-layer PRDs; `plans/sprints/` for ordered sprint backlogs operated through `scripts/sprint-backlog.sh` (installed implementations live under `.ai/harness/scripts/`; task contracts stay the execution slices)
10
10
  - `.ai/context/capabilities.json` for the capability registry and longest-prefix context boundaries
11
11
  - `tasks/workstreams/` for capability long-running workstreams that project durable progress into local contracts
12
12
  - `tasks/lessons.md` for correction-derived rules
@@ -24,7 +24,7 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
24
24
  - Sync `tasks/` whenever substantive repo changes are made.
25
25
  - Use `tasks/notes/<plan-stem>.notes.md` only for non-obvious slice decisions, deviations, tradeoffs, and open questions; `<plan-stem>` is the active plan filename without `plan-` and `.md` (for example `20260531-0045-governance-workflow`). Do not use notes as durable memory or a task log, and archive/promote them deliberately when the slice closes.
26
26
  - Treat hook execution as central-first: trusted repos run `~/.repo-harness/hooks/` (bash shim) or the packaged CLI copy; this self-host repo pins `"hook_source": "repo"` in `.ai/harness/policy.json` so `.ai/hooks/` stays the live development runtime, with `assets/hooks/` as the product source mirrored on install. User-level `~/.claude/settings.json` and `~/.codex/hooks.json` are the host adapters.
27
- - Keep the umbrella hierarchy explicit: architecture owns stable truth, capability contracts own local agent context, `tasks/workstreams/<domain>/<capability>/` owns durable progress, and `tasks/todo.md` owns only deferred medium/long-term goals with tradeoff and revisit trigger.
27
+ - Keep the umbrella hierarchy explicit: architecture owns stable truth, capability contracts own local agent context, `tasks/workstreams/<domain>/<capability>/` owns durable progress, and `tasks/todos.md` owns only deferred medium/long-term goals with tradeoff and revisit trigger.
28
28
  - Treat `.ai/context/capabilities.json` as the source of truth for capability prefixes; `agent-context-blocks.txt` and nested agent files are compatibility inputs only.
29
29
  - Keep architecture drift handling split: `architecture-queue.sh` writes architecture requests/events, `workstream-sync.sh` maintains durable capability workstreams, and `context-contract-sync.sh` only updates controlled local `CLAUDE.md`/`AGENTS.md` architecture blocks.
30
30
  - Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
@@ -90,5 +90,5 @@ bash scripts/migrate-project-template.sh --repo . --dry-run
90
90
 
91
91
  - Durable progress lives under `tasks/workstreams/runtime-harness/hook-adapters`.
92
92
  - `tasks/current.md` is the tracked derived status snapshot; it is not a live lock or task source.
93
- - `tasks/todo.md` is the deferred-goal ledger; current execution slices stay in the active plan's `## Task Breakdown`.
93
+ - `tasks/todos.md` is the deferred-goal ledger; current execution slices stay in the active plan's `## Task Breakdown`.
94
94
  <!-- END ARCHITECTURE CONTRACT -->
package/CLAUDE.md CHANGED
@@ -5,8 +5,8 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
5
5
  ## Canonical Workflow Files
6
6
 
7
7
  - `tasks/current.md` for the tracked current-status snapshot derived from workflow artifacts
8
- - `tasks/todo.md` for deferred medium/long-term goals, not active execution checklists
9
- - `tasks/sprints/` for program-level sprint PRDs and ordered backlogs, operated by `scripts/sprint-backlog.sh` (Sprint = program layer; task contracts stay the execution slices)
8
+ - `tasks/todos.md` for deferred medium/long-term goals, not active execution checklists
9
+ - `plans/prds/` for upper-layer PRDs; `plans/sprints/` for ordered sprint backlogs operated through `scripts/sprint-backlog.sh` (installed implementations live under `.ai/harness/scripts/`; task contracts stay the execution slices)
10
10
  - `.ai/context/capabilities.json` for the capability registry and longest-prefix context boundaries
11
11
  - `tasks/workstreams/` for capability long-running workstreams that project durable progress into local contracts
12
12
  - `tasks/lessons.md` for correction-derived rules
@@ -24,7 +24,7 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
24
24
  - Sync `tasks/` whenever substantive repo changes are made.
25
25
  - Use `tasks/notes/<plan-stem>.notes.md` only for non-obvious slice decisions, deviations, tradeoffs, and open questions; `<plan-stem>` is the active plan filename without `plan-` and `.md` (for example `20260531-0045-governance-workflow`). Do not use notes as durable memory or a task log, and archive/promote them deliberately when the slice closes.
26
26
  - Treat hook execution as central-first: trusted repos run `~/.repo-harness/hooks/` (bash shim) or the packaged CLI copy; this self-host repo pins `"hook_source": "repo"` in `.ai/harness/policy.json` so `.ai/hooks/` stays the live development runtime, with `assets/hooks/` as the product source mirrored on install. User-level `~/.claude/settings.json` and `~/.codex/hooks.json` are the host adapters.
27
- - Keep the umbrella hierarchy explicit: architecture owns stable truth, capability contracts own local agent context, `tasks/workstreams/<domain>/<capability>/` owns durable progress, and `tasks/todo.md` owns only deferred medium/long-term goals with tradeoff and revisit trigger.
27
+ - Keep the umbrella hierarchy explicit: architecture owns stable truth, capability contracts own local agent context, `tasks/workstreams/<domain>/<capability>/` owns durable progress, and `tasks/todos.md` owns only deferred medium/long-term goals with tradeoff and revisit trigger.
28
28
  - Treat `.ai/context/capabilities.json` as the source of truth for capability prefixes; `agent-context-blocks.txt` and nested agent files are compatibility inputs only.
29
29
  - Keep architecture drift handling split: `architecture-queue.sh` writes architecture requests/events, `workstream-sync.sh` maintains durable capability workstreams, and `context-contract-sync.sh` only updates controlled local `CLAUDE.md`/`AGENTS.md` architecture blocks.
30
30
  - Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
@@ -90,5 +90,5 @@ bash scripts/migrate-project-template.sh --repo . --dry-run
90
90
 
91
91
  - Durable progress lives under `tasks/workstreams/runtime-harness/hook-adapters`.
92
92
  - `tasks/current.md` is the tracked derived status snapshot; it is not a live lock or task source.
93
- - `tasks/todo.md` is the deferred-goal ledger; current execution slices stay in the active plan's `## Task Breakdown`.
93
+ - `tasks/todos.md` is the deferred-goal ledger; current execution slices stay in the active plan's `## Task Breakdown`.
94
94
  <!-- END ARCHITECTURE CONTRACT -->
package/README.es.md CHANGED
@@ -175,6 +175,26 @@ flowchart TD
175
175
  Cleanup --> Done["Tarea completada y auditable"]
176
176
  ```
177
177
 
178
+ ## Bucles largos de producto
179
+
180
+ Para trabajo Greenfield y Brownfield, adelanta la discovery y el juicio de
181
+ engineering plan en Claude-Fable antes de pedirle a Codex que haga loops de
182
+ ejecución:
183
+
184
+ 1. En Claude-Fable, usa gstack `office-hours` para product discovery o
185
+ `plan-eng-review` para review del plan de ingeniería. La salida debe ser los
186
+ development documents que fijan la intención de producto, la arquitectura, los
187
+ riesgos y el evidence contract.
188
+ 2. Convierte esos documentos en un PRD Sprint bajo `plans/prds/`, con un
189
+ backlog ordenado y sub-plans detallados para cada execution slice.
190
+ 3. Crea un Codex Goal que apunte a ese archivo de sprint. repo-harness puede
191
+ entonces proyectar cada sprint item por el flow normal plan -> contract ->
192
+ worktree -> verification.
193
+
194
+ Ese handoff mantiene precisos los loops largos: Claude-Fable se ocupa del juicio
195
+ amplio al inicio, el PRD Sprint es la durable source of truth, y Codex Goal mode
196
+ retoma contra un sprint concreto en vez de reinterpretar el chat original.
197
+
178
198
  ## Primeros 5 minutos
179
199
 
180
200
  Esta es la ruta más rápida para evaluar si un repositorio real es apto para
@@ -325,8 +345,8 @@ Guards habituales:
325
345
 
326
346
  ## Release actual
327
347
 
328
- - npm package: `repo-harness@0.4.0`
329
- - Generated workflow stamp: `repo-harness@0.4.0+template@0.4.0`
348
+ - npm package: `repo-harness@0.4.2`
349
+ - Generated workflow stamp: `repo-harness@0.4.2+template@0.4.2`
330
350
  - GitHub repository: `Ancienttwo/repo-harness`
331
351
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
332
352
 
@@ -349,6 +369,21 @@ Guards habituales:
349
369
  - `bash scripts/check-agent-tooling.sh --host both --check-updates`
350
370
  - no configura automáticamente gstack, gbrain, CodeGraph MCP, daemon ni provider
351
371
 
372
+ ## Agradecimientos
373
+
374
+ Gracias a [Hylarucoder](https://x.com/hylarucoder) por su contribución
375
+ metodológica. El método P1/P2/P3 due-diligence de `repo-harness`, y la práctica
376
+ Geju que disciplina el planning, el trace y el decision rationale, vienen de su
377
+ contribución e influencia.
378
+
379
+ Gracias a [TW93](https://x.com/HiTw93), autor de Waza. Los skills centrales
380
+ `think`, `hunt`, `check` y `health` dan forma al ritmo diario de planning, bug
381
+ hunt y verification de `repo-harness`.
382
+
383
+ Gracias a [Garry Tan](https://x.com/garrytan), autor de gstack y gbrain. Ambos
384
+ influyeron en el workflow de product discovery, plan/design review, release
385
+ documentation, knowledge sync y handoff retrieval.
386
+
352
387
  ## Action Command Skills
353
388
 
354
389
  Los command facades públicos están en `assets/skill-commands/`; preservan la
package/README.fr.md CHANGED
@@ -179,6 +179,27 @@ flowchart TD
179
179
  Cleanup --> Done["Tâche terminée et auditable"]
180
180
  ```
181
181
 
182
+ ## Longues boucles produit
183
+
184
+ Pour le travail Greenfield comme Brownfield, avancez la discovery et le jugement
185
+ d'engineering plan dans Claude-Fable avant de demander à Codex de boucler sur
186
+ l'exécution :
187
+
188
+ 1. Dans Claude-Fable, utilisez gstack `office-hours` pour la product discovery ou
189
+ `plan-eng-review` pour la review du plan d'ingénierie. La sortie doit être les
190
+ development documents qui verrouillent l'intention produit, l'architecture,
191
+ les risques et l'evidence contract.
192
+ 2. Transformez ces documents en PRD Sprint sous `plans/prds/`, avec un backlog
193
+ ordonné et des sub-plans détaillés pour chaque execution slice.
194
+ 3. Créez un Codex Goal qui pointe vers ce fichier de sprint. repo-harness peut
195
+ ensuite projeter chaque sprint item dans le flow normal plan -> contract ->
196
+ worktree -> verification.
197
+
198
+ Ce handoff rend les longues boucles plus précises : Claude-Fable porte le
199
+ jugement large en amont, le PRD Sprint devient la durable source of truth, et
200
+ Codex Goal mode reprend sur un sprint concret au lieu de réinterpréter le chat
201
+ initial.
202
+
182
203
  ## Les 5 premières minutes
183
204
 
184
205
  C'est le chemin le plus rapide pour évaluer si un dépôt réel se prête à l'adoption
@@ -329,8 +350,8 @@ Guards courants :
329
350
 
330
351
  ## Release actuelle
331
352
 
332
- - npm package : `repo-harness@0.4.0`
333
- - Generated workflow stamp : `repo-harness@0.4.0+template@0.4.0`
353
+ - npm package : `repo-harness@0.4.2`
354
+ - Generated workflow stamp : `repo-harness@0.4.2+template@0.4.2`
334
355
  - GitHub repository : `Ancienttwo/repo-harness`
335
356
  - Release history : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
336
357
 
@@ -353,6 +374,21 @@ Guards courants :
353
374
  - `bash scripts/check-agent-tooling.sh --host both --check-updates`
354
375
  - pas de configuration automatique de gstack, gbrain, CodeGraph MCP, daemon ou provider
355
376
 
377
+ ## Remerciements
378
+
379
+ Merci à [Hylarucoder](https://x.com/hylarucoder) pour sa contribution
380
+ méthodologique. La méthode P1/P2/P3 due-diligence de `repo-harness`, ainsi que
381
+ la pratique Geju qui structure le planning, le trace et le decision rationale,
382
+ viennent de sa contribution et de son influence.
383
+
384
+ Merci à [TW93](https://x.com/HiTw93), auteur de Waza. Les skills centraux
385
+ `think`, `hunt`, `check` et `health` structurent le rythme quotidien de planning,
386
+ bug hunt et verification de `repo-harness`.
387
+
388
+ Merci à [Garry Tan](https://x.com/garrytan), auteur de gstack et gbrain. Ils ont
389
+ influencé le workflow de product discovery, plan/design review, release
390
+ documentation, knowledge sync et handoff retrieval.
391
+
356
392
  ## Action Command Skills
357
393
 
358
394
  Les command facades publics se trouvent dans `assets/skill-commands/` ; ils
package/README.ja.md CHANGED
@@ -149,6 +149,25 @@ flowchart TD
149
149
  Cleanup --> Done["レビュー可能な完了タスク"]
150
150
  ```
151
151
 
152
+ ## 長期プロダクト Loop
153
+
154
+ Greenfield と Brownfield の作業では、Codex に実行 loop を任せる前に、
155
+ discovery と engineering-plan judgment を Claude-Fable 側で前倒しします。
156
+
157
+ 1. Claude-Fable で、product discovery には gstack `office-hours` を使い、
158
+ engineering plan review には `plan-eng-review` を使います。出力は、product
159
+ intent、architecture、risks、evidence contract を固定する development
160
+ documents にします。
161
+ 2. それらの documents を `plans/prds/` 配下の PRD Sprint に変換し、
162
+ 各 execution slice に ordered backlog と detailed sub-plans を持たせます。
163
+ 3. Codex Goal を作成し、その sprint file を指します。repo-harness はその後、
164
+ 各 sprint item を通常の plan -> contract -> worktree -> verification flow
165
+ へ投射できます。
166
+
167
+ この handoff により、長期 loop は精密になります。Claude-Fable が広い前置判断を担い、
168
+ PRD Sprint が durable source of truth となり、Codex Goal mode は元の chat を再解釈する
169
+ のではなく、具体的な sprint に対して resume します。
170
+
152
171
  ## 最初の 5 分
153
172
 
154
173
  実際のリポジトリがこの workflow を導入するのに適しているかを評価する、最速の経路です。
@@ -293,8 +312,8 @@ hook がブロックしたときは、まず terminal の構造化された出
293
312
 
294
313
  ## 現在の Release
295
314
 
296
- - npm package:`repo-harness@0.4.0`
297
- - Generated workflow stamp:`repo-harness@0.4.0+template@0.4.0`
315
+ - npm package:`repo-harness@0.4.2`
316
+ - Generated workflow stamp:`repo-harness@0.4.2+template@0.4.2`
298
317
  - GitHub repository:`Ancienttwo/repo-harness`
299
318
  - Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
300
319
 
@@ -317,6 +336,20 @@ hook がブロックしたときは、まず terminal の構造化された出
317
336
  - `bash scripts/check-agent-tooling.sh --host both --check-updates`
318
337
  - gstack、gbrain、CodeGraph MCP、daemon、provider を自動設定しない
319
338
 
339
+ ## 謝辞
340
+
341
+ [Hylarucoder](https://x.com/hylarucoder) の方法論への貢献に感謝します。
342
+ `repo-harness` の P1/P2/P3 due-diligence メソッドと、planning、trace、
343
+ decision rationale を重視する Geju の実践は、彼の貢献と示唆に基づいています。
344
+
345
+ [TW93](https://x.com/HiTw93) による Waza にも感謝します。`think`、`hunt`、
346
+ `check`、`health` という中核 skill は、`repo-harness` の日々の planning、
347
+ bug hunt、verification のリズムを形作っています。
348
+
349
+ [Garry Tan](https://x.com/garrytan) による gstack と gbrain にも感謝します。
350
+ これらは product discovery、plan/design review、release documentation、
351
+ knowledge sync、handoff retrieval の workflow 設計に影響を与えています。
352
+
320
353
  ## Action Command Skills
321
354
 
322
355
  公開 command facades は `assets/skill-commands/` にあります。host skill discovery との互換性を残しつつ、実行は CLI と hooks が担います。
package/README.md CHANGED
@@ -34,25 +34,20 @@ This repository now dogfoods its own tasks-first contract. It is both:
34
34
  read a 1KB capability contract or query the index instead of spending thousands of
35
35
  tokens rediscovering structure.
36
36
 
37
- ## What's New in 0.4.0
38
-
39
- - **Loop-engine evidence surfaces.** `repo-harness-hook state-snapshot --json`,
40
- the NL decision-table reference, route A/B evals, and the cutover gate make
41
- prompt-routing experiments measurable while keeping the TypeScript classifier
42
- authoritative until evidence says otherwise.
43
- - **Architecture queue gate.** `scripts/architecture-queue.sh`,
44
- `scripts/check-architecture-sync.sh`, and the expanded architecture event
45
- helper replace the retired append-only drift script with a derived request
46
- index that can gate stale architecture state.
47
- - **Contract delegation pilot.** Contract templates now include
48
- `budget`, `permission_scope`, and `roles`, and `scripts/contract-run.ts`
49
- can run explicit worker/verifier child commands against contract exit
50
- criteria.
51
- - **Heartbeat triage.** `scripts/heartbeat-triage.sh` records scheduled
52
- workflow checks, sprint-next signals, and architecture request state into the
53
- repo-local triage inbox.
54
- - **Workflow asset sync.** New helpers, docs, tests, and generated-repo assets
55
- keep the self-host runtime and installed template copies aligned.
37
+ ## What's New in 0.4.2
38
+
39
+ - **PRD-to-Sprint planning hierarchy.** `repo-harness-prd` now owns
40
+ upper-layer product requirements under `plans/prds/`, while
41
+ `repo-harness-sprint` derives ordered execution backlogs under
42
+ `plans/sprints/*.sprint.md`.
43
+ - **Generated helper runtime isolation.** Downstream installs place real helper
44
+ implementations under `.ai/harness/scripts/` and keep root `scripts/*` as
45
+ compatibility wrappers; this self-host repo remains the source runtime.
46
+ - **Subagent return-channel guard.** Managed hook routes include a guard that
47
+ keeps delegated runs reporting back through the parent session instead of
48
+ bypassing the file-backed contract.
49
+ - **Release path alignment.** PRD/Sprint eval fixtures, workflow checks, and
50
+ command guidance now point at the same installed helper runtime.
56
51
 
57
52
  ## What repo-harness Does
58
53
 
@@ -115,7 +110,7 @@ The diagram below assumes the harness is already installed in the repo. It shows
115
110
  the normal lifecycle from a program sprint backlog down to one contract task:
116
111
  draft or select the task, project it into execution files, check out the
117
112
  contract worktree when policy requires it, implement under hooks, verify, review,
118
- complete the sprint task when applicable, and close out. The 0.4.0 loop-system
113
+ complete the sprint task when applicable, and close out. The 0.4.x loop-system
119
114
  surfaces add scheduled heartbeat discovery, state-snapshot/eval evidence for
120
115
  routing changes, architecture queue freshness, and optional contract-run
121
116
  delegation without changing the file-backed authority model.
@@ -123,7 +118,8 @@ delegation without changing the file-backed authority model.
123
118
  ```mermaid
124
119
  flowchart TD
125
120
  Program["Program goal or release theme"] --> Sprint{"Sprint layer needed?"}
126
- Sprint -->|yes| SprintDoc["Sprint PRD + backlog<br/>tasks/sprints/*.sprint.md"]
121
+ Sprint -->|yes| PRD["Upper-layer PRD<br/>plans/prds/*.prd.md"]
122
+ PRD --> SprintDoc["Sprint backlog<br/>plans/sprints/*.sprint.md"]
127
123
  SprintDoc --> NextTask["Select next sprint task<br/>sprint-backlog.sh next"]
128
124
  Sprint -->|no| UserTask["User task or planning prompt"]
129
125
  Heartbeat["Heartbeat triage<br/>scripts/heartbeat-triage.sh<br/>.ai/harness/triage/"] --> UserTask
@@ -180,6 +176,27 @@ flowchart TD
180
176
  Cleanup --> Done["Reviewable completed task"]
181
177
  ```
182
178
 
179
+ ## Long-Running Product Loops
180
+
181
+ For Greenfield and Brownfield work, front-load discovery and engineering-plan
182
+ judgment in Claude-Fable before asking Codex to loop on execution:
183
+
184
+ 1. In Claude-Fable, use gstack `office-hours` for product discovery or
185
+ `plan-eng-review` for engineering plan review. The output should be the
186
+ development documents that lock product intent, architecture, risks, and the
187
+ evidence contract.
188
+ 2. Turn those documents into an upper-layer PRD under `plans/prds/`, then into
189
+ an ordered sprint backlog under `plans/sprints/` with detailed sub-plans for
190
+ each execution slice.
191
+ 3. In Codex, create a Goal that points at that sprint file. The harness can then
192
+ project each sprint item through the normal plan -> contract -> worktree ->
193
+ verification flow.
194
+
195
+ That handoff keeps long-running loops precise: Claude-Fable owns the broad
196
+ front-loaded judgment, the PRD remains the upper source of truth, the sprint
197
+ backlog is the durable execution queue, and Codex Goal mode resumes against a
198
+ concrete sprint instead of reinterpreting the original chat.
199
+
183
200
  ## First 5 Minutes
184
201
 
185
202
  This is the fastest path for an AI tooling owner evaluating whether the workflow is
@@ -209,11 +226,11 @@ repository to install or refresh workflow files, hook assets, host adapters,
209
226
  skill aliases, and repo-local verification surfaces from the current npm package.
210
227
 
211
228
  The npm package and generated workflow stamp now share the `0.4.x` release line.
212
- The `0.4.0` package keeps first-run
229
+ The `0.4.2` package keeps first-run
213
230
  global bootstrap (`repo-harness init`) separate from repo-local refresh
214
- (`repo-harness update`) while adding the loop-engine state snapshot, architecture
215
- queue gate, contract delegation pilot, heartbeat triage helper, and generated
216
- asset sync for those workflow surfaces.
231
+ (`repo-harness update`) while adding the PRD-to-Sprint planning hierarchy,
232
+ isolated generated-project helper runtime, subagent return-channel guard, and
233
+ release-path alignment on top of the `0.4.0` loop-engine surfaces.
217
234
  These sit on top of the renamed `repo-harness` CLI, user-level hook
218
235
  adapter bootstrap, AI-native scaffold overlays, the typed prompt-guard decision
219
236
  engine, plan-stem task artifact naming, `REPO_HARNESS_*` runtime aliases, Waza
@@ -273,7 +290,7 @@ The command should end with `=== Migration Report ===` and summarize:
273
290
  - `Host hook config target: user-level ~/.claude/settings.json and ~/.codex/hooks.json` to show the adapter layer
274
291
  - `Host hook adapters are user-level:` to remind the user to install global adapters and trust `~/.codex/hooks.json`
275
292
  - `Workflow migration:` to show the repo-local harness surfaces it will create or refresh
276
- - `Helper scripts:` to show the operational toolchain you get after apply
293
+ - `Helper runtime:` to show `.ai/harness/scripts/*` implementations and `scripts/*` compatibility wrappers after apply
277
294
  - `--- External Tooling ---` to show default gstack/Waza/gbrain routing plus advisory install/update hints
278
295
 
279
296
  ### Next two commands
@@ -364,8 +381,8 @@ Most common guards:
364
381
 
365
382
  ## Current Release
366
383
 
367
- - npm package: `repo-harness@0.4.0`
368
- - Generated workflow stamp: `repo-harness@0.4.0+template@0.4.0`
384
+ - npm package: `repo-harness@0.4.2`
385
+ - Generated workflow stamp: `repo-harness@0.4.2+template@0.4.2`
369
386
  - GitHub repository: `Ancienttwo/repo-harness`
370
387
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
371
388
 
@@ -408,27 +425,40 @@ Most common guards:
408
425
  - no automatic gstack, gbrain MCP, CodeGraph daemon, or provider setup
409
426
  - Manual distillation stays repo-local:
410
427
  - repeated corrections -> `tasks/lessons.md`
411
- - deep findings and hidden contracts -> `tasks/research.md`
428
+ - deep findings and hidden contracts -> topic-scoped `docs/researches/*.md`
412
429
  - sprint verification evidence -> `tasks/reviews/*.review.md`
413
430
  - durable capability progress -> `tasks/workstreams/`
414
431
  - release history -> `docs/CHANGELOG.md`
415
432
 
416
- ## Acknowledgements and Tooling Dependencies
433
+ ## Acknowledgements and Workflow Influences
417
434
 
418
- `repo-harness` is built around a small set of external skills and repos that
435
+ `repo-harness` is built around a small set of external skills, repos, and agent
436
+ runtimes that
419
437
  proved useful while this project was being designed, debugged, and released.
420
438
  They are acknowledged here because they shaped the workflow contract, but they
421
- are not all bundled product dependencies.
439
+ are not ordinary bundled product dependencies.
422
440
 
423
441
  | Tool or repo | Used for | Dependency shape |
424
442
  | --- | --- | --- |
425
- | gstack skills, including `document-release`, `office-hours`, `plan-eng-review`, and `plan-design-review` | Product discovery, plan review, design review, and post-ship documentation hygiene | External operator workflow; advisory by default |
426
- | Waza core skills `think`, `hunt`, `check`, and `health` | Daily planning, bug hunts, verification, health checks, and Codex-first skill sync | Installed through the skills CLI into host skill roots |
443
+ | [Hylarucoder](https://x.com/hylarucoder) / Geju | P1/P2/P3 due-diligence method and Geju practice that shaped the planning, tracing, and decision-rationale discipline in this workflow | Methodology contribution and acknowledgement; not a bundled dependency |
444
+ | Waza by [TW93](https://x.com/HiTw93), including `think`, `hunt`, `check`, and `health` | Daily planning, bug hunts, verification, health checks, and Codex-first skill sync | Installed through the skills CLI into host skill roots |
445
+ | gstack skills and `gbrain` by [Garry Tan](https://x.com/garrytan) | Product discovery, plan review, design review, post-ship documentation hygiene, knowledge sync, handoff retrieval, and long-form repo memory | External operator workflow plus optional external CLI/index; advisory by default |
427
446
  | `mermaid` | Human-readable architecture and system-flow diagrams when Mermaid is not enough | Runtime-referenced skill, not vendored into generated repos |
428
- | `gbrain` | Knowledge sync, handoff retrieval, and long-form repo memory | Optional external CLI and index |
429
447
  | CodeGraph (`@colbymchenry/codegraph`) | Symbol-aware navigation, impact tracing, and readiness checks for this self-host repo | Dev dependency in this repo; generated repos stay global-MCP-first unless policy opts in |
430
- | Bun | Source checkout execution, tests, template assembly, and release checks | Required local runtime for maintainers |
431
- | `commander` | `repo-harness` CLI command parsing | Runtime npm dependency |
448
+ | OpenAI Codex | Primary execution agent for repo-local implementation, verification, and GitHub contributor attribution when a commit materially includes Codex-authored work | External agent runtime; attribution is an explicit commit trailer, not hidden hook automation |
449
+
450
+ ### GitHub Contributor Attribution
451
+
452
+ When Codex materially contributes to a commit, use GitHub's standard co-author
453
+ trailer format at the end of the commit message:
454
+
455
+ ```text
456
+ Co-authored-by: codex <codex@openai.com>
457
+ ```
458
+
459
+ Keep this opt-in and visible per commit. Do not bake it into downstream
460
+ repo-harness commit scripts or hooks unless that repo explicitly adopts the same
461
+ policy.
432
462
 
433
463
  ## Action Command Skills
434
464
 
@@ -436,7 +466,8 @@ Source-owned command facades live in `assets/skill-commands/`. They keep host
436
466
  skill discovery compatible while the CLI and hooks own execution:
437
467
 
438
468
  - Planning and review: `repo-harness-plan`, `repo-harness-review`, `repo-harness-autoplan`
439
- - Sprint program layer: `repo-harness-sprint` (PRD + ordered backlog in `tasks/sprints/`, executed task-by-task through the contract flow)
469
+ - Product planning layer: `repo-harness-prd` (upper-layer PRDs in `plans/prds/`, evidence-marked unknowns, sprint-consumable sections)
470
+ - Sprint program layer: `repo-harness-sprint` (ordered sprint backlogs in `plans/sprints/`, each row expanded with `$think` before the contract flow)
440
471
  - Repo workflow actions: `repo-harness-ship`, `repo-harness-init`, `repo-harness-migrate`, `repo-harness-upgrade`, `repo-harness-capability`, `repo-harness-architecture`, `repo-harness-handoff`, `repo-harness-deploy`, `repo-harness-repair`, `repo-harness-check`
441
472
  - Branch project creation command: `repo-harness-scaffold`
442
473
 
package/README.zh-CN.md CHANGED
@@ -23,21 +23,19 @@ repo-local workflow 的自托管样例。
23
23
  做渐进式上下文加载:一份小而稳定的 root context(约 12KB),加上只在改到对应文件时才加载的
24
24
  capability 块。agent 读一份 1KB 的 capability 合约或查索引,而不是花上千 token 重新摸清结构。
25
25
 
26
- ## 0.4.0 新特性
27
-
28
- - **Loop-engine 证据面。** `repo-harness-hook state-snapshot --json`、NL
29
- decision-table、route A/B eval cutover gate 让 prompt-routing 实验可度量;
30
- 在证据达标前,TypeScript classifier 仍是权威路径。
31
- - **Architecture queue gate。** `scripts/architecture-queue.sh`、
32
- `scripts/check-architecture-sync.sh` 和扩展后的 architecture event helper
33
- 取代已退休的 append-only drift 脚本,用派生 request index 检查 stale 架构状态。
34
- - **Contract delegation pilot。** Contract template 新增 `budget`、
35
- `permission_scope`、`roles`,`scripts/contract-run.ts` 可用显式
36
- worker/verifier child commands 按 contract exit criteria 执行试点。
37
- - **Heartbeat triage。** `scripts/heartbeat-triage.sh` 把定时 workflow checks
38
- sprint-next 信号和 architecture request 状态写入 repo-local triage inbox
39
- - **Workflow asset sync。** 新 helpers、docs、tests 和 generated-repo assets
40
- 保持 self-host runtime 与安装模板副本同步。
26
+ ## 0.4.2 新特性
27
+
28
+ - **PRD-to-Sprint planning hierarchy。** `repo-harness-prd` 负责
29
+ `plans/prds/` 下的上层产品需求,`repo-harness-sprint` 负责把 PRD 或明确
30
+ slice 推成 `plans/sprints/*.sprint.md` 下的有序执行 backlog。
31
+ - **Generated helper runtime isolation。** 下游安装把真实 helper 实现放到
32
+ `.ai/harness/scripts/`,root `scripts/*` 只保留 compatibility wrappers;
33
+ 自托管源码仓库继续以 root `scripts/` 作为 source runtime。
34
+ - **Subagent return-channel guard。** Managed hook routes 增加 return-channel
35
+ guard,要求 delegated runs 回到 parent session 汇报,避免绕过 file-backed
36
+ contract
37
+ - **Release path alignment。** PRD/Sprint eval fixtures、workflow checks
38
+ command guidance 现在都指向同一个 installed helper runtime
41
39
 
42
40
  ## 产品做什么
43
41
 
@@ -86,14 +84,14 @@ classifier/state-machine 层不再散落在 shell 条件分支里。
86
84
  下面这张图假设目标仓库已经安装 harness。它展示的是从 program sprint backlog
87
85
  到单个 contract task 的正常闭环:先选择或形成任务,再投射到执行文件,需要时
88
86
  checkout 隔离 worktree,在 hooks 保护下实现,然后验证、review、external acceptance,
89
- 必要时标记 sprint task 完成,最后 closeout。0.4.0 的 loop-system surface
87
+ 必要时标记 sprint task 完成,最后 closeout。0.4.x 的 loop-system surface
90
88
  新增 heartbeat 定时发现、state-snapshot/eval 证据、architecture queue freshness,
91
89
  以及可选的 contract-run 委派,但 source of truth 仍然是 repo 内文件合约。
92
90
 
93
91
  ```mermaid
94
92
  flowchart TD
95
93
  Program["Program goal 或 release theme"] --> Sprint{"需要 sprint layer?"}
96
- Sprint -->|是| SprintDoc["Sprint PRD + backlog<br/>tasks/sprints/*.sprint.md"]
94
+ Sprint -->|是| SprintDoc["Sprint PRD + backlog<br/>plans/prds/*.prd.md"]
97
95
  SprintDoc --> NextTask["选择下一个 sprint task<br/>sprint-backlog.sh next"]
98
96
  Sprint -->|否| UserTask["用户任务或 planning prompt"]
99
97
  Heartbeat["Heartbeat triage<br/>scripts/heartbeat-triage.sh<br/>.ai/harness/triage/"] --> UserTask
@@ -150,6 +148,22 @@ flowchart TD
150
148
  Cleanup --> Done["可审查的已完成任务"]
151
149
  ```
152
150
 
151
+ ## 长周期产品 Loop
152
+
153
+ Greenfield 和 Brownfield 工作先把 discovery 和工程计划前置在 Claude-Fable
154
+ 中完成,不要直接让 Codex 从原始聊天长期滚动:
155
+
156
+ 1. 在 Claude-Fable 里用 gstack `office-hours` 做产品 discovery,或用
157
+ `plan-eng-review` 做工程方案评审。输出应当是锁定产品意图、架构、风险和
158
+ evidence contract 的开发文档。
159
+ 2. 把这些文档转成 `plans/prds/` 下的 PRD Sprint,并为每个 execution
160
+ slice 写清有序 backlog 和详细 sub-plan。
161
+ 3. 创建 Codex Goal,目标指向该 sprint 文件。repo-harness 之后就可以按既有
162
+ plan -> contract -> worktree -> verification flow 逐项投射和执行。
163
+
164
+ 这个交接让长周期 loop 更精准:Claude-Fable 负责前置判断,PRD Sprint 是 durable
165
+ source of truth,Codex Goal mode 只围绕具体 sprint 恢复和推进,而不是反复重新解释原始聊天。
166
+
153
167
  ## 前 5 分钟
154
168
 
155
169
  这是评估一个真实仓库是否适合接入该 workflow 的最快路径。
@@ -177,10 +191,10 @@ npx -y repo-harness update
177
191
  repo-local verification surfaces。
178
192
 
179
193
  npm package 和 generated workflow stamp 现在共用 `0.4.x` release line。
180
- `repo-harness@0.4.0` 继续把首次全局引导(`repo-harness init`)
181
- 和 repo-local 刷新(`repo-harness update`)拆开,同时新增 loop-engine state
182
- snapshot、architecture queue gate、contract delegation pilotheartbeat triage
183
- helper,以及这些 workflow surfaces generated asset sync
194
+ `repo-harness@0.4.2` 继续把首次全局引导(`repo-harness init`)
195
+ 和 repo-local 刷新(`repo-harness update`)拆开,并在 `0.4.0` loop-engine
196
+ surfaces 之上加入 PRD-to-Sprint planning hierarchyisolated generated-project
197
+ helper runtime、subagent return-channel guard release-path alignment
184
198
  这些能力叠加在改名后的 CLI、user-level hook adapter bootstrap、AI-native scaffold overlays、
185
199
  typed prompt-guard decision engine、plan-stem task artifact 命名、`REPO_HARNESS_*`
186
200
  runtime aliases、Waza runtime skill sync,以及 maintainer 发布 npm 前使用的 release gate 之上。
@@ -319,8 +333,8 @@ hook block 工作时,先看 terminal 里的结构化输出。核心字段是
319
333
 
320
334
  ## 当前 Release
321
335
 
322
- - npm package:`repo-harness@0.4.0`
323
- - Generated workflow stamp:`repo-harness@0.4.0+template@0.4.0`
336
+ - npm package:`repo-harness@0.4.2`
337
+ - Generated workflow stamp:`repo-harness@0.4.2+template@0.4.2`
324
338
  - GitHub repository:`Ancienttwo/repo-harness`
325
339
  - Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
326
340
 
@@ -344,6 +358,30 @@ hook block 工作时,先看 terminal 里的结构化输出。核心字段是
344
358
  - `bash scripts/check-agent-tooling.sh --host both --check-updates`
345
359
  - 不自动设置 gstack、gbrain MCP、CodeGraph daemon 或 provider
346
360
 
361
+ ## 致谢
362
+
363
+ 感谢 [Hylarucoder](https://x.com/hylarucoder) 的方法论贡献。`repo-harness`
364
+ 里的 P1/P2/P3 due-diligence 方法,以及 Geju 实践对 planning、trace 和
365
+ decision rationale 的要求,来自他的贡献与启发。
366
+
367
+ 感谢 [TW93](https://x.com/HiTw93) 创作 Waza;`think`、`hunt`、`check`
368
+ 和 `health` 这些核心 skill 构成了 `repo-harness` 的日常 planning、bug hunt
369
+ 和 verification 节奏。
370
+
371
+ 感谢 [Garry Tan](https://x.com/garrytan) 创作 gstack 和 gbrain;它们影响了
372
+ product discovery、plan/design review、release 文档、knowledge sync 和
373
+ handoff retrieval 的工作流设计。
374
+
375
+ 感谢 OpenAI Codex 作为本仓库主要执行 agent 参与实现、验证和收口。Codex 对某个
376
+ commit 有实质贡献时,GitHub contributor 署名使用显式 trailer:
377
+
378
+ ```text
379
+ Co-authored-by: codex <codex@openai.com>
380
+ ```
381
+
382
+ 这条署名保持逐 commit 显式添加,不把它藏进下游 `repo-harness` commit 脚本或 hook
383
+ 里,除非目标仓库自己采用同样策略。
384
+
347
385
  ## Action Command Skills
348
386
 
349
387
  公共 command facades 在 `assets/skill-commands/`;它们保留 host skill discovery