@haposoft/cafekit 0.16.0-rc.8 → 0.16.1

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 (323) hide show
  1. package/README.md +117 -28
  2. package/bin/__tests__/codex-hooks-ownership.test.js +239 -0
  3. package/bin/__tests__/codex-hooks.test.js +175 -0
  4. package/bin/__tests__/codex-native.test.js +1882 -70
  5. package/bin/__tests__/develop-contract.test.js +442 -23
  6. package/bin/__tests__/grok-envelope.test.js +271 -0
  7. package/bin/__tests__/grok-platform.test.js +133 -0
  8. package/bin/__tests__/hook-payload.test.js +194 -0
  9. package/bin/__tests__/installer-safety.test.js +3 -3
  10. package/bin/__tests__/omp-bridge.test.js +168 -0
  11. package/bin/__tests__/omp-hooks.test.js +178 -0
  12. package/bin/__tests__/omp-runtime.test.js +150 -0
  13. package/bin/__tests__/optional-skill-inventory.test.js +249 -0
  14. package/bin/__tests__/output-styles.test.js +214 -0
  15. package/bin/__tests__/package-inventory.test.js +1735 -98
  16. package/bin/__tests__/runtime-dir.test.js +158 -0
  17. package/bin/__tests__/runtime-schema.test.js +113 -0
  18. package/bin/__tests__/secret-output-guardrail.test.js +122 -0
  19. package/bin/__tests__/skill-routing-source.test.js +172 -0
  20. package/bin/__tests__/specs-v2-execution-closeout.test.js +28 -1
  21. package/bin/install.js +15 -5
  22. package/bin/lib/codex-install.js +170 -5
  23. package/bin/lib/context.js +64 -3
  24. package/bin/lib/i18n.js +15 -36
  25. package/bin/lib/skill-deps.js +5 -5
  26. package/bin/phases/claude-runtime.js +23 -0
  27. package/bin/phases/claude-settings.js +8 -0
  28. package/bin/phases/codex-hooks.js +156 -0
  29. package/bin/phases/codex-runtime.js +29 -38
  30. package/bin/phases/copy-payload.js +15 -2
  31. package/bin/phases/omp-runtime.js +140 -0
  32. package/bin/phases/root-config.js +3 -0
  33. package/bin/phases/select-platform.js +22 -1
  34. package/bin/phases/select-skill-bundles.js +96 -0
  35. package/bin/phases/skill-inventory.js +71 -0
  36. package/bin/phases/skills-setup.js +9 -2
  37. package/bin/phases/summary.js +0 -4
  38. package/bin/phases/write-metadata.js +8 -5
  39. package/package.json +8 -2
  40. package/src/claude/CLAUDE.md +3 -3
  41. package/src/claude/agents/brainstormer.md +52 -69
  42. package/src/claude/agents/code-auditor.md +32 -14
  43. package/src/claude/agents/debugger.md +35 -20
  44. package/src/claude/agents/deployer.md +12 -5
  45. package/src/claude/agents/docs-keeper.md +11 -1
  46. package/src/claude/agents/implementer.md +25 -13
  47. package/src/claude/agents/inspector.md +6 -3
  48. package/src/claude/agents/project-manager.md +1 -1
  49. package/src/claude/agents/researcher.md +26 -55
  50. package/src/claude/agents/spec-maker.md +12 -7
  51. package/src/claude/agents/strategist.md +52 -0
  52. package/src/claude/agents/test-runner.md +117 -132
  53. package/src/claude/agents/ui-ux-designer.md +1 -1
  54. package/src/claude/hooks/__tests__/fixtures/statusline-default.golden +1 -0
  55. package/src/claude/hooks/__tests__/precompact.test.js +158 -0
  56. package/src/claude/hooks/__tests__/semantic-review-authority.test.js +2 -0
  57. package/src/claude/hooks/__tests__/spec-gate.test.js +348 -3
  58. package/src/claude/hooks/__tests__/state.test.js +7 -0
  59. package/src/claude/hooks/__tests__/statusline.test.js +196 -0
  60. package/src/claude/hooks/agent.cjs +13 -8
  61. package/src/claude/hooks/completion-authority.cjs +10 -4
  62. package/src/claude/hooks/docs-sync.cjs +14 -11
  63. package/src/claude/hooks/inspect-block.cjs +28 -8
  64. package/src/claude/hooks/lib/config.cjs +8 -2
  65. package/src/claude/hooks/lib/counter.cjs +7 -5
  66. package/src/claude/hooks/lib/hook-payload.cjs +160 -0
  67. package/src/claude/hooks/lib/hook-state-dir.cjs +39 -0
  68. package/src/claude/hooks/lib/runtime-dir.cjs +49 -0
  69. package/src/claude/hooks/lib/secret-keywords.cjs +42 -0
  70. package/src/claude/hooks/precompact.cjs +106 -0
  71. package/src/claude/hooks/privacy-block.cjs +4 -2
  72. package/src/claude/hooks/rules.cjs +5 -3
  73. package/src/claude/hooks/secret-output-guardrail.cjs +44 -0
  74. package/src/claude/hooks/semantic-review-authority.cjs +6 -4
  75. package/src/claude/hooks/session.cjs +37 -9
  76. package/src/claude/hooks/spec-gate.cjs +21 -11
  77. package/src/claude/hooks/spec-state.cjs +11 -7
  78. package/src/claude/hooks/state.cjs +7 -5
  79. package/src/claude/hooks/task-scaffold-guard.cjs +30 -9
  80. package/src/claude/hooks/usage.cjs +6 -5
  81. package/src/claude/migration-manifest.json +31 -15
  82. package/src/claude/output-styles/coding-level-0-eli5.md +103 -0
  83. package/src/claude/output-styles/coding-level-1-junior.md +124 -0
  84. package/src/claude/output-styles/coding-level-2-mid.md +146 -0
  85. package/src/claude/output-styles/coding-level-3-senior.md +148 -0
  86. package/src/claude/output-styles/coding-level-4-lead.md +159 -0
  87. package/src/claude/output-styles/coding-level-5-god.md +91 -0
  88. package/src/claude/references/debugger/core-philosophy.md +5 -3
  89. package/src/claude/references/debugger/frontend-verification.md +2 -2
  90. package/src/claude/references/debugger/log-ci-analysis.md +13 -1
  91. package/src/claude/references/debugger/parallel-agent-hydration.md +19 -34
  92. package/src/claude/references/debugger/performance-diagnostics.md +2 -2
  93. package/src/claude/references/debugger/root-cause-tracing.md +37 -6
  94. package/src/claude/references/debugger/side-effect-gate.md +3 -1
  95. package/src/claude/references/debugger/verification-protocol.md +13 -12
  96. package/src/claude/rules/orchestrator.md +7 -1
  97. package/src/claude/rules/process-management.md +39 -0
  98. package/src/claude/rules/review-audit-self-decision.md +48 -0
  99. package/src/claude/rules/skill-domain-routing.md +26 -24
  100. package/src/claude/rules/skill-workflow-routing.md +22 -14
  101. package/src/claude/rules/state-sync.md +7 -1
  102. package/src/claude/rules/workflow.md +5 -3
  103. package/src/claude/runtime.json +1 -0
  104. package/src/claude/runtime.schema.json +205 -0
  105. package/src/claude/scripts/generate-skill-catalog.cjs +156 -122
  106. package/src/claude/scripts/provenance.cjs +29 -9
  107. package/src/claude/scripts/spec-receipt.cjs +65 -4
  108. package/src/claude/scripts/workflow-policy.cjs +1 -1
  109. package/src/claude/settings/settings.json +16 -0
  110. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  111. package/src/claude/skills/ai-multimodal/SKILL.md +1 -1
  112. package/src/claude/skills/brainstorm/SKILL.md +193 -172
  113. package/src/claude/skills/brainstorm/references/question-framework.md +105 -167
  114. package/src/claude/skills/chrome-devtools/SKILL.md +1 -1
  115. package/src/claude/skills/code-review/SKILL.md +43 -25
  116. package/src/claude/skills/code-review/references/spec-compliance-review.md +3 -4
  117. package/src/claude/skills/code-review/references/verification-gate.md +1 -1
  118. package/src/claude/skills/debug/SKILL.md +48 -19
  119. package/src/claude/skills/delegate/SKILL.md +1 -1
  120. package/src/claude/skills/develop/SKILL.md +92 -65
  121. package/src/claude/skills/develop/references/parallel-waves.md +36 -63
  122. package/src/claude/skills/develop/references/quality-gate.md +31 -4
  123. package/src/claude/skills/develop/references/subagent-patterns.md +21 -7
  124. package/src/claude/skills/docs/SKILL.md +42 -23
  125. package/src/claude/skills/docs/references/init-workflow.md +4 -4
  126. package/src/claude/skills/docs/references/reconstruct-workflow.md +6 -6
  127. package/src/claude/skills/docs/references/standard-docs-workflow.md +6 -2
  128. package/src/claude/skills/docs/references/summarize-workflow.md +2 -2
  129. package/src/claude/skills/docs/references/update-workflow.md +9 -7
  130. package/src/claude/skills/docs/templates/requirements-as-is.md +1 -1
  131. package/src/claude/skills/docx/SKILL.md +1 -1
  132. package/src/claude/skills/git/SKILL.md +1 -1
  133. package/src/claude/skills/git/references/commit-protocols.md +1 -1
  134. package/src/claude/skills/git/references/finish-branch.md +1 -1
  135. package/src/claude/skills/hotfix/SKILL.md +159 -170
  136. package/src/claude/skills/hotfix/references/diagnosis-protocol.md +14 -9
  137. package/src/claude/skills/hotfix/references/parallel-patterns.md +27 -13
  138. package/src/claude/skills/hotfix/references/prevention-gate.md +5 -0
  139. package/src/claude/skills/hotfix/references/review-cycle.md +21 -15
  140. package/src/claude/skills/hotfix/references/workflow-specialized.md +53 -21
  141. package/src/claude/skills/inspect/SKILL.md +55 -46
  142. package/src/claude/skills/inspect/references/internal-inspection.md +21 -5
  143. package/src/claude/skills/loop/SKILL.md +114 -0
  144. package/src/claude/skills/loop/references/bounded-loop-protocol.md +104 -0
  145. package/src/claude/skills/loop/references/metric-and-guard-contract.md +76 -0
  146. package/src/claude/skills/pdf/SKILL.md +1 -1
  147. package/src/claude/skills/pptx/SKILL.md +1 -1
  148. package/src/claude/skills/question/SKILL.md +16 -13
  149. package/src/claude/skills/research/SKILL.md +70 -43
  150. package/src/claude/skills/route/SKILL.md +94 -0
  151. package/src/claude/skills/route/references/agent-timing.md +46 -0
  152. package/src/claude/skills/route/references/chaining-patterns.md +53 -0
  153. package/src/claude/skills/route/references/task-taxonomy.md +48 -0
  154. package/src/claude/skills/specs/SKILL.md +51 -71
  155. package/src/claude/skills/specs/references/review.md +11 -8
  156. package/src/claude/skills/specs/references/templates.md +34 -18
  157. package/src/claude/skills/specs/templates/requirements-init.md +1 -1
  158. package/src/claude/skills/specs/templates/research.md +2 -2
  159. package/src/claude/skills/sync/SKILL.md +6 -6
  160. package/src/claude/skills/sync/references/sync-protocols.md +1 -1
  161. package/src/claude/skills/test/SKILL.md +120 -120
  162. package/src/claude/skills/test/references/execution-strategy.md +208 -361
  163. package/src/claude/skills/test/references/failure-triage.md +55 -121
  164. package/src/claude/skills/test/references/test-memory.md +20 -34
  165. package/src/claude/skills/ui-ux-pro-max/SKILL.md +1 -1
  166. package/src/claude/skills/web-testing/SKILL.md +1 -1
  167. package/src/claude/skills/xlsx/SKILL.md +1 -1
  168. package/src/claude/status.cjs +135 -33
  169. package/src/codex/AGENTS.md +14 -4
  170. package/src/codex/hooks/docs-sync.cjs +8 -3
  171. package/src/codex/hooks/lib/hook-context.cjs +18 -4
  172. package/src/codex/hooks/rules.cjs +29 -1
  173. package/src/codex/hooks/secret-output-guardrail.cjs +30 -0
  174. package/src/codex/hooks/spec-gate.cjs +3 -8
  175. package/src/codex/hooks/spec-state.cjs +3 -2
  176. package/src/codex/hooks.json +5 -0
  177. package/src/codex/rules/state-sync.md +7 -1
  178. package/src/codex/runtime.json +2 -0
  179. package/src/common/.env.example +1 -1
  180. package/src/omp/extensions/cafekit-bridge.mjs +233 -0
  181. package/src/omp/hooks/privacy-block.cjs +250 -0
  182. package/src/omp/runtime.json +33 -0
  183. package/bin/lib/rtk-run.js +0 -28
  184. package/bin/phases/setup-rtk.js +0 -159
  185. package/src/claude/skills/backend-development/SKILL.md +0 -101
  186. package/src/claude/skills/backend-development/references/backend-api-design.md +0 -495
  187. package/src/claude/skills/backend-development/references/backend-architecture.md +0 -454
  188. package/src/claude/skills/backend-development/references/backend-authentication.md +0 -338
  189. package/src/claude/skills/backend-development/references/backend-code-quality.md +0 -659
  190. package/src/claude/skills/backend-development/references/backend-debugging.md +0 -904
  191. package/src/claude/skills/backend-development/references/backend-devops.md +0 -491
  192. package/src/claude/skills/backend-development/references/backend-mindset.md +0 -387
  193. package/src/claude/skills/backend-development/references/backend-performance.md +0 -397
  194. package/src/claude/skills/backend-development/references/backend-security.md +0 -342
  195. package/src/claude/skills/backend-development/references/backend-technologies.md +0 -256
  196. package/src/claude/skills/backend-development/references/backend-testing.md +0 -429
  197. package/src/claude/skills/devops/.env.example +0 -76
  198. package/src/claude/skills/devops/SKILL.md +0 -102
  199. package/src/claude/skills/devops/references/browser-rendering.md +0 -305
  200. package/src/claude/skills/devops/references/cloudflare-d1-kv.md +0 -123
  201. package/src/claude/skills/devops/references/cloudflare-platform.md +0 -271
  202. package/src/claude/skills/devops/references/cloudflare-r2-storage.md +0 -280
  203. package/src/claude/skills/devops/references/cloudflare-workers-advanced.md +0 -312
  204. package/src/claude/skills/devops/references/cloudflare-workers-apis.md +0 -309
  205. package/src/claude/skills/devops/references/cloudflare-workers-basics.md +0 -418
  206. package/src/claude/skills/devops/references/docker-basics.md +0 -297
  207. package/src/claude/skills/devops/references/docker-compose.md +0 -292
  208. package/src/claude/skills/devops/references/gcloud-platform.md +0 -297
  209. package/src/claude/skills/devops/references/gcloud-services.md +0 -304
  210. package/src/claude/skills/devops/references/kubernetes-basics.md +0 -95
  211. package/src/claude/skills/devops/references/kubernetes-helm-advanced.md +0 -70
  212. package/src/claude/skills/devops/references/kubernetes-helm.md +0 -81
  213. package/src/claude/skills/devops/references/kubernetes-kubectl.md +0 -74
  214. package/src/claude/skills/devops/references/kubernetes-security-advanced.md +0 -94
  215. package/src/claude/skills/devops/references/kubernetes-security.md +0 -89
  216. package/src/claude/skills/devops/references/kubernetes-troubleshooting-advanced.md +0 -74
  217. package/src/claude/skills/devops/references/kubernetes-troubleshooting.md +0 -49
  218. package/src/claude/skills/devops/references/kubernetes-workflows-advanced.md +0 -75
  219. package/src/claude/skills/devops/references/kubernetes-workflows.md +0 -76
  220. package/src/claude/skills/devops/scripts/cloudflare_deploy.py +0 -269
  221. package/src/claude/skills/devops/scripts/docker_optimize.py +0 -332
  222. package/src/claude/skills/devops/scripts/requirements.txt +0 -20
  223. package/src/claude/skills/devops/scripts/tests/requirements.txt +0 -3
  224. package/src/claude/skills/devops/scripts/tests/test_cloudflare_deploy.py +0 -285
  225. package/src/claude/skills/devops/scripts/tests/test_docker_optimize.py +0 -436
  226. package/src/claude/skills/frontend-design/SKILL.md +0 -135
  227. package/src/claude/skills/frontend-design/references/ai-multimodal-overview.md +0 -165
  228. package/src/claude/skills/frontend-design/references/analysis-best-practices.md +0 -80
  229. package/src/claude/skills/frontend-design/references/analysis-prompts.md +0 -141
  230. package/src/claude/skills/frontend-design/references/analysis-techniques.md +0 -118
  231. package/src/claude/skills/frontend-design/references/animejs.md +0 -396
  232. package/src/claude/skills/frontend-design/references/anti-slop-rules.md +0 -103
  233. package/src/claude/skills/frontend-design/references/asset-generation.md +0 -337
  234. package/src/claude/skills/frontend-design/references/bento-motion-engine.md +0 -142
  235. package/src/claude/skills/frontend-design/references/design-extraction-overview.md +0 -71
  236. package/src/claude/skills/frontend-design/references/extraction-best-practices.md +0 -141
  237. package/src/claude/skills/frontend-design/references/extraction-output-templates.md +0 -162
  238. package/src/claude/skills/frontend-design/references/extraction-prompts.md +0 -127
  239. package/src/claude/skills/frontend-design/references/magicui-components.md +0 -129
  240. package/src/claude/skills/frontend-design/references/performance-guardrails.md +0 -169
  241. package/src/claude/skills/frontend-design/references/premium-design-patterns.md +0 -93
  242. package/src/claude/skills/frontend-design/references/redesign-audit-checklist.md +0 -114
  243. package/src/claude/skills/frontend-design/references/technical-accessibility.md +0 -119
  244. package/src/claude/skills/frontend-design/references/technical-best-practices.md +0 -97
  245. package/src/claude/skills/frontend-design/references/technical-optimization.md +0 -44
  246. package/src/claude/skills/frontend-design/references/technical-overview.md +0 -90
  247. package/src/claude/skills/frontend-design/references/technical-workflows.md +0 -150
  248. package/src/claude/skills/frontend-design/references/visual-analysis-overview.md +0 -95
  249. package/src/claude/skills/frontend-design/references/workflow-3d.md +0 -102
  250. package/src/claude/skills/frontend-design/references/workflow-describe.md +0 -87
  251. package/src/claude/skills/frontend-design/references/workflow-immersive.md +0 -87
  252. package/src/claude/skills/frontend-design/references/workflow-quick.md +0 -57
  253. package/src/claude/skills/frontend-design/references/workflow-screenshot.md +0 -63
  254. package/src/claude/skills/frontend-design/references/workflow-video.md +0 -74
  255. package/src/claude/skills/frontend-development/SKILL.md +0 -406
  256. package/src/claude/skills/frontend-development/resources/common-patterns.md +0 -331
  257. package/src/claude/skills/frontend-development/resources/complete-examples.md +0 -872
  258. package/src/claude/skills/frontend-development/resources/component-patterns.md +0 -502
  259. package/src/claude/skills/frontend-development/resources/data-fetching.md +0 -767
  260. package/src/claude/skills/frontend-development/resources/file-organization.md +0 -502
  261. package/src/claude/skills/frontend-development/resources/loading-and-error-states.md +0 -501
  262. package/src/claude/skills/frontend-development/resources/performance.md +0 -406
  263. package/src/claude/skills/frontend-development/resources/routing-guide.md +0 -364
  264. package/src/claude/skills/frontend-development/resources/styling-guide.md +0 -428
  265. package/src/claude/skills/frontend-development/resources/typescript-standards.md +0 -418
  266. package/src/claude/skills/mobile-development/SKILL.md +0 -218
  267. package/src/claude/skills/mobile-development/references/mobile-android.md +0 -604
  268. package/src/claude/skills/mobile-development/references/mobile-best-practices.md +0 -544
  269. package/src/claude/skills/mobile-development/references/mobile-debugging.md +0 -1089
  270. package/src/claude/skills/mobile-development/references/mobile-frameworks.md +0 -465
  271. package/src/claude/skills/mobile-development/references/mobile-ios.md +0 -496
  272. package/src/claude/skills/mobile-development/references/mobile-mindset.md +0 -542
  273. package/src/claude/skills/react-best-practices/AGENTS.md +0 -2249
  274. package/src/claude/skills/react-best-practices/README.md +0 -123
  275. package/src/claude/skills/react-best-practices/SKILL.md +0 -128
  276. package/src/claude/skills/react-best-practices/metadata.json +0 -15
  277. package/src/claude/skills/react-best-practices/rules/_sections.md +0 -46
  278. package/src/claude/skills/react-best-practices/rules/_template.md +0 -28
  279. package/src/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  280. package/src/claude/skills/react-best-practices/rules/advanced-use-latest.md +0 -49
  281. package/src/claude/skills/react-best-practices/rules/async-api-routes.md +0 -38
  282. package/src/claude/skills/react-best-practices/rules/async-defer-await.md +0 -80
  283. package/src/claude/skills/react-best-practices/rules/async-dependencies.md +0 -36
  284. package/src/claude/skills/react-best-practices/rules/async-parallel.md +0 -28
  285. package/src/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +0 -99
  286. package/src/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +0 -59
  287. package/src/claude/skills/react-best-practices/rules/bundle-conditional.md +0 -31
  288. package/src/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +0 -49
  289. package/src/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  290. package/src/claude/skills/react-best-practices/rules/bundle-preload.md +0 -50
  291. package/src/claude/skills/react-best-practices/rules/client-event-listeners.md +0 -74
  292. package/src/claude/skills/react-best-practices/rules/client-swr-dedup.md +0 -56
  293. package/src/claude/skills/react-best-practices/rules/js-batch-dom-css.md +0 -82
  294. package/src/claude/skills/react-best-practices/rules/js-cache-function-results.md +0 -80
  295. package/src/claude/skills/react-best-practices/rules/js-cache-property-access.md +0 -28
  296. package/src/claude/skills/react-best-practices/rules/js-cache-storage.md +0 -70
  297. package/src/claude/skills/react-best-practices/rules/js-combine-iterations.md +0 -32
  298. package/src/claude/skills/react-best-practices/rules/js-early-exit.md +0 -50
  299. package/src/claude/skills/react-best-practices/rules/js-hoist-regexp.md +0 -45
  300. package/src/claude/skills/react-best-practices/rules/js-index-maps.md +0 -37
  301. package/src/claude/skills/react-best-practices/rules/js-length-check-first.md +0 -49
  302. package/src/claude/skills/react-best-practices/rules/js-min-max-loop.md +0 -82
  303. package/src/claude/skills/react-best-practices/rules/js-set-map-lookups.md +0 -24
  304. package/src/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +0 -57
  305. package/src/claude/skills/react-best-practices/rules/rendering-activity.md +0 -26
  306. package/src/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  307. package/src/claude/skills/react-best-practices/rules/rendering-conditional-render.md +0 -40
  308. package/src/claude/skills/react-best-practices/rules/rendering-content-visibility.md +0 -38
  309. package/src/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  310. package/src/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  311. package/src/claude/skills/react-best-practices/rules/rendering-svg-precision.md +0 -28
  312. package/src/claude/skills/react-best-practices/rules/rerender-defer-reads.md +0 -39
  313. package/src/claude/skills/react-best-practices/rules/rerender-dependencies.md +0 -45
  314. package/src/claude/skills/react-best-practices/rules/rerender-derived-state.md +0 -29
  315. package/src/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +0 -74
  316. package/src/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  317. package/src/claude/skills/react-best-practices/rules/rerender-memo.md +0 -44
  318. package/src/claude/skills/react-best-practices/rules/rerender-transitions.md +0 -40
  319. package/src/claude/skills/react-best-practices/rules/server-after-nonblocking.md +0 -73
  320. package/src/claude/skills/react-best-practices/rules/server-cache-lru.md +0 -41
  321. package/src/claude/skills/react-best-practices/rules/server-cache-react.md +0 -26
  322. package/src/claude/skills/react-best-practices/rules/server-parallel-fetching.md +0 -79
  323. package/src/claude/skills/react-best-practices/rules/server-serialization.md +0 -38
@@ -1,188 +1,209 @@
1
1
  ---
2
- name: hapo:brainstorm
3
- description: "Scout-first brainstorming for unclear ideas, architectural choices, scope gates, and translating raw intent into a spec-ready design."
2
+ name: cf:brainstorm
3
+ description: "Turn unresolved product or architecture intent into a bounded decision contract, with proportional routing, evidence, and safe handoff."
4
4
  user-invocable: true
5
- when_to_use: "Invoke before choosing among unclear technical options or scope."
5
+ when_to_use: "Use when material product, scope, or architecture choices remain; skip direct factual answers and already-concrete Specs work."
6
6
  category: utilities
7
7
  keywords: [ideation, tradeoffs, decisions, scope]
8
8
  argument-hint: "<idea_or_problem>"
9
9
  metadata:
10
10
  author: haposoft
11
- version: "2.1.0"
11
+ version: "3.0.0"
12
12
  ---
13
- # Brainstorming Skill
13
+ # Brainstorm — proportional pre-delivery design
14
14
 
15
- You execute CafeKit's pre-spec design workflow. Your job is to turn a raw idea into a validated, spec-ready design without writing code or starting implementation.
16
-
17
- `hapo:brainstorm` is the workflow entrypoint. The `brainstormer` agent is a specialist you may call for difficult architectural debate; it is not a replacement for this workflow.
18
-
19
- ## Core Stance
20
-
21
- - Scout before asking. Do not ask generic questions when the repository can make the question concrete.
22
- - Make requirements exact before proposing architecture.
23
- - Challenge assumptions without turning the session into a debate for its own sake.
24
- - Prefer the simplest design that satisfies the agreed acceptance criteria.
25
- - Keep design approval incremental: small sections, explicit confirmation, then handoff.
15
+ Turn unresolved intent into a bounded contract without turning clear work into
16
+ an interview. `cf:brainstorm` owns the workflow; `brainstormer` is an optional
17
+ specialist for real architectural trade-offs.
26
18
 
27
19
  <HARD-GATE>
28
- Do NOT invoke implementation skills, write code, scaffold files, modify source, or begin `/hapo:develop` until the design has been presented and explicitly approved by the user.
20
+ Brainstorm never writes implementation, invokes Develop, or treats approval as
21
+ implementation authority. Feature or documentation delivery may prepare context
22
+ for a new explicit `cf:specs` invocation; it never starts Specs implicitly.
29
23
  </HARD-GATE>
30
24
 
31
- <HARD-GATE-SCOUT-FIRST>
32
- Before asking clarifying questions or proposing approaches, run `hapo:inspect` or perform a narrow equivalent scout.
33
-
34
- Mandatory scout findings:
35
- 1. Project type, primary languages, and major frameworks.
36
- 2. Existing files/modules relevant to the topic.
37
- 3. Current patterns or conventions for similar work.
38
- 4. Relevant docs, specs, or plans already present.
39
- 5. Constraints discovered from code, schemas, APIs, naming, or runtime setup.
40
-
41
- Then summarize the useful findings to the user in 3-6 bullets before Discovery.
42
- </HARD-GATE-SCOUT-FIRST>
43
-
44
- <HARD-GATE-EXACT-REQUIREMENTS>
45
- Before proposing solutions, capture concrete answers for:
46
- 1. Expected output: feature behavior, artifact, UI surface, API shape, CLI behavior, or document.
47
- 2. Acceptance criteria: observable checks that prove done.
48
- 3. Scope boundary: what is explicitly out of scope for this round.
49
- 4. Non-negotiable constraints: stack, files, compatibility, deadlines, naming, runtime.
50
- 5. Touchpoints: existing files/modules/data/contracts the design will affect.
51
-
52
- If any item is vague, ask one more grounded question. Do not proceed with phrases like "make it better" or "add validation" unless you have concrete examples.
53
- </HARD-GATE-EXACT-REQUIREMENTS>
54
-
55
- ## Anti-Rationalization
56
-
57
- | Thought | Reality |
58
- |---------|---------|
59
- | "This is too simple to need a design" | Simple projects = most wasted work from unexamined assumptions. |
60
- | "I already know the solution" | Then writing it down takes 30 seconds. Do it. |
61
- | "The user wants action, not talk" | Bad action wastes more time than good planning. |
62
- | "I'll skip the scout summary and go straight to questions" | Gate order is scout → summarize findings → ask. Questions come from evidence. |
63
- | "I'll just prototype quickly" | Prototypes become production code. Design first. |
64
-
65
- ## Collaboration Tools
66
-
67
- Leverage these specific tools or sub-agents to execute the workflow effectively:
68
- - `AskUserQuestion`: Use this to enforce the "One Question at a Time" rule and to present multiple choices.
69
- - `hapo:inspect`: Mandatory first pass for repo-aware brainstorming.
70
- - `hapo:ai-multimodal`: Use this when analyzing visual materials and mockups.
71
- - `repomix --remote`: Use this bash command to summarize external Github repositories if a URL is provided.
72
- - `psql`: Query database schemas to understand existing data structures.
73
- Call brainstormer only when 2+ architectures have material trade-offs after discovery; call researcher only for external/current facts the repo cannot answer.
25
+ ## Control flags
26
+
27
+ Parse controls only from the leading consecutive token segment. Accept
28
+ `--deep`, `--visual`, and `--advice` in any order, each at most once. `--` ends
29
+ the control segment. After it or the first content token, every token is user
30
+ content. An unknown or duplicate `--*` inside the leading segment returns usage
31
+ and performs no scout, question, tool call, write, or workflow action.
32
+
33
+ Parsing identifies controls but does not apply them. Route Direct first, then
34
+ apply controls only to requests that remain in Brainstorm. `--deep` may raise
35
+ non-direct analysis depth but never lower a gate; `--visual` changes presentation
36
+ only; and no control grants persistence, approval, dispatch, or implementation
37
+ authority. Use `-- --dry-run` when literal flag-like content leads the prompt.
38
+
39
+ ## Front-door routing — before scout or questions
40
+
41
+ Classify intent first. This routing never waives safety or permission rules.
42
+
43
+ 1. **Direct request:** for a factual answer, a specific command, or an explicitly
44
+ different workflow, leave Brainstorm before scout, questions, approval, or
45
+ persistence. Read-only product or architecture exploration is not direct merely
46
+ because it writes no files.
47
+ 2. **Hydrate the contract, then keep routing:** for every request that remains,
48
+ reuse accepted Outcome, Constraints, Non-goals, and Acceptance field by field
49
+ only when current user text or an approved artifact binds them to the same
50
+ target and revision. Preserve current non-conflicting fields; treat missing,
51
+ stale, or conflicting fields as gaps. Never infer approval. Hydration is not a
52
+ terminal route; continue to exactly one intent route below.
53
+ 3. **Bug or failure:** before diagnosis, capture the repaired-behavior Outcome,
54
+ Constraints, Non-goals, and Acceptance evidence. Then use `cf:debug` until
55
+ root cause is evidenced. Do not brainstorm fixes from a symptom. If at least
56
+ two cause-aligned remedies remain, compare 2–3 here. Hand off to `cf:fix`
57
+ only when the user explicitly requested a fix; diagnosis-only work returns the
58
+ root-cause report and stops.
59
+ 4. **Non-bug exploration only:** inspect enough evidence, give a chat
60
+ recommendation, and stop. Do not request design approval, persist a report, or
61
+ invoke another workflow without a new explicit request.
62
+ 5. **Feature or documentation delivery:** continue through the design workflow.
63
+
64
+ ## Adaptive analysis depth
65
+
66
+ For every non-direct request, choose the smallest adequate depth from current
67
+ evidence and material risk:
68
+
69
+ - **Standard:** bounded single-surface work with no material risk signal.
70
+ - **Deep:** critical safety/security risk; public compatibility or data migration;
71
+ cross-service state or concurrency; costly or irreversible rollback; or
72
+ unresolved feasibility at a material boundary.
73
+ - With no Deep signal, use Standard. `--deep` raises Standard to Deep. If three
74
+ or more subsystems are independently deliverable, split them instead of using
75
+ Deep as a monolithic substitute.
76
+
77
+ Deep is selective, not a checklist. Apply a lens only when its trigger is
78
+ present and otherwise record `skipped: <reason>`: feasibility for an unresolved
79
+ material boundary; stakeholders for externally affected roles; system boundaries
80
+ for cross-component state; failure isolation for partial or cascading failure
81
+ across boundaries; reversibility and recovery for costly or irreversible failure;
82
+ operability for runtime ownership; migration/rollback for data or public
83
+ compatibility; testability for a material proof gap; and second-order effects
84
+ for downstream behavior or incentives.
85
+
86
+ ## Contract and evidence
87
+
88
+ For feature/docs delivery and every bug/failure, resolve four user-owned fields:
89
+
90
+ - **Outcome:** observable end state.
91
+ - **Constraints:** safety, compatibility, time, technology, and ownership limits.
92
+ - **Non-goals:** nearby work excluded from this delivery.
93
+ - **Acceptance:** observable evidence that proves completion.
94
+
95
+ After front-door routing, run `cf:scout` or a narrow equivalent before
96
+ technical design. Inspect relevant modules, patterns, docs/plans, contracts, and
97
+ runtime constraints; summarize only useful findings in 3–6 bullets.
98
+
99
+ For supplied images, video, PDFs, or mockups, use `cf:ai-multimodal` when the
100
+ optional document bundle is installed; otherwise use the runtime's available
101
+ multimodal capability or report the evidence gap. Add a diagram only when it
102
+ clarifies a material choice or flow.
103
+
104
+ Derive technical touchpoints from repository evidence. Ask the user about a
105
+ touchpoint only when its ownership or scope boundary is a product decision that
106
+ cannot be discovered. Keep intent separate from current-state evidence.
107
+
108
+ On every route, keep feasibility (`confirmed | plausible | unknown |
109
+ infeasible`), confidence (`high | medium | low`), and disposition (`chosen |
110
+ rejected | deferred`) separate and cite evidence or basis. Missing evidence
111
+ forces feasibility `unknown` and confidence `low`. A numeric estimate requires
112
+ range, unit, basis, evidence, and assumptions; otherwise report `unknown`.
113
+
114
+ If the request spans three or more independently deliverable subsystems, split
115
+ it. A subsystem is independent only when its outcome, boundary, and verification
116
+ or deployment path can move through the lifecycle separately.
74
117
 
75
118
  ## Discovery Question Framework
76
119
 
77
- Load and follow `references/question-framework.md` before the first user-facing discovery question.
78
-
79
- Use it to:
80
- - Generate questions from scout evidence, user intent, exact requirement gaps, matching domain matrices, and risk surfaces.
81
- - Avoid asking the user to answer technical facts that should be verified from code, docs, or current provider/browser documentation.
82
- - Prioritize only questions that can materially change architecture, MVP scope, UX, cost/privacy/security, acceptance criteria, or delivery format.
83
- - Record every user-confirmed decision in a decision register in the final report.
84
-
85
- If the framework conflicts with the general "one question at a time" rule, prefer the framework's question budget and batching limits: one high-impact question by default, up to 3 independent questions in one `AskUserQuestion` call only when batching reduces friction without mixing unrelated decisions.
86
-
87
- ## Authoritative Workflow
88
-
89
- ```mermaid
90
- flowchart TD
91
- A["Run /hapo:inspect or narrow scout"] --> B["Summarize codebase findings"]
92
- B --> C["Load question framework"]
93
- C --> DQ["Ask highest-impact grounded question"]
94
- DQ --> D{"Exact requirements captured?"}
95
- D -->|No| DQ
96
- D -->|Yes| E{"Multiple independent subsystems?"}
97
- E -->|Yes| F["Decompose into sub-projects"]
98
- F --> DQ
99
- E -->|No| G{"Medium/high complexity?"}
100
- G -->|Yes| H["Call brainstormer/researcher/docs-keeper as needed"]
101
- G -->|No| I["Propose 2-3 approaches"]
102
- H --> I
103
- I --> J["Recommend simplest viable option"]
104
- J --> K["Present design in sections"]
105
- K --> L{"User approves section?"}
106
- L -->|No, revise| K
107
- L -->|Yes| M["Run 4-point review"]
108
- M --> N{"Final approval?"}
109
- N -->|No| I
110
- N -->|Yes| O["Write Design Doc / Summary Report"]
111
- O --> P["Invoke /hapo:specs with report context"]
112
- P --> Q["Optional project notes update"]
113
- ```
114
-
115
- ## Tactical Execution Rules
116
-
117
- ### 1. Scout Phase
118
-
119
- - Start with `hapo:inspect` for normal repositories. Use direct `Glob`/`Grep` only when the scope is tiny and obvious.
120
- - Do not scan the entire repository blindly. Target the user's topic.
121
- - If the user gives a GitHub URL, use `repomix --remote` before discussing architecture.
122
- - Report only useful findings, not raw file dumps.
123
-
124
- ### 2. Discovery Phase
125
-
126
- - Load `references/question-framework.md`.
127
- - Ask exactly **one high-impact question at a time** by default. Do not stack unrelated questions.
128
- - You may batch up to 3 independent questions only when each question maps to a different required decision surface and none requires explanation before the user can answer.
129
- - Prefer multiple-choice options grounded in scout findings.
130
- - Push vague intent into concrete examples, sample inputs/outputs, or acceptance criteria.
131
- - Challenge the first proposed solution when the underlying goal suggests a simpler path.
132
- - Do not ask users to decide technical facts. Research browser/runtime/provider/package facts first; then ask only the product or trade-off decision.
133
- - Track decisions as you go so the final report can distinguish `User Decision`, `Assumption`, and `Open Question`.
134
-
135
- ### 3. Scope Guard
136
-
137
- - If the request spans 3+ independent subsystems, stop and decompose it.
138
- - Each sub-project should be able to move through brainstorm -> specs -> develop -> test -> review independently.
139
- - Do not design a monolithic spec when the work needs multiple specs.
140
-
141
- ### 4. Trade-Off Analysis
142
- Whenever multiple approaches exist, compare them using specific dimensions:
143
- - setup cost
144
- - runtime complexity
145
- - maintenance load
146
- - user experience and developer experience
147
- - compatibility and migration risk
148
- - time-to-value
149
-
150
- Always name the simplest viable option and explain the trade-off that makes it preferable.
151
-
152
- ### 5. Visual & UI Protocols
153
-
154
- If the topic involves UI layouts, interactive elements, visual styling, architecture diagrams, or spatial flows:
155
- - Use `hapo:ai-multimodal` for supplied images, videos, PDFs, or mockups.
156
- - Use a Mermaid diagram in the design doc when it would make trade-offs clearer.
157
- - Do not force text-only guesswork for visual choices.
158
- - Visual aids support the brainstorm; they do not bypass user approval.
159
-
160
- ### 6. Design Presentation
161
-
162
- - Present design in sections sized to complexity: Architecture, Data Flow, Interfaces, UX, Error Cases, Testing Strategy, Rollout.
163
- - Ask for approval after each meaningful section.
164
- - Keep changes tied to discovered touchpoints.
165
- - Do not invent unrelated refactors.
166
-
167
- ### 7. 4-Point Spec Review
168
- Before passing the completed design to the user for final review, you must internally sanitize the drafted document:
169
- 1. **Placeholder Scan:** Hunt and eliminate any "TBD", "TODO", or vague placeholder variables.
170
- 2. **Consistency Check:** Ensure no contradictory flows exist between architecture and behavior segments.
171
- 3. **Scope Check:** Verify the design addresses only the agreed feature bounds without uncontrolled scope creep.
172
- 4. **Ambiguity Check:** Replace abstract claims ("we will implement logic here") with concrete instructions.
173
-
174
- ### 8. Final Handoff & Documentation
175
- Upon the user's explicit final approval of the sanitized design document:
176
- 1. Generate the final **Design Doc / Summary Report**.
177
- 2. Include: problem statement, exact requirements, evaluated approaches, recommended solution, risks, validation criteria, decision register, open questions, and next steps.
178
- 3. Invoke `/hapo:specs` with the report context to hand off into CafeKit's structured specification phase.
179
- 4. Optionally update an existing project notes, docs, or report file if the approved design context should be persisted for future work.
180
-
181
- ## Completion Bar
182
-
183
- You are done only when:
184
- - Scout findings were summarized.
185
- - The five exact requirement fields are concrete.
186
- - The selected design was approved by the user.
187
- - The 4-point review found no blocking gaps.
188
- - The summary/report is ready for `/hapo:specs`.
120
+ Load `references/question-framework.md` before the first discovery question.
121
+ Generate questions from scout evidence, user intent, contract gaps, applicable
122
+ domain guidance, and risk surfaces. Never ask the user for a technical fact that
123
+ code, docs, or trusted current research can answer.
124
+
125
+ Use the runtime's native structured user-input tool when available. Ask one
126
+ highest-impact question by default; batch at most three independent questions
127
+ only when none depends on an earlier answer. Record confirmed decisions,
128
+ assumptions, and open questions separately in the decision register.
129
+
130
+ Stop asking when remaining details have safe implementation defaults. Do not
131
+ force questions merely to consume a budget.
132
+
133
+ ## Options and specialist use
134
+
135
+ A material design choice exists only when at least two viable paths would satisfy
136
+ the contract with meaningfully different consequences.
137
+
138
+ - For a material choice, compare 2–3 mechanically distinct viable approaches by
139
+ setup cost, runtime complexity, maintenance, UX/DX, compatibility/migration,
140
+ risk, and time-to-value.
141
+ - With one viable path, present it and explain briefly why alternatives would be
142
+ artificial or fail the contract. Never create strawman options.
143
+ - Recommend the smallest path that satisfies the contract.
144
+
145
+ Call `brainstormer` only for a material architectural choice that benefits from
146
+ deeper pressure-testing. Use researcher only for current external facts the
147
+ repository cannot establish. The controller remains responsible for questions,
148
+ approval, persistence, and handoff.
149
+
150
+ `--visual` may present inline Mermaid or ASCII for any non-direct analysis and
151
+ falls back to equivalent text when rendering is unavailable. Durable or external
152
+ rendering requires explicit user authority before invocation. `--advice` invokes
153
+ `brainstormer` only after the material-choice gate; if advice is unavailable or
154
+ fails, label it unavailable and continue with controller analysis. Before an
155
+ external visual tool or adviser handoff, minimize context and redact secrets,
156
+ credentials, private keys, access tokens, and unnecessary PII. Neither overlay
157
+ writes, approves, persists, dispatches, or completes work.
158
+
159
+ ## Delivery design and approval
160
+
161
+ For feature or documentation delivery:
162
+
163
+ 1. Draft one coherent candidate scaled to the work: architecture, data flow,
164
+ interfaces/UX, error behavior, verification, and rollout only when material.
165
+ 2. Run the internal 4-point review before presentation:
166
+ - remove placeholders and vague instructions;
167
+ - reconcile contradictory behavior;
168
+ - remove scope creep;
169
+ - make observable behavior and proof concrete.
170
+ 3. Present the reviewed candidate.
171
+ 4. Before final approval, require a separate explicit section decision when
172
+ the design changes auth/secrets/privacy, destructive or irreversible behavior
173
+ or data-loss risk, money/privilege/safety, or production-state mutation.
174
+ 5. After critical section decisions and revisions, request one final approval by
175
+ default.
176
+
177
+ Revise material disagreement before handoff. An already accepted, current
178
+ contract is not re-approved unless new evidence changes it.
179
+
180
+ ## Persistence and handoff
181
+
182
+ Persist only approved decisions and semantics, only with user authority, and
183
+ only when they must survive the session or feed Specs. Use the repository's
184
+ configured report path and naming convention. Do not create a report merely to
185
+ satisfy this skill. Before writing, redact live secrets, credentials, private
186
+ keys, access tokens, and unnecessary PII; preserve exact approved meaning with a
187
+ safe placeholder and ownership reference instead of copying the sensitive value.
188
+
189
+ The default handoff stays in chat Markdown. Use these exact headings:
190
+ `Target and evidence freshness`, `Outcome`, `Constraints`, `Non-goals`,
191
+ `Acceptance`, `Touchpoints`, `Direction and alternatives`, `Relevant impacts
192
+ and failure behavior`, `Rollout and recovery`, `Proof mapping`, `Decision
193
+ register`, `Assumptions`, and `Open questions`. The first section records target
194
+ identity, current source revision and worktree state or `[UNVERIFIED]`, an
195
+ evidence-as-of value, and what change invalidates the brief. Durable file output
196
+ requires explicit authority and creates no readiness, approval, proof, or
197
+ execution state.
198
+
199
+ - Feature/docs delivery: provide the approved summary and ask the user to invoke
200
+ `cf:specs` explicitly in a new request.
201
+ - Diagnosed bug: follow the fix-authority rule in front-door routing.
202
+ - Non-bug exploration: recommendation already returned in chat; stop.
203
+
204
+ ## Completion bar
205
+
206
+ Brainstorm is complete when the selected route is explicit, current evidence is
207
+ separated from intent, every material user-owned gap is resolved or named, and
208
+ the route-specific output has been returned without unauthorized persistence or
209
+ implementation. Never claim live behavior from this written contract alone.