From f4b54a17171e4cf90601db6b6fc4ba3ab1c1f206 Mon Sep 17 00:00:00 2001 From: jesse Date: Sun, 15 Mar 2026 21:29:25 +0000 Subject: Auto-register skills from plugin, simplify OpenCode install to one line The plugin's new `config` hook injects the skills directory into OpenCode's live config singleton, so skills are discovered automatically without symlinks or manual config edits. Installation is now just adding one line to opencode.json: "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"] Rewrote docs/README.opencode.md and .opencode/INSTALL.md to reflect the new approach, removing ~200 lines of platform-specific symlink instructions. Added migration notes for existing users. Co-Authored-By: Claude Opus 4.6 --- .opencode/plugins/superpowers.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to '.opencode/plugins') diff --git a/.opencode/plugins/superpowers.js b/.opencode/plugins/superpowers.js index 886669b..5e7833b 100644 --- a/.opencode/plugins/superpowers.js +++ b/.opencode/plugins/superpowers.js @@ -2,7 +2,7 @@ * Superpowers plugin for OpenCode.ai * * Injects superpowers bootstrap context via system prompt transform. - * Skills are discovered via OpenCode's native skill tool from symlinked directory. + * Auto-registers skills directory via config hook (no symlinks needed). */ import path from 'path'; @@ -84,6 +84,18 @@ ${toolMapping} }; return { + // Inject skills path into live config so OpenCode discovers superpowers skills + // without requiring manual symlinks or config file edits. + // This works because Config.get() returns a cached singleton — modifications + // here are visible when skills are lazily discovered later. + config: async (config) => { + config.skills = config.skills || {}; + config.skills.paths = config.skills.paths || []; + if (!config.skills.paths.includes(superpowersSkillsDir)) { + config.skills.paths.push(superpowersSkillsDir); + } + }, + // Use system prompt transform to inject bootstrap (fixes #226 agent reset bug) 'experimental.chat.system.transform': async (_input, output) => { const bootstrap = getBootstrapContent(); -- cgit