summaryrefslogtreecommitdiff
path: root/.opencode/plugins
diff options
context:
space:
mode:
authorjesse <jesse@magic-kingdom>2026-03-15 21:29:25 +0000
committerjesse <jesse@magic-kingdom>2026-03-15 21:29:25 +0000
commitf4b54a17171e4cf90601db6b6fc4ba3ab1c1f206 (patch)
tree7e356e9faed0d6ecc0ba1fba0f4703a762018a0c /.opencode/plugins
parent911fa1d6c535c4e68be852f2ee153421a161aa5c (diff)
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 <noreply@anthropic.com>
Diffstat (limited to '.opencode/plugins')
-rw-r--r--.opencode/plugins/superpowers.js14
1 files changed, 13 insertions, 1 deletions
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();