@haposoft/cafekit 0.16.0-rc.7 → 0.16.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 (299) hide show
  1. package/README.md +116 -27
  2. package/bin/__tests__/codex-hooks-ownership.test.js +239 -0
  3. package/bin/__tests__/codex-hooks.test.js +295 -0
  4. package/bin/__tests__/codex-native.test.js +2289 -34
  5. package/bin/__tests__/develop-contract.test.js +400 -23
  6. package/bin/__tests__/installer-safety.test.js +3 -3
  7. package/bin/__tests__/optional-skill-inventory.test.js +249 -0
  8. package/bin/__tests__/output-styles.test.js +214 -0
  9. package/bin/__tests__/package-inventory.test.js +2131 -16
  10. package/bin/__tests__/runtime-schema.test.js +111 -0
  11. package/bin/__tests__/secret-output-guardrail.test.js +122 -0
  12. package/bin/__tests__/skill-routing-source.test.js +172 -0
  13. package/bin/__tests__/specs-v2-execution-closeout.test.js +1 -1
  14. package/bin/install.js +10 -0
  15. package/bin/lib/codex-install.js +170 -5
  16. package/bin/lib/context.js +14 -0
  17. package/bin/lib/i18n.js +12 -6
  18. package/bin/lib/skill-deps.js +5 -5
  19. package/bin/phases/claude-runtime.js +23 -0
  20. package/bin/phases/claude-settings.js +8 -0
  21. package/bin/phases/codex-hooks.js +156 -0
  22. package/bin/phases/codex-runtime.js +29 -38
  23. package/bin/phases/copy-payload.js +8 -2
  24. package/bin/phases/select-skill-bundles.js +96 -0
  25. package/bin/phases/skill-inventory.js +71 -0
  26. package/bin/phases/skills-setup.js +9 -2
  27. package/bin/phases/write-metadata.js +8 -5
  28. package/package.json +8 -2
  29. package/src/claude/CLAUDE.md +3 -3
  30. package/src/claude/agents/brainstormer.md +52 -69
  31. package/src/claude/agents/code-auditor.md +32 -14
  32. package/src/claude/agents/debugger.md +35 -20
  33. package/src/claude/agents/deployer.md +12 -5
  34. package/src/claude/agents/docs-keeper.md +11 -1
  35. package/src/claude/agents/implementer.md +25 -13
  36. package/src/claude/agents/inspector.md +6 -3
  37. package/src/claude/agents/project-manager.md +1 -1
  38. package/src/claude/agents/researcher.md +26 -55
  39. package/src/claude/agents/spec-maker.md +24 -13
  40. package/src/claude/agents/strategist.md +52 -0
  41. package/src/claude/agents/test-runner.md +117 -132
  42. package/src/claude/agents/ui-ux-designer.md +1 -1
  43. package/src/claude/hooks/__tests__/fixtures/statusline-default.golden +1 -0
  44. package/src/claude/hooks/__tests__/precompact.test.js +158 -0
  45. package/src/claude/hooks/__tests__/spec-gate.test.js +87 -4
  46. package/src/claude/hooks/__tests__/state.test.js +254 -3
  47. package/src/claude/hooks/__tests__/statusline.test.js +196 -0
  48. package/src/claude/hooks/agent.cjs +1 -1
  49. package/src/claude/hooks/docs-sync.cjs +12 -10
  50. package/src/claude/hooks/inspect-block.cjs +1 -1
  51. package/src/claude/hooks/lib/config.cjs +3 -0
  52. package/src/claude/hooks/lib/hook-state-dir.cjs +39 -0
  53. package/src/claude/hooks/lib/secret-keywords.cjs +42 -0
  54. package/src/claude/hooks/precompact.cjs +105 -0
  55. package/src/claude/hooks/rules.cjs +1 -1
  56. package/src/claude/hooks/secret-output-guardrail.cjs +43 -0
  57. package/src/claude/hooks/session.cjs +27 -1
  58. package/src/claude/hooks/spec-gate.cjs +3 -3
  59. package/src/claude/hooks/spec-state.cjs +32 -5
  60. package/src/claude/hooks/state.cjs +1 -1
  61. package/src/claude/hooks/task-scaffold-guard.cjs +1 -1
  62. package/src/claude/hooks/usage.cjs +1 -1
  63. package/src/claude/migration-manifest.json +29 -15
  64. package/src/claude/output-styles/coding-level-0-eli5.md +103 -0
  65. package/src/claude/output-styles/coding-level-1-junior.md +124 -0
  66. package/src/claude/output-styles/coding-level-2-mid.md +146 -0
  67. package/src/claude/output-styles/coding-level-3-senior.md +148 -0
  68. package/src/claude/output-styles/coding-level-4-lead.md +159 -0
  69. package/src/claude/output-styles/coding-level-5-god.md +91 -0
  70. package/src/claude/references/debugger/core-philosophy.md +5 -3
  71. package/src/claude/references/debugger/frontend-verification.md +2 -2
  72. package/src/claude/references/debugger/log-ci-analysis.md +13 -1
  73. package/src/claude/references/debugger/parallel-agent-hydration.md +19 -34
  74. package/src/claude/references/debugger/performance-diagnostics.md +2 -2
  75. package/src/claude/references/debugger/root-cause-tracing.md +37 -6
  76. package/src/claude/references/debugger/side-effect-gate.md +3 -1
  77. package/src/claude/references/debugger/verification-protocol.md +13 -12
  78. package/src/claude/rules/orchestrator.md +7 -1
  79. package/src/claude/rules/process-management.md +39 -0
  80. package/src/claude/rules/review-audit-self-decision.md +48 -0
  81. package/src/claude/rules/skill-domain-routing.md +26 -24
  82. package/src/claude/rules/skill-workflow-routing.md +22 -14
  83. package/src/claude/rules/workflow.md +3 -3
  84. package/src/claude/runtime.json +1 -0
  85. package/src/claude/runtime.schema.json +205 -0
  86. package/src/claude/scripts/generate-skill-catalog.cjs +156 -122
  87. package/src/claude/scripts/provenance.cjs +18 -5
  88. package/src/claude/scripts/spec-receipt.cjs +76 -21
  89. package/src/claude/scripts/spec-resolver.cjs +144 -4
  90. package/src/claude/scripts/workflow-policy.cjs +1 -1
  91. package/src/claude/settings/settings.json +16 -0
  92. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  93. package/src/claude/skills/ai-multimodal/SKILL.md +1 -1
  94. package/src/claude/skills/brainstorm/SKILL.md +193 -172
  95. package/src/claude/skills/brainstorm/references/question-framework.md +105 -167
  96. package/src/claude/skills/chrome-devtools/SKILL.md +1 -1
  97. package/src/claude/skills/code-review/SKILL.md +43 -25
  98. package/src/claude/skills/code-review/references/spec-compliance-review.md +3 -4
  99. package/src/claude/skills/code-review/references/verification-gate.md +1 -1
  100. package/src/claude/skills/debug/SKILL.md +48 -19
  101. package/src/claude/skills/delegate/SKILL.md +1 -1
  102. package/src/claude/skills/develop/SKILL.md +92 -65
  103. package/src/claude/skills/develop/references/parallel-waves.md +36 -63
  104. package/src/claude/skills/develop/references/quality-gate.md +31 -4
  105. package/src/claude/skills/develop/references/subagent-patterns.md +21 -7
  106. package/src/claude/skills/docs/SKILL.md +42 -23
  107. package/src/claude/skills/docs/references/init-workflow.md +4 -4
  108. package/src/claude/skills/docs/references/reconstruct-workflow.md +6 -6
  109. package/src/claude/skills/docs/references/standard-docs-workflow.md +6 -2
  110. package/src/claude/skills/docs/references/summarize-workflow.md +2 -2
  111. package/src/claude/skills/docs/references/update-workflow.md +9 -7
  112. package/src/claude/skills/docs/templates/requirements-as-is.md +1 -1
  113. package/src/claude/skills/docx/SKILL.md +1 -1
  114. package/src/claude/skills/git/SKILL.md +1 -1
  115. package/src/claude/skills/git/references/commit-protocols.md +1 -1
  116. package/src/claude/skills/git/references/finish-branch.md +1 -1
  117. package/src/claude/skills/hotfix/SKILL.md +159 -170
  118. package/src/claude/skills/hotfix/references/diagnosis-protocol.md +14 -9
  119. package/src/claude/skills/hotfix/references/parallel-patterns.md +27 -13
  120. package/src/claude/skills/hotfix/references/prevention-gate.md +5 -0
  121. package/src/claude/skills/hotfix/references/review-cycle.md +21 -15
  122. package/src/claude/skills/hotfix/references/workflow-specialized.md +53 -21
  123. package/src/claude/skills/inspect/SKILL.md +55 -46
  124. package/src/claude/skills/inspect/references/internal-inspection.md +21 -5
  125. package/src/claude/skills/loop/SKILL.md +114 -0
  126. package/src/claude/skills/loop/references/bounded-loop-protocol.md +104 -0
  127. package/src/claude/skills/loop/references/metric-and-guard-contract.md +76 -0
  128. package/src/claude/skills/pdf/SKILL.md +1 -1
  129. package/src/claude/skills/pptx/SKILL.md +1 -1
  130. package/src/claude/skills/question/SKILL.md +16 -13
  131. package/src/claude/skills/research/SKILL.md +70 -43
  132. package/src/claude/skills/route/SKILL.md +94 -0
  133. package/src/claude/skills/route/references/agent-timing.md +46 -0
  134. package/src/claude/skills/route/references/chaining-patterns.md +53 -0
  135. package/src/claude/skills/route/references/task-taxonomy.md +48 -0
  136. package/src/claude/skills/specs/SKILL.md +48 -57
  137. package/src/claude/skills/specs/references/review.md +26 -8
  138. package/src/claude/skills/specs/references/templates.md +76 -31
  139. package/src/claude/skills/specs/templates/requirements-init.md +1 -1
  140. package/src/claude/skills/specs/templates/research.md +2 -2
  141. package/src/claude/skills/sync/SKILL.md +6 -6
  142. package/src/claude/skills/sync/references/sync-protocols.md +1 -1
  143. package/src/claude/skills/test/SKILL.md +120 -120
  144. package/src/claude/skills/test/references/execution-strategy.md +208 -361
  145. package/src/claude/skills/test/references/failure-triage.md +55 -121
  146. package/src/claude/skills/test/references/test-memory.md +20 -34
  147. package/src/claude/skills/ui-ux-pro-max/SKILL.md +1 -1
  148. package/src/claude/skills/web-testing/SKILL.md +1 -1
  149. package/src/claude/skills/xlsx/SKILL.md +1 -1
  150. package/src/claude/status.cjs +135 -33
  151. package/src/codex/AGENTS.md +14 -4
  152. package/src/codex/hooks/docs-sync.cjs +8 -3
  153. package/src/codex/hooks/lib/hook-context.cjs +18 -4
  154. package/src/codex/hooks/rules.cjs +29 -1
  155. package/src/codex/hooks/secret-output-guardrail.cjs +30 -0
  156. package/src/codex/hooks/spec-gate.cjs +3 -8
  157. package/src/codex/hooks/spec-state.cjs +34 -5
  158. package/src/codex/hooks.json +5 -0
  159. package/src/codex/runtime.json +2 -0
  160. package/src/common/.env.example +1 -1
  161. package/src/claude/skills/backend-development/SKILL.md +0 -101
  162. package/src/claude/skills/backend-development/references/backend-api-design.md +0 -495
  163. package/src/claude/skills/backend-development/references/backend-architecture.md +0 -454
  164. package/src/claude/skills/backend-development/references/backend-authentication.md +0 -338
  165. package/src/claude/skills/backend-development/references/backend-code-quality.md +0 -659
  166. package/src/claude/skills/backend-development/references/backend-debugging.md +0 -904
  167. package/src/claude/skills/backend-development/references/backend-devops.md +0 -491
  168. package/src/claude/skills/backend-development/references/backend-mindset.md +0 -387
  169. package/src/claude/skills/backend-development/references/backend-performance.md +0 -397
  170. package/src/claude/skills/backend-development/references/backend-security.md +0 -342
  171. package/src/claude/skills/backend-development/references/backend-technologies.md +0 -256
  172. package/src/claude/skills/backend-development/references/backend-testing.md +0 -429
  173. package/src/claude/skills/devops/.env.example +0 -76
  174. package/src/claude/skills/devops/SKILL.md +0 -102
  175. package/src/claude/skills/devops/references/browser-rendering.md +0 -305
  176. package/src/claude/skills/devops/references/cloudflare-d1-kv.md +0 -123
  177. package/src/claude/skills/devops/references/cloudflare-platform.md +0 -271
  178. package/src/claude/skills/devops/references/cloudflare-r2-storage.md +0 -280
  179. package/src/claude/skills/devops/references/cloudflare-workers-advanced.md +0 -312
  180. package/src/claude/skills/devops/references/cloudflare-workers-apis.md +0 -309
  181. package/src/claude/skills/devops/references/cloudflare-workers-basics.md +0 -418
  182. package/src/claude/skills/devops/references/docker-basics.md +0 -297
  183. package/src/claude/skills/devops/references/docker-compose.md +0 -292
  184. package/src/claude/skills/devops/references/gcloud-platform.md +0 -297
  185. package/src/claude/skills/devops/references/gcloud-services.md +0 -304
  186. package/src/claude/skills/devops/references/kubernetes-basics.md +0 -95
  187. package/src/claude/skills/devops/references/kubernetes-helm-advanced.md +0 -70
  188. package/src/claude/skills/devops/references/kubernetes-helm.md +0 -81
  189. package/src/claude/skills/devops/references/kubernetes-kubectl.md +0 -74
  190. package/src/claude/skills/devops/references/kubernetes-security-advanced.md +0 -94
  191. package/src/claude/skills/devops/references/kubernetes-security.md +0 -89
  192. package/src/claude/skills/devops/references/kubernetes-troubleshooting-advanced.md +0 -74
  193. package/src/claude/skills/devops/references/kubernetes-troubleshooting.md +0 -49
  194. package/src/claude/skills/devops/references/kubernetes-workflows-advanced.md +0 -75
  195. package/src/claude/skills/devops/references/kubernetes-workflows.md +0 -76
  196. package/src/claude/skills/devops/scripts/cloudflare_deploy.py +0 -269
  197. package/src/claude/skills/devops/scripts/docker_optimize.py +0 -332
  198. package/src/claude/skills/devops/scripts/requirements.txt +0 -20
  199. package/src/claude/skills/devops/scripts/tests/requirements.txt +0 -3
  200. package/src/claude/skills/devops/scripts/tests/test_cloudflare_deploy.py +0 -285
  201. package/src/claude/skills/devops/scripts/tests/test_docker_optimize.py +0 -436
  202. package/src/claude/skills/frontend-design/SKILL.md +0 -135
  203. package/src/claude/skills/frontend-design/references/ai-multimodal-overview.md +0 -165
  204. package/src/claude/skills/frontend-design/references/analysis-best-practices.md +0 -80
  205. package/src/claude/skills/frontend-design/references/analysis-prompts.md +0 -141
  206. package/src/claude/skills/frontend-design/references/analysis-techniques.md +0 -118
  207. package/src/claude/skills/frontend-design/references/animejs.md +0 -396
  208. package/src/claude/skills/frontend-design/references/anti-slop-rules.md +0 -103
  209. package/src/claude/skills/frontend-design/references/asset-generation.md +0 -337
  210. package/src/claude/skills/frontend-design/references/bento-motion-engine.md +0 -142
  211. package/src/claude/skills/frontend-design/references/design-extraction-overview.md +0 -71
  212. package/src/claude/skills/frontend-design/references/extraction-best-practices.md +0 -141
  213. package/src/claude/skills/frontend-design/references/extraction-output-templates.md +0 -162
  214. package/src/claude/skills/frontend-design/references/extraction-prompts.md +0 -127
  215. package/src/claude/skills/frontend-design/references/magicui-components.md +0 -129
  216. package/src/claude/skills/frontend-design/references/performance-guardrails.md +0 -169
  217. package/src/claude/skills/frontend-design/references/premium-design-patterns.md +0 -93
  218. package/src/claude/skills/frontend-design/references/redesign-audit-checklist.md +0 -114
  219. package/src/claude/skills/frontend-design/references/technical-accessibility.md +0 -119
  220. package/src/claude/skills/frontend-design/references/technical-best-practices.md +0 -97
  221. package/src/claude/skills/frontend-design/references/technical-optimization.md +0 -44
  222. package/src/claude/skills/frontend-design/references/technical-overview.md +0 -90
  223. package/src/claude/skills/frontend-design/references/technical-workflows.md +0 -150
  224. package/src/claude/skills/frontend-design/references/visual-analysis-overview.md +0 -95
  225. package/src/claude/skills/frontend-design/references/workflow-3d.md +0 -102
  226. package/src/claude/skills/frontend-design/references/workflow-describe.md +0 -87
  227. package/src/claude/skills/frontend-design/references/workflow-immersive.md +0 -87
  228. package/src/claude/skills/frontend-design/references/workflow-quick.md +0 -57
  229. package/src/claude/skills/frontend-design/references/workflow-screenshot.md +0 -63
  230. package/src/claude/skills/frontend-design/references/workflow-video.md +0 -74
  231. package/src/claude/skills/frontend-development/SKILL.md +0 -406
  232. package/src/claude/skills/frontend-development/resources/common-patterns.md +0 -331
  233. package/src/claude/skills/frontend-development/resources/complete-examples.md +0 -872
  234. package/src/claude/skills/frontend-development/resources/component-patterns.md +0 -502
  235. package/src/claude/skills/frontend-development/resources/data-fetching.md +0 -767
  236. package/src/claude/skills/frontend-development/resources/file-organization.md +0 -502
  237. package/src/claude/skills/frontend-development/resources/loading-and-error-states.md +0 -501
  238. package/src/claude/skills/frontend-development/resources/performance.md +0 -406
  239. package/src/claude/skills/frontend-development/resources/routing-guide.md +0 -364
  240. package/src/claude/skills/frontend-development/resources/styling-guide.md +0 -428
  241. package/src/claude/skills/frontend-development/resources/typescript-standards.md +0 -418
  242. package/src/claude/skills/mobile-development/SKILL.md +0 -218
  243. package/src/claude/skills/mobile-development/references/mobile-android.md +0 -604
  244. package/src/claude/skills/mobile-development/references/mobile-best-practices.md +0 -544
  245. package/src/claude/skills/mobile-development/references/mobile-debugging.md +0 -1089
  246. package/src/claude/skills/mobile-development/references/mobile-frameworks.md +0 -465
  247. package/src/claude/skills/mobile-development/references/mobile-ios.md +0 -496
  248. package/src/claude/skills/mobile-development/references/mobile-mindset.md +0 -542
  249. package/src/claude/skills/react-best-practices/AGENTS.md +0 -2249
  250. package/src/claude/skills/react-best-practices/README.md +0 -123
  251. package/src/claude/skills/react-best-practices/SKILL.md +0 -128
  252. package/src/claude/skills/react-best-practices/metadata.json +0 -15
  253. package/src/claude/skills/react-best-practices/rules/_sections.md +0 -46
  254. package/src/claude/skills/react-best-practices/rules/_template.md +0 -28
  255. package/src/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  256. package/src/claude/skills/react-best-practices/rules/advanced-use-latest.md +0 -49
  257. package/src/claude/skills/react-best-practices/rules/async-api-routes.md +0 -38
  258. package/src/claude/skills/react-best-practices/rules/async-defer-await.md +0 -80
  259. package/src/claude/skills/react-best-practices/rules/async-dependencies.md +0 -36
  260. package/src/claude/skills/react-best-practices/rules/async-parallel.md +0 -28
  261. package/src/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +0 -99
  262. package/src/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +0 -59
  263. package/src/claude/skills/react-best-practices/rules/bundle-conditional.md +0 -31
  264. package/src/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +0 -49
  265. package/src/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  266. package/src/claude/skills/react-best-practices/rules/bundle-preload.md +0 -50
  267. package/src/claude/skills/react-best-practices/rules/client-event-listeners.md +0 -74
  268. package/src/claude/skills/react-best-practices/rules/client-swr-dedup.md +0 -56
  269. package/src/claude/skills/react-best-practices/rules/js-batch-dom-css.md +0 -82
  270. package/src/claude/skills/react-best-practices/rules/js-cache-function-results.md +0 -80
  271. package/src/claude/skills/react-best-practices/rules/js-cache-property-access.md +0 -28
  272. package/src/claude/skills/react-best-practices/rules/js-cache-storage.md +0 -70
  273. package/src/claude/skills/react-best-practices/rules/js-combine-iterations.md +0 -32
  274. package/src/claude/skills/react-best-practices/rules/js-early-exit.md +0 -50
  275. package/src/claude/skills/react-best-practices/rules/js-hoist-regexp.md +0 -45
  276. package/src/claude/skills/react-best-practices/rules/js-index-maps.md +0 -37
  277. package/src/claude/skills/react-best-practices/rules/js-length-check-first.md +0 -49
  278. package/src/claude/skills/react-best-practices/rules/js-min-max-loop.md +0 -82
  279. package/src/claude/skills/react-best-practices/rules/js-set-map-lookups.md +0 -24
  280. package/src/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +0 -57
  281. package/src/claude/skills/react-best-practices/rules/rendering-activity.md +0 -26
  282. package/src/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  283. package/src/claude/skills/react-best-practices/rules/rendering-conditional-render.md +0 -40
  284. package/src/claude/skills/react-best-practices/rules/rendering-content-visibility.md +0 -38
  285. package/src/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  286. package/src/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  287. package/src/claude/skills/react-best-practices/rules/rendering-svg-precision.md +0 -28
  288. package/src/claude/skills/react-best-practices/rules/rerender-defer-reads.md +0 -39
  289. package/src/claude/skills/react-best-practices/rules/rerender-dependencies.md +0 -45
  290. package/src/claude/skills/react-best-practices/rules/rerender-derived-state.md +0 -29
  291. package/src/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +0 -74
  292. package/src/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  293. package/src/claude/skills/react-best-practices/rules/rerender-memo.md +0 -44
  294. package/src/claude/skills/react-best-practices/rules/rerender-transitions.md +0 -40
  295. package/src/claude/skills/react-best-practices/rules/server-after-nonblocking.md +0 -73
  296. package/src/claude/skills/react-best-practices/rules/server-cache-lru.md +0 -41
  297. package/src/claude/skills/react-best-practices/rules/server-cache-react.md +0 -26
  298. package/src/claude/skills/react-best-practices/rules/server-parallel-fetching.md +0 -79
  299. package/src/claude/skills/react-best-practices/rules/server-serialization.md +0 -38
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: hapo:debug
2
+ name: cf:debug
3
3
  description: "Use before fixing any bug, failing test, CI/CD failure, production incident, performance issue, UI regression, flaky test, or unexpected behavior. Diagnostic-only root-cause workflow with evidence, hypotheses, blast-radius mapping, and verification plan."
4
4
  user-invocable: true
5
5
  when_to_use: "Invoke for evidence-first root-cause diagnosis before any fix."
@@ -23,8 +23,15 @@ Debugging is diagnosis, not repair. Find the source of the failure before changi
23
23
 
24
24
  Default: systematic diagnosis with no product-code edits, scout first.
25
25
 
26
+ ## Proportional depth
27
+
28
+ - **Quick/local:** one deterministic syntax, lint, type, or isolated-test failure. Keep the six-step flow, but omit an incident timeline and recurrence analysis when they cannot change the diagnosis or handoff.
29
+ - **Incident/deep:** production impact, multiple components, intermittent behavior, data/security risk, environment drift, concurrency, or two refuted hypotheses. Add a cross-source timeline, explicit elimination path, trigger/root-cause/contributing-factor separation, and recurrence-prevention gaps.
30
+
31
+ Depth changes evidence breadth, never the diagnostic-only gate or root-cause standard. Do not make a routine local failure perform incident ceremony merely because more tools are available.
32
+
26
33
  <DIAGNOSTIC-ONLY-GATE>
27
- `hapo:debug` is read-only for product code.
34
+ `cf:debug` is read-only for product code.
28
35
  Do NOT edit product code, apply fixes, create migrations, or add regression tests as implementation.
29
36
  Do NOT change config, dependency versions, generated assets, or test snapshots to make the failure disappear.
30
37
  Temporary instrumentation is allowed only when it is the minimal way to observe hidden state; record the file/line, capture the proof, remove it before finishing, and report `Temporary instrumentation: removed`.
@@ -48,30 +55,30 @@ Do not ask generic questions before this step unless the issue cannot be located
48
55
  Do NOT recommend a fix until the root-cause contract is complete.
49
56
  Do NOT stop at the first plausible explanation. Test hypotheses against evidence.
50
57
  If 2+ hypotheses are refuted, change strategy before continuing.
51
- If evidence is insufficient, report `Root cause: unknown`, `Missing Evidence`, and `Next Diagnostic Action`; do not hand off to `hapo:hotfix` as ready.
58
+ If evidence is insufficient, report `Root cause: unknown`, `Missing Evidence`, and `Next Diagnostic Action`; do not hand off to `cf:fix` as ready.
52
59
  Answer each item in one concrete sentence.
53
60
  If any answer contains 'probably', 'I think', 'something with', or 'maybe' — it is not an answer; gather evidence instead.
54
61
  </ROOT-CAUSE-GATE>
55
62
 
56
- If the user asks to fix while still inside `hapo:debug`, finish the debug report first. Then hand off only the completed root-cause contract to `hapo:hotfix`.
63
+ If the user asks to fix while still inside `cf:debug`, finish the debug report first. Then hand off only the completed root-cause contract to `cf:fix`.
57
64
 
58
65
  ## Process Flow
59
66
 
60
67
  ```mermaid
61
68
  flowchart TD
62
- A[Issue Input] --> B[Step 1: Scout via hapo:inspect]
69
+ A[Issue Input] --> B[Step 1: Scout via cf:scout]
63
70
  B --> C[Step 2: Capture Evidence]
64
71
  C --> D[Step 3: Pattern Analysis]
65
72
  D --> E[Step 4: Hypothesis Tests]
66
73
  E --> F[Step 5: Root Cause Trace]
67
- F --> G[Step 6: Blast Radius + Verification Plan]
74
+ F --> G[Step 6: Verification + Prevention Handoff]
68
75
  G --> H[Diagnostic Report]
69
76
  H --> I{Fix requested?}
70
- I -->|Yes| J[Hand off to hapo:hotfix]
77
+ I -->|Yes| J[Hand off to cf:fix]
71
78
  I -->|No| K[Stop after diagnosis]
72
79
  ```
73
80
 
74
- **This diagram is the authoritative workflow.** `hapo:debug` stops at diagnosis unless the user explicitly asks to fix.
81
+ **This diagram is the authoritative workflow.** `cf:debug` stops at diagnosis unless the user explicitly asks to fix.
75
82
 
76
83
  ---
77
84
 
@@ -79,8 +86,8 @@ flowchart TD
79
86
 
80
87
  Understand the affected code before forming hypotheses.
81
88
 
82
- **Action:** Activate `hapo:inspect` for the relevant scope.
83
- If `hapo:inspect` is unavailable, use direct read-only reconnaissance (`rg`, file reads, test discovery, and `git log`) and state that fallback.
89
+ **Action:** Activate `cf:scout` for the relevant scope.
90
+ If `cf:scout` is unavailable, use direct read-only reconnaissance (`rg`, file reads, test discovery, and `git log`) and state that fallback.
84
91
 
85
92
  **Checklist:**
86
93
  - [ ] Project type, language, framework, runtime, and test runner identified
@@ -107,6 +114,8 @@ Create a baseline that can later prove whether the issue changed.
107
114
  - Environment facts: runtime, dependency versions, OS, browser, CI runner, config
108
115
  - Whether the issue reproduces consistently or intermittently
109
116
 
117
+ For Incident/deep work, build an `Evidence Timeline` from timestamped facts across relevant sources. Normalize timezones, preserve request/trace/run IDs, and distinguish observed ordering from inferred causation. Quick/local work records `Timeline: skipped - local deterministic failure`.
118
+
110
119
  For frontend issues, use `.claude/references/debugger/frontend-verification.md`.
111
120
  For CI/log issues, use `.claude/references/debugger/log-ci-analysis.md`.
112
121
  For performance issues, use `.claude/references/debugger/performance-diagnostics.md`.
@@ -147,6 +156,7 @@ Rules:
147
156
  - Prefer read-only evidence: logs, grep, stack traces, DB queries, browser traces.
148
157
  - For flaky async tests, use `.claude/references/debugger/condition-based-waiting.md`.
149
158
  - If 2+ hypotheses are refuted, use inversion: ask what evidence would make the current explanation impossible.
159
+ - Preserve an elimination path: for every confirmed, refuted, or inconclusive hypothesis, cite the observation and explain why it changes the candidate set.
150
160
 
151
161
  **Output:** `✓ Step 4: Hypotheses tested - [confirmed/refuted counts]`
152
162
 
@@ -167,18 +177,22 @@ Symptom
167
177
  - Symptom: exact observable failure
168
178
  - Reproduction: command/user flow/log trigger
169
179
  - Expected vs actual behavior
180
+ - Trigger: event or input that activated the failure, or `unknown`
170
181
  - Root cause: file:line or config/env source
182
+ - Contributing factors: conditions that increased likelihood or impact but are not sufficient causes, or `none evidenced`
171
183
  - Why now: recent change, data state, dependency, environment, timing, or load factor
172
184
  - Evidence chain: observations that prove this cause
173
185
  - Blast radius: files/modules/tests/users/workflows affected
174
186
 
187
+ Do not collapse correlation into causation. The root cause must explain the mechanism from trigger to symptom and identify the earliest owned invariant whose correction would prevent recurrence. Read `.claude/references/debugger/root-cause-tracing.md` for deep call/data flow or test-pollution cases.
188
+
175
189
  **Output:** `✓ Step 5: Root cause traced - [file:line/config/env]`
176
190
 
177
191
  ---
178
192
 
179
- ## Step 6: Blast Radius + Verification Plan
193
+ ## Step 6: Blast Radius + Verification And Prevention Plan
180
194
 
181
- Prepare the handoff to `hapo:hotfix` or the user.
195
+ Prepare the handoff to `cf:fix` or the user.
182
196
 
183
197
  **Verification plan must include:**
184
198
  - Original failing command or reproduction path
@@ -188,6 +202,8 @@ Prepare the handoff to `hapo:hotfix` or the user.
188
202
  - UI screenshot/console/network checks when relevant
189
203
  - Side-effect sweep from `.claude/references/debugger/side-effect-gate.md`
190
204
 
205
+ For Incident/deep work, add recurrence-prevention candidates: missing invariant or validation layer, observability/alerting gap, and one regression scenario. These are evidence-backed handoff directions only; `cf:debug` does not implement them.
206
+
191
207
  **Output:** `✓ Step 6: Verification planned - [commands/scenarios]`
192
208
 
193
209
  ---
@@ -206,19 +222,32 @@ Prepare the handoff to `hapo:hotfix` or the user.
206
222
  - Reproduction:
207
223
  - Expected:
208
224
  - Actual:
225
+ - Trigger:
209
226
  - Root cause:
227
+ - Contributing factors:
210
228
  - Why now:
211
229
  - Evidence chain:
212
230
  - Blast radius:
213
231
 
232
+ ### Evidence Timeline
233
+ - skipped: [reason] | [timestamp/source/id/event]
234
+
214
235
  ### Hypotheses Tested
215
236
  1. [confirmed/refuted/inconclusive] [hypothesis] - [evidence]
216
237
 
238
+ ### Elimination Path
239
+ - [candidate removed or retained] - [decisive observation]
240
+
217
241
  ### Verification Plan
218
242
  - Original reproduction:
219
243
  - Regression guard:
220
244
  - Side-effect sweep:
221
245
 
246
+ ### Recurrence-Prevention Handoff
247
+ - Missing invariant/validation:
248
+ - Monitoring or alerting gap:
249
+ - Regression scenario:
250
+
222
251
  ### Temporary Instrumentation
223
252
  - none | removed: [file:line, purpose, proof captured]
224
253
 
@@ -235,21 +264,21 @@ Prepare the handoff to `hapo:hotfix` or the user.
235
264
  - [Only if any]
236
265
  ```
237
266
 
238
- ## Relationship To Hotfix
267
+ ## Relationship To Fix
239
268
 
240
- - Use `hapo:debug` to determine what is wrong.
241
- - Use `hapo:hotfix` to change code only after the root-cause contract is complete.
242
- - A `Root cause: unknown` report is not ready for hotfix; continue diagnosis or ask for the missing artifact.
243
- - If `hapo:hotfix` verification fails, return to `hapo:debug` with the new evidence.
269
+ - Use `cf:debug` to determine what is wrong.
270
+ - Use `cf:fix` to change code only after the root-cause contract is complete.
271
+ - A `Root cause: unknown` report is not ready for Fix; continue diagnosis or ask for the missing artifact.
272
+ - If `cf:fix` verification fails, return to `cf:debug` with the new evidence.
244
273
 
245
274
  ## References
246
275
 
247
276
  Load as needed:
248
277
  - `.claude/references/debugger/core-philosophy.md` - Anti-guessing discipline
249
278
  - `.claude/references/debugger/root-cause-tracing.md` - Backward trace to origin
250
- - `.claude/references/debugger/verification-protocol.md` - Fresh evidence requirements
279
+ - `.claude/references/debugger/verification-protocol.md` - Diagnostic baseline and proof handoff ownership
251
280
  - `.claude/references/debugger/log-ci-analysis.md` - Logs and CI/CD failure analysis
252
- - `.claude/references/debugger/parallel-agent-hydration.md` - Parallel reconnaissance
281
+ - `.claude/references/debugger/parallel-agent-hydration.md` - Permission-gated parallel reconnaissance
253
282
  - `.claude/references/debugger/frontend-verification.md` - Browser/UI verification
254
283
  - `.claude/references/debugger/performance-diagnostics.md` - Performance investigation
255
284
  - `.claude/references/debugger/condition-based-waiting.md` - Flaky async test diagnosis
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: hapo:delegate
2
+ name: cf:delegate
3
3
  description: "Delegate implementation tasks from Claude Code to external CLI agents (Codex or Grok). Covers task-brief authoring, non-interactive dispatch, permission setup, background monitoring, resume, and independent verification of the returned work."
4
4
  user-invocable: true
5
5
  when_to_use: "Invoke when the user asks to assign/offload a coding task to codex or grok, or to run work on an external agent CLI."
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: hapo:develop
2
+ name: cf:develop
3
3
  description: "Implement an explicitly requested process-first feature or task, run its real verification, and close it with one evidence owner. Also supports existing legacy Specs packets."
4
4
  user-invocable: true
5
5
  when_to_use: "Use to implement a ready feature packet, one named task, or a clear low-risk change."
@@ -13,19 +13,19 @@ metadata:
13
13
  # Develop — implement, prove, synchronize
14
14
 
15
15
  Implement only the explicitly requested scope. For a process-first feature,
16
- `plan.md` and flat tasks are the durable packet; one closeout owner coordinates verification, review, sync, and docs impact without borrowing evidence.
17
-
16
+ `plan.md` and flat tasks are the durable packet; one closeout owner coordinates
17
+ verification, review, sync, and docs impact without borrowing evidence.
18
18
  Develop never starts merely because Specs finished. The user invokes it.
19
19
 
20
20
  ## Usage and pre-state guard
21
21
 
22
22
  ```text
23
- /hapo:develop <feature>
24
- /hapo:develop specs/<feature>
25
- /hapo:develop <feature> task-02-<slug>.md
26
- /hapo:develop <feature> --flash
27
- /hapo:develop <feature> --parallel [N]
28
- /hapo:develop <feature> --notes
23
+ /cf:develop <feature>
24
+ /cf:develop specs/<feature>
25
+ /cf:develop <feature> task-02-<slug>.md
26
+ /cf:develop <feature> --flash
27
+ /cf:develop <feature> --parallel [N]
28
+ /cf:develop <feature> --notes
29
29
  ```
30
30
 
31
31
  `--notes` is opt-in. Only then load `references/implementation-notes-template.html`;
@@ -43,20 +43,50 @@ The pair exits `2` before a task edit, receipt, worktree, subagent, or commit. D
43
43
 
44
44
  1. Resolve one `specs/<feature>/plan.md` plus flat `task-NN-*.md`; an explicit task path wins.
45
45
  2. Read C1 scope, exclusions, acceptance mapping, ownership, and task order.
46
- 3. A task is unblocked only when every named dependency is done with a valid inline Receipt.
47
- 4. Full-feature mode selects one unblocked task at a time, in plan order.
48
- Specific-task mode implements only that task and then stops.
49
- 5. Without a packet, work directly only when the change is clear, isolated, reversible, and low-risk.
46
+ 3. A task is unblocked only when every named dependency is `done` with a valid current inline Receipt.
47
+ 4. Without a packet, work directly only when the change is clear, isolated, reversible, and low-risk.
50
48
 
51
49
  Ambiguity, overlapping ownership, a dependency cycle, or a missing Verification Plan is a blocker. Do not guess.
52
50
 
51
+ ### Accepted process-first fast path
52
+
53
+ When line two is `Specs-Contract: process-first-ready-v1`, reuse the accepted C1/C2.
54
+ Perform only a narrow freshness scout for target revision, scope drift, ownership
55
+ conflict, and dependency/state changes. Reopen C1 only for evidenced scope drift;
56
+ do not research, replan, or add a routine user gate before a real blocker or C3.
57
+ This is a source instruction contract, not a parser/runtime or live-model guarantee;
58
+ live-model adherence is `[UNVERIFIED]` without a host invocation.
59
+
60
+ Load the plan index into working context once. Later byte rereads are narrow drift
61
+ checks; load only the active task's referenced coverage-profile rows, Outcome,
62
+ Scope, Ownership, Acceptance, Dependencies, Verification Plan, owned code, and consumers.
63
+
64
+ ## Current-byte selection
65
+
66
+ Reread current plan/task bytes before each selection and controller write. Concurrent
67
+ Develop invocations are unsupported; detected state, task, or owned-path drift stops
68
+ before any Status or Receipt write.
69
+
70
+ | Current bytes | Feature mode | Explicit task mode |
71
+ |---|---|---|
72
+ | More than one `in_progress` | Fail-stop; name every active task. | Fail-stop; do not choose among them. |
73
+ | Exactly one `in_progress` | Resume exactly that task. | Recover it only when it is the exact target; otherwise stop. |
74
+ | Next row is `paused` | `paused` stops chaining; report and stop, never skip past it. | Report the target and stop. |
75
+ | Row is `blocked` or has a bad dependency | Never select it; `blocked` is not dependency-valid. | Report the blocker and stop. |
76
+ | Target is `done` | Continue queue selection only after validating its Receipt. | Report terminal state without mutation and stop. |
77
+ | No task is active | Select the first dependency-valid `pending` row in `plan.md` order. | Start only the exact pending target when dependencies are valid. |
78
+ | Status is missing, duplicate, or unknown | Stop as malformed state. | Stop as malformed state. |
79
+
80
+ Feature mode repeats this selection only after the current task closes. Specific-task
81
+ mode never touches a sibling and returns after its successful sync without chaining or C3.
82
+
53
83
  ## Modes
54
84
 
55
85
  ### Sequential feature or specific task
56
86
 
57
- Set the selected task's single `Status:` field to `in_progress`. Implement its
58
- Outcome and Acceptance only. Do not start the next task until proof, review,
59
- and sync for the current task finish. A specific-task invocation never chains.
87
+ The controller sets the selected task's single `Status:` to `in_progress`.
88
+ Implement its Outcome and Acceptance only. Keep one unblocked task at a time;
89
+ never start the next before proof, review, and sync finish for the current task.
60
90
 
61
91
  ### Parallel (`--parallel [N]`)
62
92
 
@@ -70,82 +100,79 @@ Flash is an explicit speed trade-off, never completion:
70
100
  - run only an available cheap syntax, typecheck, or compile preflight;
71
101
  - skip dedicated tests, extended manual checks, and review retry loops;
72
102
  - keep `Status: in_progress` and record `FLASH_UNVERIFIED` plus blocker
73
- `awaiting /hapo:test <feature>`;
74
- - do not unblock dependents or report Test PASS, Evidence PASS,
75
- production-ready, or done;
76
- - promotion later requires a fresh canonical PASS receipt through the trusted
77
- sync-finalize path.
103
+ `awaiting /cf:test <feature>`;
104
+ - do not unblock dependents or report Test PASS, Evidence PASS, production-ready, or done;
105
+ - stop this invocation without chaining.
78
106
 
79
- Never weaken, delete, or rewrite tests to make Flash look complete.
107
+ Only a later explicit non-Flash invocation may recover the task. It treats Flash
108
+ output as ephemeral, inspects current bytes and the owned diff, and obtains fresh
109
+ canonical proof through the trusted sync-finalize path. Never weaken, delete, or
110
+ rewrite tests to make Flash look complete.
80
111
 
81
112
  ## Task cycle
82
113
 
83
114
  ### 1. Scout
84
115
 
85
116
  Trace entrypoints, callers, dependents, registration, errors, and owned files.
86
- Compilation does not prove an unmounted UI, unregistered route, uncalled service, or missing consumer.
117
+ Compilation does not prove an unmounted UI, unregistered route, uncalled service,
118
+ or missing consumer.
119
+
120
+ For an interrupted `in_progress` task, preserve and inspect current owned changes;
121
+ discard ephemeral, remembered, or prior-attempt proof; compare unmet Acceptance
122
+ against current task bytes and owned diff. Do not blindly replay a non-idempotent
123
+ mutation. Resume only unmet work, then run fresh verification.
87
124
 
88
125
  ### 2. Implement
89
126
 
90
127
  Honor Scope, Ownership, Acceptance, and Dependencies. Do not silently replace named contracts;
91
128
  scope expansion requires evidence and a return to C1, not implementation convenience.
129
+ Load `references/subagent-patterns.md` when dispatch helps; only the controller writes Status or Receipt.
92
130
 
93
- ### 3. Verify and review once
94
-
95
- The test owner executes the exact Verification Plan and records real output.
96
- The review owner, when risk or repository policy requires review, evaluates
97
- correctness, security, scope, and reachability but does not manufacture proof.
98
- Use `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`; only literal PASS can close.
99
-
100
- Load `references/quality-gate.md` for the closeout contract. Remediate an
101
- observed failure, then rerun only affected proof and review. Do not blind-retry
102
- a blocked environment. After three failed repair rounds, stop and ask the user.
103
-
104
- ### 4. Write the inline Receipt and sync
105
-
106
- After a real pass, append or replace the task's final `## Receipt` with:
131
+ ### 3. Verify, review, and close
107
132
 
108
- - `Verification: PASS`;
109
- - the exact `Command:` and `Exit: 0`;
110
- - runtime-derived `Base:` and `Head:`;
111
- - a non-empty fenced block containing current command output;
112
- - required negative, reachability, and artifact proof from the task.
133
+ The test owner executes each exact Verification Plan and records real output. The
134
+ review owner evaluates correctness, security, scope, and reachability without
135
+ manufacturing proof. Use `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`; only literal PASS can close.
113
136
 
114
- Then set `Status: done`, update only implemented checkboxes, and recompute the
115
- queue. Missing, stale, contradictory, zero-test, placeholder, or marker-only
116
- proof leaves the task unfinished.
137
+ Load `references/quality-gate.md`. Remediate an observed failure, then rerun only
138
+ affected proof/review. Do not blind-retry a blocked environment. After three failed
139
+ repair rounds, stop and ask the user.
117
140
 
118
- ### 5. Finish the requested boundary
141
+ After a real pass, the controller writes the task's final inline `## Receipt` with
142
+ `Verification: PASS`, exact `Command`, `Exit: 0`, runtime-derived `Base:` and `Head:`,
143
+ non-empty current output, and required negative/reachability/artifact proof; then it
144
+ sets `Status: done` and only implemented checkboxes. Missing, stale, contradictory,
145
+ zero-test, placeholder, marker-only, skipped, or remembered proof is unfinished.
119
146
 
120
- Specific-task mode stops after its sync. Full-feature mode continues one task
121
- at a time, then runs the feature-level integration command and reachability
122
- check named by the repository or plan. Show current evidence and limitations at
123
- C3; the user decides completion.
147
+ ### 4. Finish the requested boundary
124
148
 
125
- Evaluate docs impact from the behavior actually changed:
149
+ Reread the task after sync and recompute the queue from current bytes. Specific-task
150
+ mode has already returned. Full-feature mode continues one task at a time, then runs
151
+ the named feature-level integration and reachability checks. Before C3, apply the
152
+ quality-gate final-Head fixed point; show current evidence and limitations, and let
153
+ the user decide completion.
126
154
 
127
- - `none`: report it and make no docs edit;
128
- - `minor` or `major`: update only affected existing docs through the docs flow.
155
+ Evaluate docs impact from behavior actually changed: `none` means report only;
156
+ `minor` or `major` updates only affected existing docs through the docs flow.
129
157
 
130
158
  ## Definition of done
131
159
 
132
- Done requires satisfied acceptance, reachable behavior, current executable
133
- proof, correct Base/Head binding, resolved blocking review findings, and no
134
- scope substitution. `PASS_WITH_WARNINGS`, `NO_TESTS`, `FLASH_UNVERIFIED`, or a
135
- review-only pass cannot close work.
160
+ Done requires satisfied acceptance, reachable behavior, current executable proof,
161
+ stable Base/Head binding, resolved blocking review findings, and no scope substitution.
162
+ `PASS_WITH_WARNINGS`, `NO_TESTS`, `FLASH_UNVERIFIED`, or review-only pass cannot close.
136
163
 
137
164
  ## Attached references
138
165
 
139
- - `references/quality-gate.md` — proof and review ownership.
166
+ - `references/quality-gate.md` — proof, review, final-Head, and shared-run ownership.
140
167
  - `references/parallel-waves.md` — opt-in isolated worktree waves.
168
+ - `references/subagent-patterns.md` — task-local briefs and controller-only handoff.
141
169
  - `references/implementation-notes-template.html` — only with `--notes`.
142
170
 
143
171
  ## Legacy workflow compatibility
144
172
 
145
- If the selected feature contains `spec.json`, use its persisted
146
- `workflow_policy`, `task_registry`, nested task paths, typed boundaries,
147
- separate task receipts, and feature closeout receipt exactly as the legacy
148
- adapters require. Preserve `planning_depth`, `assurance_level`, derived lane,
149
- and read-only `execution_tier`; do not project these fields into a new v3
150
- packet. Keep JSON and Markdown status synchronized, and use the existing
151
- completion-authority path for final closeout.
173
+ If the selected feature contains `spec.json`, use its persisted `workflow_policy`,
174
+ `task_registry`, nested task paths, typed boundaries, separate task receipts, and
175
+ feature closeout receipt exactly as legacy adapters require. Preserve `planning_depth`,
176
+ `assurance_level`, derived lane, and read-only `execution_tier`; do not project these
177
+ fields into a new v3 packet. Keep JSON and Markdown status synchronized, and use the
178
+ existing completion-authority path for final closeout.
@@ -1,102 +1,75 @@
1
- # Parallel waves — `hapo:develop --parallel`
1
+ # Parallel waves — `cf:develop --parallel`
2
2
 
3
- Load this reference only for explicit parallel execution. The goal is bounded
4
- concurrency with immutable provenance and one state writer.
3
+ Load this reference only for explicit parallel execution. The goal is bounded concurrency with immutable provenance and one state writer.
5
4
 
6
5
  ## Preconditions
7
6
 
8
- 1. Confirm the work context is a Git repository and worktree isolation is
9
- available. Otherwise state why and fall back to the sequential loop.
7
+ 1. Confirm Git and isolated worktree support; otherwise state why and fall back to the sequential loop.
10
8
  2. Respect `.claude/runtime.json` `develop.parallel: false` when present.
11
9
  3. Clamp `--parallel N` to 1..5; default to 3.
12
- 4. Require a clean destination and record its exact `base_sha`. Stop without
13
- mutation if cleanliness or base compatibility fails.
14
- 5. Confirm whether the user's parallel consent also authorizes worker commits
15
- and controller cherry-picks before creating worktrees.
10
+ 4. Require a clean destination; record exact `base_sha` and stop on incompatible bases.
11
+ 5. Confirm consent for worker commits and controller cherry-picks before creating worktrees.
16
12
 
17
- Every task receipt for a wave records:
13
+ Range facts belong only in controller handoff metadata, never the inline Receipt:
18
14
 
19
15
  ```text
20
16
  base_sha: <destination commit before dispatch>
21
- head_sha: <worker or integrated commit>
17
+ head_sha: <worker commit at handoff>
22
18
  branch: <worker branch>
23
- worktree_path: <path>
19
+ worktree_path: <isolated worktree>
24
20
  commit_range: <base_sha>..<head_sha>
25
21
  retention: retained|released
26
22
  cleanup_authorization: pending|explicit-discard|merged-release
27
23
  ```
28
24
 
29
- Test and review commands inspect `git diff <base_sha>..<head_sha>`, never an
30
- ambient working-tree diff. A fix creates a new commit and advances Head.
25
+ The final inline Receipt instead receives fresh runtime Base/Head, exact command, exit, and output after integration; handoff metadata cannot substitute for it.
31
26
 
32
- ## Build a wave
27
+ ## Build and dispatch a wave
33
28
 
34
- Read dependencies from the plan task table and each flat task's
35
- `## Dependencies`. A candidate is ready only when all named dependencies are
36
- done with valid Receipts.
29
+ Read dependencies from the plan table and each task. A candidate is ready only when every named dependency is `done` with a valid current Receipt.
30
+ Add tasks in plan order up to the cap. Exclude normalized path overlap or a shared mutable registry, lockfile, manifest, generated output, migration, or export barrel.
31
+ Uncertain overlap is a conflict. One file has one writer per wave.
37
32
 
38
- Add ready tasks in plan order up to the cap, excluding a task when it shares a
39
- write target with an earlier task or touches the same mutable registry,
40
- lockfile, manifest, generated output, migration, or export barrel. Normalize
41
- paths. Uncertain overlap is a conflict, not an invitation to guess.
33
+ Each worker receives the complete task-local brief from `subagent-patterns.md`, exact owned paths, worktree, acceptance, proof command, and these constraints:
42
34
 
43
- One file has one writer per wave. If no safe wave remains, use the sequential
44
- loop and state the dependency or ownership conflict.
45
-
46
- ## Dispatch
47
-
48
- Each worker receives the complete task packet, work context, exact owned paths,
49
- acceptance, Verification Plan, dependencies, and these constraints:
50
-
51
- 1. Work only in the assigned isolated worktree.
52
- 2. Do not edit `plan.md`, task Status, or `## Receipt`; the controller owns
53
- state and evidence synchronization.
54
- 3. Do not touch a path outside granted ownership or undo another worker's edit.
55
- 4. Run task-local prechecks and report exact commands and exits.
56
- 5. Commit only when the user's authorization covers worker commits.
57
- 6. Return status plus branch, worktree, Base, Head, range, and retention.
35
+ 1. Edit only granted paths in the assigned worktree; never undo another worker.
36
+ 2. Do not edit `plan.md`, Status, or `## Receipt`; only the controller writes state/proof.
37
+ 3. Report exact precheck commands/exits; commit only with user authorization.
38
+ 4. Return status plus branch, worktree, Base, Head, complete range, owned-path tree, and retention.
58
39
 
59
40
  A blocked or failed worker keeps its identifiable worktree and branch. Never
60
41
  force-delete it without merge success or explicit discard authorization.
61
42
 
62
- ## Verify before integration
43
+ ## Prove the full handoff
63
44
 
64
- Inside each worktree, run the task's proof through `quality-gate.md` against the
65
- immutable commit range. A task with missing proof, overlap, or unresolved High
66
- or Critical finding is not eligible to integrate. Three failed repair rounds
67
- collapse only that task; siblings may finish but do not erase its blocker.
45
+ Before integration, enumerate every commit with `git rev-list --reverse <base_sha>..<head_sha>`
46
+ and the complete changed tree with `git diff --name-status <base_sha>..<head_sha>`.
47
+ Reject an empty, discontinuous, partial, or base-incompatible range; duplicate/missing commits; and every path outside Ownership.
48
+ Test/review the complete immutable range through `quality-gate.md`; unresolved High/Critical findings block that task.
68
49
 
69
50
  ## Integrate sequentially
70
51
 
71
- Apply accepted worker commits one at a time in plan order:
52
+ In plan order, apply every enumerated worker commit, in range order:
72
53
 
73
54
  ```bash
74
- git cherry-pick <worker-commit>
55
+ git cherry-pick <next-worker-commit>
75
56
  ```
76
57
 
77
- On conflict, abort the cherry-pick, mark the task blocked, and retain its
78
- worktree/branch. After success, update the receipt range to the integrated Head.
79
- Release a worktree only after recording `cleanup_authorization: merged-release`.
58
+ After each pick, verify the destination contains that source commit's patch. After the last, compare the integrated owned-path tree with the worker tree.
59
+ Any missing/extra commit or path stops before post-merge proof. On conflict, abort the pick, block that task, and retain its branch/worktree.
60
+ Release only after recording `cleanup_authorization: merged-release` in handoff metadata.
80
61
 
81
62
  ## Post-merge proof
82
63
 
83
- After the wave's last integration, run an affected integration command derived
84
- from the tasks and repository contract. Record command, exit, Base, Head,
85
- range, and output. Failure blocks the next wave.
86
-
87
- Classify a failure before acting:
88
-
89
- - `baseline`: reproduces from the recorded Base;
90
- - `environment`: required tool, service, permission, or dependency unavailable;
91
- - `spec`: acceptance or evidence contract is wrong or incomplete;
92
- - `code`: implementation or integration regression.
93
-
94
- Do not blind-retry. Fix code/spec with a new commit and rerun affected proof;
95
- record baseline/environment as blockers.
64
+ Only after complete range/tree integration, run the affected integration command
65
+ against the fresh runtime Base/Head. Failure blocks the next wave; classify it as
66
+ `baseline`, `environment`, `spec`, or `code`. Do not blind-retry: code/spec repair
67
+ creates a new commit and repeats the full range/tree audit; other classes remain blockers.
96
68
 
97
- After the final wave, run the feature-level integration and reachability proof.
98
- The controller then writes inline Receipts and Status updates one task at a
99
- time. Worker reports are evidence inputs, not permission to claim done.
69
+ After the final wave, run feature integration and reachability proof. The controller
70
+ then writes inline Receipts and Status one task at a time. Worker reports and range
71
+ metadata are inputs, not completion authority; incomplete workers cannot be hidden
72
+ by successful siblings.
100
73
 
101
74
  ## Legacy workflow compatibility
102
75
 
@@ -33,6 +33,16 @@ Before completion, verify:
33
33
  zero-test, stale, copied, or marker-only proof is unfinished. A review PASS
34
34
  cannot replace execution evidence.
35
35
 
36
+ ## Shared captured runs
37
+
38
+ A shared command may prove several tasks only from one fresh captured run. For
39
+ each task, map the exact command, current Head, required proof level, oracle, one
40
+ uniquely named probe, and that probe's executed/pass count. Every mapped probe
41
+ must execute at least once and all executions must pass. Duplicate probe names,
42
+ ambiguous ownership/counts, skip, skipped, todo, cancel, canceled, cancelled, or
43
+ remembered output cannot close any mapped task. Source, installed, and live proof
44
+ levels remain distinct; never promote evidence from a lower level.
45
+
36
46
  ## Review focus
37
47
 
38
48
  Check task Outcome, Scope, Acceptance, Dependencies, Verification Plan, changed
@@ -62,6 +72,22 @@ after three failed repair rounds: stop and request user direction
62
72
  unfinished for state synchronization. Never retry an unchanged environment to
63
73
  manufacture a green result.
64
74
 
75
+ ## Final-Head fixed point
76
+
77
+ Before C3, repeat within the same three-round repair cap:
78
+
79
+ 1. Capture runtime Head and list every `done` task whose Receipt is stale or
80
+ bound to a different Head.
81
+ 2. Run each stale task's exact proof freshly and let only the controller replace
82
+ its inline Receipt. If proof changes any non-Specs byte, stop as BLOCKED;
83
+ remediation must settle those bytes before proof can bind them.
84
+ 3. Capture runtime Head again and rescan all `done` Receipts.
85
+
86
+ Stop only when consecutive Head captures are identical and every `done` Receipt
87
+ names that current Head. A single pass, remembered result, copied Receipt, or
88
+ proof promoted from another level is not a fixed point. If Head keeps moving or
89
+ the repair cap is reached, report the blocker instead of opening C3.
90
+
65
91
  ## Flash gate
66
92
 
67
93
  With explicit `--flash`, run only a cheap available preflight and a basic
@@ -72,12 +98,13 @@ Mode: --flash
72
98
  Tests: skipped by user request
73
99
  Evidence: FLASH_UNVERIFIED
74
100
  Status: in_progress
75
- Blocker: awaiting /hapo:test <feature>
101
+ Blocker: awaiting /cf:test <feature>
76
102
  ```
77
103
 
78
- Flash does not write a PASS receipt, mark done, unblock dependents, or report
79
- production readiness. Trusted sync-finalize may promote only after fresh proof
80
- passes the same receipt contract above.
104
+ Flash does not write a PASS receipt, mark done, unblock dependents, chain, or
105
+ report production readiness. Only a later explicit non-Flash invocation may
106
+ recover it: discard Flash output as canonical evidence, inspect current bytes
107
+ and the owned diff, and run fresh proof under the same sync-finalize contract.
81
108
 
82
109
  ## Docs impact and C3
83
110