Installation
Superpowers can be installed either via automated quick setup or manual step-by-step installation.
Quick Install (Automated)
Provide the following instruction directly to OpenCode to handle setup automatically:
Clone https://github.com/obra/superpowers to ~/.config/opencode/superpowers, then create directory ~/.config/opencode/plugin, then symlink ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js to ~/.config/opencode/plugin/superpowers.js, then restart opencode.
Manual Installation
Prerequisites
- OpenCode.ai installed
- Node.js (with ES module support) installed
- Git installed
Installation Steps
-
Install Superpowers Core Files Create the required directory and clone the Superpowers repository:
mkdir -p ~/.config/opencode/superpowers git clone https://github.com/obra/superpowers.git ~/.config/opencode/superpowers -
Register the Plugin OpenCode loads plugins from the
~/.config/opencode/plugin/directory (global, user-wide) or.opencode/plugin/directory (project-local). Create a symlink for your desired scope:- Global installation (available for all projects):
mkdir -p ~/.config/opencode/plugin ln -sf ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js ~/.config/opencode/plugin/superpowers.js - Project-local installation (only available for current project):
# Run from your OpenCode project root mkdir -p .opencode/plugin ln -sf ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js .opencode/plugin/superpowers.js
- Global installation (available for all projects):
-
Restart OpenCode Restart your OpenCode instance to load the plugin; Superpowers will activate automatically.
Usage
Core Built-In Tools
Superpowers provides two custom tools for skill management:
find_skills: Lists all available registered skills across all enabled scopes. Usage:use find_skills tooluse_skill: Loads a specified skill into the conversation. Loaded skills persist across OpenCode context compaction. Usage:use use_skill tool with skill_name: "superpowers:brainstorming"
Custom Skill Creation
Superpowers supports three scopes of custom skills, with hierarchical priority resolution. All skills follow the same structure: a dedicated directory containing a SKILL.md file with YAML frontmatter metadata.
Personal Skills (User-Wide)
Stored in ~/.config/opencode/skills/, available across all projects for your user:
- Create a dedicated directory for your skill:
mkdir -p ~/.config/opencode/skills/[your-skill-name] - Create a
SKILL.mdfile with the following structure:--- name: [your-skill-name] description: Use when [trigger condition] - [brief summary of skill functionality] --- # [Your Skill Display Name] [Full skill implementation content here]
Project Skills (Project-Specific)
Stored in .opencode/skills/ of your OpenCode project root, only available for that project:
- Create a dedicated directory for your project skill:
# Run from your OpenCode project root mkdir -p .opencode/skills/[your-project-skill-name] - Create a
SKILL.mdfile following the same format as personal skills.
Skill Priority Resolution
Skills are resolved in the following hierarchical order (highest priority to lowest) to handle name conflicts:
- Project skills (
.opencode/skills/) - Personal skills (
~/.config/opencode/skills/) - Superpowers core skills (
~/.config/opencode/superpowers/skills/)
You can force skill resolution to a specific scope by adding a prefix to the skill name:
project:[skill-name]: Force use of the project-level version of the skill[skill-name]: Use the default priority search ordersuperpowers:[skill-name]: Force use of the core Superpowers version of the skill
Core Features
- Automatic Context Injection: Core Superpowers context is automatically injected into every OpenCode session via the
chat.messagehook, requiring no manual user configuration. - Skill Persistence: Skills loaded via
use_skillare inserted as user messages with thenoReply: trueflag, ensuring they remain available throughout long conversations, even after context compaction. - Context Compaction Resilience: The plugin listens for OpenCode’s
session.compactedevents and automatically re-injects the core Superpowers bootstrap context to maintain full functionality after context compaction. - Claude Code Skill Compatibility: Skills written for Claude Code are automatically adapted for use with OpenCode via built-in tool mapping:
TodoWrite→ OpenCode’supdate_plantoolTaskwith subagents → OpenCode’s@mentionsystem- Claude Code
Skilltool → Superpowersuse_skilltool - File operations → Native OpenCode file tools
Architecture
Plugin Structure
- File Path:
~/.config/opencode/superpowers/.opencode/plugin/superpowers.js - Core Components:
- Two custom tools:
use_skill,find_skills chat.messagehook for initial context injectionsession.compactedevent handler for post-compaction context re-injection- Dependency on the shared
lib/skills-core.jsmodule
- Two custom tools:
Shared Core Module (skills-core.js)
- File Path:
~/.config/opencode/superpowers/lib/skills-core.js - A reusable module shared between OpenCode and Codex Superpowers implementations to reduce code duplication.
- Core functions:
extractFrontmatter(): Parse YAML frontmatter metadata from skill filesstripFrontmatter(): Remove metadata from skill content for displayfindSkillsInDir(): Recursively discover skills in a specified directoryresolveSkillPath(): Handle skill path resolution with priority shadowingcheckForUpdates(): Detect available Git updates for the Superpowers repository
Updating
To update Superpowers to the latest version:
cd ~/.config/opencode/superpowers
git pullRestart OpenCode to load the updated plugin version.
Troubleshooting
Plugin Not Loading
- Verify the plugin file exists:
ls ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js - Verify the symlink is correctly configured:
ls -l ~/.config/opencode/plugin/superpowers.js - Check OpenCode debug logs:
opencode run "test" --print-logs --log-level DEBUG - Confirm the plugin load log entry is present:
service=plugin path=file:///.../superpowers.js loading plugin
Skills Not Found
- Verify the core skills directory exists and contains skill folders:
ls ~/.config/opencode/superpowers/skills - Run the
find_skillstool to list all skills discovered by Superpowers - Confirm each skill directory contains a valid
SKILL.mdfile with required frontmatter
Tools Not Working
- Confirm the plugin loaded successfully via OpenCode logs
- Verify your Node.js version supports ES modules (required for the plugin)
- Test the plugin manually via Node.js:
node --input-type=module -e "import('file://~/.config/opencode/plugin/superpowers.js').then(m => console.log(Object.keys(m)))"
Context Not Injecting
- Verify the
chat.messagehook is functioning correctly - Confirm the default
using-superpowerscore skill exists - Update OpenCode to a recent version with official plugin support
Testing
Superpowers includes an automated test suite for the OpenCode implementation, located at tests/opencode/ in the repository:
- Run all integration tests with verbose output:
./tests/opencode/run-tests.sh --integration --verbose - Run a specific test file:
./tests/opencode/run-tests.sh