@hiai-gg/hiai-opencode 0.1.6 → 0.1.7

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 (140) hide show
  1. package/.env.example +7 -0
  2. package/AGENTS.md +46 -1
  3. package/ARCHITECTURE.md +6 -3
  4. package/README.md +71 -10
  5. package/assets/cli/hiai-opencode.mjs +78 -0
  6. package/config/hiai-opencode.schema.json +16 -1
  7. package/dist/agents/agent-skills.d.ts +7 -0
  8. package/dist/agents/bob/default.d.ts +1 -0
  9. package/dist/agents/bob/gemini.d.ts +1 -0
  10. package/dist/agents/bob/gpt-pro.d.ts +1 -0
  11. package/dist/agents/brainstormer.d.ts +7 -0
  12. package/dist/agents/coder/gpt-codex.d.ts +1 -1
  13. package/dist/agents/coder/gpt-pro.d.ts +1 -0
  14. package/dist/agents/coder/gpt.d.ts +2 -1
  15. package/dist/agents/designer.d.ts +7 -0
  16. package/dist/agents/strategist/gemini.d.ts +1 -0
  17. package/dist/agents/strategist/gpt.d.ts +1 -0
  18. package/dist/agents/types.d.ts +3 -1
  19. package/dist/config/index.d.ts +0 -1
  20. package/dist/config/platform-schema.d.ts +32 -0
  21. package/dist/config/schema/hooks.d.ts +0 -2
  22. package/dist/config/schema/index.d.ts +0 -2
  23. package/dist/config/schema/oh-my-opencode-config.d.ts +0 -6
  24. package/dist/config/types.d.ts +3 -1
  25. package/dist/create-hooks.d.ts +0 -2
  26. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  27. package/dist/features/builtin-skills/skills/website-copywriting.d.ts +2 -0
  28. package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
  29. package/dist/hooks/index.d.ts +0 -2
  30. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
  31. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
  32. package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +1 -1
  33. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -1
  34. package/dist/index.js +8963 -153866
  35. package/dist/mcp/index.d.ts +0 -1
  36. package/dist/mcp/registry.d.ts +1 -1
  37. package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
  38. package/dist/plugin/hooks/create-session-hooks.d.ts +1 -3
  39. package/dist/plugin/startup-diagnostics.d.ts +1 -0
  40. package/dist/shared/logger.d.ts +2 -0
  41. package/dist/shared/mode-routing.d.ts +6 -0
  42. package/dist/tools/delegate-task/git-categories.d.ts +2 -0
  43. package/dist/tools/delegate-task/sub-agent.d.ts +2 -0
  44. package/dist/tools/skill-mcp/constants.d.ts +1 -1
  45. package/hiai-opencode.json +48 -19
  46. package/package.json +6 -3
  47. package/src/agents/agent-skills.ts +70 -0
  48. package/src/agents/bob/default.ts +1 -0
  49. package/src/agents/bob/gemini.ts +1 -0
  50. package/src/agents/bob/gpt-pro.ts +2 -1
  51. package/src/agents/bob.ts +2 -0
  52. package/src/agents/brainstormer.ts +72 -0
  53. package/src/agents/builtin-agents.ts +59 -3
  54. package/src/agents/coder/gpt-codex.ts +4 -3
  55. package/src/agents/coder/gpt-pro.ts +3 -2
  56. package/src/agents/coder/gpt.ts +2 -1
  57. package/src/agents/critic/agent.ts +1 -0
  58. package/src/agents/designer.ts +70 -0
  59. package/src/agents/dynamic-agent-category-skills-guide.ts +6 -0
  60. package/src/agents/guard/default.ts +1 -0
  61. package/src/agents/guard/gemini.ts +1 -0
  62. package/src/agents/guard/gpt.ts +1 -0
  63. package/src/agents/platform-manager.ts +17 -1
  64. package/src/agents/prompt-library/platform.ts +34 -0
  65. package/src/agents/researcher.ts +1 -0
  66. package/src/agents/strategist/gemini.ts +1 -0
  67. package/src/agents/strategist/gpt.ts +1 -0
  68. package/src/agents/types.ts +4 -1
  69. package/src/agents/ui.ts +1 -0
  70. package/src/config/defaults.ts +31 -12
  71. package/src/config/index.ts +0 -1
  72. package/src/config/model-slots-and-export.test.ts +22 -4
  73. package/src/config/platform-schema.ts +2 -0
  74. package/src/config/schema/hooks.ts +0 -2
  75. package/src/config/schema/index.ts +0 -2
  76. package/src/config/schema/oh-my-opencode-config.ts +0 -2
  77. package/src/config/types.ts +3 -1
  78. package/src/features/builtin-skills/skills/index.ts +1 -0
  79. package/src/features/builtin-skills/skills/website-copywriting.ts +41 -0
  80. package/src/features/builtin-skills/skills.test.ts +8 -0
  81. package/src/features/builtin-skills/skills.ts +2 -0
  82. package/src/features/skill-mcp-manager/AGENTS.md +1 -1
  83. package/src/hooks/agent-usage-reminder/constants.ts +4 -4
  84. package/src/hooks/index.ts +0 -2
  85. package/src/hooks/keyword-detector/ultrawork/default.ts +18 -18
  86. package/src/hooks/keyword-detector/ultrawork/gemini.ts +21 -21
  87. package/src/hooks/keyword-detector/ultrawork/gpt.ts +6 -8
  88. package/src/hooks/keyword-detector/ultrawork/planner.ts +5 -5
  89. package/src/index.ts +5 -3
  90. package/src/internals/plugins/subtask2/commands/manifest.ts +2 -6
  91. package/src/internals/plugins/subtask2/hooks/command-hooks.ts +2 -2
  92. package/src/internals/plugins/subtask2/hooks/message-hooks.ts +1 -1
  93. package/src/internals/plugins/subtask2/parsing/parallel.ts +13 -10
  94. package/src/mcp/index.ts +0 -1
  95. package/src/mcp/registry.ts +27 -0
  96. package/src/plugin/chat-message.ts +0 -2
  97. package/src/plugin/hooks/create-session-hooks.ts +0 -17
  98. package/src/plugin/startup-diagnostics.ts +27 -0
  99. package/src/plugin-handlers/agent-config-handler.ts +3 -2
  100. package/src/plugin-handlers/mcp-config-handler.test.ts +63 -0
  101. package/src/plugin-handlers/mcp-config-handler.ts +29 -14
  102. package/src/plugin-handlers/strategist-agent-config-builder.ts +1 -1
  103. package/src/shared/agent-display-names.test.ts +9 -0
  104. package/src/shared/agent-display-names.ts +5 -0
  105. package/src/shared/log-legacy-plugin-startup-warning.ts +6 -8
  106. package/src/shared/logger.ts +8 -0
  107. package/src/shared/mcp-static-export.ts +4 -6
  108. package/src/shared/migration/agent-names.ts +8 -0
  109. package/src/shared/migration/hook-names.ts +1 -1
  110. package/src/shared/mode-routing.test.ts +88 -0
  111. package/src/shared/mode-routing.ts +30 -0
  112. package/src/shared/startup-diagnostics.ts +6 -7
  113. package/src/tools/call-omo-agent/tools.ts +11 -4
  114. package/src/tools/delegate-task/anthropic-categories.ts +3 -3
  115. package/src/tools/delegate-task/builtin-categories.ts +2 -0
  116. package/src/tools/delegate-task/categories.test.ts +87 -0
  117. package/src/tools/delegate-task/category-resolver.ts +8 -9
  118. package/src/tools/delegate-task/git-categories.ts +30 -0
  119. package/src/tools/delegate-task/model-string-parser.test.ts +90 -0
  120. package/src/tools/delegate-task/openai-categories.ts +26 -22
  121. package/src/tools/delegate-task/sub-agent.ts +10 -0
  122. package/src/tools/delegate-task/subagent-discovery.test.ts +123 -0
  123. package/src/tools/delegate-task/subagent-resolver.ts +18 -1
  124. package/src/tools/skill-mcp/constants.ts +1 -1
  125. package/dist/config/schema/websearch.d.ts +0 -13
  126. package/dist/hooks/no-bob-gpt/hook.d.ts +0 -16
  127. package/dist/hooks/no-bob-gpt/index.d.ts +0 -1
  128. package/dist/hooks/no-coder-non-gpt/hook.d.ts +0 -20
  129. package/dist/hooks/no-coder-non-gpt/index.d.ts +0 -1
  130. package/dist/mcp/grep-app.d.ts +0 -6
  131. package/dist/mcp/omo-mcp-index.d.ts +0 -10
  132. package/dist/mcp/websearch.d.ts +0 -11
  133. package/src/config/schema/websearch.ts +0 -15
  134. package/src/hooks/no-bob-gpt/hook.ts +0 -56
  135. package/src/hooks/no-bob-gpt/index.ts +0 -1
  136. package/src/hooks/no-coder-non-gpt/hook.ts +0 -67
  137. package/src/hooks/no-coder-non-gpt/index.ts +0 -1
  138. package/src/mcp/grep-app.ts +0 -6
  139. package/src/mcp/omo-mcp-index.ts +0 -30
  140. package/src/mcp/websearch.ts +0 -44
package/.env.example CHANGED
@@ -24,6 +24,13 @@
24
24
  # Optional - Context7 code search MCP
25
25
  # CONTEXT7_API_KEY=your_context7_api_key_here
26
26
 
27
+ # Optional - Exa remote websearch MCP. Recommended for higher limits.
28
+ # EXA_API_KEY=your_exa_api_key_here
29
+
30
+ # Optional - Tavily remote websearch MCP.
31
+ # Required only when hiai-opencode.json uses provider "tavily".
32
+ # TAVILY_API_KEY=your_tavily_api_key_here
33
+
27
34
  # Local Model Helpers
28
35
 
29
36
  # Optional - Ollama local model endpoint
package/AGENTS.md CHANGED
@@ -115,6 +115,8 @@ When a user asks OpenCode or another agent to finish installing this plugin, fol
115
115
  - `FIRECRAWL_API_KEY`
116
116
  - `STITCH_AI_API_KEY`
117
117
  - `CONTEXT7_API_KEY`
118
+ - `EXA_API_KEY`
119
+ - `TAVILY_API_KEY`
118
120
  - `MEMPALACE_PYTHON`
119
121
  - `OPENCODE_RAG_URL`
120
122
  - `HIAI_PLAYWRIGHT_INSTALL_BROWSERS`
@@ -137,10 +139,13 @@ When a user asks OpenCode or another agent to finish installing this plugin, fol
137
139
  | `rag` | User has a local or remote RAG endpoint | Uses `OPENCODE_RAG_URL`, defaulting to `http://localhost:9002/tools/search` |
138
140
  | `stitch` | `STITCH_AI_API_KEY` is set | Remote MCP endpoint |
139
141
  | `context7` | User wants Context7 docs/search | Remote MCP endpoint; use `CONTEXT7_API_KEY` if available |
142
+ | `websearch` | User wants remote web search | Defaults to Exa; `EXA_API_KEY` optional for Exa, `TAVILY_API_KEY` required for Tavily |
143
+ | `grep_app` | User wants GitHub/code search | Remote MCP endpoint; no key required |
140
144
 
141
145
  Playwright troubleshooting rules:
142
146
 
143
- - If `skill_mcp` says `MCP server "playwright" not found`, first load the `playwright` skill and check `hiai-opencode mcp-status`; do not report this as a browser dependency failure.
147
+ - `skill_mcp` can call enabled hiai-opencode builtin MCPs and skill-embedded MCPs. If it reports a builtin MCP such as `firecrawl` as missing, check that the installed plugin version includes builtin fallback support and that `hiai-opencode.json` has that MCP enabled.
148
+ - If `skill_mcp` says `MCP server "playwright" not found`, first check `hiai-opencode mcp-status`; do not report this as a browser dependency failure.
144
149
  - If Chromium reports missing Linux libraries (`libnspr4`, `libnss3`, `libatk-bridge`, `libgtk-3`, etc.), explain that MCP is present but the host lacks browser system dependencies.
145
150
  - Without sudo, try a system browser override in `hiai-opencode.json`, such as `--browser chrome` or `--browser msedge`.
146
151
  - If no browser path works, use `curl` only as degraded HTTP verification and explicitly say it is not a replacement for browser testing.
@@ -166,6 +171,8 @@ Check which services can run here:
166
171
  - rag: OPENCODE_RAG_URL or http://localhost:9002/tools/search.
167
172
  - stitch: STITCH_AI_API_KEY.
168
173
  - context7: optional CONTEXT7_API_KEY.
174
+ - websearch: optional EXA_API_KEY for Exa, or TAVILY_API_KEY when provider is tavily.
175
+ - grep_app: no key required.
169
176
 
170
177
  Report missing keys without printing secret values. Never invent or hardcode API keys.
171
178
 
@@ -223,6 +230,7 @@ The runtime loader is:
223
230
  Users configure only the 10 primary agent model slots under `models`: `bob`, `coder`, `strategist`, `guard`, `critic`, `designer`, `researcher`, `manager`, `brainstormer`, and `vision`.
224
231
  Hidden agents and task categories are derived internally in `src/config/defaults.ts`.
225
232
  Use fully qualified model IDs. Do not introduce local aliases like `hiai-fast`, `sonnet`, `fast`, or `high`.
233
+ When helping a user choose model IDs, tell them to connect providers in OpenCode, run `opencode models`, and copy the exact `provider/model-id` strings into `hiai-opencode.json`. Do not invent provider prefixes.
226
234
 
227
235
  ## Change Map
228
236
 
@@ -352,6 +360,41 @@ Current MCP set:
352
360
  - `websearch`
353
361
  - `grep_app`
354
362
 
363
+ ## Writing And Website Copy
364
+
365
+ Public-facing website/product copy is owned by `brainstormer`.
366
+ `writer`, `copywriter`, `content-writer`, and `website-writer` are aliases for `brainstormer`.
367
+
368
+ Use the `website-copywriting` skill for:
369
+
370
+ - landing pages
371
+ - hero sections
372
+ - CTA labels
373
+ - feature copy
374
+ - positioning and naming
375
+ - onboarding, empty states, and product microcopy
376
+
377
+ Preferred invocation:
378
+
379
+ ```text
380
+ task(subagent_type="brainstormer", load_skills=["website-copywriting"], run_in_background=false, description="Write landing page copy", prompt="...")
381
+ ```
382
+
383
+ Use `designer` or `visual-engineering` for visual direction. Use `brainstormer` for words.
384
+
385
+ ## Manager Memory Stewardship
386
+
387
+ Use `platform-manager` / `manager` when durable project memory or handoff state must stay current.
388
+
389
+ Manager owns:
390
+
391
+ - MemPalace decision hygiene: search first, deduplicate, write only durable decisions and important preferences.
392
+ - Architecture memory updates: when architecture changes, update MemPalace and sync to RAG only if the configured RAG endpoint exposes write/upsert capability.
393
+ - TODO hygiene: mark completed items complete, preserve unfinished tasks with blocker and next action, remove duplicate stale TODOs.
394
+ - Session continuity: write concise handoff ledgers, not raw transcripts.
395
+
396
+ Do not ask Manager to implement code. Use Coder for implementation and Manager for memory/task state.
397
+
355
398
  ## Skill Discovery Rules
356
399
 
357
400
  Default behavior is intentionally deterministic.
@@ -404,6 +447,8 @@ Common service keys:
404
447
  - `STITCH_AI_API_KEY`
405
448
  - `FIRECRAWL_API_KEY`
406
449
  - `CONTEXT7_API_KEY`
450
+ - `EXA_API_KEY`
451
+ - `TAVILY_API_KEY`
407
452
  - `OLLAMA_BASE_URL`
408
453
  - `OLLAMA_MODEL`
409
454
  - `MEMPALACE_PYTHON`
package/ARCHITECTURE.md CHANGED
@@ -89,10 +89,13 @@ Prompting is not a single file and not a single directory. `src/agents` is the m
89
89
  These files create the top-level agent config objects:
90
90
 
91
91
  - Bob: [src/agents/bob.ts](src/agents/bob.ts)
92
- - Coder: `src/agents/coder/agent.ts`
92
+ - Coder: [src/agents/coder/agent.ts](src/agents/coder/agent.ts)
93
93
  - Strategist: `src/agents/strategist/*`
94
- - Guard: `src/agents/guard/agent.ts`
95
- - Critic: `src/agents/critic/agent.ts`
94
+ - Guard: [src/agents/guard/agent.ts](src/agents/guard/agent.ts)
95
+ - Critic: [src/agents/critic/agent.ts](src/agents/critic/agent.ts)
96
+ - Designer: [src/agents/designer.ts](src/agents/designer.ts)
97
+ - Brainstormer: [src/agents/brainstormer.ts](src/agents/brainstormer.ts)
98
+ - Agent Skills: [src/agents/agent-skills.ts](src/agents/agent-skills.ts)
96
99
  - Vision: [src/agents/ui.ts](src/agents/ui.ts)
97
100
  - Manager: [src/agents/platform-manager.ts](src/agents/platform-manager.ts)
98
101
  - Researcher: [src/agents/researcher.ts](src/agents/researcher.ts)
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # hiai-opencode
2
2
 
3
+ [![CI](https://github.com/HiAi-gg/hiai-opencode/actions/workflows/ci.yml/badge.svg)](https://github.com/HiAi-gg/hiai-opencode/actions/workflows/ci.yml)
4
+
3
5
  `hiai-opencode` is an OpenCode plugin that wires together:
4
6
 
5
7
  - a curated multi-agent runtime
@@ -36,16 +38,42 @@ Then run `hiai-opencode doctor`, `hiai-opencode mcp-status`, and `opencode debug
36
38
 
37
39
  For the full operator playbook, see [AGENTS.md](AGENTS.md). 🤖
38
40
 
41
+ ## Agents
42
+
43
+ | Agent | Role | When to use |
44
+ |-------|------|-------------|
45
+ | `Bob` | Orchestrator, router, distributor | Entry point; complex tasks needing multi-agent coordination |
46
+ | `Coder` | Deep implementation, focused execution | Complex features, refactors, deep work |
47
+ | `Sub` | Bounded cheap executor | Small targeted changes, quick fixes |
48
+ | `Strategist` | Planning, architecture, pre-check | Scope definition, architectural decisions |
49
+ | `Guard` | Final acceptor, workflow enforcer | Closure validation, output acceptance |
50
+ | `Critic` | Review gate, high-accuracy verification | Plan review, code review, regression catch |
51
+ | `Researcher` | Local + external search | Codebase exploration, documentation discovery |
52
+ | `Designer` | UI/visual, creative direction | Visual problems, UX decisions, branding |
53
+ | `Brainstormer` | Ideation, content, copy | Landing pages, CTA, feature copy, onboarding |
54
+ | `Vision` | Image/PDF/layout analysis | Visual inspection, multimodal interpretation |
55
+ | `Manager` | Memory, bootstrap, ledger | Durable state, session continuity, project init |
56
+
57
+ ## Modes (Task Routing)
58
+
59
+ Mode determines prompt append, variant, and reasoning effort. The executor agent is selected via `mode → agent` mapping.
60
+
61
+ | Mode | Agent | Prompt variant | When to use |
62
+ |------|-------|----------------|-------------|
63
+ | `quick` | `sub` | Fast bounded | Small targeted changes |
64
+ | `writing` | `brainstormer` | Docs/prose | Content, i18n, copy |
65
+ | `deep` | `coder` | Deep reasoning | Complex implementation |
66
+ | `ultrabrain` | `strategist` | Plan-only | Architecture, hard logic |
67
+ | `visual-engineering` | `designer` | UI/visual | Visual problems |
68
+ | `artistry` | `designer` | Creative | Brand, SEO, creative |
69
+ | `git` | `platform-manager` | Git ops | Version control operations |
70
+ | `bounded` | `sub` | Mid-tier bounded | Moderate effort changes |
71
+ | `cross-module` | `coder` | Deep substantial | Multi-component changes |
72
+
39
73
  ## What You Get
40
74
 
41
- - Visible primary agents: `Bob`, `Coder`, `Strategist`, `Guard`, `Critic`, `Designer`, `Researcher`, `Manager`, `Brainstormer`, `Vision`
42
- - Hidden system or compatibility agents: `Agent Skills`, `Sub`, `build`, `plan`
43
- - Task routing model:
44
- - category-based execution routes through `Coder`
45
- - `quick`, `writing`, and `unspecified-low` are the fast bounded Coder contour
46
- - `deep`, `ultrabrain`, `visual-engineering`, `artistry`, and `unspecified-high` are the deep Coder contour
47
- - `Critic` and `Researcher` are selected explicitly
48
- - `Designer`, `Brainstormer`, `Manager`, and `Vision` are direct callable specialists
75
+ - **10 visible primary agents** + **4 hidden system agents** (Agent Skills, Sub, build, plan)
76
+ - **Mode-based task routing** via `task(category=..., ...)` or `task(mode=..., ...)`
49
77
  - Skill materialization into OpenCode's `skills/` view
50
78
  - MCP wiring for `playwright`, `stitch`, `sequential-thinking`, `firecrawl`, `rag`, `mempalace`, `context7`, plus remote `websearch` and `grep_app`
51
79
  - LSP wiring for TypeScript, Svelte, Python, Bash, and ESLint
@@ -67,6 +95,8 @@ Optional, depending on which services you want:
67
95
  - `FIRECRAWL_API_KEY` for Firecrawl
68
96
  - `STITCH_AI_API_KEY` for Stitch
69
97
  - `CONTEXT7_API_KEY` for Context7
98
+ - `EXA_API_KEY` for higher Exa websearch limits
99
+ - `TAVILY_API_KEY` when `mcp.websearch.provider` is `tavily`
70
100
  - Python 3.9+ or `uv` for MemPalace
71
101
  - a running RAG endpoint if you enable `rag`
72
102
  - local language servers if you want LSP beyond the npm-bootstrapped helpers
@@ -153,10 +183,19 @@ This plugin only reads the 10 model IDs in `models`. Internal routing derives hi
153
183
 
154
184
  Use OpenCode Connect to authorize the providers behind your configured model IDs. Then add only the service keys for MCP or search integrations you actually use:
155
185
 
186
+ ```bash
187
+ opencode models
188
+ ```
189
+
190
+ Use the exact model IDs printed by OpenCode in `hiai-opencode.json`. For example, `openrouter/minimax/minimax-m2.7` routes through OpenRouter, while `minimax/minimax-m2.7` routes through a direct Minimax provider only if that provider is connected in OpenCode.
191
+
156
192
  ```bash
157
193
  export FIRECRAWL_API_KEY=...
158
194
  export STITCH_AI_API_KEY=...
159
195
  export CONTEXT7_API_KEY=...
196
+ export EXA_API_KEY=...
197
+ # or, if mcp.websearch.provider is "tavily":
198
+ export TAVILY_API_KEY=...
160
199
  ```
161
200
 
162
201
  See [Environment Variables And Keys](#environment-variables-and-keys) for the full list.
@@ -245,6 +284,7 @@ Runtime loader for the bundled canonical config:
245
284
  If you want to change model selection, edit the 10 entries in `models`. Do not add category-specific model choices unless you are intentionally developing the plugin internals.
246
285
 
247
286
  Use fully qualified model IDs. Do not introduce local aliases like `hiai-fast`, `sonnet`, `fast`, or `high`.
287
+ After connecting providers in OpenCode, run `opencode models` and copy the exact model IDs from that output into `hiai-opencode.json`.
248
288
 
249
289
  ### Prompting
250
290
 
@@ -263,6 +303,7 @@ Important prompt entrypoints:
263
303
  - `Vision`: [src/agents/ui.ts](src/agents/ui.ts)
264
304
  - `Manager`: [src/agents/platform-manager.ts](src/agents/platform-manager.ts)
265
305
  - `Researcher`: [src/agents/researcher.ts](src/agents/researcher.ts)
306
+ - `Brainstormer` / `Writer`: [src/agents/brainstormer.ts](src/agents/brainstormer.ts)
266
307
 
267
308
  Name mapping and visibility:
268
309
 
@@ -279,6 +320,22 @@ Skill materialization logic:
279
320
 
280
321
  - [src/features/builtin-skills/materialize.ts](src/features/builtin-skills/materialize.ts)
281
322
 
323
+ Built-in helper skills include browser automation, frontend UI/UX, review, git workflow, hiai-opencode setup, AI slop cleanup, and `website-copywriting`.
324
+
325
+ Website/product copy should use:
326
+
327
+ ```text
328
+ task(subagent_type="brainstormer", load_skills=["website-copywriting"], ...)
329
+ ```
330
+
331
+ `writer`, `copywriter`, and `content-writer` are aliases for `brainstormer`.
332
+
333
+ Manager memory stewardship:
334
+
335
+ - Use `task(subagent_type="platform-manager", ...)` or `task(subagent_type="manager", ...)` for MemPalace cleanup, session ledgers, TODO hygiene, and architecture decision handoff.
336
+ - Manager writes only durable decisions and important project state. It should not dump raw chat logs into memory.
337
+ - RAG is retrieval-first by default; Manager syncs architecture summaries to RAG only when the configured endpoint exposes write/upsert capability.
338
+
282
339
  Skill discovery defaults:
283
340
 
284
341
  ```json
@@ -327,6 +384,8 @@ Important service variables:
327
384
  - `STITCH_AI_API_KEY`
328
385
  - `FIRECRAWL_API_KEY`
329
386
  - `CONTEXT7_API_KEY`
387
+ - `EXA_API_KEY`
388
+ - `TAVILY_API_KEY`
330
389
  - `OLLAMA_BASE_URL`
331
390
  - `OLLAMA_MODEL`
332
391
  - `MEMPALACE_PYTHON`
@@ -349,7 +408,9 @@ The user-facing MCP switchboard is the `mcp` object in `hiai-opencode.json`:
349
408
  {
350
409
  "mcp": {
351
410
  "playwright": { "enabled": true },
352
- "mempalace": { "enabled": false }
411
+ "mempalace": { "enabled": false },
412
+ "websearch": { "enabled": true, "provider": "exa" },
413
+ "grep_app": { "enabled": true }
353
414
  }
354
415
  }
355
416
  ```
@@ -360,7 +421,7 @@ The source of truth for default MCP wiring is `src/mcp/registry.ts`. Change that
360
421
 
361
422
  - `stitch`
362
423
  - `context7`
363
- - `websearch`
424
+ - `websearch`: defaults to Exa remote MCP. `EXA_API_KEY` is optional for Exa; set `"provider": "tavily"` and `TAVILY_API_KEY` to use Tavily.
364
425
  - `grep_app`
365
426
 
366
427
  ### Works with local helper bootstrap
@@ -61,11 +61,13 @@ Usage:
61
61
  hiai-opencode doctor
62
62
  hiai-opencode mcp-status
63
63
  hiai-opencode export-mcp [path]
64
+ hiai-opencode diagnose [path]
64
65
 
65
66
  Commands:
66
67
  doctor Full install/runtime diagnostic: MCP status + static export freshness + provider/skills/agents/LSP checks + MCP tool probes.
67
68
  mcp-status Check hiai-opencode MCP configuration, keys, and local runtimes.
68
69
  export-mcp Write a static .mcp.json for hosts whose mcp list ignores plugin runtime MCP.
70
+ diagnose Collect full diagnostic bundle to file (local only, no remote sending).
69
71
  `)
70
72
  }
71
73
 
@@ -826,6 +828,77 @@ async function mcpStatus(options = {}) {
826
828
  }
827
829
  }
828
830
 
831
+ async function runDiagnose(outputPath) {
832
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-")
833
+ const defaultPath = outputPath
834
+ || join(process.cwd(), `hiai-diagnose-${timestamp}.txt`)
835
+ const { path: configPath, config, error } = loadConfig()
836
+ const sections = []
837
+
838
+ sections.push("=".repeat(60))
839
+ sections.push(`hiai-opencode diagnose - ${timestamp}`)
840
+ sections.push("=".repeat(60))
841
+ sections.push("")
842
+
843
+ sections.push("ENVIRONMENT (keys only, no values):")
844
+ const envKeys = [
845
+ "FIRECRAWL_API_KEY", "STITCH_AI_API_KEY", "CONTEXT7_API_KEY",
846
+ "EXA_API_KEY", "TAVILY_API_KEY", "OPENCODE_RAG_URL",
847
+ "MEMPALACE_PYTHON", "HIAI_PLAYWRIGHT_INSTALL_BROWSERS", "HIAI_MCP_AUTO_INSTALL",
848
+ ]
849
+ for (const key of envKeys) {
850
+ const hasValue = !!process.env[key]?.trim()
851
+ sections.push(` ${key}: ${hasValue ? "(set)" : "(not set)"}`)
852
+ }
853
+ sections.push("")
854
+
855
+ sections.push("CONFIGURATION:")
856
+ sections.push(` Config path: ${configPath ?? "(defaults)"}`)
857
+ if (error) sections.push(` Config parse warning: ${error}`)
858
+ const modelKeys = Object.keys(config?.models ?? {})
859
+ const mcpKeys = Object.keys(config?.mcp ?? {})
860
+ sections.push(` models configured: ${modelKeys.length} [${modelKeys.join(", ") || "none"}]`)
861
+ sections.push(` mcp servers in config: ${mcpKeys.length} [${mcpKeys.join(", ") || "none"}]`)
862
+ sections.push("")
863
+
864
+ sections.push("TOOLS REGISTERED:")
865
+ const toolCount = 26
866
+ sections.push(` ~${toolCount} tools (from tool-registry.ts)`)
867
+ sections.push("")
868
+
869
+ sections.push("AGENTS:")
870
+ const agents = ["bob", "coder", "strategist", "guard", "critic", "designer", "researcher", "manager", "brainstormer", "vision"]
871
+ for (const agent of agents) {
872
+ const model = config?.models?.[agent]?.model
873
+ sections.push(` ${agent}: ${model ? `model=${model}` : "(default)"}`)
874
+ }
875
+ sections.push("")
876
+
877
+ sections.push("MCP SERVERS:")
878
+ for (const [name, entry] of Object.entries(MCP_REGISTRY)) {
879
+ const userEntry = config?.mcp?.[name]
880
+ const enabled = userEntry?.enabled ?? entry.defaultEnabled
881
+ sections.push(` ${name}: ${enabled ? "enabled" : "disabled"}`)
882
+ }
883
+ sections.push("")
884
+
885
+ sections.push("FILE PATHS:")
886
+ sections.push(` CWD: ${process.cwd()}`)
887
+ sections.push(` Package root: ${PACKAGE_ROOT}`)
888
+ sections.push(` Config: ${configPath ?? "(none)"}`)
889
+ sections.push(` Static MCP: ${join(process.cwd(), ".mcp.json")}`)
890
+ sections.push("")
891
+
892
+ sections.push("=".repeat(60))
893
+ sections.push("Diagnose complete. File written to: " + defaultPath)
894
+ sections.push("NO secrets or API keys are included in this output.")
895
+ sections.push("=".repeat(60))
896
+
897
+ mkdirSync(dirname(defaultPath), { recursive: true })
898
+ writeFileSync(defaultPath, sections.join("\n") + "\n")
899
+ console.log(`Diagnose written to: ${defaultPath}`)
900
+ }
901
+
829
902
  async function main() {
830
903
  const command = process.argv[2]
831
904
  if (!command || command === "-h" || command === "--help") {
@@ -848,6 +921,11 @@ async function main() {
848
921
  return
849
922
  }
850
923
 
924
+ if (command === "diagnose") {
925
+ await runDiagnose(process.argv[3])
926
+ return
927
+ }
928
+
851
929
  console.error(`Unknown command: ${command}`)
852
930
  usage()
853
931
  process.exit(1)
@@ -52,7 +52,9 @@
52
52
  "firecrawl": { "$ref": "#/definitions/toggle" },
53
53
  "rag": { "$ref": "#/definitions/toggle" },
54
54
  "mempalace": { "$ref": "#/definitions/mempalaceToggle" },
55
- "context7": { "$ref": "#/definitions/toggle" }
55
+ "context7": { "$ref": "#/definitions/toggle" },
56
+ "websearch": { "$ref": "#/definitions/websearchToggle" },
57
+ "grep_app": { "$ref": "#/definitions/toggle" }
56
58
  }
57
59
  },
58
60
  "lsp": {
@@ -123,6 +125,19 @@
123
125
  },
124
126
  "required": ["enabled"],
125
127
  "additionalProperties": false
128
+ },
129
+ "websearchToggle": {
130
+ "type": "object",
131
+ "properties": {
132
+ "enabled": { "type": "boolean", "default": true },
133
+ "provider": {
134
+ "enum": ["exa", "tavily"],
135
+ "default": "exa",
136
+ "description": "Remote web search MCP provider. Exa works without an API key but can use EXA_API_KEY. Tavily requires TAVILY_API_KEY."
137
+ }
138
+ },
139
+ "required": ["enabled"],
140
+ "additionalProperties": false
126
141
  }
127
142
  }
128
143
  }
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ import type { AgentPromptMetadata } from "./types";
3
+ export declare function createAgentSkillsAgent(model: string): AgentConfig;
4
+ export declare namespace createAgentSkillsAgent {
5
+ var mode: "subagent";
6
+ }
7
+ export declare const agentSkillsPromptMetadata: AgentPromptMetadata;
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * Default/base Bob prompt builder. Used for Claude and general models.
3
4
  * Lean router — delegates, routes, orchestrates. Does not implement.
4
5
  */
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * Gemini-specific overlay sections for Bob prompt.
3
4
  *
4
5
  * Gemini models are aggressively optimistic and tend to:
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * GPT-Pro-native Bob prompt - rewritten with 8-block architecture.
3
4
  *
4
5
  * Design principles (derived from OpenAI's GPT-Pro prompting guidance):
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ import type { AgentPromptMetadata } from "./types";
3
+ export declare function createBrainstormerAgent(model: string): AgentConfig;
4
+ export declare namespace createBrainstormerAgent {
5
+ var mode: "subagent";
6
+ }
7
+ export declare const brainstormerPromptMetadata: AgentPromptMetadata;
@@ -10,7 +10,7 @@ import type { AvailableAgent, AvailableTool, AvailableSkill, AvailableCategory }
10
10
  * Optimized for:
11
11
  * - Goal-oriented autonomous execution (not step-by-step instructions)
12
12
  * - Deep exploration before decisive action
13
- * - Active use of explore/librarian agents for comprehensive context
13
+ * - Active use of researcher agents for comprehensive context
14
14
  * - End-to-end task completion without premature stopping
15
15
  */
16
16
  export declare function buildCoderPrompt(availableAgents?: AvailableAgent[], availableTools?: AvailableTool[], availableSkills?: AvailableSkill[], availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * GPT-Pro optimized Coder prompt - entropy-reduced rewrite.
3
4
  *
4
5
  * Design principles (aligned with OpenAI GPT-Pro prompting guidance):
@@ -1,3 +1,4 @@
1
- /** Generic GPT Coder prompt - fallback for GPT models without a model-specific variant */
1
+ /** PROMPT_VERSION: 2026-04-26
2
+ * Generic GPT Coder prompt - fallback for GPT models without a model-specific variant */
2
3
  import type { AvailableAgent, AvailableTool, AvailableSkill, AvailableCategory } from "../dynamic-agent-prompt-builder";
3
4
  export declare function buildCoderPrompt(availableAgents?: AvailableAgent[], availableTools?: AvailableTool[], availableSkills?: AvailableSkill[], availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ import type { AgentPromptMetadata } from "./types";
3
+ export declare function createDesignerAgent(model: string): AgentConfig;
4
+ export declare namespace createDesignerAgent {
5
+ var mode: "subagent";
6
+ }
7
+ export declare const designerPromptMetadata: AgentPromptMetadata;
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * Gemini-optimized Strategist System Prompt
3
4
  *
4
5
  * Key differences from Claude/GPT variants:
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * GPT-5.4 Optimized Strategist System Prompt
3
4
  *
4
5
  * Tuned for GPT-5.4 system prompt design principles:
@@ -49,8 +49,10 @@ export interface AgentPromptMetadata {
49
49
  dedicatedSection?: string;
50
50
  /** Nickname/alias used in prompt (e.g., "Logician" instead of "logician") */
51
51
  promptAlias?: string;
52
- /** Key triggers that should appear in Phase 0 (e.g., "External library mentioned → fire librarian") */
52
+ /** Key triggers that should appear in Phase 0 (e.g., "External library mentioned → fire researcher") */
53
53
  keyTrigger?: string;
54
+ /** Prompt version for snapshot tracking (format: YYYY-MM-DD) */
55
+ promptVersion?: string;
54
56
  }
55
57
  export declare function isGptModel(model: string): boolean;
56
58
  export declare function isGptProModel(model: string): boolean;
@@ -33,5 +33,4 @@ export type { RalphLoopConfig } from "./schema/ralph-loop.js";
33
33
  export type { DynamicContextPruningConfig } from "./schema/dynamic-context-pruning.js";
34
34
  export type { GitMasterConfig } from "./schema/git-master.js";
35
35
  export type { ModelCapabilitiesConfig } from "./schema/model-capabilities.js";
36
- export type { WebsearchConfig, WebsearchProvider } from "./schema/websearch.js";
37
36
  export type { FastApplyConfig } from "./schema/fast-apply.js";
@@ -148,6 +148,18 @@ export declare const ModelSlotsConfigSchema: z.ZodObject<{
148
148
  design: "design";
149
149
  }>>;
150
150
  }, z.core.$strip>]>>;
151
+ sub: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
152
+ model: z.ZodString;
153
+ recommended: z.ZodOptional<z.ZodEnum<{
154
+ high: "high";
155
+ xhigh: "xhigh";
156
+ middle: "middle";
157
+ fast: "fast";
158
+ vision: "vision";
159
+ writing: "writing";
160
+ design: "design";
161
+ }>>;
162
+ }, z.core.$strip>]>>;
151
163
  }, z.core.$strip>;
152
164
  export declare const FallbackEntrySchema: z.ZodObject<{
153
165
  providers: z.ZodArray<z.ZodString>;
@@ -214,6 +226,10 @@ export declare const McpServerConfigSchema: z.ZodObject<{
214
226
  remote: "remote";
215
227
  local: "local";
216
228
  }>>;
229
+ provider: z.ZodOptional<z.ZodEnum<{
230
+ exa: "exa";
231
+ tavily: "tavily";
232
+ }>>;
217
233
  url: z.ZodOptional<z.ZodString>;
218
234
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
219
235
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -457,6 +473,18 @@ export declare const HiaiOpencodeConfigSchema: z.ZodObject<{
457
473
  design: "design";
458
474
  }>>;
459
475
  }, z.core.$strip>]>>;
476
+ sub: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
477
+ model: z.ZodString;
478
+ recommended: z.ZodOptional<z.ZodEnum<{
479
+ high: "high";
480
+ xhigh: "xhigh";
481
+ middle: "middle";
482
+ fast: "fast";
483
+ vision: "vision";
484
+ writing: "writing";
485
+ design: "design";
486
+ }>>;
487
+ }, z.core.$strip>]>>;
460
488
  }, z.core.$strip>>;
461
489
  agents: z.ZodOptional<z.ZodObject<{
462
490
  bob: z.ZodOptional<z.ZodObject<{
@@ -1297,6 +1325,10 @@ export declare const HiaiOpencodeConfigSchema: z.ZodObject<{
1297
1325
  remote: "remote";
1298
1326
  local: "local";
1299
1327
  }>>;
1328
+ provider: z.ZodOptional<z.ZodEnum<{
1329
+ exa: "exa";
1330
+ tavily: "tavily";
1331
+ }>>;
1300
1332
  url: z.ZodOptional<z.ZodString>;
1301
1333
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1302
1334
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -37,8 +37,6 @@ export declare const HookNameSchema: z.ZodEnum<{
37
37
  "delegate-task-retry": "delegate-task-retry";
38
38
  "strategist-md-only": "strategist-md-only";
39
39
  "sub-notepad": "sub-notepad";
40
- "no-bob-gpt": "no-bob-gpt";
41
- "no-coder-non-gpt": "no-coder-non-gpt";
42
40
  "unstable-agent-babysitter": "unstable-agent-babysitter";
43
41
  "task-resume-info": "task-resume-info";
44
42
  "stop-continuation-guard": "stop-continuation-guard";
@@ -50,5 +50,3 @@ export { StartWorkConfigSchema } from "./start-work";
50
50
  export type { StartWorkConfig } from "./start-work";
51
51
  export { TmuxConfigSchema, TmuxLayoutSchema, TmuxIsolationSchema } from "./tmux";
52
52
  export type { TmuxConfig, TmuxLayout, TmuxIsolation } from "./tmux";
53
- export { WebsearchConfigSchema } from "./websearch";
54
- export type { WebsearchConfig, WebsearchProvider } from "./websearch";
@@ -4234,12 +4234,6 @@ export declare const HiaiOpenCodeConfigSchema: z.ZodObject<{
4234
4234
  "playwright-cli": "playwright-cli";
4235
4235
  }>>;
4236
4236
  }, z.core.$strip>>;
4237
- websearch: z.ZodOptional<z.ZodObject<{
4238
- provider: z.ZodOptional<z.ZodEnum<{
4239
- exa: "exa";
4240
- tavily: "tavily";
4241
- }>>;
4242
- }, z.core.$strip>>;
4243
4237
  tmux: z.ZodOptional<z.ZodObject<{
4244
4238
  enabled: z.ZodDefault<z.ZodBoolean>;
4245
4239
  layout: z.ZodDefault<z.ZodEnum<{
@@ -21,6 +21,7 @@ export interface ModelSlotsConfig {
21
21
  manager?: ModelSlotConfig;
22
22
  brainstormer?: ModelSlotConfig;
23
23
  vision?: ModelSlotConfig;
24
+ sub?: ModelSlotConfig;
24
25
  }
25
26
  export declare const CANONICAL_AGENT_NAMES: readonly ["bob", "guard", "strategist", "critic", "coder", "designer", "sub", "researcher", "multimodal", "quality-guardian", "platform-manager", "brainstormer", "agent-skills"];
26
27
  export type CanonicalAgentName = (typeof CANONICAL_AGENT_NAMES)[number];
@@ -59,7 +60,7 @@ export interface HeuristicModelFamilyDefinition {
59
60
  supportsThinking?: boolean;
60
61
  }
61
62
  export interface CategoryConfig {
62
- model: string;
63
+ model?: string;
63
64
  variant?: string;
64
65
  description?: string;
65
66
  fallbackChain?: FallbackEntry[];
@@ -67,6 +68,7 @@ export interface CategoryConfig {
67
68
  export interface McpServerConfig {
68
69
  enabled: boolean;
69
70
  type?: "remote" | "local";
71
+ provider?: "exa" | "tavily";
70
72
  url?: string;
71
73
  headers?: Record<string, string>;
72
74
  command?: string[];
@@ -73,8 +73,6 @@ export declare function createHooks(args: {
73
73
  startWork: ReturnType<typeof import("./hooks").createStartWorkHook> | null;
74
74
  strategistMdOnly: ReturnType<typeof import("./hooks").createStrategistMdOnlyHook> | null;
75
75
  bobJuniorNotepad: ReturnType<typeof import("./hooks").createBobJuniorNotepadHook> | null;
76
- noBobGpt: ReturnType<typeof import("./hooks").createNoBobGptHook> | null;
77
- noCoderNonGpt: ReturnType<typeof import("./hooks").createNoCoderNonGptHook> | null;
78
76
  questionLabelTruncator: ReturnType<typeof import("./hooks").createQuestionLabelTruncatorHook> | null;
79
77
  taskResumeInfo: ReturnType<typeof import("./hooks").createTaskResumeInfoHook> | null;
80
78
  anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
@@ -6,3 +6,4 @@ export { devBrowserSkill } from "./dev-browser";
6
6
  export { reviewWorkSkill } from "./review-work";
7
7
  export { aiSlopRemoverSkill } from "./ai-slop-remover";
8
8
  export { hiaiOpencodeSetupSkill } from "./hiai-opencode-setup";
9
+ export { websiteCopywritingSkill } from "./website-copywriting";