fix: OpenCode plugin not discovering skills (#16)

OpenCode installs the repo via git and looks at the root for the plugin
entry point. Our skills/agents live inside understand-anything-plugin/,
so OpenCode couldn't find them.

- Add .opencode/plugins/understand-anything.js that uses the config hook
  to inject understand-anything-plugin/skills/ into skills.paths
- Add "main" field to root package.json pointing to the plugin entry
- Update INSTALL.md with version pinning and troubleshooting sections

Closes #16

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lum1104
2026-03-22 23:10:23 +08:00
Unverified
parent 8134bb95ca
commit c7f564a60e
3 changed files with 50 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
/**
* Understand Anything plugin for OpenCode.ai
*
* Auto-registers the skills directory so OpenCode discovers all
* understand-anything skills without manual symlinks or config edits.
*/
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export const UnderstandAnythingPlugin = async ({ client, directory }) => {
const skillsDir = path.resolve(__dirname, '../../understand-anything-plugin/skills');
return {
config: async (config) => {
config.skills = config.skills || {};
config.skills.paths = config.skills.paths || [];
if (!config.skills.paths.includes(skillsDir)) {
config.skills.paths.push(skillsDir);
}
},
};
};