@hiai-gg/hiai-opencode 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/.env.example +4 -0
  2. package/AGENTS.md +40 -44
  3. package/ARCHITECTURE.md +4 -3
  4. package/LICENSE.md +14 -0
  5. package/README.md +61 -30
  6. package/assets/cli/hiai-opencode.mjs +4 -4
  7. package/config/hiai-opencode.schema.json +11 -13
  8. package/dist/agents/{bob.d.ts → bob/claude.d.ts} +6 -2
  9. package/dist/agents/bob/core.d.ts +6 -0
  10. package/dist/agents/bob/gpt.d.ts +11 -0
  11. package/dist/agents/bob/index.d.ts +3 -0
  12. package/dist/agents/coder/core.d.ts +4 -0
  13. package/dist/agents/coder/gpt.d.ts +1 -4
  14. package/dist/agents/coder/index.d.ts +1 -0
  15. package/dist/agents/manager/agent.d.ts +1 -1
  16. package/dist/agents/manager/default-prompt-sections.d.ts +4 -4
  17. package/dist/agents/manager/guard-integration.d.ts +1 -0
  18. package/dist/agents/prompt-library/index.d.ts +0 -1
  19. package/dist/agents/prompt-library/shared-execution.d.ts +9 -0
  20. package/dist/agents/strategist/behavioral-summary.d.ts +1 -1
  21. package/dist/agents/strategist/identity-constraints.d.ts +1 -1
  22. package/dist/agents/strategist/plan-generation.d.ts +1 -1
  23. package/dist/agents/types.d.ts +2 -1
  24. package/dist/config/defaults.d.ts +1 -0
  25. package/dist/config/platform-schema.d.ts +26 -26
  26. package/dist/config/schema/agent-names.d.ts +6 -6
  27. package/dist/config/schema/agent-overrides.d.ts +0 -128
  28. package/dist/config/schema/hiai-opencode-config.d.ts +0 -128
  29. package/dist/config/types.d.ts +2 -2
  30. package/dist/features/background-agent/error-classifier.d.ts +1 -0
  31. package/dist/features/background-agent/manager-notifier.d.ts +46 -0
  32. package/dist/features/background-agent/manager-types.d.ts +40 -0
  33. package/dist/features/background-agent/manager.d.ts +3 -19
  34. package/dist/features/background-agent/polling-manager.d.ts +51 -0
  35. package/dist/features/boulder-state/constants.d.ts +3 -0
  36. package/dist/features/boulder-state/storage.d.ts +95 -0
  37. package/dist/features/boulder-state/types.d.ts +17 -0
  38. package/dist/features/builtin-commands/templates/doctor.d.ts +1 -1
  39. package/dist/features/builtin-commands/templates/loop.d.ts +2 -0
  40. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  41. package/dist/features/builtin-skills/skills/interview-me.d.ts +2 -0
  42. package/dist/features/builtin-skills/skills/planning-and-task-breakdown.d.ts +2 -0
  43. package/dist/hooks/manager/resolve-active-boulder-session.d.ts +5 -0
  44. package/dist/hooks/manager/system-reminder-templates.d.ts +2 -2
  45. package/dist/hooks/reasoning-content-cache/hook.d.ts +11 -0
  46. package/dist/hooks/reasoning-content-cache/index.d.ts +1 -0
  47. package/dist/hooks/session-recovery/checkpoint.d.ts +48 -0
  48. package/dist/hooks/session-recovery/enhanced-hook.d.ts +30 -0
  49. package/dist/hooks/session-recovery/state-backup.d.ts +76 -0
  50. package/dist/hooks/shared/compaction-in-progress.d.ts +4 -0
  51. package/dist/hooks/start-work/context-info-builder.d.ts +2 -0
  52. package/dist/hooks/start-work/git-operations.d.ts +47 -0
  53. package/dist/hooks/start-work/worktree-block.d.ts +2 -1
  54. package/dist/hooks/start-work/worktree-detector.d.ts +45 -0
  55. package/dist/hooks/strategist-md-only/agent-resolution.d.ts +1 -1
  56. package/dist/hooks/strategist-md-only/constants.d.ts +6 -0
  57. package/dist/hooks/token-budget.d.ts +30 -0
  58. package/dist/index.js +1275 -1132
  59. package/dist/mcp/rate-limiter.d.ts +68 -0
  60. package/dist/plugin/chat-message.d.ts +8 -0
  61. package/dist/plugin/command-execute-before.d.ts +1 -1
  62. package/dist/plugin/event-handlers/message-updated.d.ts +2 -0
  63. package/dist/plugin/event-handlers/session-error.d.ts +2 -0
  64. package/dist/plugin/event-handlers/session-status.d.ts +2 -0
  65. package/dist/plugin/event-handlers/types.d.ts +62 -0
  66. package/dist/plugin/event-handlers/utils.d.ts +11 -0
  67. package/dist/plugin/event.d.ts +1 -1
  68. package/dist/shared/data-path.d.ts +1 -1
  69. package/dist/shared/errors.d.ts +70 -0
  70. package/dist/shared/extract-session-id.d.ts +8 -0
  71. package/dist/shared/git-worktree/get-git-state-summary.d.ts +14 -0
  72. package/dist/shared/index.d.ts +67 -68
  73. package/dist/shared/internal-initiator-marker.d.ts +1 -1
  74. package/dist/shared/logger.d.ts +5 -1
  75. package/dist/shared/reasoning-content-cache.d.ts +68 -0
  76. package/dist/shared/safe-create-hook.d.ts +4 -4
  77. package/dist/tools/call-hiai-agent/constants.d.ts +2 -2
  78. package/dist/tools/delegate-task/sub-agent.d.ts +1 -1
  79. package/dist/tools/look-at/constants.d.ts +1 -1
  80. package/docs/architecture/bob-manager-architecture.md +244 -0
  81. package/docs/hiai-opencode/adr/ADR-001-agent-identity-section-injection.md +66 -0
  82. package/docs/hiai-opencode/adr/ADR-002-anti-loop-guard-priority.md +63 -0
  83. package/docs/hiai-opencode/adr/ADR-003-compaction-mechanism.md +71 -0
  84. package/docs/hiai-opencode/adr/ADR-004-session-recovery.md +76 -0
  85. package/docs/hiai-opencode/api.md +305 -0
  86. package/docs/hiai-opencode/hooks-architecture.md +225 -0
  87. package/docs/hiai-opencode/migration.md +209 -0
  88. package/docs/quickstart.md +1 -1
  89. package/docs/skill-discovery.md +288 -0
  90. package/package.json +2 -2
  91. package/skills/agent-browser/SKILL.md +193 -0
  92. package/skills/apple-hig/SKILL.md +43 -0
  93. package/skills/article-magazine/SKILL.md +46 -0
  94. package/skills/article-magazine/example.html +81 -0
  95. package/skills/article-magazine/example.md +38 -0
  96. package/skills/canvas-design/SKILL.md +45 -0
  97. package/skills/design-templates/audio-jingle/SKILL.md +132 -0
  98. package/skills/design-templates/audio-jingle/example.html +128 -0
  99. package/skills/design-templates/blog-post/SKILL.md +80 -0
  100. package/skills/design-templates/blog-post/example.html +80 -0
  101. package/skills/design-templates/clinical-case-report/SKILL.md +209 -0
  102. package/skills/design-templates/clinical-case-report/example.html +698 -0
  103. package/skills/design-templates/clinical-case-report/examples/example-stemi.html +698 -0
  104. package/skills/design-templates/clinical-case-report/references/case-formats.md +94 -0
  105. package/skills/design-templates/clinical-case-report/references/checklist.md +41 -0
  106. package/skills/design-templates/critique/SKILL.md +258 -0
  107. package/skills/design-templates/critique/example.html +671 -0
  108. package/skills/design-templates/dashboard/SKILL.md +76 -0
  109. package/skills/design-templates/dashboard/example.html +118 -0
  110. package/skills/design-templates/dating-web/SKILL.md +92 -0
  111. package/skills/design-templates/dating-web/example.html +265 -0
  112. package/skills/design-templates/dcf-valuation/SKILL.md +140 -0
  113. package/skills/design-templates/dcf-valuation/references/sector-wacc.md +42 -0
  114. package/skills/design-templates/digital-eguide/SKILL.md +94 -0
  115. package/skills/design-templates/digital-eguide/example.html +204 -0
  116. package/skills/design-templates/docs-page/SKILL.md +80 -0
  117. package/skills/design-templates/docs-page/example.html +122 -0
  118. package/skills/design-templates/email-marketing/SKILL.md +84 -0
  119. package/skills/design-templates/email-marketing/example.html +159 -0
  120. package/skills/design-templates/eng-runbook/SKILL.md +51 -0
  121. package/skills/design-templates/eng-runbook/example.html +250 -0
  122. package/skills/design-templates/finance-report/SKILL.md +61 -0
  123. package/skills/design-templates/finance-report/example.html +242 -0
  124. package/skills/design-templates/flowai-live-dashboard-template/SKILL.md +87 -0
  125. package/skills/design-templates/flowai-live-dashboard-template/assets/template.html +387 -0
  126. package/skills/design-templates/flowai-live-dashboard-template/example.html +13 -0
  127. package/skills/design-templates/flowai-live-dashboard-template/references/checklist.md +35 -0
  128. package/skills/design-templates/gamified-app/SKILL.md +108 -0
  129. package/skills/design-templates/gamified-app/example.html +292 -0
  130. package/skills/design-templates/github-dashboard/SKILL.md +130 -0
  131. package/skills/design-templates/github-dashboard/example.html +473 -0
  132. package/skills/design-templates/github-dashboard/references/README.md +10 -0
  133. package/skills/design-templates/github-dashboard/references/artifact-example.json +15 -0
  134. package/skills/design-templates/github-dashboard/references/example-data.json +138 -0
  135. package/skills/design-templates/github-dashboard/references/provenance-example.json +92 -0
  136. package/skills/design-templates/github-dashboard/references/template.html +473 -0
  137. package/skills/design-templates/guizang-ppt/LICENSE +21 -0
  138. package/skills/design-templates/guizang-ppt/README.en.md +119 -0
  139. package/skills/design-templates/guizang-ppt/README.md +120 -0
  140. package/skills/design-templates/guizang-ppt/README.pt-BR.md +121 -0
  141. package/skills/design-templates/guizang-ppt/SKILL.md +313 -0
  142. package/skills/design-templates/guizang-ppt/assets/example-slides.html +318 -0
  143. package/skills/design-templates/guizang-ppt/assets/template.html +647 -0
  144. package/skills/design-templates/guizang-ppt/references/checklist.md +265 -0
  145. package/skills/design-templates/guizang-ppt/references/components.md +363 -0
  146. package/skills/design-templates/guizang-ppt/references/layouts.md +630 -0
  147. package/skills/design-templates/guizang-ppt/references/styles.md +195 -0
  148. package/skills/design-templates/guizang-ppt/references/themes.md +122 -0
  149. package/skills/design-templates/hr-onboarding/SKILL.md +52 -0
  150. package/skills/design-templates/hr-onboarding/example.html +219 -0
  151. package/skills/design-templates/html-ppt/.clawscan-allow +12 -0
  152. package/skills/design-templates/html-ppt/LICENSE +21 -0
  153. package/skills/design-templates/html-ppt/README.md +234 -0
  154. package/skills/design-templates/html-ppt/README.pt-BR.md +239 -0
  155. package/skills/design-templates/html-ppt/README.zh-CN.md +238 -0
  156. package/skills/design-templates/html-ppt/SKILL.md +250 -0
  157. package/skills/design-templates/html-ppt/assets/animations/animations.css +138 -0
  158. package/skills/design-templates/html-ppt/assets/animations/fx/_util.js +63 -0
  159. package/skills/design-templates/html-ppt/assets/animations/fx/chain-react.js +41 -0
  160. package/skills/design-templates/html-ppt/assets/animations/fx/confetti-cannon.js +49 -0
  161. package/skills/design-templates/html-ppt/assets/animations/fx/constellation.js +44 -0
  162. package/skills/design-templates/html-ppt/assets/animations/fx/counter-explosion.js +58 -0
  163. package/skills/design-templates/html-ppt/assets/animations/fx/data-stream.js +45 -0
  164. package/skills/design-templates/html-ppt/assets/animations/fx/firework.js +51 -0
  165. package/skills/design-templates/html-ppt/assets/animations/fx/galaxy-swirl.js +33 -0
  166. package/skills/design-templates/html-ppt/assets/animations/fx/gradient-blob.js +39 -0
  167. package/skills/design-templates/html-ppt/assets/animations/fx/knowledge-graph.js +69 -0
  168. package/skills/design-templates/html-ppt/assets/animations/fx/letter-explode.js +50 -0
  169. package/skills/design-templates/html-ppt/assets/animations/fx/magnetic-field.js +40 -0
  170. package/skills/design-templates/html-ppt/assets/animations/fx/matrix-rain.js +33 -0
  171. package/skills/design-templates/html-ppt/assets/animations/fx/neural-net.js +75 -0
  172. package/skills/design-templates/html-ppt/assets/animations/fx/orbit-ring.js +38 -0
  173. package/skills/design-templates/html-ppt/assets/animations/fx/particle-burst.js +42 -0
  174. package/skills/design-templates/html-ppt/assets/animations/fx/shockwave.js +39 -0
  175. package/skills/design-templates/html-ppt/assets/animations/fx/sparkle-trail.js +62 -0
  176. package/skills/design-templates/html-ppt/assets/animations/fx/starfield.js +30 -0
  177. package/skills/design-templates/html-ppt/assets/animations/fx/typewriter-multi.js +51 -0
  178. package/skills/design-templates/html-ppt/assets/animations/fx/word-cascade.js +47 -0
  179. package/skills/design-templates/html-ppt/assets/animations/fx-runtime.js +99 -0
  180. package/skills/design-templates/html-ppt/assets/base.css +150 -0
  181. package/skills/design-templates/html-ppt/assets/fonts.css +9 -0
  182. package/skills/design-templates/html-ppt/assets/runtime.js +960 -0
  183. package/skills/design-templates/html-ppt/assets/themes/academic-paper.css +23 -0
  184. package/skills/design-templates/html-ppt/assets/themes/arctic-cool.css +14 -0
  185. package/skills/design-templates/html-ppt/assets/themes/aurora.css +20 -0
  186. package/skills/design-templates/html-ppt/assets/themes/bauhaus.css +16 -0
  187. package/skills/design-templates/html-ppt/assets/themes/blueprint.css +19 -0
  188. package/skills/design-templates/html-ppt/assets/themes/catppuccin-latte.css +14 -0
  189. package/skills/design-templates/html-ppt/assets/themes/catppuccin-mocha.css +14 -0
  190. package/skills/design-templates/html-ppt/assets/themes/corporate-clean.css +19 -0
  191. package/skills/design-templates/html-ppt/assets/themes/cyberpunk-neon.css +23 -0
  192. package/skills/design-templates/html-ppt/assets/themes/dracula.css +14 -0
  193. package/skills/design-templates/html-ppt/assets/themes/editorial-serif.css +18 -0
  194. package/skills/design-templates/html-ppt/assets/themes/engineering-whiteprint.css +26 -0
  195. package/skills/design-templates/html-ppt/assets/themes/glassmorphism.css +21 -0
  196. package/skills/design-templates/html-ppt/assets/themes/gruvbox-dark.css +14 -0
  197. package/skills/design-templates/html-ppt/assets/themes/japanese-minimal.css +21 -0
  198. package/skills/design-templates/html-ppt/assets/themes/magazine-bold.css +21 -0
  199. package/skills/design-templates/html-ppt/assets/themes/memphis-pop.css +20 -0
  200. package/skills/design-templates/html-ppt/assets/themes/midcentury.css +19 -0
  201. package/skills/design-templates/html-ppt/assets/themes/minimal-white.css +16 -0
  202. package/skills/design-templates/html-ppt/assets/themes/neo-brutalism.css +17 -0
  203. package/skills/design-templates/html-ppt/assets/themes/news-broadcast.css +20 -0
  204. package/skills/design-templates/html-ppt/assets/themes/nord.css +14 -0
  205. package/skills/design-templates/html-ppt/assets/themes/pitch-deck-vc.css +21 -0
  206. package/skills/design-templates/html-ppt/assets/themes/rainbow-gradient.css +16 -0
  207. package/skills/design-templates/html-ppt/assets/themes/retro-tv.css +22 -0
  208. package/skills/design-templates/html-ppt/assets/themes/rose-pine.css +14 -0
  209. package/skills/design-templates/html-ppt/assets/themes/sharp-mono.css +17 -0
  210. package/skills/design-templates/html-ppt/assets/themes/soft-pastel.css +14 -0
  211. package/skills/design-templates/html-ppt/assets/themes/solarized-light.css +14 -0
  212. package/skills/design-templates/html-ppt/assets/themes/sunset-warm.css +14 -0
  213. package/skills/design-templates/html-ppt/assets/themes/swiss-grid.css +17 -0
  214. package/skills/design-templates/html-ppt/assets/themes/terminal-green.css +18 -0
  215. package/skills/design-templates/html-ppt/assets/themes/tokyo-night.css +14 -0
  216. package/skills/design-templates/html-ppt/assets/themes/vaporwave.css +21 -0
  217. package/skills/design-templates/html-ppt/assets/themes/xiaohongshu-white.css +16 -0
  218. package/skills/design-templates/html-ppt/assets/themes/y2k-chrome.css +20 -0
  219. package/skills/design-templates/html-ppt/docs/readme/_theme-cell.html +56 -0
  220. package/skills/design-templates/html-ppt/docs/readme/animations.png +0 -0
  221. package/skills/design-templates/html-ppt/docs/readme/hero.gif +0 -0
  222. package/skills/design-templates/html-ppt/docs/readme/layouts-live.gif +0 -0
  223. package/skills/design-templates/html-ppt/docs/readme/layouts.png +0 -0
  224. package/skills/design-templates/html-ppt/docs/readme/montage-animations.html +61 -0
  225. package/skills/design-templates/html-ppt/docs/readme/montage-layouts.html +72 -0
  226. package/skills/design-templates/html-ppt/docs/readme/montage-templates.html +72 -0
  227. package/skills/design-templates/html-ppt/docs/readme/montage-themes.html +38 -0
  228. package/skills/design-templates/html-ppt/docs/readme/presenter-mode.png +0 -0
  229. package/skills/design-templates/html-ppt/docs/readme/templates.png +0 -0
  230. package/skills/design-templates/html-ppt/docs/readme/themes.png +0 -0
  231. package/skills/design-templates/html-ppt/examples/demo-deck/index.html +161 -0
  232. package/skills/design-templates/html-ppt/references/animations.md +147 -0
  233. package/skills/design-templates/html-ppt/references/authoring-guide.md +141 -0
  234. package/skills/design-templates/html-ppt/references/full-decks.md +98 -0
  235. package/skills/design-templates/html-ppt/references/layouts.md +103 -0
  236. package/skills/design-templates/html-ppt/references/presenter-mode.md +240 -0
  237. package/skills/design-templates/html-ppt/references/themes.md +107 -0
  238. package/skills/design-templates/html-ppt/scripts/new-deck.sh +46 -0
  239. package/skills/design-templates/html-ppt/scripts/render.sh +71 -0
  240. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_01.png +0 -0
  241. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_02.png +0 -0
  242. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_03.png +0 -0
  243. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_04.png +0 -0
  244. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_05.png +0 -0
  245. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_06.png +0 -0
  246. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_07.png +0 -0
  247. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_08.png +0 -0
  248. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_09.png +0 -0
  249. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_10.png +0 -0
  250. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_11.png +0 -0
  251. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_12.png +0 -0
  252. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_13.png +0 -0
  253. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_14.png +0 -0
  254. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_15.png +0 -0
  255. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_16.png +0 -0
  256. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_17.png +0 -0
  257. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_18.png +0 -0
  258. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_19.png +0 -0
  259. package/skills/design-templates/html-ppt/scripts/verify-output/animation-showcase/animation-showcase_20.png +0 -0
  260. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_01.png +0 -0
  261. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_02.png +0 -0
  262. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_03.png +0 -0
  263. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_04.png +0 -0
  264. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_05.png +0 -0
  265. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_06.png +0 -0
  266. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_07.png +0 -0
  267. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_08.png +0 -0
  268. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_09.png +0 -0
  269. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_10.png +0 -0
  270. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_11.png +0 -0
  271. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_12.png +0 -0
  272. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_13.png +0 -0
  273. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_14.png +0 -0
  274. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_15.png +0 -0
  275. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_16.png +0 -0
  276. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_17.png +0 -0
  277. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_18.png +0 -0
  278. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_19.png +0 -0
  279. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_20.png +0 -0
  280. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_21.png +0 -0
  281. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_22.png +0 -0
  282. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_23.png +0 -0
  283. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_24.png +0 -0
  284. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_25.png +0 -0
  285. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_26.png +0 -0
  286. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_27.png +0 -0
  287. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_28.png +0 -0
  288. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_29.png +0 -0
  289. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_30.png +0 -0
  290. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_31.png +0 -0
  291. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_32.png +0 -0
  292. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_33.png +0 -0
  293. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_34.png +0 -0
  294. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_35.png +0 -0
  295. package/skills/design-templates/html-ppt/scripts/verify-output/theme-showcase/theme-showcase_36.png +0 -0
  296. package/skills/design-templates/html-ppt/templates/animation-showcase.html +172 -0
  297. package/skills/design-templates/html-ppt/templates/deck.html +69 -0
  298. package/skills/design-templates/html-ppt/templates/full-decks/course-module/README.md +8 -0
  299. package/skills/design-templates/html-ppt/templates/full-decks/course-module/index.html +189 -0
  300. package/skills/design-templates/html-ppt/templates/full-decks/course-module/style.css +46 -0
  301. package/skills/design-templates/html-ppt/templates/full-decks/dir-key-nav-minimal/README.md +11 -0
  302. package/skills/design-templates/html-ppt/templates/full-decks/dir-key-nav-minimal/index.html +138 -0
  303. package/skills/design-templates/html-ppt/templates/full-decks/dir-key-nav-minimal/style.css +60 -0
  304. package/skills/design-templates/html-ppt/templates/full-decks/graphify-dark-graph/README.md +11 -0
  305. package/skills/design-templates/html-ppt/templates/full-decks/graphify-dark-graph/index.html +180 -0
  306. package/skills/design-templates/html-ppt/templates/full-decks/graphify-dark-graph/style.css +54 -0
  307. package/skills/design-templates/html-ppt/templates/full-decks/hermes-cyber-terminal/README.md +11 -0
  308. package/skills/design-templates/html-ppt/templates/full-decks/hermes-cyber-terminal/index.html +199 -0
  309. package/skills/design-templates/html-ppt/templates/full-decks/hermes-cyber-terminal/style.css +55 -0
  310. package/skills/design-templates/html-ppt/templates/full-decks/knowledge-arch-blueprint/README.md +11 -0
  311. package/skills/design-templates/html-ppt/templates/full-decks/knowledge-arch-blueprint/index.html +190 -0
  312. package/skills/design-templates/html-ppt/templates/full-decks/knowledge-arch-blueprint/style.css +49 -0
  313. package/skills/design-templates/html-ppt/templates/full-decks/obsidian-claude-gradient/README.md +11 -0
  314. package/skills/design-templates/html-ppt/templates/full-decks/obsidian-claude-gradient/index.html +144 -0
  315. package/skills/design-templates/html-ppt/templates/full-decks/obsidian-claude-gradient/style.css +59 -0
  316. package/skills/design-templates/html-ppt/templates/full-decks/pitch-deck/README.md +9 -0
  317. package/skills/design-templates/html-ppt/templates/full-decks/pitch-deck/index.html +148 -0
  318. package/skills/design-templates/html-ppt/templates/full-decks/pitch-deck/style.css +40 -0
  319. package/skills/design-templates/html-ppt/templates/full-decks/presenter-mode-reveal/README.md +102 -0
  320. package/skills/design-templates/html-ppt/templates/full-decks/presenter-mode-reveal/index.html +187 -0
  321. package/skills/design-templates/html-ppt/templates/full-decks/presenter-mode-reveal/style.css +216 -0
  322. package/skills/design-templates/html-ppt/templates/full-decks/product-launch/README.md +8 -0
  323. package/skills/design-templates/html-ppt/templates/full-decks/product-launch/index.html +121 -0
  324. package/skills/design-templates/html-ppt/templates/full-decks/product-launch/style.css +39 -0
  325. package/skills/design-templates/html-ppt/templates/full-decks/tech-sharing/README.md +8 -0
  326. package/skills/design-templates/html-ppt/templates/full-decks/tech-sharing/index.html +156 -0
  327. package/skills/design-templates/html-ppt/templates/full-decks/tech-sharing/style.css +49 -0
  328. package/skills/design-templates/html-ppt/templates/full-decks/testing-safety-alert/README.md +11 -0
  329. package/skills/design-templates/html-ppt/templates/full-decks/testing-safety-alert/index.html +183 -0
  330. package/skills/design-templates/html-ppt/templates/full-decks/testing-safety-alert/style.css +62 -0
  331. package/skills/design-templates/html-ppt/templates/full-decks/weekly-report/README.md +8 -0
  332. package/skills/design-templates/html-ppt/templates/full-decks/weekly-report/index.html +127 -0
  333. package/skills/design-templates/html-ppt/templates/full-decks/weekly-report/style.css +55 -0
  334. package/skills/design-templates/html-ppt/templates/full-decks/xhs-pastel-card/README.md +11 -0
  335. package/skills/design-templates/html-ppt/templates/full-decks/xhs-pastel-card/index.html +147 -0
  336. package/skills/design-templates/html-ppt/templates/full-decks/xhs-pastel-card/style.css +66 -0
  337. package/skills/design-templates/html-ppt/templates/full-decks/xhs-post/README.md +9 -0
  338. package/skills/design-templates/html-ppt/templates/full-decks/xhs-post/index.html +133 -0
  339. package/skills/design-templates/html-ppt/templates/full-decks/xhs-post/style.css +47 -0
  340. package/skills/design-templates/html-ppt/templates/full-decks/xhs-white-editorial/README.md +11 -0
  341. package/skills/design-templates/html-ppt/templates/full-decks/xhs-white-editorial/index.html +187 -0
  342. package/skills/design-templates/html-ppt/templates/full-decks/xhs-white-editorial/style.css +63 -0
  343. package/skills/design-templates/html-ppt/templates/full-decks-index.html +82 -0
  344. package/skills/design-templates/html-ppt/templates/layout-showcase.html +47 -0
  345. package/skills/design-templates/html-ppt/templates/single-page/arch-diagram.html +46 -0
  346. package/skills/design-templates/html-ppt/templates/single-page/big-quote.html +18 -0
  347. package/skills/design-templates/html-ppt/templates/single-page/bullets.html +19 -0
  348. package/skills/design-templates/html-ppt/templates/single-page/chart-bar.html +30 -0
  349. package/skills/design-templates/html-ppt/templates/single-page/chart-line.html +35 -0
  350. package/skills/design-templates/html-ppt/templates/single-page/chart-pie.html +36 -0
  351. package/skills/design-templates/html-ppt/templates/single-page/chart-radar.html +31 -0
  352. package/skills/design-templates/html-ppt/templates/single-page/code.html +33 -0
  353. package/skills/design-templates/html-ppt/templates/single-page/comparison.html +47 -0
  354. package/skills/design-templates/html-ppt/templates/single-page/cover.html +32 -0
  355. package/skills/design-templates/html-ppt/templates/single-page/cta.html +27 -0
  356. package/skills/design-templates/html-ppt/templates/single-page/diff.html +35 -0
  357. package/skills/design-templates/html-ppt/templates/single-page/flow-diagram.html +33 -0
  358. package/skills/design-templates/html-ppt/templates/single-page/gantt.html +29 -0
  359. package/skills/design-templates/html-ppt/templates/single-page/image-grid.html +34 -0
  360. package/skills/design-templates/html-ppt/templates/single-page/image-hero.html +33 -0
  361. package/skills/design-templates/html-ppt/templates/single-page/kpi-grid.html +19 -0
  362. package/skills/design-templates/html-ppt/templates/single-page/mindmap.html +38 -0
  363. package/skills/design-templates/html-ppt/templates/single-page/process-steps.html +27 -0
  364. package/skills/design-templates/html-ppt/templates/single-page/pros-cons.html +31 -0
  365. package/skills/design-templates/html-ppt/templates/single-page/roadmap.html +46 -0
  366. package/skills/design-templates/html-ppt/templates/single-page/section-divider.html +17 -0
  367. package/skills/design-templates/html-ppt/templates/single-page/stat-highlight.html +17 -0
  368. package/skills/design-templates/html-ppt/templates/single-page/table.html +33 -0
  369. package/skills/design-templates/html-ppt/templates/single-page/terminal.html +35 -0
  370. package/skills/design-templates/html-ppt/templates/single-page/thanks.html +21 -0
  371. package/skills/design-templates/html-ppt/templates/single-page/three-column.html +18 -0
  372. package/skills/design-templates/html-ppt/templates/single-page/timeline.html +32 -0
  373. package/skills/design-templates/html-ppt/templates/single-page/toc.html +26 -0
  374. package/skills/design-templates/html-ppt/templates/single-page/todo-checklist.html +33 -0
  375. package/skills/design-templates/html-ppt/templates/single-page/two-column.html +39 -0
  376. package/skills/design-templates/html-ppt/templates/theme-showcase.html +151 -0
  377. package/skills/design-templates/html-ppt-course-module/SKILL.md +78 -0
  378. package/skills/design-templates/html-ppt-course-module/example.html +542 -0
  379. package/skills/design-templates/html-ppt-dir-key-nav-minimal/SKILL.md +77 -0
  380. package/skills/design-templates/html-ppt-dir-key-nav-minimal/example.html +366 -0
  381. package/skills/design-templates/html-ppt-graphify-dark-graph/SKILL.md +77 -0
  382. package/skills/design-templates/html-ppt-graphify-dark-graph/example.html +402 -0
  383. package/skills/design-templates/html-ppt-hermes-cyber-terminal/SKILL.md +77 -0
  384. package/skills/design-templates/html-ppt-hermes-cyber-terminal/example.html +422 -0
  385. package/skills/design-templates/html-ppt-knowledge-arch-blueprint/SKILL.md +77 -0
  386. package/skills/design-templates/html-ppt-knowledge-arch-blueprint/example.html +407 -0
  387. package/skills/design-templates/html-ppt-obsidian-claude-gradient/SKILL.md +77 -0
  388. package/skills/design-templates/html-ppt-obsidian-claude-gradient/example.html +371 -0
  389. package/skills/design-templates/html-ppt-pitch-deck/SKILL.md +78 -0
  390. package/skills/design-templates/html-ppt-pitch-deck/example.html +495 -0
  391. package/skills/design-templates/html-ppt-presenter-mode-reveal/SKILL.md +78 -0
  392. package/skills/design-templates/html-ppt-presenter-mode-reveal/example.html +725 -0
  393. package/skills/design-templates/html-ppt-product-launch/SKILL.md +77 -0
  394. package/skills/design-templates/html-ppt-product-launch/example.html +467 -0
  395. package/skills/design-templates/html-ppt-taste-brutalist/SKILL.md +70 -0
  396. package/skills/design-templates/html-ppt-taste-brutalist/example.html +774 -0
  397. package/skills/design-templates/html-ppt-taste-editorial/SKILL.md +62 -0
  398. package/skills/design-templates/html-ppt-taste-editorial/example.html +689 -0
  399. package/skills/design-templates/html-ppt-tech-sharing/SKILL.md +77 -0
  400. package/skills/design-templates/html-ppt-tech-sharing/example.html +512 -0
  401. package/skills/design-templates/html-ppt-testing-safety-alert/SKILL.md +78 -0
  402. package/skills/design-templates/html-ppt-testing-safety-alert/example.html +413 -0
  403. package/skills/design-templates/html-ppt-weekly-report/SKILL.md +77 -0
  404. package/skills/design-templates/html-ppt-weekly-report/example.html +489 -0
  405. package/skills/design-templates/html-ppt-xhs-pastel-card/SKILL.md +78 -0
  406. package/skills/design-templates/html-ppt-xhs-pastel-card/example.html +381 -0
  407. package/skills/design-templates/html-ppt-xhs-post/SKILL.md +78 -0
  408. package/skills/design-templates/html-ppt-xhs-post/example.html +487 -0
  409. package/skills/design-templates/html-ppt-xhs-white-editorial/SKILL.md +77 -0
  410. package/skills/design-templates/html-ppt-xhs-white-editorial/example.html +418 -0
  411. package/skills/design-templates/html-ppt-zhangzara-8-bit-orbit/LICENSE +21 -0
  412. package/skills/design-templates/html-ppt-zhangzara-8-bit-orbit/SKILL.md +93 -0
  413. package/skills/design-templates/html-ppt-zhangzara-8-bit-orbit/example.html +1640 -0
  414. package/skills/design-templates/html-ppt-zhangzara-8-bit-orbit/template.json +48 -0
  415. package/skills/design-templates/html-ppt-zhangzara-biennale-yellow/LICENSE +21 -0
  416. package/skills/design-templates/html-ppt-zhangzara-biennale-yellow/SKILL.md +93 -0
  417. package/skills/design-templates/html-ppt-zhangzara-biennale-yellow/example.html +833 -0
  418. package/skills/design-templates/html-ppt-zhangzara-biennale-yellow/template.json +49 -0
  419. package/skills/design-templates/html-ppt-zhangzara-block-frame/LICENSE +21 -0
  420. package/skills/design-templates/html-ppt-zhangzara-block-frame/SKILL.md +93 -0
  421. package/skills/design-templates/html-ppt-zhangzara-block-frame/example.html +1453 -0
  422. package/skills/design-templates/html-ppt-zhangzara-block-frame/template.json +47 -0
  423. package/skills/design-templates/html-ppt-zhangzara-blue-professional/LICENSE +21 -0
  424. package/skills/design-templates/html-ppt-zhangzara-blue-professional/SKILL.md +93 -0
  425. package/skills/design-templates/html-ppt-zhangzara-blue-professional/example.html +1423 -0
  426. package/skills/design-templates/html-ppt-zhangzara-blue-professional/template.json +44 -0
  427. package/skills/design-templates/html-ppt-zhangzara-bold-poster/LICENSE +21 -0
  428. package/skills/design-templates/html-ppt-zhangzara-bold-poster/SKILL.md +93 -0
  429. package/skills/design-templates/html-ppt-zhangzara-bold-poster/example.html +876 -0
  430. package/skills/design-templates/html-ppt-zhangzara-bold-poster/template.json +45 -0
  431. package/skills/design-templates/html-ppt-zhangzara-broadside/LICENSE +21 -0
  432. package/skills/design-templates/html-ppt-zhangzara-broadside/SKILL.md +92 -0
  433. package/skills/design-templates/html-ppt-zhangzara-broadside/example.html +2144 -0
  434. package/skills/design-templates/html-ppt-zhangzara-broadside/template.json +49 -0
  435. package/skills/design-templates/html-ppt-zhangzara-capsule/LICENSE +21 -0
  436. package/skills/design-templates/html-ppt-zhangzara-capsule/SKILL.md +92 -0
  437. package/skills/design-templates/html-ppt-zhangzara-capsule/example.html +1413 -0
  438. package/skills/design-templates/html-ppt-zhangzara-capsule/template.json +51 -0
  439. package/skills/design-templates/html-ppt-zhangzara-cartesian/LICENSE +21 -0
  440. package/skills/design-templates/html-ppt-zhangzara-cartesian/SKILL.md +92 -0
  441. package/skills/design-templates/html-ppt-zhangzara-cartesian/example.html +1136 -0
  442. package/skills/design-templates/html-ppt-zhangzara-cartesian/template.json +47 -0
  443. package/skills/design-templates/html-ppt-zhangzara-cobalt-grid/LICENSE +21 -0
  444. package/skills/design-templates/html-ppt-zhangzara-cobalt-grid/SKILL.md +93 -0
  445. package/skills/design-templates/html-ppt-zhangzara-cobalt-grid/example.html +1205 -0
  446. package/skills/design-templates/html-ppt-zhangzara-cobalt-grid/template.json +49 -0
  447. package/skills/design-templates/html-ppt-zhangzara-coral/LICENSE +21 -0
  448. package/skills/design-templates/html-ppt-zhangzara-coral/SKILL.md +92 -0
  449. package/skills/design-templates/html-ppt-zhangzara-coral/example.html +1487 -0
  450. package/skills/design-templates/html-ppt-zhangzara-coral/template.json +45 -0
  451. package/skills/design-templates/html-ppt-zhangzara-creative-mode/LICENSE +21 -0
  452. package/skills/design-templates/html-ppt-zhangzara-creative-mode/SKILL.md +99 -0
  453. package/skills/design-templates/html-ppt-zhangzara-creative-mode/assets/deck-stage.js +619 -0
  454. package/skills/design-templates/html-ppt-zhangzara-creative-mode/example.html +636 -0
  455. package/skills/design-templates/html-ppt-zhangzara-creative-mode/template.json +47 -0
  456. package/skills/design-templates/html-ppt-zhangzara-daisy-days/LICENSE +21 -0
  457. package/skills/design-templates/html-ppt-zhangzara-daisy-days/SKILL.md +93 -0
  458. package/skills/design-templates/html-ppt-zhangzara-daisy-days/example.html +469 -0
  459. package/skills/design-templates/html-ppt-zhangzara-daisy-days/template.json +54 -0
  460. package/skills/design-templates/html-ppt-zhangzara-editorial-tri-tone/LICENSE +21 -0
  461. package/skills/design-templates/html-ppt-zhangzara-editorial-tri-tone/SKILL.md +98 -0
  462. package/skills/design-templates/html-ppt-zhangzara-editorial-tri-tone/assets/deck-stage.js +619 -0
  463. package/skills/design-templates/html-ppt-zhangzara-editorial-tri-tone/example.html +737 -0
  464. package/skills/design-templates/html-ppt-zhangzara-editorial-tri-tone/template.json +44 -0
  465. package/skills/design-templates/html-ppt-zhangzara-grove/LICENSE +21 -0
  466. package/skills/design-templates/html-ppt-zhangzara-grove/SKILL.md +92 -0
  467. package/skills/design-templates/html-ppt-zhangzara-grove/example.html +1676 -0
  468. package/skills/design-templates/html-ppt-zhangzara-grove/template.json +51 -0
  469. package/skills/figma-code-connect-components/SKILL.md +42 -0
  470. package/skills/figma-create-design-system-rules/SKILL.md +42 -0
  471. package/skills/figma-create-new-file/SKILL.md +41 -0
  472. package/skills/figma-generate-design/SKILL.md +42 -0
  473. package/skills/figma-generate-library/SKILL.md +42 -0
  474. package/skills/figma-implement-design/SKILL.md +42 -0
  475. package/skills/figma-use/SKILL.md +42 -0
  476. package/skills/full-page-screenshot/SKILL.md +42 -0
  477. package/skills/interview-me/SKILL.md +64 -0
  478. package/skills/planning-and-task-breakdown/SKILL.md +52 -0
  479. package/skills/sora/SKILL.md +43 -0
  480. package/skills/theme-factory/SKILL.md +43 -0
  481. package/skills/web-design-guidelines/SKILL.md +42 -0
  482. package/dist/agents/prompt-library/orchestration.d.ts +0 -4
  483. package/skills/brainstorming/SKILL.md +0 -164
  484. package/skills/brainstorming/scripts/frame-template.html +0 -214
  485. package/skills/brainstorming/scripts/helper.js +0 -88
  486. package/skills/brainstorming/scripts/server.cjs +0 -354
  487. package/skills/brainstorming/scripts/start-server.sh +0 -148
  488. package/skills/brainstorming/scripts/stop-server.sh +0 -56
  489. package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  490. package/skills/brainstorming/visual-companion.md +0 -287
@@ -0,0 +1,244 @@
1
+ # Bob→Manager Worker Pool Architecture
2
+
3
+ **Document Version:** 2026-05-14
4
+ **ARC:** ARC-009
5
+ **Status:** Implemented (verified against source)
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ The hiai-opencode agent system implements a two-tier orchestration hierarchy:
12
+
13
+ - **Tier 1 (Singletons):** Bob, Strategist, Critic, Designer — directly owned by the orchestrator
14
+ - **Tier 2 (Worker Pool):** Coder, Researcher, Vision, Writer — coordinated by Manager
15
+
16
+ This architecture ensures clear separation of concerns: Bob handles top-level orchestration and routing, Manager coordinates the execution workforce, and specialized agents perform domain-specific work.
17
+
18
+ ---
19
+
20
+ ## Agent Hierarchy
21
+
22
+ ```
23
+ ┌─────────────────────────────────────────┐
24
+ │ USER INPUT │
25
+ └─────────────────┬─────────────────────────┘
26
+
27
+
28
+ ┌─────────────────────────────────────────┐
29
+ │ BOB (Orchestrator) │
30
+ │ • Intent classification │
31
+ │ • Strategic delegation routing │
32
+ │ • Parallel execution orchestration │
33
+ │ • Singleton: owns Strategist/Critic/ │
34
+ │ Manager/Designer directly │
35
+ └──────────┬───────────────────────────────┘
36
+
37
+ ┌────────────────────┼────────────────────┐
38
+ │ │ │
39
+ ▼ ▼ ▼
40
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐
41
+ │ STRATEGIST │ │ CRITIC │ │ MANAGER │
42
+ │ (Planning) │ │ (Review) │ │ (Worker Pool Co.)│
43
+ │ │ │ │ │ │
44
+ │ Architecture │ │ Plan gate │ │ Coder │
45
+ │ Scope def │ │ Code review │ │ Researcher │
46
+ │ Work breakdown│ │ QA verify │ │ Vision │
47
+ │ │ │ │ │ Writer │
48
+ └──────────────┘ └──────────────┘ └────────┬─────────┘
49
+
50
+ ┌───────────────────┼───────────────────┐
51
+ │ │ │
52
+ ▼ ▼ ▼
53
+ ┌────────────┐ ┌────────────┐ ┌────────────┐
54
+ │ CODER │ │ RESEARCHER │ │ VISION │
55
+ │ (Deep Impl)│ │ (Discovery)│ │ (Media/UI) │
56
+ └────────────┘ └────────────┘ └────────────┘
57
+ ┌────────────┐
58
+ │ WRITER │
59
+ │ (Copy) │
60
+ └────────────┘
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Tier 1 — Singleton Agents (Bob-owned)
66
+
67
+ Bob owns these four agents directly. They are singletons — one instance, directly callable.
68
+
69
+ ### Bob
70
+ - **Role:** Primary orchestrator, intent classifier, top-level router
71
+ - **Mode:** `primary`
72
+ - **Delegates to:** Strategist, Critic, Manager, Designer
73
+ - **Key principle:** Never implements directly; orchestrates specialists
74
+
75
+ ### Strategist
76
+ - **Role:** Planning, architecture, work breakdown
77
+ - **Mode:** `subagent`
78
+ - **Trigger:** Complex scope, multi-step tasks, ambiguous requirements
79
+ - **Bob's usage:** Consult FIRST before implementation on non-trivial tasks
80
+
81
+ ### Critic
82
+ - **Role:** Review gate, high-accuracy verification
83
+ - **Mode:** `subagent`
84
+ - **Trigger:** Plan validation, code review, QA gate before completion
85
+ - **Bob's usage:** Blocks implementation until approval
86
+
87
+ ### Designer
88
+ - **Role:** UI/visual direction via Stitch MCP, design systems
89
+ - **Mode:** `subagent`
90
+ - **Trigger:** Visual problems, layout, design tokens, screen generation
91
+ - **Bob's usage:** Routes all visual work to Designer, not Coder
92
+
93
+ ---
94
+
95
+ ## Tier 2 — Worker Pool Agents (Manager-coordinated)
96
+
97
+ Manager acts as the worker pool coordinator. These agents are spawned as needed for specific work units.
98
+
99
+ ### Manager
100
+ - **Role:** Delegation orchestrator + Memory steward (MemPalace)
101
+ - **Mode:** `subagent`
102
+ - **Owns:**
103
+ - TODO tracking and plan checkbox management
104
+ - Session continuity (session_id tracking for handoffs)
105
+ - MemPalace writes (durable decisions, architecture choices)
106
+ - Post-wave verification coordination (Quality Guardian)
107
+ - **Coordinates:** Coder, Researcher, Vision, Writer
108
+ - **Key principle:** Delegates ALL implementation; never writes code
109
+
110
+ ### Coder
111
+ - **Role:** Deep implementation, substantial code changes
112
+ - **Category routing:** `category="deep"`, `category="unspecified-high"`, `category="visual-engineering"`
113
+ - **Trigger:** Multi-file changes, complex logic, architecture implementation
114
+ - **Manager's usage:** Primary executor for implementation tasks
115
+
116
+ ### Researcher
117
+ - **Role:** Codebase exploration, external documentation discovery
118
+ - **Category routing:** `subagent_type="researcher"` (direct call)
119
+ - **Trigger:** Pattern finding, library docs, OSS code search
120
+ - **Manager's usage:** Background discovery; always `run_in_background=true`
121
+
122
+ ### Vision
123
+ - **Role:** PDF/image/diagram extraction, browser-based UI verification
124
+ - **Category routing:** `subagent_type="vision"` (direct call)
125
+ - **Trigger:** Screenshot analysis, multimodal extraction, UI verification
126
+ - **Manager's usage:** Screenshot/verification tasks via agent-browser skill
127
+
128
+ ### Writer
129
+ - **Role:** Copy, content, positioning, SEO, landing pages
130
+ - **Category routing:** `subagent_type="writer"` (direct call)
131
+ - **Trigger:** Website copy, product messaging, naming
132
+ - **Manager's usage:** All text/copy tasks; uses `website-copywriting` skill
133
+
134
+ ---
135
+
136
+ ## Delegation Path Summary
137
+
138
+ | From | To | Routing Method | Use Case |
139
+ |------|----|----------------|----------|
140
+ | Bob | Strategist | `task(subagent_type="strategist", ...)` | Architecture, scope, planning |
141
+ | Bob | Critic | `task(subagent_type="critic", ...)` | Plan review, code review, QA gate |
142
+ | Bob | Designer | `task(subagent_type="designer", ...)` | Visual work, Stitch UI, design systems |
143
+ | Bob | Manager | `task(subagent_type="manager", ...)` | Multi-wave plans, TODO orchestration |
144
+ | Manager | Coder | `task(category="deep", ...)` | Complex implementation |
145
+ | Manager | Researcher | `task(subagent_type="researcher", run_in_background=true, ...)` | Codebase search, docs |
146
+ | Manager | Vision | `task(subagent_type="vision", ...)` | Media extraction, UI verification |
147
+ | Manager | Writer | `task(subagent_type="writer", load_skills=["website-copywriting"], ...)` | Copy, content |
148
+
149
+ ---
150
+
151
+ ## Stewardship Responsibilities (Manager-owned)
152
+
153
+ Manager owns these stewardship responsibilities beyond worker pool coordination:
154
+
155
+ ### MemPalace Memory Hygiene
156
+ - Search MemPalace BEFORE making decisions
157
+ - Write durable decisions, architectural choices, and session outcomes to MemPalace
158
+ - Never dump raw transcripts; write concise handoff ledgers
159
+
160
+ ### TODO Hygiene
161
+ - Mark completed items `completed` immediately (not batched)
162
+ - Preserve unfinished tasks with blocker context and next action
163
+ - Remove duplicate stale TODOs
164
+
165
+ ### Session Continuity
166
+ - Store `session_id` from every delegation
167
+ - Use `session_id` for retries and follow-ups
168
+ - Write handoff ledgers for complex multi-session work
169
+
170
+ ### Post-Wave Verification
171
+ - Dispatch Quality Guardian after each wave completes
172
+ - Verify cross-task file conflicts via `git diff --name-only`
173
+ - Mark completed checkboxes in plan files
174
+
175
+ ---
176
+
177
+ ## Category-to-Agent Routing
178
+
179
+ Categories spawn agents with domain-specific configurations:
180
+
181
+ | Category | Spawns | Agent | Typical Use |
182
+ |----------|--------|-------|-------------|
183
+ | `deep` | SubAgent | Coder | Complex multi-file implementation |
184
+ | `ultrabrain` | SubAgent | Strategist | Architecture, hard logic planning |
185
+ | `quick` | SubAgent | Coder (fast contour) | Small targeted changes |
186
+ | `visual-engineering` | SubAgent | Designer | UI/layout/styling |
187
+ | `artistry` | SubAgent | Designer | Brand, creative, SEO |
188
+ | `writing` | SubAgent | Writer | Copy, content, documentation |
189
+ | `bounded` | SubAgent | Coder (fast contour) | Moderate bounded changes |
190
+ | `cross-module` | SubAgent | Coder | Multi-component changes |
191
+ | `unspecified-low` | SubAgent | Coder (fast contour) | Unclassified small tasks |
192
+ | `unspecified-high` | SubAgent | Coder | Unclassified substantial tasks |
193
+
194
+ ---
195
+
196
+ ## Verification Against Source
197
+
198
+ ### Bob (src/agents/bob.ts)
199
+ - Bob delegates to: Strategist, Critic, Manager, Designer (line 145: `task(subagent_type='manager', ...)`)
200
+ - Bob does NOT implement directly; orchestrates only
201
+ - Intent gate classifies requests and routes to appropriate specialist
202
+
203
+ ### Manager (src/agents/manager/*)
204
+ - Manager coordinates worker pool: Coder, Researcher, Vision, Writer
205
+ - Manager does NOT write code; only delegates
206
+ - Manager owns MemPalace stewardship, TODO tracking, session continuity
207
+
208
+ ### Agent Roster in Manager (shared-prompt.ts lines 121-170)
209
+ - Lists all 11 agents with roles and routing patterns
210
+ - Worker pool agents clearly marked as Manager-coordinated
211
+ - Task routing decision table enforces specialist routing (not everything to Coder)
212
+
213
+ ### Parallel Execution (default-prompt-sections.ts)
214
+ - Wave-based dispatch for multi-wave plans
215
+ - Sequential dispatch for single-task plans
216
+ - Routing table for task-type to specialist mapping
217
+
218
+ ---
219
+
220
+ ## File Reference
221
+
222
+ | File | Purpose |
223
+ |------|---------|
224
+ | `src/agents/bob.ts` | Bob's prompt and orchestration logic |
225
+ | `src/agents/manager/agent.ts` | Manager agent factory |
226
+ | `src/agents/manager/default.ts` | Manager's default prompt |
227
+ | `src/agents/manager/shared-prompt.ts` | Manager's delegation system, agent roster |
228
+ | `src/agents/manager/default-prompt-sections.ts` | Manager's workflow, parallel execution, boundaries |
229
+ | `src/agents/manager/guard-integration.ts` | Quality Guardian integration |
230
+ | `src/agents/manager/prompt-section-builder.ts` | Dynamic section builders |
231
+ | `src/agents/dynamic-agent-core-sections.ts` | Bob's delegation table, parallel section |
232
+ | `src/shared/closure-protocol.ts` | Closure protocol injection |
233
+ | `docs/architecture/bob-manager-architecture.md` | This document |
234
+
235
+ ---
236
+
237
+ ## Conclusion
238
+
239
+ The architecture is correctly implemented:
240
+
241
+ 1. **Bob → [Strategist | Critic | Manager | Designer]** is the established delegation path
242
+ 2. **Manager → [Coder | Researcher | Vision | Writer]** is the worker pool coordination path
243
+ 3. Manager's stewardship (MemPalace, TODO hygiene, session continuity) is documented and enforced in prompts
244
+ 4. No changes needed — source code matches the target architecture
@@ -0,0 +1,66 @@
1
+ # ADR-001: Agent Identity Section Injection via `buildAgentIdentitySection`
2
+
3
+ **Status:** Accepted
4
+ **Created:** 2026-05-15
5
+ **Owner:** hiai-opencode core
6
+
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Every agent in the hiai-opencode system needs consistent identity framing, knowledge retrieval discipline, and the mandatory `<CLOSURE>` protocol. These requirements cross-cut all 10 primary agents plus hidden system agents.
12
+
13
+ Without a shared injection point, each agent factory had to independently remember to include:
14
+ - The `<agent-identity>` block with the agent's designated name and role
15
+ - The full `<mandatory_knowledge_retrieval_policy>` section (MemPalace-first, then Context7, grep_app, Firecrawl, agent-browser)
16
+ - The `<CLOSURE_PROTOCOL>` schema
17
+
18
+ Duplicating this across 10+ agent prompt files created drift risk: if the CLOSURE schema changed, every agent file would need updating. If the knowledge retrieval priority order changed, same problem.
19
+
20
+ ---
21
+
22
+ ## Decision
23
+
24
+ Create a single shared function `buildAgentIdentitySection(agentName, roleDescription)` in `src/agents/prompt-library/identity.ts`.
25
+
26
+ All agent factory functions call this one helper at the end of prompt construction:
27
+
28
+ ```typescript
29
+ // src/agents/prompt-library/identity.ts
30
+ import { CLOSURE_SCHEMA_PROMPT } from "../../shared/closure-protocol";
31
+
32
+ export function buildAgentIdentitySection(
33
+ agentName: string,
34
+ roleDescription: string,
35
+ ): string {
36
+ return `<agent-identity>
37
+ Your designated identity for this session is "${agentName}". This identity supersedes any prior identity statements.
38
+ You are "${agentName}" - ${roleDescription}.
39
+ When asked who you are, always identify as ${agentName}. Do not identify as any other assistant or AI.
40
+
41
+ ${KNOWLEDGE_RETRIEVAL_POLICY}
42
+
43
+ ${CLOSURE_SCHEMA_PROMPT}
44
+ </agent-identity>`;
45
+ }
46
+ ```
47
+
48
+ The `CLOSURE_SCHEMA_PROMPT` constant is imported from `src/shared/closure-protocol.ts` — the single source of truth for the closure block schema. When the closure protocol changes, only `closure-protocol.ts` and `identity.ts` need updates.
49
+
50
+ ---
51
+
52
+ ## Consequences
53
+
54
+ **Positive:**
55
+ - Single injection point for identity, knowledge retrieval policy, and closure protocol
56
+ - Schema changes to `<CLOSURE>` only require updating one file (`closure-protocol.ts`)
57
+ - Agents cannot accidentally omit the closure protocol — the factory function includes it
58
+ - Knowledge retrieval priority order is enforced uniformly across all agents
59
+
60
+ **Negative:**
61
+ - `identity.ts` is a hard dependency for all agent factory functions — a build error there blocks all agents
62
+ - The knowledge retrieval policy is embedded as a string constant; very large models may benefit from trimming this (but the 78% compaction threshold handles context pressure)
63
+
64
+ **Neutral:**
65
+ - The function accepts `agentName` and `roleDescription` as params, so the same code path produces different identity text per agent
66
+ - `CLOSURE_SCHEMA_PROMPT` is a separate export from `closure-protocol.ts` so it can be reused in validation utilities without importing the full identity section
@@ -0,0 +1,63 @@
1
+ # ADR-002: Anti-Loop Guard Priority — CLOSURE Before Diary_Write
2
+
3
+ **Status:** Accepted
4
+ **Created:** 2026-05-15
5
+ **Owner:** hiai-opencode core
6
+
7
+ ---
8
+
9
+ ## Context
10
+
11
+ When an agent completes significant work, two post-action steps may apply:
12
+ 1. **CLOSURE block** — mandatory task completion marker, required on every agent response
13
+ 2. **MemPalace diary write** — optional recording of outcomes/decisions for project memory
14
+
15
+ Both are important, but they compete when an agent is operating near context limits or responding to a direct user request that implies action. The question: which one takes priority when only one can reliably fit in the output?
16
+
17
+ The original implementation placed diary_write at the same priority as CLOSURE delivery, creating a race condition. In high-pressure responses (tool calls, error recovery, final deliverables), agents sometimes omitted the CLOSURE block because they wrote diary content instead — triggering automatic rejection by the closure validator.
18
+
19
+ ---
20
+
21
+ ## Decision
22
+
23
+ The `<mandatory_knowledge_retrieval_policy>` embedded in every agent prompt via `buildAgentIdentitySection()` states the priority explicitly:
24
+
25
+ ```
26
+ **PRIORITY ORDER**: When CLOSURE and diary_write both apply, deliver CLOSURE FIRST — diary is optional. If context-limit warning is active, skip diary_write, deliver CLOSURE immediately.
27
+ ```
28
+
29
+ This rule is enforced by:
30
+
31
+ 1. **Prompt-level instruction** — every agent receives the priority rule in their identity section
32
+ 2. **Context-limit guard** — when `context-window-monitor` detects usage > 70%, the directive to skip diary_write is activated
33
+ 3. **No hard dependency** — `mempalace_diary_write` is called voluntarily by the agent after CLOSURE; it is never a hard requirement for task completion
34
+
35
+ The CLOSURE block schema:
36
+
37
+ ```xml
38
+ <CLOSURE>
39
+ {
40
+ "reasoning": "Concise summary of what was achieved and why it satisfies the request.",
41
+ "evidence": ["Link to test results", "File path to changes", "Log snippets", "LSP diagnostics clean"],
42
+ "readiness": "done" | "accept" | "reject"
43
+ }
44
+ </CLOSURE>
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Consequences
50
+
51
+ **Positive:**
52
+ - Closure validator rejection rate drops to near-zero for normal completion paths
53
+ - Agents operating under context pressure cannot accidentally fail the closure gate by writing diary entries first
54
+ - Diary recording remains available and encouraged, just as a best-effort secondary action
55
+ - The priority rule is visible in every agent's prompt, making it self-enforcing
56
+
57
+ **Negative:**
58
+ - Diary entries may be less complete when agents are near context limits, as diary_write is skipped
59
+ - No hard technical enforcement — agents that ignore the prompt directive can still omit CLOSURE; the validator catches this downstream but does not prevent it
60
+
61
+ **Neutral:**
62
+ - The `mempalace_diary_write` tool is still available and recommended for significant work; the policy only prevents it from blocking CLOSURE delivery
63
+ - The context-window-monitor at 70% usage activates the "skip diary" recommendation, so agents are warned before hitting the 78% compaction threshold
@@ -0,0 +1,71 @@
1
+ # ADR-003: Compaction Mechanism — 15s Guard, 78% Threshold
2
+
3
+ **Status:** Accepted
4
+ **Created:** 2026-05-15
5
+ **Owner:** hiai-opencode core
6
+
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Large context windows are a finite resource. When an OpenCode session runs long, the risk of hitting a hard context limit increases. The session becomes unusable — every message returns a token limit error with no recovery path except manual restart.
12
+
13
+ Two questions needed answers:
14
+ 1. **When** should compaction trigger? (threshold)
15
+ 2. **How** should concurrent compaction attempts be prevented? (guard)
16
+
17
+ Early prototypes triggered compaction only on hard errors (`session.error` with token limit). This meant the first compaction attempt always came *after* a failed response — the agent had already wasted a turn and potentially corrupted state. We needed preemptive action.
18
+
19
+ For the guard, early prototypes had no synchronization. Multiple hooks could independently decide to compact the same session simultaneously, causing race conditions in the summarize call.
20
+
21
+ ---
22
+
23
+ ## Decision
24
+
25
+ ### Threshold: 78%
26
+
27
+ The `preemptive-compaction` hook monitors token usage after every assistant message. When the ratio `(inputTokens + cacheReadTokens) / actualLimit > 0.78`, it calls `session.summarize()` to compact the context before the hard limit is reached.
28
+
29
+ The 78% figure was chosen empirically:
30
+ - At 70%, `context-window-monitor` only *reminds* the agent to be concise — no compaction yet
31
+ - At 78%, there is enough headroom for the summarize call itself (~60s, ~5–10% of context) without immediately hitting the wall
32
+ - Below 78%, the overhead of compaction exceeds the benefit of doing it early
33
+ - Above 78%, the risk of not having enough room to complete the summarize call itself becomes non-trivial
34
+
35
+ ### Guard: 15-Second Lock + Shared Set
36
+
37
+ Concurrent compaction attempts are prevented by a shared `compactionInProgress` Set in `src/hooks/shared/compaction-in-progress.ts`:
38
+
39
+ ```typescript
40
+ const compactionInProgress = new Set<string>();
41
+
42
+ export function isCompacting(sessionID: string): boolean
43
+ export function markCompacting(sessionID: string): void
44
+ export function markCompactionDone(sessionID: string): void
45
+ export function clearSession(sessionID: string): void
46
+ ```
47
+
48
+ Additionally, a 60-second cooldown between compaction attempts prevents thrashing on sessions that compact successfully but immediately approach the threshold again.
49
+
50
+ ### Hard Timeout: 60s
51
+
52
+ All `session.summarize()` calls are wrapped in `withTimeout(promise, 60_000)`. On timeout, compaction is considered failed and the session continues without compaction. The `preemptive-compaction-degradation-monitor` then tracks post-compaction message quality to detect if the session entered a degraded (no-text response) state.
53
+
54
+ ---
55
+
56
+ ## Consequences
57
+
58
+ **Positive:**
59
+ - Preemptive compaction prevents hard limit errors in the common case where a session runs long but not extremely long
60
+ - The shared Set guard ensures no two hooks can trigger simultaneous compaction on the same session
61
+ - 60s timeout prevents summarize calls from blocking session progress indefinitely
62
+ - Degradation monitor provides a safety net: if compaction causes output quality collapse, recovery compaction is attempted
63
+
64
+ **Negative:**
65
+ - 78% threshold is a global constant — some models/context configurations may want a lower threshold
66
+ - The 60s timeout can fire on genuinely slow summarize calls, leaving the session uncompacted and approaching the limit
67
+ - Cooldown of 60s means a session that triggers compaction cannot be compacted again for 60 seconds, even if it immediately approaches the limit again
68
+
69
+ **Neutral:**
70
+ - Compaction model can be overridden per-agent via `pluginConfig.agents.<agent>.compaction.model`
71
+ - The summarize call itself consumes context (~5–10%), so the effective gain is context reduction, not elimination of the limit problem
@@ -0,0 +1,76 @@
1
+ # ADR-004: Session Recovery with State-Backup and Checkpoints
2
+
3
+ **Status:** Accepted
4
+ **Created:** 2026-05-15
5
+ **Owner:** hiai-opencode core
6
+
7
+ ---
8
+
9
+ ## Context
10
+
11
+ OpenCode sessions can fail in ways that lose work:
12
+ - Context window limit errors that cannot be recovered via compaction
13
+ - Session deletion (`:done`, timeout, or explicit close)
14
+ - Hard errors that put the session into an unrecoverable state
15
+ - Agent crashes mid-task with unresolved todos
16
+
17
+ When a session dies, the agent loses: conversation history, todo state, pending tool results, and any context that was being built. The user experience was: start over from scratch.
18
+
19
+ Existing recovery mechanisms were limited to compaction (context reduction), which helps with token limits but does not address session death, todo loss, or state corruption.
20
+
21
+ ---
22
+
23
+ ## Decision
24
+
25
+ Implement a multi-layer session recovery system:
26
+
27
+ ### Layer 1: Todo Preservation Around Compaction
28
+
29
+ `src/hooks/compaction-todo-preserver/` captures the full todo list before compaction and restores it after:
30
+
31
+ - `session.compacted` event → restore todos via `opencode/session/todo`'s `Todo.update`
32
+ - `session.deleted` event → clear local snapshot
33
+ - Skips restore if todos already exist post-compaction (avoid overwriting intentional post-compaction changes)
34
+
35
+ This ensures todos survive the most common context-recovery operation.
36
+
37
+ ### Layer 2: Compaction Context Injection
38
+
39
+ `src/hooks/compaction-context-injector/` saves a checkpoint of agent config before compaction, then injects a context summary after:
40
+
41
+ - `capture(sessionID)` — saves agent config checkpoint before `session.compacted`
42
+ - `session.compacted` → recovers checkpointed agent config, warns about no-text tails
43
+ - `session.idle` → finalizes tracked assistant messages
44
+ - `message.part.delta` → tracks text output to detect no-text tails
45
+
46
+ The `inject` function appends compaction context to the next prompt so the resumed session has continuity.
47
+
48
+ ### Layer 3: Session Recovery Hook
49
+
50
+ `src/hooks/session-recovery.ts` (part of `createContinuationHooks`) handles post-failure session state reconstruction:
51
+
52
+ - On `session.idle` after an error → attempt to reconstruct todo state from last known good checkpoint
53
+ - On `session.created` → check for recovered state and offer to resume
54
+
55
+ ### Layer 4: Background Task History for Delegated Sessions
56
+
57
+ `backgroundManager.taskHistory` tracks the history of delegated sub-agent sessions. When compaction occurs, `compaction-context-injector` injects this history into the compaction context prompt so the parent agent can see what sub-agents were working on.
58
+
59
+ ---
60
+
61
+ ## Consequences
62
+
63
+ **Positive:**
64
+ - Todo lists survive compaction and session recovery — the most common failure mode
65
+ - Agent config checkpoints survive compaction, allowing the resumed session to use the same model/settings
66
+ - Delegated task history provides continuity when a parent agent resumes after sub-agents complete
67
+ - No-text tail detection catches degraded sessions early and triggers recovery compaction
68
+
69
+ **Negative:**
70
+ - Checkpoint storage is in-memory (via `backgroundManager.taskHistory`) — a full server restart loses recovery state
71
+ - Session recovery from a fully deleted session is limited to todos and agent config; conversation history is not reconstructable
72
+ - The `compaction-context-injector` injects context that increases prompt size — too many compactifications can cause the injected context itself to approach context limits
73
+
74
+ **Neutral:**
75
+ - Session recovery is best-effort, not guaranteed — agents should still emit `<promise>DONE</promise>` promptly to allow the loop to exit cleanly rather than relying on recovery
76
+ - Todo preservation uses OpenCode's native `Todo.update` API, so todo state is as durable as OpenCode's native session storage