Skip to content

Auto-register skills from plugin, simplify OpenCode install#753

Merged
obra merged 2 commits intodevfrom
f/opencode-plugin
Mar 17, 2026
Merged

Auto-register skills from plugin, simplify OpenCode install#753
obra merged 2 commits intodevfrom
f/opencode-plugin

Conversation

@obra
Copy link
Owner

@obra obra commented Mar 15, 2026

Summary

  • Plugin config hook injects the skills directory into OpenCode's live config singleton at startup, so skills are discovered automatically — no symlinks or skills.paths config needed
  • Installation is now one line in opencode.json: "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
  • Rewrote install docs (docs/README.opencode.md and .opencode/INSTALL.md), removing ~200 lines of platform-specific symlink instructions
  • Added migration notes for users who installed the old symlink-based way
  • Added package.json so OpenCode can install superpowers as an npm package from git

How it works

OpenCode's Config.get() returns a cached singleton. Plugins load during bootstrap (Plugin.init()), before skills are lazily discovered. The plugin's config hook pushes its skills directory into config.skills.paths in-memory — when skills are later accessed, they see the modified config and discover all superpowers skills.

Before (old install)

git clone https://github.com/obra/superpowers.git ~/.config/opencode/superpowers
mkdir -p ~/.config/opencode/plugins ~/.config/opencode/skills
ln -s ~/.config/opencode/superpowers/.opencode/plugins/superpowers.js ~/.config/opencode/plugins/superpowers.js
ln -s ~/.config/opencode/superpowers/skills ~/.config/opencode/skills/superpowers
# Plus Windows-specific instructions for Command Prompt, PowerShell, Git Bash...

After (new install)

{
  "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
}

Test plan

  • Tested with OpenCode — all 14 skills discovered via config hook
  • Verified from a clean directory (no local project skills) — plugin loaded from npm cache, skills registered
  • Bootstrap context injection still works
  • Test on Windows
  • Test version pinning with #v5.x.x tag

🤖 Generated with Claude Code

jesse and others added 2 commits March 15, 2026 20:08
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant