@haposoft/cafekit 0.16.0-rc.8 → 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 (297) 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 +50 -0
  4. package/bin/__tests__/codex-native.test.js +1882 -70
  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 +1735 -98
  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 +12 -7
  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 +10 -3
  46. package/src/claude/hooks/__tests__/state.test.js +5 -0
  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 +2 -2
  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/workflow-policy.cjs +1 -1
  89. package/src/claude/settings/settings.json +16 -0
  90. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  91. package/src/claude/skills/ai-multimodal/SKILL.md +1 -1
  92. package/src/claude/skills/brainstorm/SKILL.md +193 -172
  93. package/src/claude/skills/brainstorm/references/question-framework.md +105 -167
  94. package/src/claude/skills/chrome-devtools/SKILL.md +1 -1
  95. package/src/claude/skills/code-review/SKILL.md +43 -25
  96. package/src/claude/skills/code-review/references/spec-compliance-review.md +3 -4
  97. package/src/claude/skills/code-review/references/verification-gate.md +1 -1
  98. package/src/claude/skills/debug/SKILL.md +48 -19
  99. package/src/claude/skills/delegate/SKILL.md +1 -1
  100. package/src/claude/skills/develop/SKILL.md +92 -65
  101. package/src/claude/skills/develop/references/parallel-waves.md +36 -63
  102. package/src/claude/skills/develop/references/quality-gate.md +31 -4
  103. package/src/claude/skills/develop/references/subagent-patterns.md +21 -7
  104. package/src/claude/skills/docs/SKILL.md +42 -23
  105. package/src/claude/skills/docs/references/init-workflow.md +4 -4
  106. package/src/claude/skills/docs/references/reconstruct-workflow.md +6 -6
  107. package/src/claude/skills/docs/references/standard-docs-workflow.md +6 -2
  108. package/src/claude/skills/docs/references/summarize-workflow.md +2 -2
  109. package/src/claude/skills/docs/references/update-workflow.md +9 -7
  110. package/src/claude/skills/docs/templates/requirements-as-is.md +1 -1
  111. package/src/claude/skills/docx/SKILL.md +1 -1
  112. package/src/claude/skills/git/SKILL.md +1 -1
  113. package/src/claude/skills/git/references/commit-protocols.md +1 -1
  114. package/src/claude/skills/git/references/finish-branch.md +1 -1
  115. package/src/claude/skills/hotfix/SKILL.md +159 -170
  116. package/src/claude/skills/hotfix/references/diagnosis-protocol.md +14 -9
  117. package/src/claude/skills/hotfix/references/parallel-patterns.md +27 -13
  118. package/src/claude/skills/hotfix/references/prevention-gate.md +5 -0
  119. package/src/claude/skills/hotfix/references/review-cycle.md +21 -15
  120. package/src/claude/skills/hotfix/references/workflow-specialized.md +53 -21
  121. package/src/claude/skills/inspect/SKILL.md +55 -46
  122. package/src/claude/skills/inspect/references/internal-inspection.md +21 -5
  123. package/src/claude/skills/loop/SKILL.md +114 -0
  124. package/src/claude/skills/loop/references/bounded-loop-protocol.md +104 -0
  125. package/src/claude/skills/loop/references/metric-and-guard-contract.md +76 -0
  126. package/src/claude/skills/pdf/SKILL.md +1 -1
  127. package/src/claude/skills/pptx/SKILL.md +1 -1
  128. package/src/claude/skills/question/SKILL.md +16 -13
  129. package/src/claude/skills/research/SKILL.md +70 -43
  130. package/src/claude/skills/route/SKILL.md +94 -0
  131. package/src/claude/skills/route/references/agent-timing.md +46 -0
  132. package/src/claude/skills/route/references/chaining-patterns.md +53 -0
  133. package/src/claude/skills/route/references/task-taxonomy.md +48 -0
  134. package/src/claude/skills/specs/SKILL.md +41 -60
  135. package/src/claude/skills/specs/references/review.md +11 -8
  136. package/src/claude/skills/specs/references/templates.md +34 -18
  137. package/src/claude/skills/specs/templates/requirements-init.md +1 -1
  138. package/src/claude/skills/specs/templates/research.md +2 -2
  139. package/src/claude/skills/sync/SKILL.md +6 -6
  140. package/src/claude/skills/sync/references/sync-protocols.md +1 -1
  141. package/src/claude/skills/test/SKILL.md +120 -120
  142. package/src/claude/skills/test/references/execution-strategy.md +208 -361
  143. package/src/claude/skills/test/references/failure-triage.md +55 -121
  144. package/src/claude/skills/test/references/test-memory.md +20 -34
  145. package/src/claude/skills/ui-ux-pro-max/SKILL.md +1 -1
  146. package/src/claude/skills/web-testing/SKILL.md +1 -1
  147. package/src/claude/skills/xlsx/SKILL.md +1 -1
  148. package/src/claude/status.cjs +135 -33
  149. package/src/codex/AGENTS.md +14 -4
  150. package/src/codex/hooks/docs-sync.cjs +8 -3
  151. package/src/codex/hooks/lib/hook-context.cjs +18 -4
  152. package/src/codex/hooks/rules.cjs +29 -1
  153. package/src/codex/hooks/secret-output-guardrail.cjs +30 -0
  154. package/src/codex/hooks/spec-gate.cjs +3 -8
  155. package/src/codex/hooks/spec-state.cjs +2 -1
  156. package/src/codex/hooks.json +5 -0
  157. package/src/codex/runtime.json +2 -0
  158. package/src/common/.env.example +1 -1
  159. package/src/claude/skills/backend-development/SKILL.md +0 -101
  160. package/src/claude/skills/backend-development/references/backend-api-design.md +0 -495
  161. package/src/claude/skills/backend-development/references/backend-architecture.md +0 -454
  162. package/src/claude/skills/backend-development/references/backend-authentication.md +0 -338
  163. package/src/claude/skills/backend-development/references/backend-code-quality.md +0 -659
  164. package/src/claude/skills/backend-development/references/backend-debugging.md +0 -904
  165. package/src/claude/skills/backend-development/references/backend-devops.md +0 -491
  166. package/src/claude/skills/backend-development/references/backend-mindset.md +0 -387
  167. package/src/claude/skills/backend-development/references/backend-performance.md +0 -397
  168. package/src/claude/skills/backend-development/references/backend-security.md +0 -342
  169. package/src/claude/skills/backend-development/references/backend-technologies.md +0 -256
  170. package/src/claude/skills/backend-development/references/backend-testing.md +0 -429
  171. package/src/claude/skills/devops/.env.example +0 -76
  172. package/src/claude/skills/devops/SKILL.md +0 -102
  173. package/src/claude/skills/devops/references/browser-rendering.md +0 -305
  174. package/src/claude/skills/devops/references/cloudflare-d1-kv.md +0 -123
  175. package/src/claude/skills/devops/references/cloudflare-platform.md +0 -271
  176. package/src/claude/skills/devops/references/cloudflare-r2-storage.md +0 -280
  177. package/src/claude/skills/devops/references/cloudflare-workers-advanced.md +0 -312
  178. package/src/claude/skills/devops/references/cloudflare-workers-apis.md +0 -309
  179. package/src/claude/skills/devops/references/cloudflare-workers-basics.md +0 -418
  180. package/src/claude/skills/devops/references/docker-basics.md +0 -297
  181. package/src/claude/skills/devops/references/docker-compose.md +0 -292
  182. package/src/claude/skills/devops/references/gcloud-platform.md +0 -297
  183. package/src/claude/skills/devops/references/gcloud-services.md +0 -304
  184. package/src/claude/skills/devops/references/kubernetes-basics.md +0 -95
  185. package/src/claude/skills/devops/references/kubernetes-helm-advanced.md +0 -70
  186. package/src/claude/skills/devops/references/kubernetes-helm.md +0 -81
  187. package/src/claude/skills/devops/references/kubernetes-kubectl.md +0 -74
  188. package/src/claude/skills/devops/references/kubernetes-security-advanced.md +0 -94
  189. package/src/claude/skills/devops/references/kubernetes-security.md +0 -89
  190. package/src/claude/skills/devops/references/kubernetes-troubleshooting-advanced.md +0 -74
  191. package/src/claude/skills/devops/references/kubernetes-troubleshooting.md +0 -49
  192. package/src/claude/skills/devops/references/kubernetes-workflows-advanced.md +0 -75
  193. package/src/claude/skills/devops/references/kubernetes-workflows.md +0 -76
  194. package/src/claude/skills/devops/scripts/cloudflare_deploy.py +0 -269
  195. package/src/claude/skills/devops/scripts/docker_optimize.py +0 -332
  196. package/src/claude/skills/devops/scripts/requirements.txt +0 -20
  197. package/src/claude/skills/devops/scripts/tests/requirements.txt +0 -3
  198. package/src/claude/skills/devops/scripts/tests/test_cloudflare_deploy.py +0 -285
  199. package/src/claude/skills/devops/scripts/tests/test_docker_optimize.py +0 -436
  200. package/src/claude/skills/frontend-design/SKILL.md +0 -135
  201. package/src/claude/skills/frontend-design/references/ai-multimodal-overview.md +0 -165
  202. package/src/claude/skills/frontend-design/references/analysis-best-practices.md +0 -80
  203. package/src/claude/skills/frontend-design/references/analysis-prompts.md +0 -141
  204. package/src/claude/skills/frontend-design/references/analysis-techniques.md +0 -118
  205. package/src/claude/skills/frontend-design/references/animejs.md +0 -396
  206. package/src/claude/skills/frontend-design/references/anti-slop-rules.md +0 -103
  207. package/src/claude/skills/frontend-design/references/asset-generation.md +0 -337
  208. package/src/claude/skills/frontend-design/references/bento-motion-engine.md +0 -142
  209. package/src/claude/skills/frontend-design/references/design-extraction-overview.md +0 -71
  210. package/src/claude/skills/frontend-design/references/extraction-best-practices.md +0 -141
  211. package/src/claude/skills/frontend-design/references/extraction-output-templates.md +0 -162
  212. package/src/claude/skills/frontend-design/references/extraction-prompts.md +0 -127
  213. package/src/claude/skills/frontend-design/references/magicui-components.md +0 -129
  214. package/src/claude/skills/frontend-design/references/performance-guardrails.md +0 -169
  215. package/src/claude/skills/frontend-design/references/premium-design-patterns.md +0 -93
  216. package/src/claude/skills/frontend-design/references/redesign-audit-checklist.md +0 -114
  217. package/src/claude/skills/frontend-design/references/technical-accessibility.md +0 -119
  218. package/src/claude/skills/frontend-design/references/technical-best-practices.md +0 -97
  219. package/src/claude/skills/frontend-design/references/technical-optimization.md +0 -44
  220. package/src/claude/skills/frontend-design/references/technical-overview.md +0 -90
  221. package/src/claude/skills/frontend-design/references/technical-workflows.md +0 -150
  222. package/src/claude/skills/frontend-design/references/visual-analysis-overview.md +0 -95
  223. package/src/claude/skills/frontend-design/references/workflow-3d.md +0 -102
  224. package/src/claude/skills/frontend-design/references/workflow-describe.md +0 -87
  225. package/src/claude/skills/frontend-design/references/workflow-immersive.md +0 -87
  226. package/src/claude/skills/frontend-design/references/workflow-quick.md +0 -57
  227. package/src/claude/skills/frontend-design/references/workflow-screenshot.md +0 -63
  228. package/src/claude/skills/frontend-design/references/workflow-video.md +0 -74
  229. package/src/claude/skills/frontend-development/SKILL.md +0 -406
  230. package/src/claude/skills/frontend-development/resources/common-patterns.md +0 -331
  231. package/src/claude/skills/frontend-development/resources/complete-examples.md +0 -872
  232. package/src/claude/skills/frontend-development/resources/component-patterns.md +0 -502
  233. package/src/claude/skills/frontend-development/resources/data-fetching.md +0 -767
  234. package/src/claude/skills/frontend-development/resources/file-organization.md +0 -502
  235. package/src/claude/skills/frontend-development/resources/loading-and-error-states.md +0 -501
  236. package/src/claude/skills/frontend-development/resources/performance.md +0 -406
  237. package/src/claude/skills/frontend-development/resources/routing-guide.md +0 -364
  238. package/src/claude/skills/frontend-development/resources/styling-guide.md +0 -428
  239. package/src/claude/skills/frontend-development/resources/typescript-standards.md +0 -418
  240. package/src/claude/skills/mobile-development/SKILL.md +0 -218
  241. package/src/claude/skills/mobile-development/references/mobile-android.md +0 -604
  242. package/src/claude/skills/mobile-development/references/mobile-best-practices.md +0 -544
  243. package/src/claude/skills/mobile-development/references/mobile-debugging.md +0 -1089
  244. package/src/claude/skills/mobile-development/references/mobile-frameworks.md +0 -465
  245. package/src/claude/skills/mobile-development/references/mobile-ios.md +0 -496
  246. package/src/claude/skills/mobile-development/references/mobile-mindset.md +0 -542
  247. package/src/claude/skills/react-best-practices/AGENTS.md +0 -2249
  248. package/src/claude/skills/react-best-practices/README.md +0 -123
  249. package/src/claude/skills/react-best-practices/SKILL.md +0 -128
  250. package/src/claude/skills/react-best-practices/metadata.json +0 -15
  251. package/src/claude/skills/react-best-practices/rules/_sections.md +0 -46
  252. package/src/claude/skills/react-best-practices/rules/_template.md +0 -28
  253. package/src/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  254. package/src/claude/skills/react-best-practices/rules/advanced-use-latest.md +0 -49
  255. package/src/claude/skills/react-best-practices/rules/async-api-routes.md +0 -38
  256. package/src/claude/skills/react-best-practices/rules/async-defer-await.md +0 -80
  257. package/src/claude/skills/react-best-practices/rules/async-dependencies.md +0 -36
  258. package/src/claude/skills/react-best-practices/rules/async-parallel.md +0 -28
  259. package/src/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +0 -99
  260. package/src/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +0 -59
  261. package/src/claude/skills/react-best-practices/rules/bundle-conditional.md +0 -31
  262. package/src/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +0 -49
  263. package/src/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  264. package/src/claude/skills/react-best-practices/rules/bundle-preload.md +0 -50
  265. package/src/claude/skills/react-best-practices/rules/client-event-listeners.md +0 -74
  266. package/src/claude/skills/react-best-practices/rules/client-swr-dedup.md +0 -56
  267. package/src/claude/skills/react-best-practices/rules/js-batch-dom-css.md +0 -82
  268. package/src/claude/skills/react-best-practices/rules/js-cache-function-results.md +0 -80
  269. package/src/claude/skills/react-best-practices/rules/js-cache-property-access.md +0 -28
  270. package/src/claude/skills/react-best-practices/rules/js-cache-storage.md +0 -70
  271. package/src/claude/skills/react-best-practices/rules/js-combine-iterations.md +0 -32
  272. package/src/claude/skills/react-best-practices/rules/js-early-exit.md +0 -50
  273. package/src/claude/skills/react-best-practices/rules/js-hoist-regexp.md +0 -45
  274. package/src/claude/skills/react-best-practices/rules/js-index-maps.md +0 -37
  275. package/src/claude/skills/react-best-practices/rules/js-length-check-first.md +0 -49
  276. package/src/claude/skills/react-best-practices/rules/js-min-max-loop.md +0 -82
  277. package/src/claude/skills/react-best-practices/rules/js-set-map-lookups.md +0 -24
  278. package/src/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +0 -57
  279. package/src/claude/skills/react-best-practices/rules/rendering-activity.md +0 -26
  280. package/src/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  281. package/src/claude/skills/react-best-practices/rules/rendering-conditional-render.md +0 -40
  282. package/src/claude/skills/react-best-practices/rules/rendering-content-visibility.md +0 -38
  283. package/src/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  284. package/src/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  285. package/src/claude/skills/react-best-practices/rules/rendering-svg-precision.md +0 -28
  286. package/src/claude/skills/react-best-practices/rules/rerender-defer-reads.md +0 -39
  287. package/src/claude/skills/react-best-practices/rules/rerender-dependencies.md +0 -45
  288. package/src/claude/skills/react-best-practices/rules/rerender-derived-state.md +0 -29
  289. package/src/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +0 -74
  290. package/src/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  291. package/src/claude/skills/react-best-practices/rules/rerender-memo.md +0 -44
  292. package/src/claude/skills/react-best-practices/rules/rerender-transitions.md +0 -40
  293. package/src/claude/skills/react-best-practices/rules/server-after-nonblocking.md +0 -73
  294. package/src/claude/skills/react-best-practices/rules/server-cache-lru.md +0 -41
  295. package/src/claude/skills/react-best-practices/rules/server-cache-react.md +0 -26
  296. package/src/claude/skills/react-best-practices/rules/server-parallel-fetching.md +0 -79
  297. package/src/claude/skills/react-best-practices/rules/server-serialization.md +0 -38
@@ -1,232 +1,170 @@
1
1
  # Brainstorm Question Framework
2
2
 
3
- Use this reference to decide **what to ask**, **what not to ask**, and **how to record decisions** during `hapo:brainstorm`.
3
+ Use this reference to ask the smallest set of questions that can materially
4
+ change the selected route or design. It does not override front-door routing in
5
+ `cf:brainstorm`.
4
6
 
5
- The goal is not to ask many questions. The goal is to ask the smallest set of questions that can materially change the design.
7
+ ## Contract gaps and accepted decisions
6
8
 
7
- ## Source Hierarchy
9
+ The four user-owned contract fields are Outcome, Constraints, Non-goals, and
10
+ Acceptance. Evaluate them independently:
8
11
 
9
- Generate questions from this hierarchy, in order:
12
+ - Reuse a field only when current user text or an approved artifact binds it to
13
+ the same target and revision.
14
+ - Preserve a current non-conflicting field; do not ask the user to repeat it.
15
+ - Treat a missing, stale, or conflicting field as unresolved and ask only when
16
+ it materially changes scope, safety, public behavior, or proof.
17
+ - Never convert an assumption or old “approved” label into user acceptance.
18
+ - Hydration never selects the route; classify the remaining request afterward.
10
19
 
11
- 1. **Scout evidence** — repo type, framework, existing modules, docs, specs, plans, runtime config, and constraints.
12
- 2. **User intent** — nouns, verbs, success language, target users, examples, and implied deliverables in the prompt.
13
- 3. **Exact requirement gaps** — expected output, acceptance criteria, scope boundary, non-negotiable constraints, touchpoints.
14
- 4. **Domain matrix** — only domains that actually apply to the request.
15
- 5. **Risk matrix** — security, privacy, cost, runtime limits, provider failure, migration, compliance, maintainability.
20
+ Technical touchpoints are evidence, not a fifth user-owned field. Derive paths,
21
+ modules, schemas, APIs, and conventions from scouting; ask only when ownership or
22
+ scope is genuinely a user decision.
16
23
 
17
- Never ask a question that the repository, docs, or trusted technical research can answer directly.
24
+ ## Source hierarchy
18
25
 
19
- ## Ask / Do Not Ask
26
+ Generate candidates in this order:
27
+
28
+ 1. Scout evidence: relevant code, docs, specs, plans, runtime, and constraints.
29
+ 2. User intent: outcome language, target users, examples, and delivery format.
30
+ 3. Missing or conflicting contract fields.
31
+ 4. Applicable Domain Matrix entries.
32
+ 5. Applicable risk surfaces.
20
33
 
21
- Ask the user when the answer changes:
34
+ Never ask a question the repository, docs, or trusted technical research can
35
+ answer directly.
22
36
 
23
- - product scope or MVP boundaries
24
- - target user workflow or UX surface
25
- - expected output artifact or delivery format
26
- - acceptance criteria
27
- - business priority, timeline, or rollout
28
- - cost, privacy, API-key ownership, external provider choice
29
- - irreversible workspace action such as renaming/moving/deleting
30
- - whether to accept a trade-off after you explain it
37
+ ## Ask / Do Not Ask
31
38
 
32
- Do **not** ask the user when the answer is a technical fact you should verify:
39
+ Ask when the answer changes:
33
40
 
34
- - browser or runtime limits
35
- - package/API compatibility
36
- - dependency maintenance state
37
- - security best practice
38
- - exact syntax for framework config
39
- - existing code location, schema, endpoint, or convention
41
+ - outcome, MVP boundary, non-goal, or acceptance evidence;
42
+ - target user workflow, UX surface, or output artifact;
43
+ - business priority, rollout, cost, privacy, provider/key ownership;
44
+ - an irreversible workspace action or a public compatibility contract;
45
+ - acceptance of a material trade-off after its consequences are explained.
40
46
 
41
- If a topic mixes user preference and technical fact, verify the technical facts first, then ask the preference question with those facts included.
47
+ Do not ask for technical facts such as current code locations, schema shape,
48
+ runtime/browser limits, package/API compatibility, dependency state, security
49
+ practice, or framework syntax. Verify first, then ask only the remaining product
50
+ or trade-off decision.
42
51
 
43
52
  ## Prioritization
44
53
 
45
- Before asking, score each candidate question:
54
+ Score candidate questions before asking:
46
55
 
47
56
  | Signal | Score |
48
57
  |---|---:|
49
- | Could change architecture, data model, or platform | +3 |
50
- | Could change MVP scope or exclude a feature | +3 |
51
- | Could affect cost, privacy, security, or compliance | +3 |
52
- | Defines observable acceptance criteria | +2 |
53
- | Defines UX flow or primary user surface | +2 |
54
- | Can be answered from repo/docs/research | -4 |
55
- | Merely names an implementation detail with a safe default | -2 |
56
-
57
- Ask only the highest-impact question. If several are tied and independent, ask at most 3 in one `AskUserQuestion` batch; otherwise ask one at a time.
58
-
59
- ## Required Decision Surfaces
60
-
61
- Every brainstorm must eventually resolve these surfaces:
58
+ | Changes architecture, data model, platform, scope, privacy, security, or compliance | +3 |
59
+ | Defines acceptance, primary flow, or user-visible output | +2 |
60
+ | Answerable from code, docs, or research | -4 |
61
+ | Safe implementation default only | -2 |
62
62
 
63
- | Surface | Question Intent |
64
- |---|---|
65
- | Outcome | What does the user expect to exist or happen after the work? |
66
- | Done | How will the user verify it works? |
67
- | Scope | What is explicitly not included now? |
68
- | Constraints | What cannot change: stack, platform, naming, runtime, compatibility, deadline? |
69
- | Touchpoints | Which existing files/modules/contracts will this affect? |
70
-
71
- If any surface is missing, ask a grounded question before proposing architecture.
63
+ Ask the highest-impact question. Batch at most three tied, independent questions;
64
+ otherwise ask one. Stop when the next answer would not change the contract.
72
65
 
73
66
  ## Domain Matrix
74
67
 
75
- Use only the domains that match the request.
68
+ Use only matching domains. These are prompts for material gaps, not a checklist.
76
69
 
77
70
  ### Product / UX
78
71
 
79
- Ask when the prompt includes UI, workflow, dashboard, extension, app, or user-facing behavior.
80
-
81
- - Primary user: who uses this first?
82
- - Primary flow: what is the shortest successful path?
83
- - Surface: page, overlay, sidebar, modal, command, background task?
84
- - State: loading, empty, error, partial result, retry?
85
- - Accessibility or localization expectations?
72
+ - Primary user and shortest successful flow?
73
+ - Surface and loading/empty/error/partial/retry states?
74
+ - Accessibility, localization, responsive, or native constraints?
86
75
 
87
76
  ### Browser Extension
88
77
 
89
- Ask when the work involves Chrome, Edge, Firefox, YouTube, DOM injection, content scripts, popup, options page, or browser APIs.
90
-
91
- - Target browser/runtime and manifest version?
92
- - UI surface: content overlay, sidebar, popup, options page, or all?
93
- - Permissions posture: minimal host permissions or broader convenience?
94
- - Storage: browser storage, IndexedDB, sync storage, or no persistence?
95
- - Publishing target: dev-only, Chrome Web Store, enterprise install?
96
-
97
- Verify instead of asking:
98
-
99
- - Manifest V3 service worker lifetime.
100
- - Browser-reserved shortcut conflicts.
101
- - Content script isolated-world vs main-world behavior.
102
- - Current Chrome API compatibility.
78
+ - Browser/manifest target, UI surface, permission posture, storage, publishing?
79
+ - Verify service-worker lifetime, shortcut conflicts, execution worlds, and API
80
+ compatibility rather than asking the user.
103
81
 
104
82
  ### AI / LLM
105
83
 
106
- Ask when the work involves translation, summarization, agents, prompt output, generation, or provider choice.
107
-
108
- - Provider ownership: user API key, app-owned key, proxy, or local model?
109
- - Provider shape: fixed provider, multi-provider, or custom base URL?
110
- - Output contract: prose, JSON, markdown, SRT, code, patch?
111
- - Failure behavior: retry, fallback, partial result, ask user, or stop?
112
- - Cache policy: never, per session, persistent, or shared?
113
- - Privacy boundary: what content may leave the browser/server?
84
+ - Provider/key ownership, output contract, failure/fallback, cache, privacy?
85
+ - Verify endpoint/auth shape, tool/schema/streaming support, and provider
86
+ compatibility rather than asking the user.
114
87
 
115
- Verify instead of asking:
88
+ ### Data / Documents / Media
116
89
 
117
- - Whether a provider is Anthropic-compatible vs OpenAI-compatible.
118
- - Whether a provider supports tool use / JSON schema / streaming.
119
- - Current API endpoint paths and auth header format.
120
-
121
- ### Data / Transcript / Documents
122
-
123
- Ask when the work transforms documents, captions, data, logs, OCR, audio, video, or legacy code into another artifact.
124
-
125
- - Source priority and fallback order?
126
- - Output format and fidelity level?
127
- - Confidence / evidence tracking requirement?
128
- - Missing/unknown handling?
129
- - Export/import requirements?
90
+ - Source priority, output format/fidelity, unknown/confidence handling, export?
130
91
 
131
92
  ### Backend / API / Database
132
93
 
133
- Ask when the work includes server endpoints, persistence, auth, jobs, integrations, or migrations.
134
-
135
- - API contract: endpoint, method, request/response shape?
136
- - Persistence: new table, existing table, no DB?
137
- - Auth/permission model?
138
- - Idempotency, retries, and background job behavior?
139
- - Migration and rollback constraints?
94
+ - Public request/response behavior, identity/permissions, persistence,
95
+ idempotency/retry, migration and rollback?
140
96
 
141
97
  ### Docs / Legacy Reconstruction
142
98
 
143
- Ask when the work is documentation, legacy analysis, or requirement reconstruction.
144
-
145
- - Scope path/module to reconstruct?
146
- - Output docs required: overview, requirements, architecture, evidence map, unknowns?
147
- - Evidence level: observed-only or inferred allowed with confidence?
148
- - Review gate: who approves the reconstructed docs?
149
- - Change request follows reconstruction or is separate?
99
+ - Scope, required artifacts, allowed inference/evidence level, human review,
100
+ and whether a later change request is separate?
150
101
 
151
102
  ### Release / Packaging
152
103
 
153
- Ask when the work includes publish, store listing, npm release, versioning, or deployment.
154
-
155
- - Target release channel?
156
- - Version bump type?
157
- - Required checks before publish?
158
- - Store/listing metadata ownership?
159
- - Rollback or deprecation plan?
104
+ - Channel, version intent, required checks, metadata ownership, rollback?
160
105
 
161
- ## Question Format
106
+ ## Risk surfaces
162
107
 
163
- Use `AskUserQuestion` when available.
108
+ Raise only risks that can change the contract or approval path:
164
109
 
165
- - Use 2-4 concrete options.
166
- - Put the recommended option first and label it `(Recommended)`.
167
- - Include a one-sentence impact description per option.
168
- - Do not add an explicit "Other" option; the tool supplies it.
169
- - Avoid abstract labels like "Option A" unless paired with concrete meaning.
110
+ - **Critical section decision:** auth/secrets/privacy; destructive/irreversible
111
+ behavior or data loss; money/privilege/safety; production-state mutation.
112
+ - **Other material risks:** external-provider failure, cost limits, migration,
113
+ compatibility, concurrency, compliance, maintainability, or unavailable proof.
170
114
 
171
- Good:
115
+ Explain the verified risk and viable consequences before asking. Do not create a
116
+ ceremonial risk matrix.
172
117
 
173
- > "Where should transcript fallback live?"
174
- > - "Defer STT for MVP (Recommended)" — Ships faster; no fragile audio extraction now.
175
- > - "Browser-only STT" — No backend, but fragile and heavy.
176
- > - "Companion backend" — More robust, but requires hosting and ops.
118
+ ## Evidence calibration
177
119
 
178
- Bad:
120
+ Keep these independent in every recommendation:
179
121
 
180
- > "What architecture do you want?"
122
+ - **Feasibility:** `confirmed | plausible | unknown | infeasible`.
123
+ - **Confidence:** `high | medium | low`.
124
+ - **Disposition:** `chosen | rejected | deferred`.
181
125
 
182
- ## Explain Before Asking
126
+ Every value cites its repository/current-research evidence or stated basis.
127
+ Missing evidence forces feasibility `unknown` and confidence `low`; it never
128
+ becomes a confident guess. A numeric estimate is valid only with range, unit,
129
+ basis, evidence, and assumptions. Otherwise write `unknown`, not a factual
130
+ number. Record why an inapplicable Deep lens was skipped so selective analysis
131
+ is auditable without forcing ceremony.
183
132
 
184
- When the user cannot reasonably know the answer, first explain the trade-off briefly, then ask.
133
+ ## Question format
185
134
 
186
- Use this pattern:
135
+ Use the runtime's native structured user-input tool when available.
187
136
 
188
- 1. State why the decision matters.
189
- 2. Give 2-3 viable options with consequences.
190
- 3. Recommend one.
191
- 4. Ask the user to confirm or override.
192
-
193
- Do not force a choice before explaining hidden technical risk.
137
+ - Give 2–4 concrete options and put the recommended one first.
138
+ - Explain one consequence per option; do not use abstract “Option A” labels.
139
+ - Do not add an explicit Other choice when the runtime supplies it.
140
+ - If the user cannot know a hidden technical fact, explain it before asking.
194
141
 
195
142
  ## Decision Register
196
143
 
197
- Every final brainstorm report must include a decision register.
198
-
199
- ```markdown
200
- ## Decision Register
144
+ For a durable delivery summary, record only decisions actually made:
201
145
 
202
- | ID | Question | Options Presented | User Decision | Rationale | Impact |
146
+ | ID | Question | Options | User Decision | Rationale | Impact |
203
147
  |---|---|---|---|---|---|
204
- | D-001 | Where does transcript fallback live? | Defer STT / Browser-only / Backend | Defer STT | Ships MVP safely | Phase 7 becomes graceful fallback |
205
- ```
206
-
207
- Rules:
208
-
209
- - Record only decisions actually made by the user or explicitly accepted in chat.
210
- - Do not write "user selected" unless `AskUserQuestion` or direct user text confirms it.
211
- - If you infer a default, label it as `Assumption`, not `User Decision`.
212
- - Carry unresolved decisions into `Open Questions`.
213
-
214
- ## Maximum Question Budget
148
+ | D-001 | <material choice> | <options shown> | <confirmed answer> | <why> | <effect> |
215
149
 
216
- Default budget:
150
+ - Do not write "user selected" unless direct user text or the native input tool
151
+ confirms it.
152
+ - Label inferred defaults as `Assumption`, not `User Decision`.
153
+ - Carry truly blocking unknowns into `Open Questions`; defer safe defaults.
217
154
 
218
- - Small change: 1-2 questions.
219
- - Medium feature: 3-6 questions.
220
- - Large/greenfield/architecture-heavy: 6-10 questions across multiple rounds.
155
+ ## Question budget
221
156
 
222
- Stop asking when the next question would only refine an implementation detail with a safe default. Propose the design and list remaining assumptions instead.
157
+ - Small change: usually 1–2.
158
+ - Medium feature: usually 3–6.
159
+ - Large or architecture-heavy work: usually 6–10 across rounds.
223
160
 
224
- ## Final Self-Check
161
+ Budgets are ceilings, not targets. Non-bug exploration may need no approval
162
+ question; an accepted contract may need only one missing-field question.
225
163
 
226
- Before presenting design:
164
+ ## Final self-check
227
165
 
228
- - Did each asked question map to one of the required decision surfaces or domain risks?
229
- - Did any question ask the user to answer a technical fact that should have been researched?
230
- - Are all user decisions captured in the decision register?
231
- - Are assumptions clearly separated from user decisions?
232
- - Are open questions truly blocking, or can they be deferred?
166
+ - Did direct routing happen before scout and questions?
167
+ - Is each question tied to a user-owned contract field or material risk?
168
+ - Were technical facts discovered instead of delegated to the user?
169
+ - Are decisions, assumptions, and open questions separated?
170
+ - Would another question materially change the outcome?
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: hapo:chrome-devtools
2
+ name: cf:chrome-devtools
3
3
  description: Automate browsers with Puppeteer CLI scripts and persistent sessions. Use for screenshots, performance analysis, network monitoring, web scraping, form automation, JavaScript debugging.
4
4
  license: Apache-2.0
5
5
  user-invocable: true
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: hapo:code-review
2
+ name: cf:code-review
3
3
  description: "Review a change for correctness, security, and specification compliance without owning execution proof."
4
4
  user-invocable: true
5
5
  when_to_use: "Use for a pending diff, commit, PR, or explicitly scoped review."
@@ -14,14 +14,21 @@ metadata:
14
14
 
15
15
  Review evaluates correctness, security, scope, architecture, and specification
16
16
  compliance. It does not execute the test suite, create a canonical execution
17
- receipt, or turn a missing test result into a review-owned proof. `hapo:test`
17
+ receipt, or turn a missing test result into a review-owned proof. `cf:test`
18
18
  owns execution proof; the single closeout owner combines both results.
19
19
 
20
20
  ## Input and depth
21
21
 
22
22
  With no argument, review the pending diff. Supported targets are a PR, commit,
23
- pending changes, or an explicit path. Load only the spec and references needed
24
- for the target.
23
+ pending changes, or an explicit path. Load only current target bytes and needed
24
+ references. For a valid process-first target, read `plan.md`, the active flat
25
+ `task-NN-*.md`, and the controller-validated `test-proof-v1` handoff. Mixed,
26
+ orphaned, malformed, symlinked, nonregular, or identity-conflicting packet state
27
+ is `BLOCKED`; review never migrates it.
28
+
29
+ For process-first proof consumption, this skill's `## Execution-proof boundary`
30
+ is authoritative. Do not load or follow legacy separate-receipt paragraphs from
31
+ references; they apply only after the Legacy route below is selected.
25
32
 
26
33
  Select review depth from `assurance_level`, risk, and blast radius. Lane is a
27
34
  derived view:
@@ -38,10 +45,9 @@ fixed Light/Standard/Deep sequence.
38
45
 
39
46
  ### 1. Specification compliance
40
47
 
41
- Compare the diff with `scope_lock`, requirements, design contracts, active task
42
- Outcome/Scope/Anchors and Ownership/Changes/Acceptance/Dependencies/
43
- `Verification Plan`, typed `coordination.boundaries`, and declared
44
- runtime reachability. Identify missing behavior,
48
+ For process-first work, compare the diff with current plan scope and the active
49
+ task's Outcome, Scope, Coverage, Ownership, Acceptance, Dependencies,
50
+ Verification Plan, and declared runtime reachability. Identify missing behavior,
45
51
  unjustified extras, contract substitution, orphaned outputs, and incorrect
46
52
  completion claims. If a design image or document carries requirements, load its
47
53
  multimodal reference only when needed; do not guess from a filename.
@@ -69,18 +75,20 @@ provenance is insufficient.
69
75
 
70
76
  ## Execution-proof boundary
71
77
 
72
- Consume the current canonical receipt when available and report its identity,
73
- scope, and caveats. Never rerun commands to manufacture proof. If execution
74
- proof is missing, say `execution proof unavailable` and leave the overall
75
- closeout to the test owner; do not claim PASS on the feature from review alone.
76
- A review can still return a correctness verdict when its review inputs are
77
- complete.
78
-
79
- For new tasks, read proof from `receipts/<task-basename>.md`; use legacy task
80
- `## Evidence` only as fallback. If both exist and their proof identities
81
- conflict, fail closed. At feature closeout also consume `feature-receipt.md`.
82
- Receipt validity never supplies approval, readiness, audit status, or product
83
- semantics.
78
+ For process-first work, consume only the controller-validated `test-proof-v1`
79
+ handoff. Require its exact closed schema, stable digest, current Base/Head,
80
+ target task, exact command, exit/counts, raw output, reachability, proof level,
81
+ artifacts, branches, and redactions. Unknown keys/verdicts, duplicate or missing
82
+ branches, stale provenance, zero execution, required skips, unsafe redaction, or
83
+ `PASS_WITH_WARNINGS` remain unfinished. Never create or search for a separate
84
+ process-first receipt; Develop alone writes Status and inline `## Receipt` after
85
+ proof and review are both literal `PASS`.
86
+
87
+ Never rerun commands to manufacture proof. If execution proof is missing or
88
+ invalid, say `execution proof unavailable` and leave closeout unfinished; do not
89
+ claim feature PASS from review alone. A review may still return a correctness
90
+ verdict when its review inputs are complete, but that verdict is not execution
91
+ proof or C3 approval.
84
92
 
85
93
  ## Verdict
86
94
 
@@ -99,12 +107,12 @@ closeout result; only literal `PASS` can finish a task. `BLOCKED` means the revi
99
107
  decision is unavailable.
100
108
 
101
109
  ```markdown
102
- # Code Review Results [hapo:code-review]
110
+ # Code Review Results [cf:code-review]
103
111
 
104
112
  **Verdict:** PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED
105
113
  **Target:** [PR | Commit | Path]
106
114
  **Assurance / risk:** [canonical policy input and relevant signals]
107
- **Execution proof:** consumed | unavailable (owned by hapo:test)
115
+ **Execution proof:** test-proof-v1 consumed | unavailable (owned by cf:test)
108
116
 
109
117
  ## Findings
110
118
  - [Critical|High|Medium|Low] path:line — issue, failure scenario, evidence,
@@ -119,10 +127,20 @@ decision is unavailable.
119
127
  Do not add a test command, a fabricated receipt, or an `Audit: PASS` marker to
120
128
  make the review look complete. Return unresolved questions at the end.
121
129
 
130
+ ## Legacy workflow compatibility
131
+
132
+ For a valid legacy packet only, retain its current spec/task resolution,
133
+ separate `receipts/<task-basename>.md` fallback, feature receipt, persisted audit
134
+ obligations, and legacy verdict normalization. If separate and embedded legacy
135
+ proof identities conflict, fail closed. Never copy that adapter into a flat
136
+ process-first packet.
137
+
122
138
  ## References
123
139
 
124
- - `references/spec-compliance-review.md` — load for detailed scope checks.
140
+ - `references/spec-compliance-review.md` — load only its detailed scope checks;
141
+ its separate-receipt paragraph is Legacy-only.
125
142
  - `references/pre-landing-checklists.md` — load for the selected risk surface.
126
143
  - `references/adversarial-review.md` — load for Critical/adversarial depth.
127
- - `references/verification-gate.md` — receipt consumption only; execution stays
128
- with `hapo:test`.
144
+ - `references/verification-gate.md` — Legacy separate-receipt consumption only;
145
+ process-first proof uses this skill's execution-proof boundary. Execution
146
+ always stays with `cf:test`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spec-compliance-review
3
- description: Hapo native protocol for verifying core implementation requirements using multimodal visual validation via ai-multimodal.
3
+ description: Hapo native protocol for verifying core implementation requirements, using multimodal visual validation when available.
4
4
  ---
5
5
 
6
6
  # Spec Compliance Review (Stage 1)
@@ -19,8 +19,7 @@ Do not attempt a standard text-based review if the project includes Visual Specs
19
19
 
20
20
  **Spec Detection Algorithm:**
21
21
  1. Check if the `.specs/` directory, user instructions, or Jira tickets contain attached Image files (`.png`, `.jpg`, `.svg`) or Documents (`.pdf`).
22
- 2. If YES: IMMEDIATELY halt static code analysis. Delegate the generated Frontend code / Logic code along with the Image/PDF to the **`hapo:ai-multimodal` analysis gateway**.
23
- - *Prompt:* "Hey `hapo:ai-multimodal`, please look at this design mockup/document and compare it with the layout/logic described in this Code. Are there any discrepancies?"
22
+ 2. If YES: use **`cf:ai-multimodal` when installed**, or the runtime's available multimodal capability. If neither is available, mark visual comparison `UNPROVEN` and continue the non-visual review.
24
23
  3. If NO (Markdown Spec only): Read the spec directly and extract:
25
24
  - requirement bullets
26
25
  - task `Outcome`, `Scope`, `Anchors and Ownership`, `Changes`, `Acceptance`,
@@ -42,7 +41,7 @@ Each Requirement in the Spec must return 1 of 3 states:
42
41
  - `[PASS]` Fully implemented. Proceed to Code Quality Review.
43
42
  - `[MISSING]` Forgotten feature. Force the Developer to add it immediately (BLOCK MERGE).
44
43
  - `[EXTRA]` The code has bloated with spontaneous features not in the spec card. If unjustified -> FAIL.
45
- - `[VISUAL_MISMATCH]` (For UI Design): The report from `ai-multimodal` indicates this screen will break layout or violate the Design System.
44
+ - `[VISUAL_MISMATCH]` (For UI Design): Available multimodal evidence indicates this screen will break layout or violate the Design System.
46
45
  - `[UNPROVEN]` Required artifact/runtime behavior or verification evidence is missing, so completion cannot be trusted.
47
46
 
48
47
  ## 4. Red Flags
@@ -25,7 +25,7 @@ To clear the Verification Gate, you must cite one of the following concrete proo
25
25
  - **Test Suite Logs:** Output showing tests ran and passed (e.g., `PASS src/components/Login.test.tsx`).
26
26
  - **Compilation/Build Status:** Terminal output proving the typescript compiler (`tsc`) or bundler succeeded with `Exit code: 0`.
27
27
  - **Linter Completion:** Output proving no syntax errors exist.
28
- - **Multimodal Visual Evidence:** `hapo:ai-multimodal` confirming that the visual rendering perfectly matches the design layout.
28
+ - **Multimodal Visual Evidence:** `cf:ai-multimodal` when installed, or another available runtime visual capability; otherwise report visual parity as `UNPROVEN`.
29
29
 
30
30
  For Specs v2, accepted proof must be persisted by the test owner at
31
31
  `receipts/<task-basename>.md`; legacy `## Evidence` remains fallback-only. The