repo-harness 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/AGENTS.md +3 -2
  2. package/CLAUDE.md +3 -2
  3. package/README.es.md +5 -6
  4. package/README.fr.md +5 -6
  5. package/README.ja.md +6 -6
  6. package/README.md +103 -77
  7. package/README.zh-CN.md +63 -44
  8. package/SKILL.md +40 -29
  9. package/assets/hooks/codex.hooks.template.json +9 -13
  10. package/assets/hooks/hook-input.sh +14 -2
  11. package/assets/hooks/lib/session-state.sh +4 -1
  12. package/assets/hooks/lib/workflow-state.sh +104 -15
  13. package/assets/hooks/post-bash.sh +6 -0
  14. package/assets/hooks/post-edit-guard.sh +52 -7
  15. package/assets/hooks/{context-pressure-hook.sh → post-tool-observer.sh} +100 -19
  16. package/assets/hooks/pre-edit-guard.sh +80 -0
  17. package/assets/hooks/prompt-guard.sh +374 -660
  18. package/assets/hooks/run-hook.sh +26 -26
  19. package/assets/hooks/session-start-context.sh +62 -4
  20. package/assets/hooks/settings.template.json +9 -13
  21. package/assets/initializer-question-pack.v4.json +81 -1
  22. package/assets/initializer-question-pack.v4.schema.json +36 -2
  23. package/assets/partials/04-project-structure.partial.md +10 -0
  24. package/assets/partials/05-workflow.partial.md +1 -1
  25. package/assets/partials/06-cloudflare.partial.md +10 -5
  26. package/assets/partials/07-footer.partial.md +1 -1
  27. package/assets/partials-agents/02-operating-mode.partial.md +2 -2
  28. package/assets/partials-agents/03-orchestration.partial.md +1 -1
  29. package/assets/partials-agents/04-task-protocol.partial.md +1 -1
  30. package/assets/partials-agents/07-cloudflare.partial.md +4 -5
  31. package/assets/partials-agents/08-deep-docs.partial.md +1 -1
  32. package/assets/plan-map.json +52 -7
  33. package/assets/project-structures/tanstack-start-workers.txt +51 -0
  34. package/assets/project-structures/vite-tanstack.txt +8 -1
  35. package/assets/reference-configs/agentic-development-flow.md +2 -1
  36. package/assets/reference-configs/development-protocol.md +2 -1
  37. package/assets/reference-configs/document-generation.md +1 -1
  38. package/assets/reference-configs/external-tooling.md +2 -2
  39. package/assets/reference-configs/harness-overview.md +2 -2
  40. package/assets/reference-configs/hook-operations.md +32 -48
  41. package/assets/reference-configs/release-deploy.md +20 -2
  42. package/assets/reference-configs/sprint-contracts.md +14 -0
  43. package/assets/skill-commands/manifest.json +7 -0
  44. package/assets/skill-commands/repo-harness-architecture/SKILL.md +6 -0
  45. package/assets/skill-commands/repo-harness-autoplan/SKILL.md +10 -0
  46. package/assets/skill-commands/repo-harness-capability/SKILL.md +6 -0
  47. package/assets/skill-commands/repo-harness-check/SKILL.md +18 -1
  48. package/assets/skill-commands/repo-harness-deploy/SKILL.md +6 -0
  49. package/assets/skill-commands/repo-harness-handoff/SKILL.md +6 -0
  50. package/assets/skill-commands/repo-harness-init/SKILL.md +6 -0
  51. package/assets/skill-commands/repo-harness-migrate/SKILL.md +11 -1
  52. package/assets/skill-commands/repo-harness-plan/SKILL.md +6 -0
  53. package/assets/skill-commands/repo-harness-repair/SKILL.md +6 -0
  54. package/assets/skill-commands/repo-harness-review/SKILL.md +6 -0
  55. package/assets/skill-commands/repo-harness-scaffold/SKILL.md +6 -0
  56. package/assets/skill-commands/repo-harness-ship/SKILL.md +10 -0
  57. package/assets/skill-commands/repo-harness-sprint/SKILL.md +39 -0
  58. package/assets/skill-commands/repo-harness-upgrade/SKILL.md +10 -0
  59. package/assets/skill-version.json +3 -5
  60. package/assets/templates/helpers/architecture-drift.sh +49 -2
  61. package/assets/templates/helpers/architecture-event.ts +19 -3
  62. package/assets/templates/helpers/archive-architecture-request.sh +29 -0
  63. package/assets/templates/helpers/archive-workflow.sh +49 -16
  64. package/assets/templates/helpers/capability-resolver.ts +1 -1
  65. package/assets/templates/helpers/capture-plan.sh +1 -1
  66. package/assets/templates/helpers/check-agent-tooling.sh +9 -2
  67. package/assets/templates/helpers/check-task-workflow.sh +171 -1
  68. package/assets/templates/helpers/codex-handoff-resume.sh +2 -4
  69. package/assets/templates/helpers/context-contract-sync.sh +23 -4
  70. package/assets/templates/helpers/contract-worktree.sh +46 -0
  71. package/assets/templates/helpers/ensure-task-workflow.sh +5 -2
  72. package/assets/templates/helpers/migrate-project-template.sh +0 -3
  73. package/assets/templates/helpers/migrate-workflow-docs.ts +4 -0
  74. package/assets/templates/helpers/plan-to-todo.sh +2 -2
  75. package/assets/templates/helpers/prepare-codex-handoff.sh +1 -1
  76. package/assets/templates/helpers/prepare-handoff.sh +6 -0
  77. package/assets/templates/helpers/refresh-current-status.sh +59 -1
  78. package/assets/templates/helpers/select-agent-context-blocks.sh +2 -2
  79. package/assets/templates/helpers/sprint-backlog.sh +815 -0
  80. package/assets/templates/helpers/sync-brain-docs.sh +74 -4
  81. package/assets/templates/helpers/workflow-contract.ts +0 -7
  82. package/assets/templates/sprint.template.md +66 -0
  83. package/assets/templates/tech-stack.template.md +14 -0
  84. package/assets/workflow-contract.v1.json +16 -0
  85. package/docs/reference-configs/agentic-development-flow.md +2 -1
  86. package/docs/reference-configs/development-protocol.md +2 -1
  87. package/docs/reference-configs/document-generation.md +1 -1
  88. package/docs/reference-configs/external-tooling.md +2 -2
  89. package/docs/reference-configs/harness-overview.md +2 -2
  90. package/docs/reference-configs/hook-operations.md +32 -48
  91. package/docs/reference-configs/release-deploy.md +20 -2
  92. package/docs/reference-configs/sprint-contracts.md +14 -0
  93. package/package.json +2 -2
  94. package/scripts/architecture-drift.sh +49 -2
  95. package/scripts/architecture-event.ts +19 -3
  96. package/scripts/archive-architecture-request.sh +29 -0
  97. package/scripts/archive-workflow.sh +49 -16
  98. package/scripts/assemble-template.ts +153 -6
  99. package/scripts/capability-resolver.ts +1 -1
  100. package/scripts/capture-plan.sh +1 -1
  101. package/scripts/check-agent-tooling.sh +9 -2
  102. package/scripts/check-npm-release.sh +3 -0
  103. package/scripts/check-task-workflow.sh +171 -1
  104. package/scripts/codex-handoff-resume.sh +2 -4
  105. package/scripts/context-contract-sync.sh +23 -4
  106. package/scripts/contract-worktree.sh +46 -0
  107. package/scripts/ensure-task-workflow.sh +5 -2
  108. package/scripts/hook-shim.sh +60 -4
  109. package/scripts/init-project.sh +1 -1
  110. package/scripts/initializer-question-pack.ts +26 -0
  111. package/scripts/lib/project-init-lib.sh +45 -33
  112. package/scripts/migrate-project-template.sh +1 -1
  113. package/scripts/migrate-workflow-docs.ts +4 -0
  114. package/scripts/plan-to-todo.sh +2 -2
  115. package/scripts/prepare-codex-handoff.sh +1 -1
  116. package/scripts/prepare-handoff.sh +6 -0
  117. package/scripts/refresh-current-status.sh +59 -1
  118. package/scripts/repo-harness.sh +155 -25
  119. package/scripts/run-skill-evals.ts +51 -0
  120. package/scripts/select-agent-context-blocks.sh +2 -2
  121. package/scripts/sprint-backlog.sh +815 -0
  122. package/scripts/sync-brain-docs.sh +74 -4
  123. package/scripts/sync-codex-installed-copies.sh +9 -64
  124. package/scripts/workflow-contract.ts +0 -7
  125. package/src/cli/commands/doctor.ts +52 -0
  126. package/src/cli/commands/hook.ts +2 -1
  127. package/src/cli/commands/prompt-guard-decision.ts +150 -0
  128. package/src/cli/commands/status.ts +1 -1
  129. package/src/cli/hook/prompt-intents.ts +534 -0
  130. package/src/cli/hook/route-registry.ts +1 -1
  131. package/src/cli/hook/runtime.ts +98 -6
  132. package/src/cli/hook-entry.ts +2 -2
  133. package/src/cli/index.ts +10 -12
  134. package/src/cli/installer/managed-entries.ts +2 -1
  135. package/assets/hooks/atomic-commit.sh +0 -78
  136. package/assets/hooks/atomic-pending.sh +0 -22
  137. package/assets/hooks/finalize-handoff.sh +0 -12
  138. package/assets/hooks/pre-code-change.sh +0 -33
  139. package/assets/hooks/tdd-guard-hook.sh +0 -78
  140. package/assets/hooks/trace-event.sh +0 -76
  141. package/scripts/check-versions.ts +0 -488
package/AGENTS.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # repo-harness AGENTS.md
2
2
 
3
- This repository self-hosts the `repo-harness` contract, formerly `repo-harness-skill` and `project-initializer`. Claude and Codex should follow the same repo-local workflow surface.
3
+ This repository self-hosts the `repo-harness` contract; the former `repo-harness-skill` and `project-initializer` names are retired and removed by installed-copy sync. Claude and Codex should follow the same repo-local workflow surface.
4
4
 
5
5
  ## Canonical Workflow Files
6
6
 
7
7
  - `tasks/current.md` for the tracked current-status snapshot derived from workflow artifacts
8
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)
9
10
  - `.ai/context/capabilities.json` for the capability registry and longest-prefix context boundaries
10
11
  - `tasks/workstreams/` for capability long-running workstreams that project durable progress into local contracts
11
12
  - `tasks/lessons.md` for correction-derived rules
@@ -22,7 +23,7 @@ This repository self-hosts the `repo-harness` contract, formerly `repo-harness-s
22
23
 
23
24
  - Sync `tasks/` whenever substantive repo changes are made.
24
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.
25
- - Treat `.ai/hooks/` as the shared repo-local hook implementation; user-level `~/.claude/settings.json` and `~/.codex/hooks.json` are the host adapters.
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.
26
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
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.
28
29
  - Keep architecture drift handling split: `architecture-drift.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.
package/CLAUDE.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # repo-harness AGENTS.md
2
2
 
3
- This repository self-hosts the `repo-harness` contract, formerly `repo-harness-skill` and `project-initializer`. Claude and Codex should follow the same repo-local workflow surface.
3
+ This repository self-hosts the `repo-harness` contract; the former `repo-harness-skill` and `project-initializer` names are retired and removed by installed-copy sync. Claude and Codex should follow the same repo-local workflow surface.
4
4
 
5
5
  ## Canonical Workflow Files
6
6
 
7
7
  - `tasks/current.md` for the tracked current-status snapshot derived from workflow artifacts
8
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)
9
10
  - `.ai/context/capabilities.json` for the capability registry and longest-prefix context boundaries
10
11
  - `tasks/workstreams/` for capability long-running workstreams that project durable progress into local contracts
11
12
  - `tasks/lessons.md` for correction-derived rules
@@ -22,7 +23,7 @@ This repository self-hosts the `repo-harness` contract, formerly `repo-harness-s
22
23
 
23
24
  - Sync `tasks/` whenever substantive repo changes are made.
24
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.
25
- - Treat `.ai/hooks/` as the shared repo-local hook implementation; user-level `~/.claude/settings.json` and `~/.codex/hooks.json` are the host adapters.
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.
26
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
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.
28
29
  - Keep architecture drift handling split: `architecture-drift.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.
package/README.es.md CHANGED
@@ -186,7 +186,7 @@ adoptar este workflow.
186
186
  npx -y repo-harness init
187
187
  ```
188
188
 
189
- La npm package release line es ahora `0.2.x`; el workflow compatibility model line
189
+ La npm package release line es ahora `0.3.x`; el workflow compatibility model line
190
190
  generado se rastrea por separado como `5.x`. `repo-harness init` es el bootstrap
191
191
  global y `repo-harness update` es el refresco repo-local. `repo-harness init`
192
192
  configura el CLI, los hook adapters de nivel usuario, Waza, Mermaid, el brain
@@ -204,14 +204,13 @@ bun src/cli/index.ts init
204
204
  Modelo de rutas locales:
205
205
 
206
206
  - Repositorio fuente: `~/Projects/repo-harness`
207
- - Claude skill aliases: `~/.claude/skills/repo-harness`, `~/.claude/skills/repo-harness-skill`
207
+ - Claude skill alias: `~/.claude/skills/repo-harness`
208
208
  - Codex discoverable skill alias: `~/.codex/skills/repo-harness`
209
- - Codex compatibility fallback alias: `~/.codex/skills/repo-harness-skill`
210
209
 
211
210
  `~/Projects/repo-harness` es la única source of truth editable. Las rutas locales
212
211
  de Claude/Codex son runtime entrypoints respaldados por symlinks. Los directorios
213
- del runtime `project-initializer` ya retirado los limpia
214
- `scripts/sync-codex-installed-copies.sh`.
212
+ de los runtimes ya retirados `repo-harness-skill` y `project-initializer` los
213
+ elimina `scripts/sync-codex-installed-copies.sh`.
215
214
 
216
215
  ### Prerrequisitos mínimos
217
216
 
@@ -326,7 +325,7 @@ Guards habituales:
326
325
 
327
326
  ## Release actual
328
327
 
329
- - npm package: `repo-harness@0.2.1`
328
+ - npm package: `repo-harness@0.3.0`
330
329
  - Generated workflow compatibility: `5.2.3`
331
330
  - GitHub repository: `Ancienttwo/repo-harness`
332
331
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
package/README.fr.md CHANGED
@@ -190,7 +190,7 @@ de ce workflow.
190
190
  npx -y repo-harness init
191
191
  ```
192
192
 
193
- La release line du package npm est désormais `0.2.x` ; la generated workflow
193
+ La release line du package npm est désormais `0.3.x` ; la generated workflow
194
194
  compatibility model line est suivie séparément en `5.x`. `repo-harness init`
195
195
  sert au bootstrap global et `repo-harness update` sert au rafraîchissement
196
196
  repo-local. `repo-harness init` configure le CLI, les hook adapters de niveau
@@ -208,14 +208,13 @@ bun src/cli/index.ts init
208
208
  Modèle de chemins locaux :
209
209
 
210
210
  - Dépôt source : `~/Projects/repo-harness`
211
- - Claude skill aliases : `~/.claude/skills/repo-harness`, `~/.claude/skills/repo-harness-skill`
211
+ - Claude skill alias : `~/.claude/skills/repo-harness`
212
212
  - Codex discoverable skill alias : `~/.codex/skills/repo-harness`
213
- - Codex compatibility fallback alias : `~/.codex/skills/repo-harness-skill`
214
213
 
215
214
  `~/Projects/repo-harness` est l'unique source of truth éditable. Les chemins
216
215
  Claude/Codex locaux sont des runtime entrypoints adossés à des symlinks. Les
217
- répertoires du runtime `project-initializer` retiré sont nettoyés par
218
- `scripts/sync-codex-installed-copies.sh`.
216
+ répertoires des runtimes retirés `repo-harness-skill` et `project-initializer`
217
+ sont supprimés par `scripts/sync-codex-installed-copies.sh`.
219
218
 
220
219
  ### Prérequis minimaux
221
220
 
@@ -330,7 +329,7 @@ Guards courants :
330
329
 
331
330
  ## Release actuelle
332
331
 
333
- - npm package : `repo-harness@0.2.1`
332
+ - npm package : `repo-harness@0.3.0`
334
333
  - Generated workflow compatibility : `5.2.3`
335
334
  - GitHub repository : `Ancienttwo/repo-harness`
336
335
  - Release history : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
package/README.ja.md CHANGED
@@ -159,7 +159,7 @@ flowchart TD
159
159
  npx -y repo-harness init
160
160
  ```
161
161
 
162
- npm package の release line は現在 `0.2.x` です。生成される workflow compatibility model line は
162
+ npm package の release line は現在 `0.3.x` です。生成される workflow compatibility model line は
163
163
  別途 `5.x` として追跡されます。`repo-harness init` は global bootstrap、`repo-harness update` は
164
164
  repo-local refresh です。`repo-harness init` は CLI、user-level hook adapters、Waza、Mermaid、
165
165
  brain root、CodeGraph MCP を設定し、退役した `scripts/setup-plugins.sh` の Claude plugin path は使いません。
@@ -175,13 +175,13 @@ bun src/cli/index.ts init
175
175
  ローカルパスのモデル:
176
176
 
177
177
  - ソースリポジトリ:`~/Projects/repo-harness`
178
- - Claude skill aliases:`~/.claude/skills/repo-harness`、`~/.claude/skills/repo-harness-skill`
178
+ - Claude skill alias:`~/.claude/skills/repo-harness`
179
179
  - Codex discoverable skill alias:`~/.codex/skills/repo-harness`
180
- - Codex compatibility fallback alias:`~/.codex/skills/repo-harness-skill`
181
180
 
182
181
  `~/Projects/repo-harness` が唯一の編集可能な source of truth です。ローカルの Claude/Codex パスは
183
- symlink に裏打ちされた runtime entrypoint です。退役した `project-initializer` runtime ディレクトリは
184
- `scripts/sync-codex-installed-copies.sh` によって整理されます。
182
+ symlink に裏打ちされた runtime entrypoint です。退役した `repo-harness-skill`
183
+ `project-initializer` の runtime ディレクトリは
184
+ `scripts/sync-codex-installed-copies.sh` によって削除されます。
185
185
 
186
186
  ### 最小の前提条件
187
187
 
@@ -293,7 +293,7 @@ hook がブロックしたときは、まず terminal の構造化された出
293
293
 
294
294
  ## 現在の Release
295
295
 
296
- - npm package:`repo-harness@0.2.1`
296
+ - npm package:`repo-harness@0.3.0`
297
297
  - Generated workflow compatibility:`5.2.3`
298
298
  - GitHub repository:`Ancienttwo/repo-harness`
299
299
  - Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
package/README.md CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  Repo-local agentic development harness CLI and skill runtime for Claude/Codex
8
8
  workflows. The npm package and primary command are now `repo-harness`.
9
- `repo-harness-skill` remains a compatibility alias, while `project-initializer`
10
- install paths are retired and removed by installed-copy sync.
9
+ The legacy `repo-harness-skill` and `project-initializer` install paths are
10
+ retired and removed by installed-copy sync.
11
11
  Repository: `https://github.com/Ancienttwo/repo-harness`
12
12
 
13
13
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [Français](README.fr.md) | [Español](README.es.md)
@@ -34,40 +34,28 @@ 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.2.3
38
-
39
- - **Safer global init defaults.** `repo-harness init` no longer calls the legacy
40
- Claude plugin setup script or any Superpowers marketplace installer path.
41
- - **Global init command (`repo-harness init`).** One command installs the
42
- `repo-harness` CLI globally, refreshes repo-harness skill aliases, installs
43
- user-level Codex/Claude hook adapters, configures Waza
44
- (`think`, `hunt`, `check`, `health`) plus Mermaid, persists the brain root, and
45
- configures CodeGraph MCP.
46
- Run `npx -y repo-harness init`; no source checkout is required.
47
- - **Repo refresh command (`repo-harness update`).** Existing-repo install and
48
- refresh now has its own command surface, preserving the previous repo-local
49
- harness migration path while keeping `init` focused on global runtime setup.
50
- - **CodeGraph index self-heal.** When the prompt hook detects structural
51
- code-navigation intent and the repo has no `.codegraph` index, it initializes
52
- the index with the local or PATH-visible CodeGraph binary before emitting the
53
- route hint. This remains advisory: no dependency install, no heavy readiness
54
- probe, and no prompt block if CodeGraph is unavailable.
55
- - **Security sentinel (`repo-harness security scan` + `security-sentinel.sh`).** A
56
- read-only check over high-value config injection surfaces (`~/.claude/settings.json`,
57
- `~/.codex/hooks.json`, repo-local `.vscode/tasks.json`, and legacy project-level
58
- `.claude`/`.codex` adapters). It flags suspicious command patterns remote-shell
59
- pipes, base64-decode-to-exec, `osascript`, `launchctl`/`crontab` persistence, netcat,
60
- inline interpreter exec — plus unmanaged hooks and auto-run `folderOpen` tasks, and it
61
- never mutates config. The `SessionStart` sentinel fingerprints the set and re-scans
62
- only when a fingerprint changes, so there is no session-start noise. Audit on demand:
63
- `repo-harness security scan --json`.
64
- - **Claude/Codex draft-plan lifecycle.** Plan mode is explicitly two-stage: Draft vs
65
- Approved. Hooks detect plan-creation intent and track pending orchestration; a stop gate
66
- (`stop-orchestrator.sh`) requires one self-review pass before a session ends mid-plan.
67
- Capture a draft with `scripts/capture-plan.sh --slug <slug> --title <title> --status
68
- Draft`, then promote to Approved and project into execution with `--execute` or
69
- `scripts/plan-to-todo.sh --plan <plan>`. Plans become the file-backed source of truth in
70
- `plans/`.
37
+ ## What's New in 0.3.0
38
+
39
+ - **Sprint program layer.** `repo-harness-sprint`, `tasks/sprints/`, sprint
40
+ templates, active sprint markers, and `scripts/sprint-backlog.sh` now capture
41
+ program-level PRDs and ordered backlogs without turning `tasks/todo.md` into
42
+ an active execution checklist.
43
+ - **Central-first hook runtime.** User-level Claude/Codex adapters dispatch into
44
+ `repo-harness-hook`; central packaged hooks are the default runtime, while
45
+ this self-host repo can still pin `"hook_source": "repo"` for live hook
46
+ development.
47
+ - **Prompt decisions moved to TypeScript.** Prompt-text intent classification is
48
+ Unicode-aware in `src/cli/hook/prompt-intents.ts`, the shell hook receives one
49
+ verdict JSON line, and prompt-layer plan/spec/contract gates are advisory.
50
+ - **Edit-layer enforcement.** Implementation writes are enforced at
51
+ `pre-edit-guard.sh`, where the guard can key off path, active plan state, and
52
+ repo files instead of natural-language guesses.
53
+ - **Cheaper always-on hooks.** `trace-event.sh` and `context-pressure-hook.sh`
54
+ are merged into `post-tool-observer.sh`: one dispatch, one stdin parse, one
55
+ trace file, and sampled context-budget probes.
56
+ - **Legacy surface cleanup.** The retired `repo-harness-skill`,
57
+ `project-initializer`, `PROJECT_INITIALIZER_*` fallbacks, duplicate shell
58
+ classifier table, orphan version checker, and split observer hooks are gone.
71
59
 
72
60
  ## What repo-harness Does
73
61
 
@@ -97,19 +85,28 @@ The design has three layers:
97
85
  `.ai/harness/`, helper scripts, and `.ai/hooks/`.
98
86
  3. **Host adapters**: user-level `~/.claude/settings.json` and
99
87
  `~/.codex/hooks.json` route Claude/Codex events into `repo-harness-hook`.
100
- The hook entrypoint exits silently for non-opt-in repos and dispatches into
101
- the current repo's `.ai/hooks/*` scripts only when
102
- `.ai/harness/workflow-contract.json` exists.
88
+ The hook entrypoint exits silently for non-opt-in repos. For opted-in repos,
89
+ it resolves hooks central-first through the packaged install or
90
+ `~/.repo-harness/hooks/`, with repo policy able to pin self-host development
91
+ back to `.ai/hooks/*`.
103
92
 
104
93
  For `UserPromptSubmit`, the public adapter contract stays
105
94
  `repo-harness-hook UserPromptSubmit --route default`. The CLI route registry
106
95
  dispatches that route to `.ai/hooks/prompt-guard.sh`. The shell hook remains the
107
96
  repo-local adapter for host JSON parsing, workflow file reads, capture side
108
- effects, quality gate rendering, and host-safe stdout/stderr. The prompt intent
109
- and workflow-state decision is handled by the TypeScript decision engine behind
110
- `repo-harness-hook prompt-guard-decide`, which returns one action enum from an
111
- explicit decision table. That split keeps host configuration stable while moving
112
- the brittle classifier/state-machine layer out of shell conditionals.
97
+ effects, and host-safe stdout/stderr. It pipes the prompt text into
98
+ `repo-harness-hook prompt-guard-decide`, where every prompt-text intent
99
+ classifier (Unicode-aware, `src/cli/hook/prompt-intents.ts`) and the
100
+ `intent x plan state` decision table live; the engine returns one verdict JSON
101
+ line with the action, the classified intent facts, and derived strings. The
102
+ shell keeps no duplicate classifier or fallback decision table — when the
103
+ engine is unreachable the prompt layer degrades to a one-shot advisory.
104
+
105
+ Prompt-layer plan/spec/contract gates are advisory routing. Hard enforcement
106
+ lives at the edit boundary: `pre-edit-guard.sh` blocks implementation edits
107
+ unless the active plan is Approved/Executing (policy
108
+ `.guards.edit_plan_gate`: enforce | advice | off). Done-claim gates keep
109
+ blocking because they verify file-backed completion evidence, not language.
113
110
 
114
111
  The core invariant is that durable truth lives in the repo, not in a chat
115
112
  thread. Hooks are accelerators and guardrails; the authority remains the
@@ -118,13 +115,20 @@ file-backed plan, contract, review, checks, and handoff artifacts.
118
115
  ## Task Workflow: Plan to Closeout
119
116
 
120
117
  The diagram below assumes the harness is already installed in the repo. It shows
121
- the normal task lifecycle: plan, project into a sprint contract, check out the
118
+ the normal lifecycle from a program sprint backlog down to one contract task:
119
+ draft or select the task, project it into execution files, check out the
122
120
  contract worktree when policy requires it, implement under hooks, verify, review,
123
- and close out.
121
+ complete the sprint task when applicable, and close out.
124
122
 
125
123
  ```mermaid
126
124
  flowchart TD
127
- UserTask["User task or planning prompt"] --> Discovery["Due diligence<br/>P1 map, P2 trace, P3 decision"]
125
+ Program["Program goal or release theme"] --> Sprint{"Sprint layer needed?"}
126
+ Sprint -->|yes| SprintDoc["Sprint PRD + backlog<br/>tasks/sprints/*.sprint.md"]
127
+ SprintDoc --> NextTask["Select next sprint task<br/>sprint-backlog.sh next"]
128
+ Sprint -->|no| UserTask["User task or planning prompt"]
129
+ NextTask --> UserTask
130
+
131
+ UserTask --> Discovery["Due diligence<br/>P1 map, P2 trace, P3 decision"]
128
132
  Discovery --> PlanDraft["Draft plan<br/>plans/plan-*.md"]
129
133
  PlanDraft --> PlanReview{"Plan ready for execution?"}
130
134
  PlanReview -->|no| Refine["Refine plan, scope, evidence contract"]
@@ -133,6 +137,7 @@ flowchart TD
133
137
 
134
138
  Approve --> Project["Project plan into execution<br/>capture-plan.sh --execute<br/>or plan-to-todo.sh --plan"]
135
139
  Project --> Active["Active markers<br/>.ai/harness/active-plan<br/>.ai/harness/active-worktree"]
140
+ Project --> SprintActive["Sprint projection<br/>active-sprint marker<br/>tasks/current.md"]
136
141
  Project --> Contract["Sprint contract<br/>tasks/contracts/YYYYMMDD-HHMM-task-slug.contract.md"]
137
142
  Project --> ReviewFile["Review file<br/>tasks/reviews/YYYYMMDD-HHMM-task-slug.review.md"]
138
143
  Project --> Notes["Task notes<br/>tasks/notes/YYYYMMDD-HHMM-task-slug.notes.md"]
@@ -156,7 +161,10 @@ flowchart TD
156
161
  External --> DoneGate{"Contract, checks, review, and acceptance pass?"}
157
162
  DoneGate -->|no| Repair["Repair failing evidence or implementation"]
158
163
  Repair --> Implement
159
- DoneGate -->|yes| Closeout["Closeout<br/>scripts/contract-worktree.sh finish"]
164
+ DoneGate -->|yes| SprintComplete{"Sprint task active?"}
165
+ SprintComplete -->|yes| MarkSprint["Mark backlog item complete<br/>sprint-backlog.sh complete-task"]
166
+ SprintComplete -->|no| Closeout["Closeout<br/>scripts/contract-worktree.sh finish"]
167
+ MarkSprint --> Closeout
160
168
 
161
169
  Closeout --> Commit["Commit contract branch"]
162
170
  Commit --> Merge["Fast-forward target branch"]
@@ -193,14 +201,13 @@ npx -y repo-harness update
193
201
  repository to install or refresh workflow files, hook assets, host adapters,
194
202
  skill aliases, and repo-local verification surfaces from the current npm package.
195
203
 
196
- The npm package release line is now `0.2.x`; generated workflow compatibility is
197
- tracked separately as the `5.x` model line. The `0.2.3` package splits first-run
198
- global bootstrap (`repo-harness init`) from repo-local refresh
199
- (`repo-harness update`), replaces the legacy global plugin installer path with
200
- typed CLI/hook/dependency bootstrap, keeps the read-only config security sentinel
201
- (`repo-harness security scan`), the explicit Claude/Codex draft-plan lifecycle,
202
- and adds non-blocking CodeGraph index initialization for structural prompt
203
- routing.
204
+ The npm package release line is now `0.3.x`; generated workflow compatibility is
205
+ tracked separately as the `5.x` model line. The `0.3.0` package keeps first-run
206
+ global bootstrap (`repo-harness init`) separate from repo-local refresh
207
+ (`repo-harness update`), adds the sprint program layer, moves hook execution to
208
+ central-first runtime resolution, moves prompt decisions into TypeScript,
209
+ enforces implementation writes at the edit boundary, and merges always-on hook
210
+ observers into one cheaper path.
204
211
  These sit on top of the renamed `repo-harness` CLI, user-level hook
205
212
  adapter bootstrap, AI-native scaffold overlays, the typed prompt-guard decision
206
213
  engine, plan-stem task artifact naming, `REPO_HARNESS_*` runtime aliases, Waza
@@ -217,16 +224,14 @@ bun src/cli/index.ts update
217
224
  Local path model:
218
225
 
219
226
  - Source repo: `~/Projects/repo-harness`
220
- - Claude skill aliases: `~/.claude/skills/repo-harness`, `~/.claude/skills/repo-harness-skill`
227
+ - Claude skill alias: `~/.claude/skills/repo-harness`
221
228
  - Codex discoverable skill alias: `~/.codex/skills/repo-harness`
222
- - Codex compatibility fallback alias: `~/.codex/skills/repo-harness-skill`
223
229
 
224
230
  The `~/Projects/repo-harness` repo is the only editable source of truth. Local
225
231
  Claude/Codex paths are symlink-backed runtime entrypoints. Only
226
232
  `~/.codex/skills/repo-harness` should expose `SKILL.md` and
227
- `assets/skill-commands/`; compatibility directories exist only so renamed
228
- repos can still resolve upstream assets without duplicate command discovery.
229
- The retired `project-initializer` directories under `~/.codex/skills` and
233
+ `assets/skill-commands/`. The retired `repo-harness-skill` and
234
+ `project-initializer` directories under `~/.codex/skills` and
230
235
  `~/.claude/skills` are deleted by `scripts/sync-codex-installed-copies.sh`.
231
236
 
232
237
  ### Minimum prerequisites
@@ -284,16 +289,29 @@ before applying anything.
284
289
  - Repo-local `.claude/settings.json` and `.codex/hooks.json` hook adapters are legacy project-level config and should be retired during migration.
285
290
  - Codex must mark `~/.codex/hooks.json` as trusted in Codex Settings before those hooks run.
286
291
  - Debug in this order: user-level adapter config -> `repo-harness-hook` (or fallback `repo-harness hook`) -> route registry -> `.ai/hooks/*`.
292
+ - If `repo-harness-hook` reports `.ai/hooks` drift, refresh the repo-local copy with `repo-harness update --repo <root>`.
287
293
 
288
- `SessionStart` runs two ordered scripts before work begins:
294
+ `SessionStart` resolves hooks central-first, then runs two ordered scripts before
295
+ work begins:
289
296
 
290
297
  ```mermaid
291
298
  flowchart LR
292
- SessionStart["Claude/Codex SessionStart"] --> Ctx["session-start-context.sh<br/>resume + handoff context"]
299
+ SessionStart["Claude/Codex SessionStart"] --> Adapter["user-level adapter"]
300
+ Adapter --> Entry["repo-harness-hook SessionStart --route default"]
301
+ Entry --> Source{"hook source"}
302
+ Source -->|central default| Central["packaged hooks<br/>or ~/.repo-harness/hooks"]
303
+ Source -->|repo policy pin| Repo["repo .ai/hooks<br/>self-host development"]
304
+ Central --> Ctx["session-start-context.sh<br/>resume + sprint + handoff context"]
305
+ Repo --> Ctx
293
306
  Ctx --> Sec["security-sentinel.sh<br/>read-only config scan, fingerprint-gated"]
294
307
  Sec --> SSOut["SessionStart additionalContext<br/>prior-session state + SecurityConfig findings"]
295
308
  ```
296
309
 
310
+ `SessionStart` and `Stop` hooks are advisory for missing repo-local scripts: stale
311
+ repos get a drift warning instead of a startup failure. Required guard routes,
312
+ including edit and prompt gates, still fail closed when their scripts are
313
+ missing.
314
+
297
315
  Prompt guard has one extra internal step:
298
316
 
299
317
  ```mermaid
@@ -302,15 +320,15 @@ flowchart LR
302
320
  Adapter --> CLI["repo-harness-hook UserPromptSubmit --route default"]
303
321
  CLI --> Route["route registry"]
304
322
  Route --> Shell[".ai/hooks/prompt-guard.sh"]
305
- Shell --> Decision["repo-harness-hook prompt-guard-decide<br/>TypeScript decision table"]
306
- Decision --> Action["single action enum"]
307
- Action --> Shell
323
+ Shell -->|"stdin {prompt}"| Decision["repo-harness-hook prompt-guard-decide<br/>TypeScript classifiers + decision table"]
324
+ Decision -->|"verdict JSON<br/>action + intent facts + derived"| Shell
308
325
  Shell --> RouteHint["Waza route hint<br/>explicit think/planning matched first → /think"]
309
- Shell --> HostOutput["host-safe allow, advice, block, or done gate output"]
326
+ Shell --> HostOutput["host-safe advice, done gate, or capture output"]
310
327
  ```
311
328
 
312
- The shell layer still owns filesystem authority and side effects. TypeScript owns
313
- only the classifier plus `intent x plan state` decision table.
329
+ The shell layer owns filesystem authority and side effects. TypeScript owns all
330
+ prompt-text classification plus the `intent x plan state` decision table.
331
+ Plan-state blocks render at the PreToolUse edit layer, not here.
314
332
 
315
333
  ## Hook Failure Playbook
316
334
 
@@ -323,7 +341,7 @@ fields are `guard`, `reason`, `fix`, `failure_class`, and `run_id`.
323
341
 
324
342
  Most common guards:
325
343
 
326
- - `PlanStatusGuard`: no active plan, or the plan is not ready to execute
344
+ - `PlanStatusGuard` (edit layer): an implementation edit was attempted with no active plan, or the plan is not ready to execute; the prompt layer emits the same guard name as advisory guidance
327
345
  - `ContractGuard`: approved execution has not yet produced the contract/review/notes scaffold
328
346
  - `ContractGuard`: completion was claimed before the task contract passed
329
347
  - `WorktreeGuard`: writes were attempted in the primary worktree while linked worktrees are enforced
@@ -340,7 +358,7 @@ Most common guards:
340
358
 
341
359
  ## Current Release
342
360
 
343
- - npm package: `repo-harness@0.2.3`
361
+ - npm package: `repo-harness@0.3.0`
344
362
  - Generated workflow compatibility: `5.2.3`
345
363
  - GitHub repository: `Ancienttwo/repo-harness`
346
364
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
@@ -412,6 +430,7 @@ Source-owned command facades live in `assets/skill-commands/`. They keep host
412
430
  skill discovery compatible while the CLI and hooks own execution:
413
431
 
414
432
  - Planning and review: `repo-harness-plan`, `repo-harness-review`, `repo-harness-autoplan`
433
+ - Sprint program layer: `repo-harness-sprint` (PRD + ordered backlog in `tasks/sprints/`, executed task-by-task through the contract flow)
415
434
  - 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`
416
435
  - Branch project creation command: `repo-harness-scaffold`
417
436
 
@@ -428,6 +447,12 @@ UI runtime, Bun/Hono gateway, shared contracts, observability, and MCP/HTTP
428
447
  sidecar rules without installing model providers or making Python, Go, Rust, or
429
448
  A2UI mandatory defaults.
430
449
 
450
+ Webapp rendering is a separate overlay. Client-only Vite remains Plan B, while
451
+ React webapps that need public SEO/SSR plus an authenticated workspace should
452
+ use Plan C: one TanStack Start + Vite app deployed as a Cloudflare Worker under
453
+ `apps/web`, with `/` SSR/prerender-capable and `/app` client-only. The scaffold
454
+ does not default to separate `apps/marketing` and `apps/web` frontend deploys.
455
+
431
456
  Use `repo-harness-capability` when the harness already exists and only selected
432
457
  capability boundaries should be added. It updates `.ai/context/capabilities.json`,
433
458
  syncs the requested local `AGENTS.md` / `CLAUDE.md` contract files, and validates
@@ -439,11 +464,9 @@ passes. These commands call existing repo-local helpers and keep their scope
439
464
  narrow instead of refreshing the full harness.
440
465
 
441
466
  Codex installed-copy rule: only `~/.codex/skills/repo-harness` exposes the root
442
- skill and `repo-harness-*` command facades. The compatibility directory
443
- `~/.codex/skills/repo-harness-skill` is a runtime fallback bundle only; it must
444
- not contain `SKILL.md` files or `assets/skill-commands/`. The retired
445
- `~/.codex/skills/project-initializer` and `~/.claude/skills/project-initializer`
446
- directories are removed during sync.
467
+ skill and `repo-harness-*` command facades. The retired `repo-harness-skill`
468
+ and `project-initializer` directories under `~/.codex/skills` and
469
+ `~/.claude/skills` are removed during sync.
447
470
 
448
471
  After cloning or moving this source repo, rebuild the local runtime aliases with:
449
472
 
@@ -480,6 +503,9 @@ bun scripts/assemble-template.ts --target agents --plan C --name "MyProject"
480
503
  bun run benchmark:skills --dry-run
481
504
  ```
482
505
 
506
+ Dry-run benchmark output is a wiring smoke only. Release or readiness evidence
507
+ needs a non-dry-run eval with grader output.
508
+
483
509
  ### Run one eval across both Claude and Codex
484
510
 
485
511
  ```bash
@@ -534,5 +560,5 @@ bash scripts/check-task-workflow.sh --strict
534
560
  bun scripts/inspect-project-state.ts --repo . --format text
535
561
  bash scripts/migrate-project-template.sh --repo . --dry-run
536
562
  bash scripts/check-agent-tooling.sh --host both --check-updates
537
- bun run benchmark:skills --dry-run
563
+ bun run benchmark:skills --eval route-workflow-check
538
564
  ```