Migrate Hive skills to OpenCode-native loading#95
Open
imarshallwidjaja wants to merge 15 commits into
Open
Conversation
Add OpenCode-compatible frontmatter parsing with schema detection, conflict-safe materialized skill directories in .hive/skills, URL conflict scanning with per-request timeout, and focused materializer tests.
Replace hive_skill prompt/SKILL.md references with native skill wording and regenerate bundled skill registry and tests.
Retry OpenCode-compatible fallback sanitization when initial frontmatter parsing yields non-string skill metadata, so conflict scanning does not skip native skills OpenCode would load.
Config hook calls prepareNativeHiveSkills, generated Hive skill path is inserted before preserved user paths, skills.urls are preserved, and autoload now injects only eligible Hive bundled skill bodies while handing user/native file skills to OpenCode native discovery.
Remove the plugin-defined hive_skill tool, remove agent allow-list entries, regenerate plugin.json, trim obsolete builtin skill loader exports, and update hard-cut regression tests.
Delete `file-loader`, remove the export, rewrite autoload coverage for native handoff. Preserve paths/urls, URL-scan failure suppression, and custom subagent delta autoload.
Active docs/schema/types/templates/AGENTS.md updates for generated native skill materialization, `disableSkills` semantics, native user skill handoff, and URL-scan conservative behavior.
Use the MCP package name in the root build filter so verification runs every workspace, and refresh the tracked VS Code bundle generated from the updated default config.
Update active OpenCode Hive docs after the hive_skill hard cut so tool counts and tool-domain summaries reflect the 17 remaining Hive plugin tools.
Updates opencode-hive regression tests to avoid literal removed-tool strings while preserving absence assertions and enabling the final hard-cut grep to pass.
Remove stale file-skill fallback wording from active OpenCode Hive docs and describe the removed custom skill-loading tool without reintroducing the removed tool literal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hive_skillsurface with OpenCode's nativeskilltool.autoLoadSkills, but resolve native/user skills first and bundled Hive skills second.SKILL.mdfrontmatter contract.Behavior
autoLoadSkillsinjects either native discovered skills or eligible bundled Hive skills into agent prompts.SKILL.mdfrontmattername, not the directory name.disableSkillsonly disables bundled Hive skills. It does not block native/user skills.skills.urlscannot be scanned, bundled Hive skill materialization/autoload is skipped for that run. Local native skills can still load./, generated Hive skills go under the OpenCode config directory instead of/.hive.Agent Hivein their native descriptions. General skills keep general descriptions.Notable Changes
packages/opencode-hive/src/skills/native-materializer.ts.packages/opencode-hive/src/skills/file-loader.tsand the oldhive_skillplugin tool surface.~/.config/opencode/agent-hive/generated/opencode-skills/<hash>or the configured OpenCode config dir equivalent.@tctinh/agent-hive-mcpinstead of the stalehive-mcpworkspace filter.Testing
cd packages/hive-core && bun test->238 pass, 0 failcd packages/opencode-hive && bun test->475 pass, 0 failcd packages/opencode-hive && XDG_CONFIG_HOME=/tmp/ci-xdg-config bun test -- src/skills/native-materializer.test.ts->26 pass, 0 failcd packages/opencode-hive && bun test -- src/skills/skill-content.test.ts->6 pass, 0 failbun run build->PASS (exit 0)bun run test->PASS (exit 0)Smoke Test: Bundled Hive Skill
Use this with
hive-masteron this branch:Expected:
This checks that a Hive-bundled skill which used to rely on
hive_skillis now exposed through native skill registration and prompt autoload.Smoke Test: Native User Skill
Create this file:
Configure:
{ "agents": { "hive-master": { "autoLoadSkills": ["diagnostic-skill"] } } }Ask
hive-master:Expected:
present.Will have conflict after #94 will rebase after that merges