@hiai-gg/hiai-opencode 0.1.5 → 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.
- package/.env.example +21 -8
- package/AGENTS.md +60 -6
- package/ARCHITECTURE.md +6 -3
- package/LICENSE.md +0 -1
- package/README.md +113 -33
- package/assets/cli/hiai-opencode.mjs +668 -7
- package/assets/mcp/mempalace.mjs +159 -25
- package/config/hiai-opencode.schema.json +29 -3
- package/dist/agents/agent-skills.d.ts +7 -0
- package/dist/agents/bob/default.d.ts +1 -0
- package/dist/agents/bob/gemini.d.ts +1 -0
- package/dist/agents/bob/gpt-pro.d.ts +1 -0
- package/dist/agents/brainstormer.d.ts +7 -0
- package/dist/agents/coder/gpt-codex.d.ts +1 -1
- package/dist/agents/coder/gpt-pro.d.ts +1 -0
- package/dist/agents/coder/gpt.d.ts +2 -1
- package/dist/agents/designer.d.ts +7 -0
- package/dist/agents/dynamic-agent-core-sections.d.ts +4 -1
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
- package/dist/agents/strategist/gemini.d.ts +1 -0
- package/dist/agents/strategist/gpt.d.ts +1 -0
- package/dist/agents/types.d.ts +3 -1
- package/dist/config/index.d.ts +0 -1
- package/dist/config/platform-schema.d.ts +34 -6
- package/dist/config/schema/commands.d.ts +1 -0
- package/dist/config/schema/hooks.d.ts +0 -2
- package/dist/config/schema/index.d.ts +0 -2
- package/dist/config/schema/oh-my-opencode-config.d.ts +1 -9
- package/dist/config/types.d.ts +4 -4
- package/dist/create-hooks.d.ts +0 -2
- package/dist/features/builtin-commands/templates/doctor.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/builtin-skills/skills/hiai-opencode-setup.d.ts +2 -0
- package/dist/features/builtin-skills/skills/index.d.ts +2 -0
- package/dist/features/builtin-skills/skills/website-copywriting.d.ts +2 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -1
- package/dist/index.js +7719 -153698
- package/dist/mcp/index.d.ts +0 -1
- package/dist/mcp/registry.d.ts +1 -1
- package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -3
- package/dist/plugin/startup-diagnostics.d.ts +1 -0
- package/dist/shared/logger.d.ts +2 -0
- package/dist/shared/mcp-static-export.d.ts +22 -0
- package/dist/shared/mode-routing.d.ts +6 -0
- package/dist/tools/ast-grep/constants.d.ts +1 -1
- package/dist/tools/ast-grep/environment-check.d.ts +1 -5
- package/dist/tools/ast-grep/language-support.d.ts +0 -1
- package/dist/tools/ast-grep/types.d.ts +1 -2
- package/dist/tools/delegate-task/git-categories.d.ts +2 -0
- package/dist/tools/delegate-task/sub-agent.d.ts +2 -0
- package/dist/tools/skill-mcp/constants.d.ts +1 -1
- package/hiai-opencode.json +50 -19
- package/package.json +10 -5
- package/src/agents/agent-skills.ts +70 -0
- package/src/agents/bob/default.ts +7 -1
- package/src/agents/bob/gemini.ts +1 -0
- package/src/agents/bob/gpt-pro.ts +3 -1
- package/src/agents/bob.ts +3 -0
- package/src/agents/brainstormer.ts +72 -0
- package/src/agents/builtin-agents.ts +59 -3
- package/src/agents/coder/gpt-codex.ts +5 -3
- package/src/agents/coder/gpt-pro.ts +4 -2
- package/src/agents/coder/gpt.ts +3 -1
- package/src/agents/critic/agent.ts +1 -0
- package/src/agents/designer.ts +70 -0
- package/src/agents/dynamic-agent-category-skills-guide.ts +6 -0
- package/src/agents/dynamic-agent-core-sections.ts +36 -0
- package/src/agents/dynamic-agent-prompt-builder.ts +1 -0
- package/src/agents/guard/default.ts +1 -0
- package/src/agents/guard/gemini.ts +1 -0
- package/src/agents/guard/gpt.ts +1 -0
- package/src/agents/platform-manager.ts +17 -1
- package/src/agents/prompt-library/platform.ts +34 -0
- package/src/agents/researcher.ts +1 -0
- package/src/agents/strategist/gemini.ts +1 -0
- package/src/agents/strategist/gpt.ts +1 -0
- package/src/agents/types.ts +4 -1
- package/src/agents/ui.ts +1 -0
- package/src/config/defaults.ts +45 -13
- package/src/config/index.ts +0 -1
- package/src/config/model-slots-and-export.test.ts +73 -0
- package/src/config/platform-schema.ts +3 -3
- package/src/config/schema/commands.ts +1 -0
- package/src/config/schema/hooks.ts +0 -2
- package/src/config/schema/index.ts +0 -2
- package/src/config/schema/oh-my-opencode-config.ts +0 -5
- package/src/config/types.ts +4 -4
- package/src/features/builtin-commands/commands.ts +7 -0
- package/src/features/builtin-commands/templates/doctor.ts +43 -0
- package/src/features/builtin-commands/types.ts +1 -1
- package/src/features/builtin-skills/skills/hiai-opencode-setup.ts +69 -0
- package/src/features/builtin-skills/skills/index.ts +2 -0
- package/src/features/builtin-skills/skills/website-copywriting.ts +41 -0
- package/src/features/builtin-skills/skills.test.ts +8 -0
- package/src/features/builtin-skills/skills.ts +12 -1
- package/src/features/skill-mcp-manager/AGENTS.md +1 -1
- package/src/hooks/agent-usage-reminder/constants.ts +4 -4
- package/src/hooks/index.ts +0 -2
- package/src/hooks/keyword-detector/ultrawork/default.ts +18 -18
- package/src/hooks/keyword-detector/ultrawork/gemini.ts +21 -21
- package/src/hooks/keyword-detector/ultrawork/gpt.ts +6 -8
- package/src/hooks/keyword-detector/ultrawork/planner.ts +5 -5
- package/src/index.ts +8 -78
- package/src/internals/plugins/subtask2/commands/manifest.ts +2 -6
- package/src/internals/plugins/subtask2/hooks/command-hooks.ts +2 -2
- package/src/internals/plugins/subtask2/hooks/message-hooks.ts +1 -1
- package/src/internals/plugins/subtask2/parsing/parallel.ts +13 -10
- package/src/mcp/index.ts +0 -1
- package/src/mcp/registry.ts +27 -0
- package/src/plugin/chat-message.ts +0 -2
- package/src/plugin/hooks/create-session-hooks.ts +0 -17
- package/src/plugin/startup-diagnostics.ts +27 -0
- package/src/plugin-handlers/agent-config-handler.ts +3 -2
- package/src/plugin-handlers/mcp-config-handler.test.ts +63 -0
- package/src/plugin-handlers/mcp-config-handler.ts +29 -14
- package/src/plugin-handlers/strategist-agent-config-builder.ts +1 -1
- package/src/shared/agent-display-names.test.ts +9 -0
- package/src/shared/agent-display-names.ts +5 -0
- package/src/shared/log-legacy-plugin-startup-warning.ts +6 -8
- package/src/shared/logger.ts +8 -0
- package/src/shared/mcp-static-export.ts +119 -0
- package/src/shared/migration/agent-names.ts +8 -0
- package/src/shared/migration/hook-names.ts +1 -1
- package/src/shared/mode-routing.test.ts +88 -0
- package/src/shared/mode-routing.ts +30 -0
- package/src/shared/startup-diagnostics.ts +6 -7
- package/src/tools/ast-grep/constants.ts +1 -1
- package/src/tools/ast-grep/environment-check.ts +2 -32
- package/src/tools/ast-grep/language-support.ts +0 -3
- package/src/tools/ast-grep/types.ts +1 -2
- package/src/tools/call-omo-agent/tools.ts +11 -4
- package/src/tools/delegate-task/anthropic-categories.ts +3 -3
- package/src/tools/delegate-task/builtin-categories.ts +2 -0
- package/src/tools/delegate-task/categories.test.ts +87 -0
- package/src/tools/delegate-task/category-resolver.ts +8 -9
- package/src/tools/delegate-task/git-categories.ts +30 -0
- package/src/tools/delegate-task/model-string-parser.test.ts +90 -0
- package/src/tools/delegate-task/openai-categories.ts +26 -22
- package/src/tools/delegate-task/sub-agent.ts +10 -0
- package/src/tools/delegate-task/subagent-discovery.test.ts +123 -0
- package/src/tools/delegate-task/subagent-resolver.ts +18 -1
- package/src/tools/skill-mcp/constants.ts +1 -1
- package/src/tools/skill-mcp/tools.test.ts +44 -0
- package/dist/ast-grep-napi.win32-x64-msvc-67c0y8nc.node +0 -0
- package/dist/config/loader.test.d.ts +0 -1
- package/dist/config/models.d.ts +0 -13
- package/dist/config/schema/websearch.d.ts +0 -13
- package/dist/hooks/no-bob-gpt/hook.d.ts +0 -16
- package/dist/hooks/no-bob-gpt/index.d.ts +0 -1
- package/dist/hooks/no-coder-non-gpt/hook.d.ts +0 -20
- package/dist/hooks/no-coder-non-gpt/index.d.ts +0 -1
- package/dist/internals/plugins/websearch-cited/google.d.ts +0 -38
- package/dist/internals/plugins/websearch-cited/index.d.ts +0 -17
- package/dist/internals/plugins/websearch-cited/openai.d.ts +0 -9
- package/dist/internals/plugins/websearch-cited/openrouter.d.ts +0 -2
- package/dist/internals/plugins/websearch-cited/types.d.ts +0 -5
- package/dist/mcp/grep-app.d.ts +0 -6
- package/dist/mcp/omo-mcp-index.d.ts +0 -10
- package/dist/mcp/websearch.d.ts +0 -11
- package/src/config/schema/websearch.ts +0 -15
- package/src/hooks/no-bob-gpt/hook.ts +0 -56
- package/src/hooks/no-bob-gpt/index.ts +0 -1
- package/src/hooks/no-coder-non-gpt/hook.ts +0 -67
- package/src/hooks/no-coder-non-gpt/index.ts +0 -1
- package/src/internals/plugins/websearch-cited/LICENSE +0 -214
- package/src/internals/plugins/websearch-cited/codex_prompt.txt +0 -79
- package/src/internals/plugins/websearch-cited/google.ts +0 -749
- package/src/internals/plugins/websearch-cited/index.ts +0 -306
- package/src/internals/plugins/websearch-cited/openai.ts +0 -407
- package/src/internals/plugins/websearch-cited/openrouter.ts +0 -190
- package/src/internals/plugins/websearch-cited/types.ts +0 -7
- package/src/mcp/grep-app.ts +0 -6
- package/src/mcp/omo-mcp-index.ts +0 -30
- package/src/mcp/websearch.ts +0 -44
|
@@ -9,6 +9,7 @@ import { START_WORK_TEMPLATE } from "./templates/start-work"
|
|
|
9
9
|
import { HANDOFF_TEMPLATE } from "./templates/handoff"
|
|
10
10
|
import { REMOVE_AI_SLOPS_TEMPLATE } from "./templates/remove-ai-slops"
|
|
11
11
|
import { MCP_STATUS_TEMPLATE } from "./templates/mcp-status"
|
|
12
|
+
import { DOCTOR_TEMPLATE } from "./templates/doctor"
|
|
12
13
|
|
|
13
14
|
interface LoadBuiltinCommandsOptions {
|
|
14
15
|
useRegisteredAgents?: boolean
|
|
@@ -126,6 +127,12 @@ $ARGUMENTS
|
|
|
126
127
|
description: "(builtin) Show hiai-opencode MCP server status, missing keys, and local runtime availability",
|
|
127
128
|
template: `<command-instruction>
|
|
128
129
|
${MCP_STATUS_TEMPLATE}
|
|
130
|
+
</command-instruction>`,
|
|
131
|
+
},
|
|
132
|
+
doctor: {
|
|
133
|
+
description: "(builtin) Run hiai-opencode install/runtime diagnostics and explain setup issues",
|
|
134
|
+
template: `<command-instruction>
|
|
135
|
+
${DOCTOR_TEMPLATE}
|
|
129
136
|
</command-instruction>`,
|
|
130
137
|
},
|
|
131
138
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const DOCTOR_TEMPLATE = `# Hiai OpenCode Doctor Command
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Use /doctor to run the hiai-opencode install/runtime diagnostic and report actionable setup issues.
|
|
6
|
+
|
|
7
|
+
## Execute
|
|
8
|
+
|
|
9
|
+
Run:
|
|
10
|
+
|
|
11
|
+
\`\`\`bash
|
|
12
|
+
hiai-opencode doctor
|
|
13
|
+
\`\`\`
|
|
14
|
+
|
|
15
|
+
If the binary is not on PATH, try the package-local fallback:
|
|
16
|
+
|
|
17
|
+
\`\`\`bash
|
|
18
|
+
node ./node_modules/@hiai-gg/hiai-opencode/assets/cli/hiai-opencode.mjs doctor
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
## Report
|
|
22
|
+
|
|
23
|
+
Summarize:
|
|
24
|
+
|
|
25
|
+
- config path
|
|
26
|
+
- enabled and disabled MCP servers
|
|
27
|
+
- missing env vars by name only
|
|
28
|
+
- static \`.mcp.json\` freshness and whether it is managed by hiai-opencode
|
|
29
|
+
- OpenCode Connect visibility for configured model providers
|
|
30
|
+
- OpenCode plugin registration sanity (including \`plugin: ["list"]\` misconfiguration warning)
|
|
31
|
+
- skill materialization status from skill registry
|
|
32
|
+
- agent count and naming summary
|
|
33
|
+
- LSP runtime availability
|
|
34
|
+
- MemPalace python source and selected interpreter (env/config/auto)
|
|
35
|
+
- MCP tool probes (real connect + tools/list) for stdio and basic endpoint probes for remote MCP
|
|
36
|
+
|
|
37
|
+
Rules:
|
|
38
|
+
|
|
39
|
+
- Do not print API key values.
|
|
40
|
+
- Do not ask for model provider env vars such as OPENROUTER_API_KEY or OPENAI_API_KEY; normal model auth belongs to OpenCode Connect.
|
|
41
|
+
- If \`opencode mcp list\` is empty but doctor/mcp-status sees servers, explain the runtime-vs-static config distinction and run \`hiai-opencode export-mcp .mcp.json\` if the user wants static visibility.
|
|
42
|
+
- Do not run package installs unless the user explicitly asks.
|
|
43
|
+
`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../claude-code-command-loader"
|
|
2
2
|
|
|
3
|
-
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "remove-ai-slops" | "mcp-status"
|
|
3
|
+
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "remove-ai-slops" | "mcp-status" | "doctor"
|
|
4
4
|
|
|
5
5
|
export interface BuiltinCommandConfig {
|
|
6
6
|
disabled_commands?: BuiltinCommandName[]
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { BuiltinSkill } from "../types"
|
|
2
|
+
|
|
3
|
+
export const hiaiOpencodeSetupSkill: BuiltinSkill = {
|
|
4
|
+
name: "hiai-opencode-setup",
|
|
5
|
+
description:
|
|
6
|
+
"Use when install/setup/onboarding or MCP debug mentions: install, setup, bootstrap, doctor, mcp-status, MCP not found, mcp list empty, MemPalace, RAG, firecrawl, stitch, sequential-thinking, playwright, DCP, agents, skills, or LSP.",
|
|
7
|
+
template: `# hiai-opencode Setup And Runtime Operations
|
|
8
|
+
|
|
9
|
+
Use this skill for hiai-opencode installation, diagnostics, and integration repair.
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
- hiai-opencode is an OpenCode plugin, not a standalone app.
|
|
14
|
+
- MCP servers are external upstream tools launched by hiai-opencode wiring.
|
|
15
|
+
- The user-facing config is \`hiai-opencode.json\` or \`.opencode/hiai-opencode.json\`.
|
|
16
|
+
- Model provider credentials belong to OpenCode Connect. Do not ask for \`OPENROUTER_API_KEY\`, \`OPENAI_API_KEY\`, or \`ANTHROPIC_API_KEY\` for normal model usage.
|
|
17
|
+
- Service credentials are separate: \`FIRECRAWL_API_KEY\`, \`STITCH_AI_API_KEY\`, \`CONTEXT7_API_KEY\`.
|
|
18
|
+
|
|
19
|
+
## First Diagnostic Commands
|
|
20
|
+
|
|
21
|
+
\`\`\`bash
|
|
22
|
+
hiai-opencode doctor
|
|
23
|
+
hiai-opencode mcp-status
|
|
24
|
+
opencode debug config
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
If \`opencode mcp list\` is empty but doctor/mcp-status sees servers, explain that OpenCode's list may read only static \`.mcp.json\`. Refresh static visibility:
|
|
28
|
+
|
|
29
|
+
\`\`\`bash
|
|
30
|
+
hiai-opencode export-mcp .mcp.json
|
|
31
|
+
opencode mcp list --print-logs --log-level INFO
|
|
32
|
+
\`\`\`
|
|
33
|
+
|
|
34
|
+
## Plugin vs MCP
|
|
35
|
+
|
|
36
|
+
Install OpenCode plugins with:
|
|
37
|
+
|
|
38
|
+
\`\`\`bash
|
|
39
|
+
opencode plugin @hiai-gg/hiai-opencode@latest --global
|
|
40
|
+
opencode plugin @tarquinen/opencode-dcp@latest --global
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
Do not add MCP packages to the OpenCode plugin array. MCP packages are launched through \`hiai-opencode.json\` and helper scripts.
|
|
44
|
+
|
|
45
|
+
## MCP Runtime Notes
|
|
46
|
+
|
|
47
|
+
- \`playwright\`: node/npx; browser binaries may need \`HIAI_PLAYWRIGHT_INSTALL_BROWSERS=1\`; Linux system deps may require admin rights.
|
|
48
|
+
- \`sequential-thinking\`: node/npx; use for complex planning, revision, and branching.
|
|
49
|
+
- \`firecrawl\`: requires \`FIRECRAWL_API_KEY\`.
|
|
50
|
+
- \`mempalace\`: prefers \`uv\`; otherwise Python 3.9+ with \`mempalace\`. Use \`mempalace_status\` first, search before answering memory questions, and never invent memories.
|
|
51
|
+
- \`rag\`: requires \`OPENCODE_RAG_URL\` or a reachable default \`http://localhost:9002/tools/search\`.
|
|
52
|
+
- \`stitch\`: requires \`STITCH_AI_API_KEY\`.
|
|
53
|
+
- \`context7\`: remote docs/search; key optional but recommended for limits.
|
|
54
|
+
|
|
55
|
+
## Calling MCP
|
|
56
|
+
|
|
57
|
+
- Use native MCP tools if OpenCode exposes them.
|
|
58
|
+
- Use \`skill_mcp\` for skill-embedded MCP or enabled hiai-opencode MCP.
|
|
59
|
+
- If \`skill_mcp\` says a server is not found, check whether the skill is loaded, whether the MCP is enabled in \`hiai-opencode.json\`, and whether \`.mcp.json\` needs export.
|
|
60
|
+
|
|
61
|
+
## Safety Rules
|
|
62
|
+
|
|
63
|
+
- Report missing keys by env var name only. Never print key values.
|
|
64
|
+
- Prefer project-local or user-level installs. Do not use sudo/admin rights unless the user explicitly asks.
|
|
65
|
+
- Do not edit unrelated OpenCode/Claude/Agents global skill folders unless the user opts in.
|
|
66
|
+
- Keep DCP separate: it is an optional OpenCode plugin, not part of the hiai-opencode package.
|
|
67
|
+
`,
|
|
68
|
+
allowedTools: ["Bash(*)", "Read(*)", "Edit(*)", "Glob(*)", "Grep(*)", "skill_mcp(*)"],
|
|
69
|
+
}
|
|
@@ -5,3 +5,5 @@ export { gitMasterSkill } from "./git-master"
|
|
|
5
5
|
export { devBrowserSkill } from "./dev-browser"
|
|
6
6
|
export { reviewWorkSkill } from "./review-work"
|
|
7
7
|
export { aiSlopRemoverSkill } from "./ai-slop-remover"
|
|
8
|
+
export { hiaiOpencodeSetupSkill } from "./hiai-opencode-setup"
|
|
9
|
+
export { websiteCopywritingSkill } from "./website-copywriting"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { BuiltinSkill } from "../types"
|
|
2
|
+
|
|
3
|
+
export const websiteCopywritingSkill: BuiltinSkill = {
|
|
4
|
+
name: "website-copywriting",
|
|
5
|
+
description:
|
|
6
|
+
"Writes sharp website/product copy: landing pages, hero sections, CTAs, feature blocks, positioning, naming, and tone of voice.",
|
|
7
|
+
template: `# Website Copywriting
|
|
8
|
+
|
|
9
|
+
Use this skill for public-facing product and website text.
|
|
10
|
+
|
|
11
|
+
## Inputs To Clarify
|
|
12
|
+
|
|
13
|
+
- Audience: who reads this and what do they already know?
|
|
14
|
+
- Goal: sign up, book demo, understand feature, trust product, recover from error, continue onboarding.
|
|
15
|
+
- Tone: precise, playful, premium, technical, calm, bold, founder-led, enterprise, developer-first.
|
|
16
|
+
- Proof: real features, constraints, metrics, customer pain, differentiators. Do not invent proof.
|
|
17
|
+
|
|
18
|
+
## Output Shape
|
|
19
|
+
|
|
20
|
+
Prefer copy that can be pasted into UI:
|
|
21
|
+
|
|
22
|
+
- Hero: headline, subheadline, primary CTA, secondary CTA.
|
|
23
|
+
- Feature block: title, one-sentence value, 2-4 proof bullets.
|
|
24
|
+
- Section copy: heading, short intro, card titles, card bodies.
|
|
25
|
+
- Microcopy: button labels, empty states, errors, onboarding hints.
|
|
26
|
+
- Alternatives: 3-5 variants when tone or positioning is undecided.
|
|
27
|
+
|
|
28
|
+
## Writing Rules
|
|
29
|
+
|
|
30
|
+
- Specific beats clever. Concrete verbs beat vague hype.
|
|
31
|
+
- Avoid generic AI language: seamless, unlock, supercharge, leverage, robust, cutting-edge, revolutionize, next-generation.
|
|
32
|
+
- Keep claims tied to actual capabilities.
|
|
33
|
+
- Use short lines for UI. Long paragraphs are usually wrong for websites.
|
|
34
|
+
- Preserve product vocabulary from the codebase/docs when available.
|
|
35
|
+
- If visual direction matters, pair with \`frontend-ui-ux\` or delegate visual work to Designer.
|
|
36
|
+
|
|
37
|
+
## Delegation Hint
|
|
38
|
+
|
|
39
|
+
Use \`task(subagent_type="brainstormer", load_skills=["website-copywriting"], ...)\` for copy-only work.
|
|
40
|
+
Use \`category="writing"\` when a category is required. Writer/copywriter aliases map to Brainstormer.`,
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
|
|
3
|
+
import { createBuiltinSkills } from "./skills"
|
|
4
|
+
|
|
5
|
+
test("website-copywriting is available as a builtin skill", () => {
|
|
6
|
+
const skills = createBuiltinSkills()
|
|
7
|
+
expect(skills.some((skill) => skill.name === "website-copywriting")).toBe(true)
|
|
8
|
+
})
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
devBrowserSkill,
|
|
11
11
|
reviewWorkSkill,
|
|
12
12
|
aiSlopRemoverSkill,
|
|
13
|
+
hiaiOpencodeSetupSkill,
|
|
14
|
+
websiteCopywritingSkill,
|
|
13
15
|
} from "./skills/index"
|
|
14
16
|
|
|
15
17
|
export interface CreateBuiltinSkillsOptions {
|
|
@@ -29,7 +31,16 @@ export function createBuiltinSkills(options: CreateBuiltinSkillsOptions = {}): B
|
|
|
29
31
|
browserSkill = playwrightSkill
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
const skills = [
|
|
34
|
+
const skills = [
|
|
35
|
+
browserSkill,
|
|
36
|
+
hiaiOpencodeSetupSkill,
|
|
37
|
+
frontendUiUxSkill,
|
|
38
|
+
gitMasterSkill,
|
|
39
|
+
devBrowserSkill,
|
|
40
|
+
reviewWorkSkill,
|
|
41
|
+
aiSlopRemoverSkill,
|
|
42
|
+
websiteCopywritingSkill,
|
|
43
|
+
]
|
|
33
44
|
|
|
34
45
|
if (!disabledSkills) {
|
|
35
46
|
return skills
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
| Tier | Manager | Scope |
|
|
12
12
|
|------|---------|-------|
|
|
13
|
-
| 1.
|
|
13
|
+
| 1. Platform defaults | `HIAI_MCP_REGISTRY` (src/mcp/registry.ts) | Global MCP defaults materialized from hiai-opencode.json |
|
|
14
14
|
| 2. Claude Code | `claude-code-mcp-loader` (src/features/) | From `.mcp.json` |
|
|
15
15
|
| 3. **Skill-embedded** | **`SkillMcpManager` (this module)** | **Per-session, from SKILL.md YAML** |
|
|
16
16
|
|
|
@@ -30,13 +30,13 @@ export const REMINDER_MESSAGE = `
|
|
|
30
30
|
|
|
31
31
|
You called a search/fetch tool directly without leveraging specialized agents.
|
|
32
32
|
|
|
33
|
-
RECOMMENDED: Use task with
|
|
33
|
+
RECOMMENDED: Use task with researcher agents for better results:
|
|
34
34
|
|
|
35
35
|
\`\`\`
|
|
36
36
|
// Parallel exploration - fire multiple agents simultaneously
|
|
37
|
-
task(subagent_type="
|
|
38
|
-
task(subagent_type="
|
|
39
|
-
task(subagent_type="
|
|
37
|
+
task(subagent_type="researcher", load_skills=[], prompt="Find all files matching pattern X")
|
|
38
|
+
task(subagent_type="researcher", load_skills=[], prompt="Search for implementation of Y")
|
|
39
|
+
task(subagent_type="researcher", load_skills=[], prompt="Lookup documentation for Z")
|
|
40
40
|
|
|
41
41
|
// Then continue your work while they run in background
|
|
42
42
|
// System will notify you when each completes
|
package/src/hooks/index.ts
CHANGED
|
@@ -28,8 +28,6 @@ export { createThinkingBlockValidatorHook } from "./thinking-block-validator";
|
|
|
28
28
|
export { createToolPairValidatorHook } from "./tool-pair-validator";
|
|
29
29
|
export { createCategorySkillReminderHook } from "./category-skill-reminder";
|
|
30
30
|
export { createRalphLoopHook, type RalphLoopHook } from "./ralph-loop";
|
|
31
|
-
export { createNoBobGptHook } from "./no-bob-gpt";
|
|
32
|
-
export { createNoCoderNonGptHook } from "./no-coder-non-gpt";
|
|
33
31
|
export { createAutoSlashCommandHook } from "./auto-slash-command";
|
|
34
32
|
export { createEditErrorRecoveryHook } from "./edit-error-recovery";
|
|
35
33
|
|
|
@@ -95,50 +95,50 @@ TELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.
|
|
|
95
95
|
|
|
96
96
|
## MANDATORY: PLAN AGENT INVOCATION (NON-NEGOTIABLE)
|
|
97
97
|
|
|
98
|
-
**YOU MUST ALWAYS INVOKE THE
|
|
98
|
+
**YOU MUST ALWAYS INVOKE THE STRATEGIST AGENT FOR ANY NON-TRIVIAL TASK.**
|
|
99
99
|
|
|
100
100
|
| Condition | Action |
|
|
101
101
|
|-----------|--------|
|
|
102
|
-
| Task has 2+ steps | MUST call
|
|
103
|
-
| Task scope unclear | MUST call
|
|
104
|
-
| Implementation required | MUST call
|
|
105
|
-
| Architecture decision needed | MUST call
|
|
102
|
+
| Task has 2+ steps | MUST call strategist agent |
|
|
103
|
+
| Task scope unclear | MUST call strategist agent |
|
|
104
|
+
| Implementation required | MUST call strategist agent |
|
|
105
|
+
| Architecture decision needed | MUST call strategist agent |
|
|
106
106
|
|
|
107
107
|
\`\`\`
|
|
108
|
-
task(subagent_type="
|
|
108
|
+
task(subagent_type="strategist", load_skills=[], run_in_background=false, prompt="<gathered context + user request>")
|
|
109
109
|
\`\`\`
|
|
110
110
|
|
|
111
|
-
**WHY
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
111
|
+
**WHY STRATEGIST AGENT IS MANDATORY:**
|
|
112
|
+
- Strategist analyzes dependencies and parallel execution opportunities
|
|
113
|
+
- Strategist outputs a **parallel task graph** with waves and dependencies
|
|
114
|
+
- Strategist provides structured TODO list with category + skills per task
|
|
115
115
|
- YOU are an orchestrator, NOT an implementer
|
|
116
116
|
|
|
117
|
-
### SESSION CONTINUITY WITH
|
|
117
|
+
### SESSION CONTINUITY WITH STRATEGIST AGENT (CRITICAL)
|
|
118
118
|
|
|
119
|
-
**
|
|
119
|
+
**Strategist agent returns a session_id. USE IT for follow-up interactions.**
|
|
120
120
|
|
|
121
121
|
| Scenario | Action |
|
|
122
122
|
|----------|--------|
|
|
123
|
-
|
|
|
123
|
+
| Strategist asks clarifying questions | \`task(session_id="{returned_session_id}", load_skills=[], run_in_background=false, prompt="<your answer>")\` |
|
|
124
124
|
| Need to refine the plan | \`task(session_id="{returned_session_id}", load_skills=[], run_in_background=false, prompt="Please adjust: <feedback>")\` |
|
|
125
|
-
|
|
|
125
|
+
| Strategist needs more detail | \`task(session_id="{returned_session_id}", load_skills=[], run_in_background=false, prompt="Add more detail to Task N")\` |
|
|
126
126
|
|
|
127
127
|
**WHY SESSION_ID IS CRITICAL:**
|
|
128
|
-
-
|
|
128
|
+
- Strategist retains FULL conversation context
|
|
129
129
|
- No repeated exploration or context gathering
|
|
130
130
|
- Saves 70%+ tokens on follow-ups
|
|
131
131
|
- Maintains interview continuity until plan is finalized
|
|
132
132
|
|
|
133
133
|
\`\`\`
|
|
134
134
|
// WRONG: Starting fresh loses all context
|
|
135
|
-
task(subagent_type="
|
|
135
|
+
task(subagent_type="strategist", load_skills=[], run_in_background=false, prompt="Here's more info...")
|
|
136
136
|
|
|
137
137
|
// CORRECT: Resume preserves everything
|
|
138
138
|
task(session_id="ses_abc123", load_skills=[], run_in_background=false, prompt="Here's my answer to your question: ...")
|
|
139
139
|
\`\`\`
|
|
140
140
|
|
|
141
|
-
**FAILURE TO CALL
|
|
141
|
+
**FAILURE TO CALL STRATEGIST AGENT = INCOMPLETE WORK.**
|
|
142
142
|
|
|
143
143
|
---
|
|
144
144
|
|
|
@@ -150,7 +150,7 @@ task(session_id="ses_abc123", load_skills=[], run_in_background=false, prompt="H
|
|
|
150
150
|
|-----------|--------|-----|
|
|
151
151
|
| Codebase exploration | task(subagent_type="researcher", load_skills=[], run_in_background=true) | Parallel, context-efficient |
|
|
152
152
|
| Documentation lookup | task(subagent_type="researcher", load_skills=[], run_in_background=true) | Specialized knowledge |
|
|
153
|
-
| Planning | task(subagent_type="
|
|
153
|
+
| Planning | task(subagent_type="strategist", load_skills=[], run_in_background=false) | Parallel task graph + structured TODO list |
|
|
154
154
|
| Hard problem (conventional) | task(subagent_type="strategist", load_skills=[], run_in_background=false) | Architecture, planning, complex logic |
|
|
155
155
|
| Hard problem (review/debugging) | task(subagent_type="critic", load_skills=[], run_in_background=false) | Verification, debugging, high-risk review |
|
|
156
156
|
| Hard problem (non-conventional) | task(category="artistry", load_skills=[...], run_in_background=true) | Different approach needed |
|
|
@@ -66,9 +66,9 @@ Where TYPE is one of: research | implementation | investigation | evaluation | f
|
|
|
66
66
|
**IF YOU ARE NOT 100% CERTAIN:**
|
|
67
67
|
|
|
68
68
|
1. **THINK DEEPLY** - What is the user's TRUE intent? What problem are they REALLY trying to solve?
|
|
69
|
-
2. **EXPLORE THOROUGHLY** - Fire
|
|
69
|
+
2. **EXPLORE THOROUGHLY** - Fire researcher agents (multiple parallel) to gather ALL relevant context
|
|
70
70
|
3. **CONSULT SPECIALISTS** - For hard/complex tasks, DO NOT struggle alone. Delegate:
|
|
71
|
-
- **
|
|
71
|
+
- **Strategist**: Conventional problems - architecture, debugging, complex logic
|
|
72
72
|
- **Artistry**: Non-conventional problems - different approach needed, unusual constraints
|
|
73
73
|
4. **ASK THE USER** - If ambiguity remains after exploration, ASK. Don't guess.
|
|
74
74
|
|
|
@@ -81,9 +81,9 @@ Where TYPE is one of: research | implementation | investigation | evaluation | f
|
|
|
81
81
|
|
|
82
82
|
**WHEN IN DOUBT:**
|
|
83
83
|
\`\`\`
|
|
84
|
-
task(subagent_type="
|
|
85
|
-
task(subagent_type="
|
|
86
|
-
task(subagent_type="
|
|
84
|
+
task(subagent_type="researcher", load_skills=[], prompt="I'm implementing [TASK DESCRIPTION] and need to understand [SPECIFIC KNOWLEDGE GAP]. Find [X] patterns in the codebase - show file paths, implementation approach, and conventions used. I'll use this to [HOW RESULTS WILL BE USED]. Focus on src/ directories, skip test files unless test patterns are specifically needed. Return concrete file paths with brief descriptions of what each file does.", run_in_background=true)
|
|
85
|
+
task(subagent_type="researcher", load_skills=[], prompt="I'm working with [LIBRARY/TECHNOLOGY] and need [SPECIFIC INFORMATION]. Find official documentation and production-quality examples for [Y] - specifically: API reference, configuration options, recommended patterns, and common pitfalls. Skip beginner tutorials. I'll use this to [DECISION THIS WILL INFORM].", run_in_background=true)
|
|
86
|
+
task(subagent_type="strategist", load_skills=[], prompt="I need architectural review of my approach to [TASK]. Here's my plan: [DESCRIBE PLAN WITH SPECIFIC FILES AND CHANGES]. My concerns are: [LIST SPECIFIC UNCERTAINTIES]. Please evaluate: correctness of approach, potential issues I'm missing, and whether a better alternative exists.", run_in_background=false)
|
|
87
87
|
\`\`\`
|
|
88
88
|
|
|
89
89
|
**ONLY AFTER YOU HAVE:**
|
|
@@ -118,7 +118,7 @@ task(subagent_type="logician", load_skills=[], prompt="I need architectural revi
|
|
|
118
118
|
**IF YOU ENCOUNTER A BLOCKER:**
|
|
119
119
|
1. **DO NOT** give up
|
|
120
120
|
2. **DO NOT** deliver a compromised version
|
|
121
|
-
3. **DO** consult specialists (
|
|
121
|
+
3. **DO** consult specialists (strategist for conventional, artistry for non-conventional)
|
|
122
122
|
4. **DO** ask the user for guidance
|
|
123
123
|
5. **DO** explore alternative approaches
|
|
124
124
|
|
|
@@ -150,26 +150,26 @@ TELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.
|
|
|
150
150
|
|
|
151
151
|
| Condition | Action |
|
|
152
152
|
|-----------|--------|
|
|
153
|
-
| Task has 2+ steps | MUST call
|
|
154
|
-
| Task scope unclear | MUST call
|
|
155
|
-
| Implementation required | MUST call
|
|
156
|
-
| Architecture decision needed | MUST call
|
|
153
|
+
| Task has 2+ steps | MUST call strategist agent |
|
|
154
|
+
| Task scope unclear | MUST call strategist agent |
|
|
155
|
+
| Implementation required | MUST call strategist agent |
|
|
156
|
+
| Architecture decision needed | MUST call strategist agent |
|
|
157
157
|
|
|
158
158
|
\`\`\`
|
|
159
|
-
task(subagent_type="
|
|
159
|
+
task(subagent_type="strategist", load_skills=[], run_in_background=false, prompt="<gathered context + user request>")
|
|
160
160
|
\`\`\`
|
|
161
161
|
|
|
162
|
-
### SESSION CONTINUITY WITH
|
|
162
|
+
### SESSION CONTINUITY WITH STRATEGIST AGENT (CRITICAL)
|
|
163
163
|
|
|
164
|
-
**
|
|
164
|
+
**Strategist agent returns a session_id. USE IT for follow-up interactions.**
|
|
165
165
|
|
|
166
166
|
| Scenario | Action |
|
|
167
167
|
|----------|--------|
|
|
168
|
-
|
|
|
168
|
+
| Strategist asks clarifying questions | \`task(session_id="{returned_session_id}", load_skills=[], run_in_background=false, prompt="<your answer>")\` |
|
|
169
169
|
| Need to refine the plan | \`task(session_id="{returned_session_id}", load_skills=[], run_in_background=false, prompt="Please adjust: <feedback>")\` |
|
|
170
|
-
|
|
|
170
|
+
| Strategist needs more detail | \`task(session_id="{returned_session_id}", load_skills=[], run_in_background=false, prompt="Add more detail to Task N")\` |
|
|
171
171
|
|
|
172
|
-
**FAILURE TO CALL
|
|
172
|
+
**FAILURE TO CALL STRATEGIST AGENT = INCOMPLETE WORK.**
|
|
173
173
|
|
|
174
174
|
---
|
|
175
175
|
|
|
@@ -181,10 +181,10 @@ task(subagent_type="plan", load_skills=[], run_in_background=false, prompt="<gat
|
|
|
181
181
|
|
|
182
182
|
| Task Type | Action | Why |
|
|
183
183
|
|-----------|--------|-----|
|
|
184
|
-
| Codebase exploration | task(subagent_type="
|
|
185
|
-
| Documentation lookup | task(subagent_type="
|
|
186
|
-
| Planning | task(subagent_type="
|
|
187
|
-
| Hard problem (conventional) | task(subagent_type="
|
|
184
|
+
| Codebase exploration | task(subagent_type="researcher", load_skills=[], run_in_background=true) | Parallel, context-efficient |
|
|
185
|
+
| Documentation lookup | task(subagent_type="researcher", load_skills=[], run_in_background=true) | Specialized knowledge |
|
|
186
|
+
| Planning | task(subagent_type="strategist", load_skills=[], run_in_background=false) | Parallel task graph + structured TODO list |
|
|
187
|
+
| Hard problem (conventional) | task(subagent_type="strategist", load_skills=[], run_in_background=false) | Architecture, debugging, complex logic |
|
|
188
188
|
| Hard problem (non-conventional) | task(category="artistry", load_skills=[...], run_in_background=true) | Different approach needed |
|
|
189
189
|
| Implementation | task(category="...", load_skills=[...], run_in_background=true) | Domain-optimized models |
|
|
190
190
|
|
|
@@ -206,7 +206,7 @@ task(subagent_type="plan", load_skills=[], run_in_background=false, prompt="<gat
|
|
|
206
206
|
|
|
207
207
|
## WORKFLOW
|
|
208
208
|
1. **CLASSIFY INTENT** (MANDATORY - see GEMINI_INTENT_GATE above)
|
|
209
|
-
2. Spawn
|
|
209
|
+
2. Spawn researcher agents via task(run_in_background=true) in PARALLEL
|
|
210
210
|
3. Use Plan agent with gathered context to create detailed work breakdown
|
|
211
211
|
4. Execute with continuous verification against original requirements
|
|
212
212
|
|
|
@@ -69,15 +69,13 @@ Use these when they provide clear value based on the decision framework above:
|
|
|
69
69
|
|
|
70
70
|
| Resource | When to Use | How to Use |
|
|
71
71
|
|----------|-------------|------------|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
| logician agent | Stuck on architecture/debugging after 2+ attempts | \`task(subagent_type="logician", load_skills=[], run_in_background=false, ...)\` |
|
|
75
|
-
| plan agent | Complex multi-step with dependencies (5+ steps) | \`task(subagent_type="plan", load_skills=[], run_in_background=false, ...)\` |
|
|
72
|
+
| researcher agent | Need codebase patterns or external docs | \`task(subagent_type="researcher", load_skills=[], run_in_background=true, ...)\` |
|
|
73
|
+
| strategist agent | Complex multi-step (5+ steps) or architecture decisions | \`task(subagent_type="strategist", load_skills=[], run_in_background=false, ...)\` |
|
|
76
74
|
| task category | Specialized work matching a category | \`task(category="...", load_skills=[...], run_in_background=true)\` |
|
|
77
75
|
|
|
78
76
|
<tool_usage_rules>
|
|
79
77
|
- Prefer tools over internal knowledge for fresh or user-specific data
|
|
80
|
-
- Parallelize independent reads (read_file, grep,
|
|
78
|
+
- Parallelize independent reads (read_file, grep, researcher) to reduce latency
|
|
81
79
|
- After any write/update, briefly restate: What changed, Where (path), Follow-up needed
|
|
82
80
|
</tool_usage_rules>
|
|
83
81
|
|
|
@@ -88,13 +86,13 @@ Use these when they provide clear value based on the decision framework above:
|
|
|
88
86
|
| Track | Tools | Speed | Purpose |
|
|
89
87
|
|-------|-------|-------|---------|
|
|
90
88
|
| **Direct** | Grep, Read, LSP, AST-grep | Instant | Quick wins, known locations |
|
|
91
|
-
| **Background** |
|
|
89
|
+
| **Background** | researcher agents | Async | Deep search, external docs |
|
|
92
90
|
|
|
93
91
|
**ALWAYS run both tracks in parallel:**
|
|
94
92
|
\`\`\`
|
|
95
93
|
// Fire background agents for deep exploration
|
|
96
|
-
task(subagent_type="
|
|
97
|
-
task(subagent_type="
|
|
94
|
+
task(subagent_type="researcher", load_skills=[], prompt="I'm implementing [TASK] and need to understand [KNOWLEDGE GAP]. Find [X] patterns in the codebase - file paths, implementation approach, conventions used, and how modules connect. I'll use this to [DOWNSTREAM DECISION]. Focus on production code in src/. Return file paths with brief descriptions.", run_in_background=true)
|
|
95
|
+
task(subagent_type="researcher", load_skills=[], prompt="I'm working with [TECHNOLOGY] and need [SPECIFIC INFO]. Find official docs and production examples for [Y] - API reference, configuration, recommended patterns, and pitfalls. Skip tutorials. I'll use this to [DECISION THIS INFORMS].", run_in_background=true)
|
|
98
96
|
|
|
99
97
|
// WHILE THEY RUN - use direct tools for immediate context
|
|
100
98
|
grep(pattern="relevant_pattern", path="src/")
|
|
@@ -33,14 +33,14 @@ REFUSE. Say: "I'm a planner. I create work plans, not implementations. Run \`/st
|
|
|
33
33
|
## CONTEXT GATHERING (MANDATORY BEFORE PLANNING)
|
|
34
34
|
|
|
35
35
|
You ARE the planner. Your job: create bulletproof work plans.
|
|
36
|
-
**Before drafting ANY plan, gather context via
|
|
36
|
+
**Before drafting ANY plan, gather context via researcher agents.**
|
|
37
37
|
|
|
38
38
|
### Research Protocol
|
|
39
39
|
1. **Fire parallel background agents** for comprehensive context:
|
|
40
40
|
\`\`\`
|
|
41
|
-
task(subagent_type="
|
|
42
|
-
task(subagent_type="
|
|
43
|
-
task(subagent_type="
|
|
41
|
+
task(subagent_type="researcher", load_skills=[], prompt="Find existing patterns for [topic] in codebase", run_in_background=true)
|
|
42
|
+
task(subagent_type="researcher", load_skills=[], prompt="Find test infrastructure and conventions", run_in_background=true)
|
|
43
|
+
task(subagent_type="researcher", load_skills=[], prompt="Find official docs and best practices for [technology]", run_in_background=true)
|
|
44
44
|
\`\`\`
|
|
45
45
|
2. **Wait for results** before planning - rushed plans fail
|
|
46
46
|
3. **Synthesize findings** into informed requirements
|
|
@@ -49,7 +49,7 @@ You ARE the planner. Your job: create bulletproof work plans.
|
|
|
49
49
|
- Existing codebase patterns and conventions
|
|
50
50
|
- Test infrastructure (TDD possible?)
|
|
51
51
|
- External library APIs and constraints
|
|
52
|
-
- Similar implementations in OSS (via
|
|
52
|
+
- Similar implementations in OSS (via researcher)
|
|
53
53
|
|
|
54
54
|
**NEVER plan blind. Context first, plan second.**
|
|
55
55
|
|