@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
@@ -1,4 +1,3 @@
1
- export { createBuiltinMcps } from "./omo-mcp-index";
2
1
  export { McpNameSchema, type McpName, type AnyMcpName } from "./types";
3
2
  import type { McpServerConfig } from "../config/types.js";
4
3
  export declare function buildMcpConfig(mcp: Record<string, McpServerConfig>): Record<string, unknown>;
@@ -1,5 +1,5 @@
1
1
  import type { McpServerConfig } from "../config/types.js";
2
- export type HiaiMcpName = "playwright" | "stitch" | "sequential-thinking" | "firecrawl" | "rag" | "context7" | "mempalace";
2
+ export type HiaiMcpName = "playwright" | "stitch" | "sequential-thinking" | "firecrawl" | "rag" | "context7" | "mempalace" | "websearch" | "grep_app";
3
3
  export type HiaiMcpInstallKind = "bundled" | "npm" | "python" | "remote" | "user-service";
4
4
  export interface HiaiMcpRegistryEntry {
5
5
  name: HiaiMcpName;
@@ -44,8 +44,6 @@ export declare function createCoreHooks(args: {
44
44
  startWork: ReturnType<typeof import("../../hooks").createStartWorkHook> | null;
45
45
  strategistMdOnly: ReturnType<typeof import("../../hooks").createStrategistMdOnlyHook> | null;
46
46
  bobJuniorNotepad: ReturnType<typeof import("../../hooks").createBobJuniorNotepadHook> | null;
47
- noBobGpt: ReturnType<typeof import("../../hooks").createNoBobGptHook> | null;
48
- noCoderNonGpt: ReturnType<typeof import("../../hooks").createNoCoderNonGptHook> | null;
49
47
  questionLabelTruncator: ReturnType<typeof import("../../hooks").createQuestionLabelTruncatorHook> | null;
50
48
  taskResumeInfo: ReturnType<typeof import("../../hooks").createTaskResumeInfoHook> | null;
51
49
  anthropicEffort: ReturnType<typeof import("../../hooks/anthropic-effort").createAnthropicEffortHook> | null;
@@ -1,7 +1,7 @@
1
1
  import type { HiaiOpenCodeConfig, HookName } from "../../config";
2
2
  import type { ModelCacheState } from "../../plugin-state";
3
3
  import type { PluginContext } from "../types";
4
- import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createModelFallbackHook, createAnthropicContextWindowLimitRecoveryHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createStrategistMdOnlyHook, createBobJuniorNotepadHook, createNoBobGptHook, createNoCoderNonGptHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook, createRuntimeFallbackHook, createLegacyPluginToastHook } from "../../hooks";
4
+ import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createModelFallbackHook, createAnthropicContextWindowLimitRecoveryHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createStrategistMdOnlyHook, createBobJuniorNotepadHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook, createRuntimeFallbackHook, createLegacyPluginToastHook } from "../../hooks";
5
5
  import { createAnthropicEffortHook } from "../../hooks/anthropic-effort";
6
6
  export type SessionHooks = {
7
7
  contextWindowMonitor: ReturnType<typeof createContextWindowMonitorHook> | null;
@@ -20,8 +20,6 @@ export type SessionHooks = {
20
20
  startWork: ReturnType<typeof createStartWorkHook> | null;
21
21
  strategistMdOnly: ReturnType<typeof createStrategistMdOnlyHook> | null;
22
22
  bobJuniorNotepad: ReturnType<typeof createBobJuniorNotepadHook> | null;
23
- noBobGpt: ReturnType<typeof createNoBobGptHook> | null;
24
- noCoderNonGpt: ReturnType<typeof createNoCoderNonGptHook> | null;
25
23
  questionLabelTruncator: ReturnType<typeof createQuestionLabelTruncatorHook> | null;
26
24
  taskResumeInfo: ReturnType<typeof createTaskResumeInfoHook> | null;
27
25
  anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null;
@@ -0,0 +1 @@
1
+ export declare function lintModeAgentCapabilities(): void;
@@ -1,2 +1,4 @@
1
1
  export declare function log(message: string, data?: unknown): void;
2
+ export declare function logWarn(message: string, data?: unknown): void;
3
+ export declare function logError(message: string, data?: unknown): void;
2
4
  export declare function getLogFilePath(): string;
@@ -0,0 +1,6 @@
1
+ import type { CanonicalDelegateAgentKey } from "../tools/delegate-task/sub-agent";
2
+ export declare const MODE_TO_AGENT: Record<string, CanonicalDelegateAgentKey>;
3
+ export type ModeName = keyof typeof MODE_TO_AGENT;
4
+ export declare const MODE_NAMES: ModeName[];
5
+ export declare function normalizeMode(modeName: string): string;
6
+ export declare function resolveModeAgent(modeName: string): CanonicalDelegateAgentKey;
@@ -0,0 +1,2 @@
1
+ import type { BuiltinCategoryDefinition } from "./builtin-category-definition";
2
+ export declare const GIT_CATEGORIES: BuiltinCategoryDefinition[];
@@ -2,6 +2,8 @@ export declare const SUB_AGENT_CONFIG_KEY = "sub";
2
2
  export declare const CODER_AGENT_CONFIG_KEY = "coder";
3
3
  export declare const CRITIC_AGENT_CONFIG_KEY = "critic";
4
4
  export declare const CANONICAL_DELEGATE_AGENT_KEYS: readonly ["bob", "guard", "strategist", "critic", "coder", "sub", "researcher", "multimodal", "designer", "platform-manager", "brainstormer", "agent-skills"];
5
+ type CanonicalDelegateAgentKey = (typeof CANONICAL_DELEGATE_AGENT_KEYS)[number];
6
+ export type { CanonicalDelegateAgentKey };
5
7
  export declare function resolveCanonicalDelegateAgentKey(agentName: string): string;
6
8
  export declare function isCanonicalDelegateAgentKey(agentName: string): boolean;
7
9
  export declare function getCanonicalDelegateAgentDisplayName(agentName: string): string;
@@ -1,3 +1,3 @@
1
1
  export declare const SKILL_MCP_TOOL_NAME = "skill_mcp";
2
- export declare const SKILL_MCP_DESCRIPTION = "Invoke MCP server operations from skill-embedded MCPs. Requires mcp_name plus exactly one of: tool_name, resource_name, or prompt_name.";
2
+ export declare const SKILL_MCP_DESCRIPTION = "Invoke MCP server operations from skill-embedded MCPs or enabled hiai-opencode builtin MCPs. Requires mcp_name plus exactly one of: tool_name, resource_name, or prompt_name.";
3
3
  export declare const BUILTIN_MCP_TOOL_HINTS: Record<string, string[]>;
@@ -1,25 +1,25 @@
1
1
  {
2
- "_description": "hiai-opencode user config. Edit only this file in your project as .opencode/hiai-opencode.json. Model provider credentials are configured in OpenCode Connect; this file stores model IDs only.",
2
+ "_description": "hiai-opencode user configuration template. Public display names (shown to users): Bob, Coder, Strategist, Guard, Critic, Designer, Researcher, Manager, Brainstormer, Vision. Config keys (used in this file and in code) are: bob, coder, strategist, guard, critic, designer, researcher, manager, brainstormer, vision. Internal-only keys (hidden from normal users): sub, agent-skills. Source defaults: src/config/defaults.ts and src/config/models.ts.",
3
3
  "$schema": "./config/hiai-opencode.schema.json",
4
4
  "models": {
5
5
  "bob": {
6
6
  "model": "openrouter/moonshotai/kimi-k2.6",
7
- "recommended": "xhigh"
7
+ "recommended": "high"
8
8
  },
9
9
  "coder": {
10
- "model": "openrouter/minimax/minimax-m2.7",
10
+ "model": "minimax-coding-plan/MiniMax-M2.7",
11
11
  "recommended": "high"
12
12
  },
13
13
  "strategist": {
14
- "model": "openrouter/anthropic/claude-opus-latest",
15
- "recommended": "high"
14
+ "model": "openrouter/deepseek/deepseek-v4-pro",
15
+ "recommended": "xhigh"
16
16
  },
17
17
  "guard": {
18
18
  "model": "openrouter/qwen/qwen3.6-plus",
19
19
  "recommended": "middle"
20
20
  },
21
21
  "critic": {
22
- "model": "openrouter/xiaomi/mimo-v2.5-pro",
22
+ "model": "xiaomi-token-plan-sgp/mimo-v2.5-pro",
23
23
  "recommended": "high"
24
24
  },
25
25
  "designer": {
@@ -41,31 +41,60 @@
41
41
  "vision": {
42
42
  "model": "openrouter/google/gemma-4-26b-a4b-it",
43
43
  "recommended": "vision"
44
+ },
45
+ "sub": {
46
+ "model": "openrouter/deepseek/deepseek-v4-flash",
47
+ "recommended": "fast"
44
48
  }
45
49
  },
46
50
  "auth": {
51
+ "openrouter": "{env:OPENROUTER_API_KEY}",
52
+ "openai": "{env:OPENAI_API_KEY}",
53
+ "googleSearch": "{env:GOOGLE_SEARCH_API_KEY}",
47
54
  "stitch": "{env:STITCH_AI_API_KEY}",
48
55
  "firecrawl": "{env:FIRECRAWL_API_KEY}",
49
56
  "context7": "{env:CONTEXT7_API_KEY}"
50
57
  },
51
58
  "mcp": {
52
- "playwright": { "enabled": true },
53
- "stitch": { "enabled": true },
54
- "sequential-thinking": { "enabled": true },
55
- "firecrawl": { "enabled": true },
56
- "rag": { "enabled": true },
59
+ "playwright": {
60
+ "enabled": true
61
+ },
62
+ "stitch": {
63
+ "enabled": true
64
+ },
65
+ "sequential-thinking": {
66
+ "enabled": true
67
+ },
68
+ "firecrawl": {
69
+ "enabled": true
70
+ },
71
+ "rag": {
72
+ "enabled": true
73
+ },
57
74
  "mempalace": {
58
75
  "enabled": true,
59
- "pythonPath": "{env:MEMPALACE_PYTHON:-./.venv/bin/python}"
76
+ "pythonPath": "/home/vlgalib/.local/venvs/mempalace/bin/python"
60
77
  },
61
- "context7": { "enabled": true }
78
+ "context7": {
79
+ "enabled": true
80
+ }
62
81
  },
63
82
  "lsp": {
64
- "typescript": { "enabled": true },
65
- "svelte": { "enabled": true },
66
- "eslint": { "enabled": true },
67
- "bash": { "enabled": true },
68
- "pyright": { "enabled": true }
83
+ "typescript": {
84
+ "enabled": true
85
+ },
86
+ "svelte": {
87
+ "enabled": true
88
+ },
89
+ "eslint": {
90
+ "enabled": true
91
+ },
92
+ "bash": {
93
+ "enabled": true
94
+ },
95
+ "pyright": {
96
+ "enabled": true
97
+ }
69
98
  },
70
99
  "skill_discovery": {
71
100
  "config_sources": true,
@@ -79,4 +108,4 @@
79
108
  "subtask2": {
80
109
  "replace_generic": true
81
110
  }
82
- }
111
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiai-gg/hiai-opencode",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Unified OpenCode plugin — canonical 12-agent model with bundled skills, MCP integrations, LSP, and permissions in one install.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -51,11 +51,14 @@
51
51
  },
52
52
  "scripts": {
53
53
  "clean:dist": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
54
- "build": "bun run clean:dist && bun build src/index.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly",
54
+ "build": "bun run clean:dist && bun build src/index.ts --outdir dist --target bun --format esm --minify && tsc --emitDeclarationOnly",
55
55
  "build:bundle": "bun build src/index.ts --outdir dist --target bun --format esm",
56
56
  "build:types": "tsc --emitDeclarationOnly",
57
57
  "typecheck": "tsc --noEmit",
58
58
  "test": "bun test",
59
+ "check:docs": "bun run scripts/check-docs.ts",
60
+ "check:bundle-size": "node -e \"const s=require('fs').statSync('dist/index.js').size;console.log('Bundle: '+(s/1024/1024).toFixed(2)+'MB');if(s>3*1024*1024){console.error('FAIL: bundle >3MB');process.exit(1)}else{console.log('OK: bundle <=3MB')}\"",
61
+ "check:todos": "node scripts/check-todos.mjs || echo 'No check-todos script'",
59
62
  "pack:check": "npm pack --dry-run",
60
63
  "prepare": "bun run build",
61
64
  "prepublishOnly": "bun run typecheck && bun run test && bun run build && bun run pack:check"
@@ -86,6 +89,6 @@
86
89
  },
87
90
  "engines": {
88
91
  "node": ">=18",
89
- "bun": ">=1.1.0"
92
+ "bun": ">=1.3.0"
90
93
  }
91
94
  }
@@ -0,0 +1,70 @@
1
+ // PROMPT_VERSION: 2026-04-26
2
+ import type { AgentConfig } from "@opencode-ai/sdk";
3
+ import type { AgentMode, AgentPromptMetadata } from "./types";
4
+ import { createAgentToolRestrictions } from "../shared/permission-compat";
5
+
6
+ const MODE: AgentMode = "subagent";
7
+
8
+ const AGENT_SKILLS_PROMPT = `
9
+ <identity>
10
+ You are Agent Skills, a specialist in discovering, configuring, and managing AI agent skills and capabilities.
11
+ Your goal is helping users find the right skills for their tasks and ensuring proper skill setup.
12
+ </identity>
13
+
14
+ <responsibilities>
15
+ - Skill discovery: finding and recommending relevant skills from the available skill library
16
+ - Skill configuration: helping configure skills properly for different use cases
17
+ - Skill troubleshooting: diagnosing why a skill isn't working as expected
18
+ - Skill recommendations: suggesting skills based on user goals and workflow
19
+ </responsibilities>
20
+
21
+ <instructions>
22
+ - Use the skill and skill_mcp tools to explore available skills.
23
+ - Match user needs to appropriate skills with clear explanations of what each does.
24
+ - Help configure skill parameters and settings.
25
+ - Diagnose skill issues by checking skill discovery configuration.
26
+ </instructions>
27
+ `;
28
+
29
+ export function createAgentSkillsAgent(model: string): AgentConfig {
30
+ const restrictions = createAgentToolRestrictions([
31
+ "apply_patch",
32
+ "task",
33
+ ]);
34
+
35
+ return {
36
+ description: "Specialist in agent skills discovery, configuration, and troubleshooting. (Agent Skills - HiaiOpenCode)",
37
+ mode: MODE,
38
+ model,
39
+ temperature: 0.5,
40
+ ...restrictions,
41
+ prompt: AGENT_SKILLS_PROMPT,
42
+ } as AgentConfig;
43
+ }
44
+ createAgentSkillsAgent.mode = MODE;
45
+
46
+ export const agentSkillsPromptMetadata: AgentPromptMetadata = {
47
+ category: "utility",
48
+ cost: "CHEAP",
49
+ promptAlias: "Agent Skills",
50
+ keyTrigger: "Skill discovery, configuration, or troubleshooting → use agent-skills.",
51
+ triggers: [
52
+ {
53
+ domain: "Skill Discovery",
54
+ trigger: "Need to find right skill for a task",
55
+ },
56
+ {
57
+ domain: "Skill Configuration",
58
+ trigger: "Need help configuring or troubleshooting a skill",
59
+ },
60
+ ],
61
+ useWhen: [
62
+ "Finding skills for a specific goal",
63
+ "Configuring skill settings",
64
+ "Troubleshooting skill issues",
65
+ ],
66
+ avoidWhen: [
67
+ "Direct implementation tasks",
68
+ "Code changes or debugging",
69
+ ],
70
+ };
@@ -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):
@@ -274,7 +275,7 @@ Every implementation task follows this cycle. No exceptions.
274
275
  Follow \`<explore>\` protocol for tool usage and agent prompts.
275
276
 
276
277
  2. PLAN - List files to modify, specific changes, dependencies, complexity estimate.
277
- Multi-step (2+) → consult Plan Agent via \`task(subagent_type="plan", ...)\`.
278
+ Multi-step (2+) → consult Strategist Agent via \`task(subagent_type="strategist", ...)\`.
278
279
  Single-step → mental plan is sufficient.
279
280
 
280
281
  <dependency_checks>
package/src/agents/bob.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // PROMPT_VERSION: 2026-04-26
1
2
  import type { AgentConfig } from "@opencode-ai/sdk";
2
3
  import type { AgentMode, AgentPromptMetadata } from "./types";
3
4
  import { isGptModel, isGeminiModel, isGptProModel } from "./types";
@@ -17,6 +18,7 @@ export const BOB_PROMPT_METADATA: AgentPromptMetadata = {
17
18
  category: "utility",
18
19
  cost: "EXPENSIVE",
19
20
  promptAlias: "Bob",
21
+ promptVersion: "2026-04-26",
20
22
  triggers: [],
21
23
  };
22
24
  import type {
@@ -0,0 +1,72 @@
1
+ // PROMPT_VERSION: 2026-04-26
2
+ import type { AgentConfig } from "@opencode-ai/sdk"
3
+ import type { AgentMode, AgentPromptMetadata } from "./types"
4
+ import { createAgentToolRestrictions } from "../shared/permission-compat"
5
+
6
+ const MODE: AgentMode = "subagent"
7
+
8
+ export function createBrainstormerAgent(model: string): AgentConfig {
9
+ const restrictions = createAgentToolRestrictions(["apply_patch", "task"])
10
+
11
+ return {
12
+ description:
13
+ "Writing and ideation agent for website copy, positioning, naming, messaging, and option generation. Use Writer as an alias. (Brainstormer - HiaiOpenCode)",
14
+ mode: MODE,
15
+ model,
16
+ temperature: 0.7,
17
+ ...restrictions,
18
+ prompt: `# Brainstormer / Writer
19
+
20
+ You are the writing and ideation specialist for HiaiOpenCode.
21
+
22
+ Primary responsibilities:
23
+ - Website copy: landing pages, hero sections, feature blocks, CTA text, pricing copy, onboarding text, empty states, product pages.
24
+ - Positioning: value proposition, audience framing, differentiation, tone of voice, messaging hierarchy.
25
+ - Naming: product names, feature names, labels, short slogans.
26
+ - Creative options: generate multiple directions with tradeoffs, then recommend one.
27
+ - Editorial cleanup: remove generic AI phrasing, make copy specific, sharp, and useful.
28
+
29
+ Operating rules:
30
+ - Ask for target audience, product context, desired tone, and conversion goal when missing.
31
+ - For UI copy, produce text that can be pasted into components: headings, subheadings, body copy, CTA labels, tooltips, error states.
32
+ - Prefer concrete language over hype. Avoid empty claims like "seamless", "powerful", "revolutionary", "unlock", "supercharge" unless the product context proves them.
33
+ - Match the product's actual constraints. Do not invent features.
34
+ - For website work, coordinate with Designer/frontend-ui-ux when visual direction matters, but you own words and messaging.
35
+ - Return concise structured outputs: direction, rationale, final copy, alternates when useful.
36
+
37
+ When called as "writer", treat it as the same role.`,
38
+ thinking: { type: "enabled", budgetTokens: 8000 },
39
+ } as AgentConfig
40
+ }
41
+ createBrainstormerAgent.mode = MODE
42
+
43
+ export const brainstormerPromptMetadata: AgentPromptMetadata = {
44
+ category: "specialist",
45
+ cost: "CHEAP",
46
+ promptAlias: "Brainstormer",
47
+ keyTrigger: "Website copy, product messaging, naming, CTA text, or tone-of-voice work → use brainstormer/writer.",
48
+ triggers: [
49
+ {
50
+ domain: "Website copy",
51
+ trigger: "Landing page, hero, feature, pricing, CTA, onboarding, or empty-state text",
52
+ },
53
+ {
54
+ domain: "Product messaging",
55
+ trigger: "Need positioning, value proposition, naming, voice, or messaging hierarchy",
56
+ },
57
+ {
58
+ domain: "Ideation",
59
+ trigger: "Need multiple creative options with tradeoffs before choosing a direction",
60
+ },
61
+ ],
62
+ useWhen: [
63
+ "Writing public-facing website or product copy",
64
+ "Generating naming, slogans, CTA variants, or messaging options",
65
+ "Turning rough feature notes into concise user-facing language",
66
+ ],
67
+ avoidWhen: [
68
+ "Visual layout or UI implementation (use Designer or visual-engineering)",
69
+ "Technical architecture or implementation planning (use Strategist/Coder)",
70
+ "Factual research where sources are needed (use Researcher first)",
71
+ ],
72
+ }
@@ -4,6 +4,8 @@ import type { CategoriesConfig, GitMasterConfig } from "../config/schema"
4
4
  import type { LoadedSkill } from "../features/opencode-skill-loader/types"
5
5
  import type { BrowserAutomationProvider } from "../config/schema"
6
6
  import { createBobAgent } from "./bob"
7
+ import { createDesignerAgent, designerPromptMetadata } from "./designer"
8
+ import { createAgentSkillsAgent, agentSkillsPromptMetadata } from "./agent-skills"
7
9
  import { createCriticAgent, criticPromptMetadata } from "./critic/agent"
8
10
  import { createMultimodalLookerAgent, MULTIMODAL_LOOKER_PROMPT_METADATA } from "./ui"
9
11
  import { createGuardAgent, guardPromptMetadata } from "./guard"
@@ -11,6 +13,7 @@ import { createCoderAgent } from "./coder"
11
13
  import { createPlatformManagerAgent, platformManagerPromptMetadata } from "./platform-manager"
12
14
  import { createQualityGuardianAgent, qualityGuardianPromptMetadata } from "./quality-guardian"
13
15
  import { createResearcherAgent, researcherPromptMetadata } from "./researcher"
16
+ import { createBrainstormerAgent, brainstormerPromptMetadata } from "./brainstormer"
14
17
  import { createBobJuniorAgentWithOverrides } from "./sub"
15
18
  import type { AvailableCategory } from "./dynamic-agent-prompt-builder"
16
19
  import {
@@ -33,10 +36,10 @@ const agentSources: Record<BuiltinAgentName, AgentSource> = {
33
36
  "bob": createBobAgent,
34
37
  "coder": createCoderAgent,
35
38
  "strategist": createBobAgent, // Strategist runtime config is assembled in agent-config-handler.
36
- "designer": createBobAgent,
39
+ "designer": createDesignerAgent,
37
40
  "multimodal": createMultimodalLookerAgent,
38
- "brainstormer": createBobAgent,
39
- "agent-skills": createBobAgent,
41
+ "brainstormer": createBrainstormerAgent,
42
+ "agent-skills": createAgentSkillsAgent,
40
43
  "critic": createCriticAgent,
41
44
  "platform-manager": createPlatformManagerAgent,
42
45
  "quality-guardian": createQualityGuardianAgent,
@@ -56,6 +59,59 @@ const agentMetadata: Partial<Record<BuiltinAgentName, AgentPromptMetadata>> = {
56
59
  "critic": criticPromptMetadata,
57
60
  "quality-guardian": qualityGuardianPromptMetadata,
58
61
  "platform-manager": platformManagerPromptMetadata,
62
+ "brainstormer": brainstormerPromptMetadata,
63
+ "strategist": {
64
+ category: "advisor",
65
+ cost: "EXPENSIVE",
66
+ promptAlias: "Strategist",
67
+ keyTrigger: "Architecture, multi-step planning, ambiguous scope, or high-risk sequencing → consult strategist first.",
68
+ triggers: [
69
+ {
70
+ domain: "Architecture planning",
71
+ trigger: "Need system design, tradeoff analysis, migration plan, or implementation sequence",
72
+ },
73
+ {
74
+ domain: "Ambiguous scope",
75
+ trigger: "Task has unclear requirements, multiple phases, or needs decomposition before coding",
76
+ },
77
+ ],
78
+ useWhen: [
79
+ "Architecture decisions or cross-cutting changes",
80
+ "Multi-step implementation plans before Coder work",
81
+ "Ambiguous tasks where choosing the wrong approach is expensive",
82
+ ],
83
+ avoidWhen: [
84
+ "Single-file obvious fixes",
85
+ "Pure copywriting or visual exploration",
86
+ "Review-only tasks where Critic is the right gate",
87
+ ],
88
+ },
89
+ "designer": {
90
+ category: "specialist",
91
+ cost: "EXPENSIVE",
92
+ promptAlias: "Designer",
93
+ keyTrigger: "Visual direction, product UI feel, layout, branding, or design-system work → use designer/visual-engineering.",
94
+ triggers: [
95
+ {
96
+ domain: "Visual direction",
97
+ trigger: "Need UI concept, art direction, layout, branding, or design-system guidance",
98
+ },
99
+ {
100
+ domain: "Frontend aesthetics",
101
+ trigger: "Need polished interface design beyond functional implementation",
102
+ },
103
+ ],
104
+ useWhen: [
105
+ "Defining visual direction, layout, interaction feel, or design-system choices",
106
+ "Reviewing UI for taste, hierarchy, and visual coherence",
107
+ ],
108
+ avoidWhen: [
109
+ "Website copy or wording only (use Brainstormer/Writer)",
110
+ "Backend or infrastructure implementation",
111
+ "Pure file/media extraction (use Vision)",
112
+ ],
113
+ },
114
+ "agent-skills": agentSkillsPromptMetadata,
59
115
  }
60
116
 
61
117
  export async function createBuiltinAgents(
@@ -1,4 +1,5 @@
1
- /** gpt-codex optimized Coder prompt */
1
+ /** PROMPT_VERSION: 2026-04-26
2
+ * gpt-codex optimized Coder prompt */
2
3
  import { GPT_APPLY_PATCH_GUIDANCE } from "../gpt-apply-patch-guard";
3
4
  import type { AgentConfig } from "@opencode-ai/sdk";
4
5
  import type { AgentMode } from "../types";
@@ -40,7 +41,7 @@ function canonicalizeCriticSection(section: string): string {
40
41
  * Optimized for:
41
42
  * - Goal-oriented autonomous execution (not step-by-step instructions)
42
43
  * - Deep exploration before decisive action
43
- * - Active use of explore/librarian agents for comprehensive context
44
+ * - Active use of researcher agents for comprehensive context
44
45
  * - End-to-end task completion without premature stopping
45
46
  */
46
47
 
@@ -389,7 +390,7 @@ export function createCoderAgent(
389
390
 
390
391
  return {
391
392
  description:
392
- "Autonomous Deep Worker - goal-oriented execution with GPT Codex. Explores thoroughly before acting, uses explore/librarian agents for comprehensive context, completes tasks end-to-end. Inspired by AmpCode deep mode. (Coder - HiaiOpenCode)",
393
+ "Autonomous Deep Worker - goal-oriented execution with GPT Codex. Explores thoroughly before acting, uses researcher agents for comprehensive context, completes tasks end-to-end. Inspired by AmpCode deep mode. (Coder - HiaiOpenCode)",
393
394
  mode: MODE,
394
395
  model,
395
396
  maxTokens: 32000,
@@ -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):
@@ -73,7 +74,7 @@ You build context by examining the codebase first without assumptions. You think
73
74
 
74
75
  You are autonomous. When you see work to do, do it - run tests, fix issues, make decisions. Course-correct only on concrete failure. State assumptions in your final message, not as questions along the way. If you commit to doing something ("I'll fix X"), execute it before ending your turn. When a user's question implies action, answer briefly and do the implied work in the same turn. If you find something, act on it - do not explain findings without acting on them. Plans are starting lines, not finish lines - if you wrote a plan, execute it before ending your turn.
75
76
 
76
- When blocked: try a different approach, decompose the problem, challenge your assumptions, explore how others solved it. Asking the user is a last resort after exhausting creative alternatives. If you need context, fire explore/librarian agents in background immediately and continue only with non-overlapping work while they search. Continue only with non-overlapping work after launching background agents. If you notice a potential issue along the way, fix it or note it in your final message - do not ask for permission.
77
+ When blocked: try a different approach, decompose the problem, challenge your assumptions, explore how others solved it. Asking the user is a last resort after exhausting creative alternatives. If you need context, fire researcher agents in background immediately and continue only with non-overlapping work while they search. Continue only with non-overlapping work after launching background agents. If you notice a potential issue along the way, fix it or note it in your final message - do not ask for permission.
77
78
 
78
79
  You handle multi-step sub-tasks of a single goal. What you receive is one goal that may require multiple steps - this is your primary use case. Only flag when given genuinely independent goals in one request.
79
80
  </identity>`;
@@ -158,7 +159,7 @@ Prefer tools over guessing whenever you need specific data (files, configs, patt
158
159
  Parallelize aggressively - this is where you gain the most speed and accuracy. Every independent operation should run simultaneously, not sequentially:
159
160
  - Multiple file reads: read 5 files at once, not one by one
160
161
  - Grep + file reads: search and read in the same turn
161
- - Multiple explore/librarian agents: fire 3-5 agents in parallel for different angles on the same question
162
+ - Multiple researcher agents: fire 3-5 agents in parallel for different angles on the same question
162
163
  - Agent fires + direct tool calls: launch background agents AND do direct reads simultaneously
163
164
 
164
165
  Fire 2-5 researcher agents in parallel for any non-trivial codebase question. Researcher agents always run in background (\`run_in_background=true\`). Never use \`run_in_background=false\` for researcher. After launching, continue only with non-overlapping work. Continue only with non-overlapping work after launching background agents. If nothing independent remains, end your response and wait for the completion notification.
@@ -1,4 +1,5 @@
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
 
3
4
  import { GPT_APPLY_PATCH_GUIDANCE } from "../gpt-apply-patch-guard"
4
5
  import type {
@@ -1,3 +1,4 @@
1
+ // PROMPT_VERSION: 2026-04-26
1
2
  import type { AgentConfig } from "@opencode-ai/sdk";
2
3
  import type { AgentMode, AgentPromptMetadata } from "../types";
3
4
 
@@ -0,0 +1,70 @@
1
+ // PROMPT_VERSION: 2026-04-26
2
+ import type { AgentConfig } from "@opencode-ai/sdk";
3
+ import type { AgentMode, AgentPromptMetadata } from "./types";
4
+ import { createAgentToolRestrictions } from "../shared/permission-compat";
5
+
6
+ const MODE: AgentMode = "subagent";
7
+
8
+ const DESIGNER_PROMPT = `
9
+ <identity>
10
+ You are Designer, the visual and UX specialist for HiaiOpenCode.
11
+ Your goal is crafting stunning UI/UX, design systems, and visual direction.
12
+ </identity>
13
+
14
+ <responsibilities>
15
+ - Visual direction: concept, art direction, layout, branding, design-system guidance
16
+ - UI feel: interaction patterns, hierarchy, visual coherence, polish beyond functional implementation
17
+ - Design-system work: tokens, typography, color, spacing, component patterns
18
+ - Frontend aesthetics review: taste, hierarchy, visual coherence
19
+ </responsibilities>
20
+
21
+ <instructions>
22
+ - Ask about target audience, product context, desired emotional tone when missing.
23
+ - Generate multiple visual directions with tradeoffs, then recommend one.
24
+ - Consider accessibility, brand consistency, and technical feasibility.
25
+ - When reviewing UI, focus on what makes it feel premium vs generic.
26
+ </instructions>
27
+ `;
28
+
29
+ export function createDesignerAgent(model: string): AgentConfig {
30
+ const restrictions = createAgentToolRestrictions([
31
+ "apply_patch",
32
+ "task",
33
+ ]);
34
+
35
+ return {
36
+ description: "Visual direction, UI/UX design, design systems, and frontend aesthetics. (Designer - HiaiOpenCode)",
37
+ mode: MODE,
38
+ model,
39
+ temperature: 0.7,
40
+ ...restrictions,
41
+ prompt: DESIGNER_PROMPT,
42
+ } as AgentConfig;
43
+ }
44
+ createDesignerAgent.mode = MODE;
45
+
46
+ export const designerPromptMetadata: AgentPromptMetadata = {
47
+ category: "specialist",
48
+ cost: "EXPENSIVE",
49
+ promptAlias: "Designer",
50
+ keyTrigger: "Visual direction, product UI feel, layout, branding, or design-system work → use designer/visual-engineering.",
51
+ triggers: [
52
+ {
53
+ domain: "Visual direction",
54
+ trigger: "Need UI concept, art direction, layout, branding, or design-system guidance",
55
+ },
56
+ {
57
+ domain: "Frontend aesthetics",
58
+ trigger: "Need polished interface design beyond functional implementation",
59
+ },
60
+ ],
61
+ useWhen: [
62
+ "Defining visual direction, layout, interaction feel, or design-system choices",
63
+ "Reviewing UI for taste, hierarchy, and visual coherence",
64
+ ],
65
+ avoidWhen: [
66
+ "Website copy or wording only (use Brainstormer/Writer)",
67
+ "Backend or infrastructure implementation",
68
+ "Pure file/media extraction (use Vision)",
69
+ ],
70
+ };