File: README.md
Superpowers
Superpowers is a complete software development methodology for your coding agents, built on top of a set of composable skills and some initial instructions that make sure your agent uses them.
Table of Contents
- How it works
- Commercial Services
- Getting Started
- The Basic Workflow
- Community
- What's Inside
- Philosophy
- Contributing
- Updating
- License
- Visual companion telemetry
How it works
It starts from the moment you fire up your coding agent. As soon as it sees that you're building something, it doesn't just jump into trying to write code. Instead, it steps back and asks you what you're really trying to do.
Once it's teased a spec out of the conversation, it shows it to you in chunks short enough to actually read and digest.
After you've signed off on the design, your agent puts together an implementation plan that's clear enough for an enthusiastic junior engineer with poor taste, no judgement, no project context, and an aversion to testing to follow. It emphasizes true red/green TDD, YAGNI (You Aren't Gonna Need It), and DRY.
Next up, once you say "go", it launches a subagent-driven-development process, having agents work through each engineering task, inspecting and reviewing their work, and continuing forward. It's not uncommon for your agent to work autonomously for a couple hours at a time without deviating from the plan you put together.
There's a bunch more to it, but that's the core of the system. And because the skills trigger automatically, you don't need to do anything special. Your coding agent just has Superpowers.
Commercial Services
If you're using Superpowers in enterprise and could benefit from commercial support, additional tooling, or managed spending, please don't hesitate to drop us a line at [email protected].
Installation
Installation differs by harness. If you use more than one, install Superpowers separately for each one.
Claude Code
Superpowers is available via the official Claude plugin marketplace
Official Marketplace
Install the plugin from Anthropic's official marketplace:
bash/plugin install superpowers@claude-plugins-official
Superpowers Marketplace
The Superpowers marketplace provides Superpowers and some other related plugins for Claude Code.
Register the marketplace:
bash/plugin marketplace add obra/superpowers-marketplaceInstall the plugin from this marketplace:
bash/plugin install superpowers@superpowers-marketplace
Antigravity
Install Superpowers as a plugin from this repository:
agy plugin install https://github.com/obra/superpowersAntigravity runs the plugin's session-start hook, so Superpowers is active from
the first message. Reinstall with the same command to update.
Codex App
Superpowers is available via the official Codex plugin marketplace.
- In the Codex app, click on Plugins in the sidebar.
- You should see
Superpowersin the Coding section. - Click the
+next to Superpowers and follow the prompts.
Codex CLI
Superpowers is available via the official Codex plugin marketplace.
Open the plugin search interface:
bash/pluginsSearch for Superpowers:
bashsuperpowersSelect
Install Plugin.
Cursor
In Cursor Agent chat, install from marketplace:
text/add-plugin superpowersOr search for "superpowers" in the plugin marketplace.
Devin CLI
Install the plugin from this repository:
bashdevin plugins install obra/superpowersUpdate to the latest version with:
bashdevin plugins update superpowers
Factory Droid
Register the marketplace:
bashdroid plugin marketplace add https://github.com/obra/superpowersInstall the plugin:
bashdroid plugin install superpowers@superpowers
Gemini CLI
Install the extension:
bashgemini extensions install https://github.com/obra/superpowersUpdate later:
bashgemini extensions update superpowers
GitHub Copilot CLI
Register the marketplace:
bashcopilot plugin marketplace add obra/superpowers-marketplaceInstall the plugin:
bashcopilot plugin install superpowers@superpowers-marketplace
Grok Build CLI
Superpowers is available via the official Grok plugin marketplace.
Install the plugin from xAI's official marketplace:
bashgrok plugin install superpowers@xai-official --trustOr open the marketplace in the TUI, search for Superpowers, and install it:
text/marketplace
Kimi Code
Superpowers is available in Kimi Code's plugin marketplace.
Open Kimi Code's plugin manager:
text/pluginsGo to
Marketplace>Superpowersand install it.Or install directly from this repository:
text/plugins install https://github.com/obra/superpowersDetailed docs: docs/README.kimi.md
OpenCode
OpenCode uses its own plugin install; install Superpowers separately even if you
already use it in another harness.
Tell OpenCode:
textFetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.opencode/INSTALL.mdDetailed docs: docs/README.opencode.md
Pi
Install Superpowers as a Pi package from this repository:
pi install git:github.com/obra/superpowersFor local development, run Pi with this checkout loaded as a temporary package:
pi -e /path/to/superpowersThe Pi package loads the Superpowers skills and a small extension that injects the using-superpowers bootstrap at session startup and again after compaction. Pi has native skills, so no compatibility Skill tool is required. Subagent and task-list tools remain optional Pi companion packages.
Hermes Agent
Install Superpowers as a Hermes plugin from this repository:
hermes plugins install obra/superpowers --enableRestart any active Hermes sessions after installing. Note: Hermes has no
post-compaction hook, so a very long session that compacts over its first
turn loses the bootstrap โ start a fresh session if skills stop triggering.
The Basic Workflow
brainstorming - Activates before writing code. Refines rough ideas through questions, explores alternatives, presents design in sections for validation. Saves design document.
using-git-worktrees - Activates after design approval. Creates isolated workspace on new branch, runs project setup, verifies clean test baseline.
writing-plans - Activates with approved design. Breaks work into bite-sized tasks (2-5 minutes each). Every task has exact file paths, complete code, verification steps.
subagent-driven-development or executing-plans - Activates with plan. Dispatches fresh subagent per task with two-stage review (spec compliance, then code quality), or executes in batches with human checkpoints.
test-driven-development - Activates during implementation. Enforces RED-GREEN-REFACTOR: write failing test, watch it fail, write minimal code, watch it pass, commit. Deletes code written before tests.
requesting-code-review - Activates between tasks. Reviews against plan, reports issues by severity. Critical issues block progress.
finishing-a-development-branch - Activates when tasks complete. Verifies tests, presents options (merge/PR/keep/discard), cleans up worktree.
The agent checks for relevant skills before any task. Mandatory workflows, not suggestions.
Community
Superpowers is built by Jesse Vincent and the rest of the folks at Prime Radiant.
- Discord: Join us for community support, questions, and sharing what you're building with Superpowers
- Issues: https://github.com/obra/superpowers/issues
- Release announcements: Sign up to get notified about new versions
What's Inside
Skills Library
Testing
- test-driven-development - RED-GREEN-REFACTOR cycle (includes testing anti-patterns reference)
Debugging
- systematic-debugging - 4-phase root cause process (includes root-cause-tracing, defense-in-depth, condition-based-waiting techniques)
- verification-before-completion - Ensure it's actually fixed
Collaboration
- brainstorming - Socratic design refinement
- writing-plans - Detailed implementation plans
- executing-plans - Batch execution with checkpoints
- dispatching-parallel-agents - Concurrent subagent workflows
- requesting-code-review - Pre-review checklist
- receiving-code-review - Responding to feedback
- using-git-worktrees - Parallel development branches
- finishing-a-development-branch - Merge/PR decision workflow
- subagent-driven-development - Fast iteration with two-stage review (spec compliance, then code quality)
Meta
- writing-skills - Create new skills following best practices (includes testing methodology)
- using-superpowers - Introduction to the skills system
Philosophy
- Test-Driven Development - Write tests first, always
- Systematic over ad-hoc - Process over guessing
- Complexity reduction - Simplicity as primary goal
- Evidence over claims - Verify before declaring success
Read the original release announcement.
Contributing
The general contribution process for Superpowers is below. Keep in mind that we don't generally accept contributions of new skills and that any updates to skills must work across all of the coding agents we support.
- Fork the repository
- Switch to the 'dev' branch
- Create a branch for your work
- Follow the
writing-skillsskill for creating and testing new and modified skills - Submit a PR, being sure to fill in the pull request template.
Skill-behavior tests use the drill eval harness from superpowers-evals, cloned into evals/ โ see evals/README.md for setup. Plugin-infrastructure tests live at tests/ and run via the relevant run-*.sh or npm test.
See skills/writing-skills/SKILL.md for the complete guide.
Updating
Superpowers updates are somewhat coding-agent dependent, but are often automatic.
License
MIT License - see LICENSE file for details
Visual companion telemetry
Because skills and plugins don't provide any feedback to creators, we have no idea how many of you are using Superpowers. By default, the Prime Radiant logo on brainstorming's optional visual companion feature is loaded from our website. It includes the version of Superpowers in use. It does not include any details about your project, prompt, or coding agent. We don't see your clicks or anything about what you're building. This helps us have a rough idea of how many folks are using Superpowers and which version of Superpowers they're using. It's 100% optional. To disable this, set the environment variable SUPERPOWERS_DISABLE_TELEMETRY to any true value. Superpowers also honors Claude Code's DISABLE_TELEMETRY and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC opt-outs.
File: docs/plans/2025-11-22-opencode-support-design.md
OpenCode Support Design
Date: 2025-11-22
Author: Bot & Jesse
Status: Design Complete, Awaiting Implementation
Overview
Add full superpowers support for OpenCode.ai using a native OpenCode plugin architecture that shares core functionality with the existing Codex implementation.
Background
OpenCode.ai is a coding agent similar to Claude Code and Codex. Previous attempts to port superpowers to OpenCode (PR #93, PR #116) used file-copying approaches. This design takes a different approach: building a native OpenCode plugin using their JavaScript/TypeScript plugin system while sharing code with the Codex implementation.
Key Differences Between Platforms
- Claude Code: Native Anthropic plugin system + file-based skills
- Codex: No plugin system โ bootstrap markdown + CLI script
- OpenCode: JavaScript/TypeScript plugins with event hooks and custom tools API
OpenCode's Agent System
- Primary agents: Build (default, full access) and Plan (restricted, read-only)
- Subagents: General (research, searching, multi-step tasks)
- Invocation: Automatic dispatch by primary agents OR manual
@mentionsyntax - Configuration: Custom agents in
opencode.jsonor~/.config/opencode/agent/
Architecture
High-Level Structure
Shared Core Module (
lib/skills-core.js)- Common skill discovery and parsing logic
- Used by both Codex and OpenCode implementations
Platform-Specific Wrappers
- Codex: CLI script (
.codex/superpowers-codex) - OpenCode: Plugin module (
.opencode/plugin/superpowers.js)
- Codex: CLI script (
Skill Directories
- Core:
~/.config/opencode/superpowers/skills/(or installed location) - Personal:
~/.config/opencode/skills/(shadows core skills)
- Core:
Code Reuse Strategy
Extract common functionality from .codex/superpowers-codex into shared module:
// lib/skills-core.js
module.exports = {
extractFrontmatter(filePath), // Parse name + description from YAML
findSkillsInDir(dir, maxDepth), // Recursive SKILL.md discovery
findAllSkills(dirs), // Scan multiple directories
resolveSkillPath(skillName, dirs), // Handle shadowing (personal > core)
checkForUpdates(repoDir) // Git fetch/status check
};Skill Frontmatter Format
Current format (no when_to_use field):
---
name: skill-name
---OpenCode Plugin Implementation
Custom Tools
Tool 1: use_skill
Loads a specific skill's content into the conversation (equivalent to Claude's Skill tool).
{
name: 'use_skill',
schema: z.object({
skill_name: z.string().describe('Name of skill (e.g., "superpowers:brainstorming")')
}),
execute: async ({ skill_name }) => {
const { skillPath, content, frontmatter } = resolveAndReadSkill(skill_name);
const skillDir = path.dirname(skillPath);
return `# ${frontmatter.name}
# ${frontmatter.description}
# Supporting tools and docs are in ${skillDir}
# ============================================
${content}`;
}
}Tool 2: find_skills
Lists all available skills with metadata.
{
name: 'find_skills',
schema: z.object({}),
execute: async () => {
const skills = discoverAllSkills();
return skills.map(s =>
`${s.namespace}:${s.name}
${s.description}
Directory: ${s.directory}
`).join('\n');
}
}Session Startup Hook
When a new session starts (session.started event):
Inject using-superpowers content
- Full content of the using-superpowers skill
- Establishes mandatory workflows
Run find_skills automatically
- Display full list of available skills upfront
- Include skill directories for each
Inject tool mapping instructions
markdown**Tool Mapping for OpenCode:** When skills reference tools you don't have, substitute: - `TodoWrite` โ `update_plan` - `Task` with subagents โ Use OpenCode subagent system (@mention) - `Skill` tool โ `use_skill` custom tool - Read, Write, Edit, Bash โ Your native equivalents **Skill directories contain:** - Supporting scripts (run with bash) - Additional documentation (read with read tool) - Utilities specific to that skillCheck for updates (non-blocking)
- Quick git fetch with timeout
- Notify if updates available
Plugin Structure
// .opencode/plugin/superpowers.js
const skillsCore = require('../../lib/skills-core');
const path = require('path');
const fs = require('fs');
const { z } = require('zod');
export const SuperpowersPlugin = async ({ client, directory, $ }) => {
const superpowersDir = path.join(process.env.HOME, '.config/opencode/superpowers');
const personalDir = path.join(process.env.HOME, '.config/opencode/skills');
return {
'session.started': async () => {
const usingSuperpowers = await readSkill('using-superpowers');
const skillsList = await findAllSkills();
const toolMapping = getToolMappingInstructions();
return {
context: `${usingSuperpowers}\n\n${skillsList}\n\n${toolMapping}`
};
},
tools: [
{
name: 'use_skill',
schema: z.object({
skill_name: z.string()
}),
execute: async ({ skill_name }) => {
// Implementation using skillsCore
}
},
{
name: 'find_skills',
schema: z.object({}),
execute: async () => {
// Implementation using skillsCore
}
}
]
};
};File Structure
superpowers/
โโโ lib/
โ โโโ skills-core.js # NEW: Shared skill logic
โโโ .codex/
โ โโโ superpowers-codex # UPDATED: Use skills-core
โ โโโ superpowers-bootstrap.md
โ โโโ INSTALL.md
โโโ .opencode/
โ โโโ plugin/
โ โ โโโ superpowers.js # NEW: OpenCode plugin
โ โโโ INSTALL.md # NEW: Installation guide
โโโ skills/ # UnchangedImplementation Plan
Phase 1: Refactor Shared Core
Create
lib/skills-core.js- Extract frontmatter parsing from
.codex/superpowers-codex - Extract skill discovery logic
- Extract path resolution (with shadowing)
- Update to use only
nameanddescription(nowhen_to_use)
- Extract frontmatter parsing from
Update
.codex/superpowers-codexto use shared core- Import from
../lib/skills-core.js - Remove duplicated code
- Keep CLI wrapper logic
- Import from
Test Codex implementation still works
- Verify bootstrap command
- Verify use-skill command
- Verify find-skills command
Phase 2: Build OpenCode Plugin
Create
.opencode/plugin/superpowers.js- Import shared core from
../../lib/skills-core.js - Implement plugin function
- Define custom tools (use_skill, find_skills)
- Implement session.started hook
- Import shared core from
Create
.opencode/INSTALL.md- Installation instructions
- Directory setup
- Configuration guidance
Test OpenCode implementation
- Verify session startup bootstrap
- Verify use_skill tool works
- Verify find_skills tool works
- Verify skill directories are accessible
Phase 3: Documentation & Polish
- Update README with OpenCode support
- Add OpenCode installation to main docs
- Update RELEASE-NOTES
- Test both Codex and OpenCode work correctly
Next Steps
Create isolated workspace (using git worktrees)
- Branch:
feature/opencode-support
- Branch:
Follow TDD where applicable
- Test shared core functions
- Test skill discovery and parsing
- Integration tests for both platforms
Incremental implementation
- Phase 1: Refactor shared core + update Codex
- Verify Codex still works before moving on
- Phase 2: Build OpenCode plugin
- Phase 3: Documentation and polish
Testing strategy
- Manual testing with real OpenCode installation
- Verify skill loading, directories, scripts work
- Test both Codex and OpenCode side-by-side
- Verify tool mappings work correctly
PR and merge
- Create PR with complete implementation
- Test in clean environment
- Merge to main
Benefits
- Code reuse: Single source of truth for skill discovery/parsing
- Maintainability: Bug fixes apply to both platforms
- Extensibility: Easy to add future platforms (Cursor, Windsurf, etc.)
- Native integration: Uses OpenCode's plugin system properly
- Consistency: Same skill experience across all platforms
File: docs/plans/2025-11-22-opencode-support-implementation.md
OpenCode Support Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: Add full superpowers support for OpenCode.ai with a native JavaScript plugin that shares core functionality with the existing Codex implementation.
Architecture: Extract common skill discovery/parsing logic into lib/skills-core.js, refactor Codex to use it, then build OpenCode plugin using their native plugin API with custom tools and session hooks.
Tech Stack: Node.js, JavaScript, OpenCode Plugin API, Git worktrees
Phase 1: Create Shared Core Module
Task 1: Extract Frontmatter Parsing
Files:
- Create:
lib/skills-core.js - Reference:
.codex/superpowers-codex(lines 40-74)
Step 1: Create lib/skills-core.js with extractFrontmatter function
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
/**
* Extract YAML frontmatter from a skill file.
* Current format:
* ---
* name: skill-name
* description: Use when [condition] - [what it does]
* ---
*
* @param {string} filePath - Path to SKILL.md file
* @returns {{name: string, description: string}}
*/
function extractFrontmatter(filePath) {
try {
const content = fs.readFileSync(filePath, 'utf8');
const lines = content.split('\n');
let inFrontmatter = false;
let name = '';
let description = '';
for (const line of lines) {
if (line.trim() === '---') {
if (inFrontmatter) break;
inFrontmatter = true;
continue;
}
if (inFrontmatter) {
const match = line.match(/^(\w+):\s*(.*)$/);
if (match) {
const [, key, value] = match;
switch (key) {
case 'name':
name = value.trim();
break;
case 'description':
description = value.trim();
break;
}
}
}
}
return { name, description };
} catch (error) {
return { name: '', description: '' };
}
}
module.exports = {
extractFrontmatter
};Step 2: Verify file was created
Run: ls -l lib/skills-core.js
Expected: File exists
Step 3: Commit
git add lib/skills-core.js
git commit -m "feat: create shared skills core module with frontmatter parser"Task 2: Extract Skill Discovery Logic
Files:
- Modify:
lib/skills-core.js - Reference:
.codex/superpowers-codex(lines 97-136)
Step 1: Add findSkillsInDir function to skills-core.js
Add before module.exports:
/**
* Find all SKILL.md files in a directory recursively.
*
* @param {string} dir - Directory to search
* @param {string} sourceType - 'personal' or 'superpowers' for namespacing
* @param {number} maxDepth - Maximum recursion depth (default: 3)
* @returns {Array<{path: string, name: string, description: string, sourceType: string}>}
*/
function findSkillsInDir(dir, sourceType, maxDepth = 3) {
const skills = [];
if (!fs.existsSync(dir)) return skills;
function recurse(currentDir, depth) {
if (depth > maxDepth) return;
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = path.join(currentDir, entry.name);
if (entry.isDirectory()) {
// Check for SKILL.md in this directory
const skillFile = path.join(fullPath, 'SKILL.md');
if (fs.existsSync(skillFile)) {
const { name, description } = extractFrontmatter(skillFile);
skills.push({
path: fullPath,
skillFile: skillFile,
name: name || entry.name,
sourceType: sourceType
});
}
// Recurse into subdirectories
recurse(fullPath, depth + 1);
}
}
}
recurse(dir, 0);
return skills;
}Step 2: Update module.exports
Replace the exports line with:
module.exports = {
extractFrontmatter,
findSkillsInDir
};Step 3: Verify syntax
Run: node -c lib/skills-core.js
Expected: No output (success)
Step 4: Commit
git add lib/skills-core.js
git commit -m "feat: add skill discovery function to core module"Task 3: Extract Skill Resolution Logic
Files:
- Modify:
lib/skills-core.js - Reference:
.codex/superpowers-codex(lines 212-280)
Step 1: Add resolveSkillPath function
Add before module.exports:
/**
* Resolve a skill name to its file path, handling shadowing
* (personal skills override superpowers skills).
*
* @param {string} skillName - Name like "superpowers:brainstorming" or "my-skill"
* @param {string} superpowersDir - Path to superpowers skills directory
* @param {string} personalDir - Path to personal skills directory
* @returns {{skillFile: string, sourceType: string, skillPath: string} | null}
*/
function resolveSkillPath(skillName, superpowersDir, personalDir) {
// Strip superpowers: prefix if present
const forceSuperpowers = skillName.startsWith('superpowers:');
const actualSkillName = forceSuperpowers ? skillName.replace(/^superpowers:/, '') : skillName;
// Try personal skills first (unless explicitly superpowers:)
if (!forceSuperpowers && personalDir) {
const personalPath = path.join(personalDir, actualSkillName);
const personalSkillFile = path.join(personalPath, 'SKILL.md');
if (fs.existsSync(personalSkillFile)) {
return {
skillFile: personalSkillFile,
sourceType: 'personal',
skillPath: actualSkillName
};
}
}
// Try superpowers skills
if (superpowersDir) {
const superpowersPath = path.join(superpowersDir, actualSkillName);
const superpowersSkillFile = path.join(superpowersPath, 'SKILL.md');
if (fs.existsSync(superpowersSkillFile)) {
return {
skillFile: superpowersSkillFile,
sourceType: 'superpowers',
skillPath: actualSkillName
};
}
}
return null;
}Step 2: Update module.exports
module.exports = {
extractFrontmatter,
findSkillsInDir,
resolveSkillPath
};Step 3: Verify syntax
Run: node -c lib/skills-core.js
Expected: No output
Step 4: Commit
git add lib/skills-core.js
git commit -m "feat: add skill path resolution with shadowing support"Task 4: Extract Update Check Logic
Files:
- Modify:
lib/skills-core.js - Reference:
.codex/superpowers-codex(lines 16-38)
Step 1: Add checkForUpdates function
Add at top after requires:
const { execSync } = require('child_process');Add before module.exports:
/**
* Check if a git repository has updates available.
*
* @param {string} repoDir - Path to git repository
* @returns {boolean} - True if updates are available
*/
function checkForUpdates(repoDir) {
try {
// Quick check with 3 second timeout to avoid delays if network is down
const output = execSync('git fetch origin && git status --porcelain=v1 --branch', {
cwd: repoDir,
timeout: 3000,
encoding: 'utf8',
stdio: 'pipe'
});
// Parse git status output to see if we're behind
const statusLines = output.split('\n');
for (const line of statusLines) {
if (line.startsWith('## ') && line.includes('[behind ')) {
return true; // We're behind remote
}
}
return false; // Up to date
} catch (error) {
// Network down, git error, timeout, etc. - don't block bootstrap
return false;
}
}Step 2: Update module.exports
module.exports = {
extractFrontmatter,
findSkillsInDir,
resolveSkillPath,
checkForUpdates
};Step 3: Verify syntax
Run: node -c lib/skills-core.js
Expected: No output
Step 4: Commit
git add lib/skills-core.js
git commit -m "feat: add git update checking to core module"Phase 2: Refactor Codex to Use Shared Core
Task 5: Update Codex to Import Shared Core
Files:
- Modify:
.codex/superpowers-codex(add import at top)
Step 1: Add import statement
After the existing requires at top of file (around line 6), add:
const skillsCore = require('../lib/skills-core');Step 2: Verify syntax
Run: node -c .codex/superpowers-codex
Expected: No output
Step 3: Commit
git add .codex/superpowers-codex
git commit -m "refactor: import shared skills core in codex"Task 6: Replace extractFrontmatter with Core Version
Files:
- Modify:
.codex/superpowers-codex(lines 40-74)
Step 1: Remove local extractFrontmatter function
Delete lines 40-74 (the entire extractFrontmatter function definition).
Step 2: Update all extractFrontmatter calls
Find and replace all calls from extractFrontmatter( to skillsCore.extractFrontmatter(
Affected lines approximately: 90, 310
Step 3: Verify script still works
Run: .codex/superpowers-codex find-skills | head -20
Expected: Shows list of skills
Step 4: Commit
git add .codex/superpowers-codex
git commit -m "refactor: use shared extractFrontmatter in codex"Task 7: Replace findSkillsInDir with Core Version
Files:
- Modify:
.codex/superpowers-codex(lines 97-136, approximately)
Step 1: Remove local findSkillsInDir function
Delete the entire findSkillsInDir function definition (approximately lines 97-136).
Step 2: Update all findSkillsInDir calls
Replace calls from findSkillsInDir( to skillsCore.findSkillsInDir(
Step 3: Verify script still works
Run: .codex/superpowers-codex find-skills | head -20
Expected: Shows list of skills
Step 4: Commit
git add .codex/superpowers-codex
git commit -m "refactor: use shared findSkillsInDir in codex"Task 8: Replace checkForUpdates with Core Version
Files:
- Modify:
.codex/superpowers-codex(lines 16-38, approximately)
Step 1: Remove local checkForUpdates function
Delete the entire checkForUpdates function definition.
Step 2: Update all checkForUpdates calls
Replace calls from checkForUpdates( to skillsCore.checkForUpdates(
Step 3: Verify script still works
Run: .codex/superpowers-codex bootstrap | head -50
Expected: Shows bootstrap content
Step 4: Commit
git add .codex/superpowers-codex
git commit -m "refactor: use shared checkForUpdates in codex"Phase 3: Build OpenCode Plugin
Task 9: Create OpenCode Plugin Directory Structure
Files:
- Create:
.opencode/plugin/superpowers.js
Step 1: Create directory
Run: mkdir -p .opencode/plugin
Step 2: Create basic plugin file
#!/usr/bin/env node
/**
* Superpowers plugin for OpenCode.ai
*
* Provides custom tools for loading and discovering skills,
* with automatic bootstrap on session start.
*/
const skillsCore = require('../../lib/skills-core');
const path = require('path');
const fs = require('fs');
const os = require('os');
const homeDir = os.homedir();
const superpowersSkillsDir = path.join(homeDir, '.config/opencode/superpowers/skills');
const personalSkillsDir = path.join(homeDir, '.config/opencode/skills');
/**
* OpenCode plugin entry point
*/
export const SuperpowersPlugin = async ({ project, client, $, directory, worktree }) => {
return {
// Custom tools and hooks will go here
};
};Step 3: Verify file was created
Run: ls -l .opencode/plugin/superpowers.js
Expected: File exists
Step 4: Commit
git add .opencode/plugin/superpowers.js
git commit -m "feat: create opencode plugin scaffold"Task 10: Implement use_skill Tool
Files:
- Modify:
.opencode/plugin/superpowers.js
Step 1: Add use_skill tool implementation
Replace the plugin return statement with:
/* Detailed source-code truncated for AI context efficiency. */Step 2: Verify syntax
Run: node -c .opencode/plugin/superpowers.js
Expected: No output
Step 3: Commit
git add .opencode/plugin/superpowers.js
git commit -m "feat: implement use_skill tool for opencode"Task 11: Implement find_skills Tool
Files:
- Modify:
.opencode/plugin/superpowers.js
Step 1: Add find_skills tool to tools array
Add after the use_skill tool definition, before closing the tools array:
{
name: 'find_skills',
schema: z.object({}),
execute: async () => {
// Find skills in both directories
const superpowersSkills = skillsCore.findSkillsInDir(
superpowersSkillsDir,
'superpowers',
3
);
const personalSkills = skillsCore.findSkillsInDir(
personalSkillsDir,
'personal',
3
);
// Combine and format skills list
const allSkills = [...personalSkills, ...superpowersSkills];
if (allSkills.length === 0) {
return 'No skills found. Install superpowers skills to ~/.config/opencode/superpowers/skills/';
}
let output = 'Available skills:\n\n';
for (const skill of allSkills) {
const namespace = skill.sourceType === 'personal' ? '' : 'superpowers:';
const skillName = skill.name || path.basename(skill.path);
output += `${namespace}${skillName}\n`;
if (skill.description) {
output += ` ${skill.description}\n`;
}
output += ` Directory: ${skill.path}\n\n`;
}
return output;
}
}Step 2: Verify syntax
Run: node -c .opencode/plugin/superpowers.js
Expected: No output
Step 3: Commit
git add .opencode/plugin/superpowers.js
git commit -m "feat: implement find_skills tool for opencode"Task 12: Implement Session Start Hook
Files:
- Modify:
.opencode/plugin/superpowers.js
Step 1: Add session.started hook
After the tools array, add:
/* Detailed source-code truncated for AI context efficiency. */Step 2: Verify syntax
Run: node -c .opencode/plugin/superpowers.js
Expected: No output
Step 3: Commit
git add .opencode/plugin/superpowers.js
git commit -m "feat: implement session.started hook for opencode"Phase 4: Documentation
Task 13: Create OpenCode Installation Guide
Files:
- Create:
.opencode/INSTALL.md
Step 1: Create installation guide
# Installing Superpowers for OpenCode
## Prerequisites
- [OpenCode.ai](https://opencode.ai) installed
- Node.js installed
- Git installed
## Installation Steps
### 1. Install Superpowers Skills
```bash
# Clone superpowers skills to OpenCode config directory
mkdir -p ~/.config/opencode/superpowers
git clone https://github.com/obra/superpowers.git ~/.config/opencode/superpowers2. Install the Plugin
The plugin is included in the superpowers repository you just cloned.
OpenCode will automatically discover it from:
~/.config/opencode/superpowers/.opencode/plugin/superpowers.js
Or you can link it to the project-local plugin directory:
# In your OpenCode project
mkdir -p .opencode/plugin
ln -s ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js .opencode/plugin/superpowers.js3. Restart OpenCode
Restart OpenCode to load the plugin. On the next session, you should see:
You have superpowers.Usage
Finding Skills
Use the find_skills tool to list all available skills:
use find_skills toolLoading a Skill
Use the use_skill tool to load a specific skill:
use use_skill tool with skill_name: "superpowers:brainstorming"Personal Skills
Create your own skills in ~/.config/opencode/skills/:
mkdir -p ~/.config/opencode/skills/my-skillCreate ~/.config/opencode/skills/my-skill/SKILL.md:
---
name: my-skill
---
# My Skill
[Your skill content here]Personal skills override superpowers skills with the same name.
Updating
cd ~/.config/opencode/superpowers
git pullTroubleshooting
Plugin not loading
- Check plugin file exists:
ls ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js - Check OpenCode logs for errors
- Verify Node.js is installed:
node --version
Skills not found
- Verify skills directory exists:
ls ~/.config/opencode/superpowers/skills - Use
find_skillstool to see what's discovered - Check file structure: each skill should have a
SKILL.mdfile
Tool mapping issues
When a skill references a Claude Code tool you don't have:
TodoWriteโ useupdate_planTaskwith subagents โ use@mentionsyntax to invoke OpenCode subagentsSkillโ useuse_skilltool- File operations โ use your native tools
Getting Help
- Report issues: https://github.com/obra/superpowers/issues
- Documentation: https://github.com/obra/superpowers
**Step 2: Verify file created**
Run: `ls -l .opencode/INSTALL.md`
Expected: File exists
**Step 3: Commit**
```bash
git add .opencode/INSTALL.md
git commit -m "docs: add opencode installation guide"Task 14: Update Main README
Files:
- Modify:
README.md
Step 1: Add OpenCode section
Find the section about supported platforms (search for "Codex" in the file), and add after it:
### OpenCode
Superpowers works with [OpenCode.ai](https://opencode.ai) through a native JavaScript plugin.
**Installation:** See [.opencode/INSTALL.md](.opencode/INSTALL.md)
**Features:**
- Custom tools: `use_skill` and `find_skills`
- Automatic session bootstrap
- Personal skills with shadowing
- Supporting files and scripts accessStep 2: Verify formatting
Run: grep -A 10 "### OpenCode" README.md
Expected: Shows the section you added
Step 3: Commit
git add README.md
git commit -m "docs: add opencode support to readme"Task 15: Update Release Notes
Files:
- Modify:
RELEASE-NOTES.md
Step 1: Add entry for OpenCode support
At the top of the file (after the header), add:
## [Unreleased]
### Added
- **OpenCode Support**: Native JavaScript plugin for OpenCode.ai
- Custom tools: `use_skill` and `find_skills`
- Automatic session bootstrap with tool mapping instructions
- Shared core module (`lib/skills-core.js`) for code reuse
- Installation guide in `.opencode/INSTALL.md`
### Changed
- **Refactored Codex Implementation**: Now uses shared `lib/skills-core.js` module
- Eliminates code duplication between Codex and OpenCode
- Single source of truth for skill discovery and parsing
---Step 2: Verify formatting
Run: head -30 RELEASE-NOTES.md
Expected: Shows your new section
Step 3: Commit
git add RELEASE-NOTES.md
git commit -m "docs: add opencode support to release notes"Phase 5: Final Verification
Task 16: Test Codex Still Works
Files:
- Test:
.codex/superpowers-codex
Step 1: Test find-skills command
Run: .codex/superpowers-codex find-skills | head -20
Expected: Shows list of skills with names and descriptions
Step 2: Test use-skill command
Run: .codex/superpowers-codex use-skill superpowers:brainstorming | head -20
Expected: Shows brainstorming skill content
Step 3: Test bootstrap command
Run: .codex/superpowers-codex bootstrap | head -30
Expected: Shows bootstrap content with instructions
Step 4: If all tests pass, record success
No commit needed - this is verification only.
Task 17: Verify File Structure
Files:
- Check: All new files exist
Step 1: Verify all files created
Run:
ls -l lib/skills-core.js
ls -l .opencode/plugin/superpowers.js
ls -l .opencode/INSTALL.mdExpected: All files exist
Step 2: Verify directory structure
Run: tree -L 2 .opencode/ (or find .opencode -type f if tree not available)
Expected:
.opencode/
โโโ INSTALL.md
โโโ plugin/
โโโ superpowers.jsStep 3: If structure correct, proceed
No commit needed - this is verification only.
Task 18: Final Commit and Summary
Files:
- Check:
git status
Step 1: Check git status
Run: git status
Expected: Working tree clean, all changes committed
Step 2: Review commit log
Run: git log --oneline -20
Expected: Shows all commits from this implementation
Step 3: Create summary document
Create a completion summary showing:
- Total commits made
- Files created:
lib/skills-core.js,.opencode/plugin/superpowers.js,.opencode/INSTALL.md - Files modified:
.codex/superpowers-codex,README.md,RELEASE-NOTES.md - Testing performed: Codex commands verified
- Ready for: Testing with actual OpenCode installation
Step 4: Report completion
Present summary to user and offer to:
- Push to remote
- Create pull request
- Test with real OpenCode installation (requires OpenCode installed)
Testing Guide (Manual - Requires OpenCode)
These steps require OpenCode to be installed and are not part of the automated implementation:
- Install skills: Follow
.opencode/INSTALL.md - Start OpenCode session: Verify bootstrap appears
- Test find_skills: Should list all available skills
- Test use_skill: Load a skill and verify content appears
- Test supporting files: Verify skill directory paths are accessible
- Test personal skills: Create a personal skill and verify it shadows core
- Test tool mapping: Verify TodoWrite โ update_plan mapping works
Success Criteria
-
lib/skills-core.jscreated with all core functions -
.codex/superpowers-codexrefactored to use shared core - Codex commands still work (find-skills, use-skill, bootstrap)
-
.opencode/plugin/superpowers.jscreated with tools and hooks - Installation guide created
- README and RELEASE-NOTES updated
- All changes committed
- Working tree clean
File: docs/plans/2025-11-28-skills-improvements-from-user-feedback.md
Skills Improvements from User Feedback
Date: 2025-11-28
Status: Draft
Source: Two Claude instances using superpowers in real development scenarios
Executive Summary
Two Claude instances provided detailed feedback from actual development sessions. Their feedback reveals systematic gaps in current skills that allowed preventable bugs to ship despite following the skills.
Critical insight: These are problem reports, not just solution proposals. The problems are real; the solutions need careful evaluation.
Key themes:
- Verification gaps - We verify operations succeed but not that they achieve intended outcomes
- Process hygiene - Background processes accumulate and interfere across subagents
- Context optimization - Subagents get too much irrelevant information
- Self-reflection missing - No prompt to critique own work before handoff
- Mock safety - Mocks can drift from interfaces without detection
- Skill activation - Skills exist but aren't being read/used
Problems Identified
Problem 1: Configuration Change Verification Gap
What happened:
- Subagent tested "OpenAI integration"
- Set
OPENAI_API_KEYenv var - Got status 200 responses
- Reported "OpenAI integration working"
- BUT response contained
"model": "claude-sonnet-4-20250514"- was actually using Anthropic
Root cause:verification-before-completion checks operations succeed but not that outcomes reflect intended configuration changes.
Impact: High - False confidence in integration tests, bugs ship to production
Example failure pattern:
- Switch LLM provider โ verify status 200 but don't check model name
- Enable feature flag โ verify no errors but don't check feature is active
- Change environment โ verify deployment succeeds but don't check environment vars
Problem 2: Background Process Accumulation
What happened:
- Multiple subagents dispatched during session
- Each started background server processes
- Processes accumulated (4+ servers running)
- Stale processes still bound to ports
- Later E2E test hit stale server with wrong config
- Confusing/incorrect test results
Root cause:
Subagents are stateless - don't know about previous subagents' processes. No cleanup protocol.
Impact: Medium-High - Tests hit wrong server, false passes/failures, debugging confusion
Problem 3: Context Bloat in Subagent Prompts
What happened:
- Standard approach: give subagent full plan file to read
- Experiment: give only task + pattern + file + verify command
- Result: Faster, more focused, single-attempt completion more common
Root cause:
Subagents waste tokens and attention on irrelevant plan sections.
Impact: Medium - Slower execution, more failed attempts
What worked:
You are adding a single E2E test to packnplay's test suite.
**Your task:** Add `TestE2E_FeaturePrivilegedMode` to `pkg/runner/e2e_test.go`
**What to test:** A local devcontainer feature that requests `"privileged": true`
in its metadata should result in the container running with `--privileged` flag.
**Follow the exact pattern of TestE2E_FeatureOptionValidation** (at the end of the file)
**After writing, run:** `go test -v ./pkg/runner -run TestE2E_FeaturePrivilegedMode -timeout 5m`Problem 4: No Self-Reflection Before Handoff
What happened:
- Added self-reflection prompt: "Look at your work with fresh eyes - what could be better?"
- Implementer for Task 5 identified failing test was due to implementation bug, not test bug
- Traced to line 99:
strings.Join(metadata.Entrypoint, " ")creating invalid Docker syntax - Without self-reflection, would have just reported "test fails" without root cause
Root cause:
Implementers don't naturally step back and critique their own work before reporting completion.
Impact: Medium - Bugs handed off to reviewer that implementer could have caught
Problem 5: Mock-Interface Drift
What happened:
// Interface defines close()
interface PlatformAdapter {
close(): Promise<void>;
}
// Code (BUGGY) calls cleanup()
await adapter.cleanup();
// Mock (MATCHES BUG) defines cleanup()
vi.mock('web-adapter', () => ({
WebAdapter: vi.fn().mockImplementation(() => ({
cleanup: vi.fn().mockResolvedValue(undefined), // Wrong!
})),
}));- Tests passed
- Runtime crashed: "adapter.cleanup is not a function"
Root cause:
Mock derived from what buggy code calls, not from interface definition. TypeScript can't catch inline mocks with wrong method names.
Impact: High - Tests give false confidence, runtime crashes
Why testing-anti-patterns didn't prevent this:
The skill covers testing mock behavior and mocking without understanding, but not the specific pattern of "derive mock from interface, not implementation."
Problem 6: Code Reviewer File Access
What happened:
- Code reviewer subagent dispatched
- Couldn't find test file: "The file doesn't appear to exist in the repository"
- File actually exists
- Reviewer didn't know to explicitly read it first
Root cause:
Reviewer prompts don't include explicit file reading instructions.
Impact: Low-Medium - Reviews fail or incomplete
Problem 7: Fix Workflow Latency
What happened:
- Implementer identifies bug during self-reflection
- Implementer knows the fix
- Current workflow: report โ I dispatch fixer โ fixer fixes โ I verify
- Extra round-trip adds latency without adding value
Root cause:
Rigid separation between implementer and fixer roles when implementer has already diagnosed.
Impact: Low - Latency, but no correctness issue
Problem 8: Skills Not Being Read
What happened:
testing-anti-patternsskill exists- Neither human nor subagents read it before writing tests
- Would have prevented some issues (though not all - see Problem 5)
Root cause:
No enforcement that subagents read relevant skills. No prompt includes skill reading.
Impact: Medium - Skill investment wasted if not used
Proposed Improvements
1. verification-before-completion: Add Configuration Change Verification
Add new section:
## Verifying Configuration Changes
When testing changes to configuration, providers, feature flags, or environment:
**Don't just verify the operation succeeded. Verify the output reflects the intended change.**
### Common Failure Pattern
Operation succeeds because *some* valid config exists, but it's not the config you intended to test.
### Examples
| Change | Insufficient | Required |
|--------|-------------|----------|
| Switch LLM provider | Status 200 | Response contains expected model name |
| Enable feature flag | No errors | Feature behavior actually active |
| Change environment | Deploy succeeds | Logs/vars reference new environment |
| Set credentials | Auth succeeds | Authenticated user/context is correct |
### Gate FunctionBEFORE claiming configuration change works:
- IDENTIFY: What should be DIFFERENT after this change?
- LOCATE: Where is that difference observable?
- Response field (model name, user ID)
- Log line (environment, provider)
- Behavior (feature active/inactive)
- RUN: Command that shows the observable difference
- VERIFY: Output contains expected difference
- ONLY THEN: Claim configuration change works
Red flags:
- "Request succeeded" without checking content
- Checking status code but not response body
- Verifying no errors but not positive confirmation
**Why this works:**
Forces verification of INTENT, not just operation success.
---
### 2. subagent-driven-development: Add Process Hygiene for E2E Tests
**Add new section:**
```markdown
## Process Hygiene for E2E Tests
When dispatching subagents that start services (servers, databases, message queues):
### Problem
Subagents are stateless - they don't know about processes started by previous subagents. Background processes persist and can interfere with later tests.
### Solution
**Before dispatching E2E test subagent, include cleanup in prompt:**BEFORE starting any services:
- Kill existing processes: pkill -f "
" 2>/dev/null || true - Wait for cleanup: sleep 1
- Verify port free: lsof -i : && echo "ERROR: Port still in use" || echo "Port free"
AFTER tests complete:
- Kill the process you started
- Verify cleanup: pgrep -f "
" || echo "Cleanup successful"
### ExampleTask: Run E2E test of API server
Prompt includes:
"Before starting the server:
- Kill any existing servers: pkill -f 'node.*server.js' 2>/dev/null || true
- Verify port 3001 is free: lsof -i :3001 && exit 1 || echo 'Port available'
After tests:
- Kill the server you started
- Verify: pgrep -f 'node.*server.js' || echo 'Cleanup verified'"
### Why This Matters
- Stale processes serve requests with wrong config
- Port conflicts cause silent failures
- Process accumulation slows system
- Confusing test results (hitting wrong server)Trade-off analysis:
- Adds boilerplate to prompts
- But prevents very confusing debugging
- Worth it for E2E test subagents
3. subagent-driven-development: Add Lean Context Option
Modify Step 2: Execute Task with Subagent
Before:
Read that task carefully from [plan-file].After:
## Context Approaches
**Full Plan (default):**
Use when tasks are complex or have dependencies:Read Task N from [plan-file] carefully.
**Lean Context (for independent tasks):**
Use when task is standalone and pattern-based:You are implementing: [1-2 sentence task description]
File to modify: [exact path]
Pattern to follow: [reference to existing function/test]
What to implement: [specific requirement]
Verification: [exact command to run]
[Do NOT include full plan file]
**Use lean context when:**
- Task follows existing pattern (add similar test, implement similar feature)
- Task is self-contained (doesn't need context from other tasks)
- Pattern reference is sufficient (e.g., "follow TestE2E_FeatureOptionValidation")
**Use full plan when:**
- Task has dependencies on other tasks
- Requires understanding of overall architecture
- Complex logic that needs contextExample:
Lean context prompt:
"You are adding a test for privileged mode in devcontainer features.
File: pkg/runner/e2e_test.go
Pattern: Follow TestE2E_FeatureOptionValidation (at end of file)
Test: Feature with `"privileged": true` in metadata results in `--privileged` flag
Verify: go test -v ./pkg/runner -run TestE2E_FeaturePrivilegedMode -timeout 5m
Report: Implementation, test results, any issues."Why this works:
Reduces token usage, increases focus, faster completion when appropriate.
4. subagent-driven-development: Add Self-Reflection Step
Modify Step 2: Execute Task with Subagent
Add to prompt template:
When done, BEFORE reporting back:
Take a step back and review your work with fresh eyes.
Ask yourself:
- Does this actually solve the task as specified?
- Are there edge cases I didn't consider?
- Did I follow the pattern correctly?
- If tests are failing, what's the ROOT CAUSE (implementation bug vs test bug)?
- What could be better about this implementation?
If you identify issues during this reflection, fix them now.
Then report:
- What you implemented
- Self-reflection findings (if any)
- Test results
- Files changedWhy this works:
Catches bugs implementer can find themselves before handoff. Documented case: identified entrypoint bug through self-reflection.
Trade-off:
Adds ~30 seconds per task, but catches issues before review.
5. requesting-code-review: Add Explicit File Reading
Modify the code-reviewer template:
Add at the beginning:
## Files to Review
BEFORE analyzing, read these files:
1. [List specific files that changed in the diff]
2. [Files referenced by changes but not modified]
Use Read tool to load each file.
If you cannot find a file:
- Check exact path from diff
- Try alternate locations
- Report: "Cannot locate [path] - please verify file exists"
DO NOT proceed with review until you've read the actual code.Why this works:
Explicit instruction prevents "file not found" issues.
6. testing-anti-patterns: Add Mock-Interface Drift Anti-Pattern
Add new Anti-Pattern 6:
## Anti-Pattern 6: Mocks Derived from Implementation
**The violation:**
```typescript
// Code (BUGGY) calls cleanup()
await adapter.cleanup();
// Mock (MATCHES BUG) has cleanup()
const mock = {
cleanup: vi.fn().mockResolvedValue(undefined)
};
// Interface (CORRECT) defines close()
interface PlatformAdapter {
close(): Promise<void>;
}Why this is wrong:
- Mock encodes the bug into the test
- TypeScript can't catch inline mocks with wrong method names
- Test passes because both code and mock are wrong
- Runtime crashes when real object is used
The fix:
// โ
GOOD: Derive mock from interface
// Step 1: Open interface definition (PlatformAdapter)
// Step 2: List methods defined there (close, initialize, etc.)
// Step 3: Mock EXACTLY those methods
const mock = {
initialize: vi.fn().mockResolvedValue(undefined),
close: vi.fn().mockResolvedValue(undefined), // From interface!
};
// Now test FAILS because code calls cleanup() which doesn't exist
// That failure reveals the bug BEFORE runtimeGate Function
BEFORE writing any mock:
1. STOP - Do NOT look at the code under test yet
2. FIND: The interface/type definition for the dependency
3. READ: The interface file
4. LIST: Methods defined in the interface
5. MOCK: ONLY those methods with EXACTLY those names
6. DO NOT: Look at what your code calls
IF your test fails because code calls something not in mock:
โ
GOOD - The test found a bug in your code
Fix the code to call the correct interface method
NOT the mock
Red flags:
- "I'll mock what the code calls"
- Copying method names from implementation
- Mock written without reading interface
- "The test is failing so I'll add this method to the mock"Detection:
When you see runtime error "X is not a function" and tests pass:
- Check if X is mocked
- Compare mock methods to interface methods
- Look for method name mismatches
**Why this works:**
Directly addresses the failure pattern from feedback.
---
### 7. subagent-driven-development: Require Skills Reading for Test Subagents
**Add to prompt template when task involves testing:**
```markdown
BEFORE writing any tests:
1. Read testing-anti-patterns skill:
Use Skill tool: superpowers:testing-anti-patterns
2. Apply gate functions from that skill when:
- Writing mocks
- Adding methods to production classes
- Mocking dependencies
This is NOT optional. Tests that violate anti-patterns will be rejected in review.Why this works:
Ensures skills are actually used, not just exist.
Trade-off:
Adds time to each task, but prevents entire classes of bugs.
8. subagent-driven-development: Allow Implementer to Fix Self-Identified Issues
Modify Step 2:
Current:
Subagent reports back with summary of work.Proposed:
Subagent performs self-reflection, then:
IF self-reflection identifies fixable issues:
1. Fix the issues
2. Re-run verification
3. Report: "Initial implementation + self-reflection fix"
ELSE:
Report: "Implementation complete"
Include in report:
- Self-reflection findings
- Whether fixes were applied
- Final verification resultsWhy this works:
Reduces latency when implementer already knows the fix. Documented case: would have saved one round-trip for entrypoint bug.
Trade-off:
Slightly more complex prompt, but faster end-to-end.
Implementation Plan
Phase 1: High-Impact, Low-Risk (Do First)
verification-before-completion: Configuration change verification
- Clear addition, doesn't change existing content
- Addresses high-impact problem (false confidence in tests)
- File:
skills/verification-before-completion/SKILL.md
testing-anti-patterns: Mock-interface drift
- Adds new anti-pattern, doesn't modify existing
- Addresses high-impact problem (runtime crashes)
- File:
skills/testing-anti-patterns/SKILL.md
requesting-code-review: Explicit file reading
- Simple addition to template
- Fixes concrete problem (reviewers can't find files)
- File:
skills/requesting-code-review/SKILL.md
Phase 2: Moderate Changes (Test Carefully)
subagent-driven-development: Process hygiene
- Adds new section, doesn't change workflow
- Addresses medium-high impact (test reliability)
- File:
skills/subagent-driven-development/SKILL.md
subagent-driven-development: Self-reflection
- Changes prompt template (higher risk)
- But documented to catch bugs
- File:
skills/subagent-driven-development/SKILL.md
subagent-driven-development: Skills reading requirement
- Adds prompt overhead
- But ensures skills are actually used
- File:
skills/subagent-driven-development/SKILL.md
Phase 3: Optimization (Validate First)
subagent-driven-development: Lean context option
- Adds complexity (two approaches)
- Needs validation that it doesn't cause confusion
- File:
skills/subagent-driven-development/SKILL.md
subagent-driven-development: Allow implementer to fix
- Changes workflow (higher risk)
- Optimization, not bug fix
- File:
skills/subagent-driven-development/SKILL.md
Open Questions
Lean context approach:
- Should we make it the default for pattern-based tasks?
- How do we decide which approach to use?
- Risk of being too lean and missing important context?
Self-reflection:
- Will this slow down simple tasks significantly?
- Should it only apply to complex tasks?
- How do we prevent "reflection fatigue" where it becomes rote?
Process hygiene:
- Should this be in subagent-driven-development or a separate skill?
- Does it apply to other workflows beyond E2E tests?
- How do we handle cases where process SHOULD persist (dev servers)?
Skills reading enforcement:
- Should we require ALL subagents to read relevant skills?
- How do we keep prompts from becoming too long?
- Risk of over-documenting and losing focus?
Success Metrics
How do we know these improvements work?
Configuration verification:
- Zero instances of "test passed but wrong config was used"
- Jesse doesn't say "that's not actually testing what you think"
Process hygiene:
- Zero instances of "test hit wrong server"
- No port conflict errors during E2E test runs
Mock-interface drift:
- Zero instances of "tests pass but runtime crashes on missing method"
- No method name mismatches between mocks and interfaces
Self-reflection:
- Measurable: Do implementer reports include self-reflection findings?
- Qualitative: Do fewer bugs make it to code review?
Skills reading:
- Subagent reports reference skill gate functions
- Fewer anti-pattern violations in code review
Risks and Mitigations
Risk: Prompt Bloat
Problem: Adding all these requirements makes prompts overwhelming
Mitigation:
- Phase implementation (don't add everything at once)
- Make some additions conditional (E2E hygiene only for E2E tests)
- Consider templates for different task types
Risk: Analysis Paralysis
Problem: Too much reflection/verification slows execution
Mitigation:
- Keep gate functions quick (seconds, not minutes)
- Make lean context opt-in initially
- Monitor task completion times
Risk: False Sense of Security
Problem: Following checklist doesn't guarantee correctness
Mitigation:
- Emphasize gate functions are minimums, not maximums
- Keep "use judgment" language in skills
- Document that skills catch common failures, not all failures
Risk: Skill Divergence
Problem: Different skills give conflicting advice
Mitigation:
- Review changes across all skills for consistency
- Document how skills interact (Integration sections)
- Test with real scenarios before deployment
Recommendation
Proceed with Phase 1 immediately:
- verification-before-completion: Configuration change verification
- testing-anti-patterns: Mock-interface drift
- requesting-code-review: Explicit file reading
Test Phase 2 with Jesse before finalizing:
- Get feedback on self-reflection impact
- Validate process hygiene approach
- Confirm skills reading requirement is worth overhead
Hold Phase 3 pending validation:
- Lean context needs real-world testing
- Implementer-fix workflow change needs careful evaluation
These changes address real problems documented by users while minimizing risk of making skills worse.
File: docs/windows/polyglot-hooks.md
Cross-Platform Polyglot Hooks for Claude Code
Claude Code plugins need hooks that work on Windows, macOS, and Linux. This document describes the single generic dispatcher pattern used in hooks/run-hook.cmd.
Authoritative source:
hooks/run-hook.cmdis the canonical implementation. When this document and the code diverge, trust the code.
The Problem
Claude Code runs hook commands through a shell:
- macOS/Linux: bash or sh
- Windows with Git Bash installed: Git Bash
- Windows without Git Bash: PowerShell (older versions used CMD.exe)
Neither Windows fallback shell can parse our command string: PowerShell treats
a leading quoted path as a string expression and errors on the next bareword,
and CMD.exe's /c quoting rules strip the outer quotes when the path contains
a metacharacter such as (. Our hooks therefore declare "shell": "bash"
(supported since Claude Code 2.1.81; older versions ignore the key), which
forces the Git Bash route and, when Git Bash is absent, produces an actionable
"install Git for Windows" error instead of a shell parser failure.
This creates several challenges:
- Script execution: Windows CMD can't execute
.shfiles directly - Path format: Windows uses backslashes (
C:\path), Unix uses forward slashes (/path) - Environment variables:
$VARsyntax doesn't work in CMD .shauto-prepend: Claude Code on Windows automatically prependsbashto any command that contains.shin its path โ this interferes with the dispatcher if scripts have extensions
The Solution: Extensionless Scripts + Single Generic Dispatcher
The repo uses one generic run-hook.cmd dispatcher for all hooks. Hook scripts are extensionless (session-start, not session-start.sh). This is deliberate: it prevents Claude Code's Windows auto-detection from prepending bash to the dispatcher command and breaking it.
File Structure
hooks/
โโโ hooks.json # Points to run-hook.cmd with extensionless script name
โโโ run-hook.cmd # Cross-platform dispatcher (the polyglot wrapper)
โโโ session-start # Actual hook logic โ extensionless bash scripthooks.json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|clear|compact",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",
"shell": "bash",
"async": false
}
]
}
]
}
}The path is quoted because ${CLAUDE_PLUGIN_ROOT} may contain spaces.
How `run-hook.cmd` Works at a High Level
run-hook.cmd is a polyglot script: Windows treats the first block as batch
commands, while Unix shells treat that block as a no-op heredoc and continue
after it.
Do not copy an implementation from this document. Read hooks/run-hook.cmd
directly when changing the dispatcher, and run tests/hooks/test-session-start.sh
afterward.
How it works on Windows (CMD.exe)
- The batch section validates the script name and resolves the hook directory
from the dispatcher's own location. - It tries bash in three places:
C:\Program Files\Git\bin\bash.exeC:\Program Files (x86)\Git\bin\bash.exebashonPATH(MSYS2, Cygwin, or a non-default Git install)
- If bash is found, it runs the named extensionless hook script from the hooks
directory. - If no bash is found, the dispatcher exits
0silently โ the plugin
continues working, it just skips the hook. exit /bstops CMD before it reaches the Unix section.
How it works on Unix (bash/sh)
: << 'CMDBLOCK'opens a heredoc on a no-op command.- The entire CMD batch block is consumed by the heredoc and ignored.
- After
CMDBLOCK, bash resolves the script directory andexecs the named
extensionless script directly.
Key design decisions
| Decision | Why |
|---|---|
| Extensionless scripts | Prevents Claude Code's Windows .sh-auto-prepend from interfering with the dispatcher command |
No -l (login shell) |
Not needed; hook scripts should be self-contained and not depend on login-shell PATH setup |
No cygpath |
Bash receives the Windows path directly and handles it correctly; cygpath was needed by the old -c "..." invocation pattern, not by direct exec |
| Silent exit on no-bash | Avoids breaking the plugin for users who don't have Git for Windows; hook context injection is skipped gracefully |
Writing Cross-Platform Hook Scripts
Your hook logic goes in the extensionless script file. A few portable patterns:
Do
- Use pure bash builtins when possible
- Use
$(command)instead of backticks - Quote all variable expansions:
"$VAR"
Avoid
- Relying on PATH-dependent tools without fallbacks (the hook runs without
-l, so login-shell PATH is not set) - Giving scripts a
.shextension โ this triggers Claude Code's Windows auto-prepend
Example: JSON escaping without external tools
escape_for_json() {
local input="$1"
local output=""
local i char
for (( i=0; i<${#input}; i++ )); do
char="${input:$i:1}"
case "$char" in
$'\\') output+='\\' ;;
'"') output+='\"' ;;
$'\n') output+='\n' ;;
$'\r') output+='\r' ;;
$'\t') output+='\t' ;;
*) output+="$char" ;;
esac
done
printf '%s' "$output"
}Troubleshooting
"bash is not recognized"
CMD couldn't find bash in any of the three locations the dispatcher tries. The dispatcher exits silently (0) rather than erroring, so the hook is skipped. Install Git for Windows at the standard path or ensure bash is on PATH.
Hook runs on Unix but does nothing on Windows
Check that the script filename is extensionless in hooks.json. A command like run-hook.cmd session-start.sh can trigger Claude Code's .sh auto-detection and bypass the intended CMD dispatcher path, or just try to run a non-existent session-start.sh script.
Hook doesn't fire at all
Verify the matcher in hooks.json matches the event type your harness emits. Claude Code uses startup|clear|compact; Cursor uses sessionStart. Check hooks-cursor.json for the Cursor variant.
Related Issues
- anthropics/claude-code#9758 โ
.shscripts open in editor on Windows - anthropics/claude-code#3417 โ Hooks don't work on Windows
File: docs/README.opencode.md
Superpowers for OpenCode
Complete guide for using Superpowers with OpenCode.ai.
Installation
Add superpowers to the plugin array in your opencode.json (global or project-level):
{
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
}Restart OpenCode. The plugin installs through OpenCode's plugin manager and
registers all skills.
Verify by asking: "Tell me about your superpowers"
OpenCode uses its own plugin install. If you also use Claude Code, Codex, or
another harness, install Superpowers separately for each one.
Migrating from the old symlink-based install
If you previously installed superpowers using git clone and symlinks, remove the old setup:
# Remove old symlinks
rm -f ~/.config/opencode/plugins/superpowers.js
rm -rf ~/.config/opencode/skills/superpowers
# Optionally remove the cloned repo
rm -rf ~/.config/opencode/superpowers
# Remove skills.paths from opencode.json if you added one for superpowersThen follow the installation steps above.
Usage
Finding Skills
Use OpenCode's native skill tool to list all available skills:
use skill tool to list skillsLoading a Skill
use skill tool to load brainstormingPersonal Skills
Create your own skills in ~/.config/opencode/skills/:
mkdir -p ~/.config/opencode/skills/my-skillCreate ~/.config/opencode/skills/my-skill/SKILL.md:
---
name: my-skill
---
# My Skill
[Your skill content here]Project Skills
Create project-specific skills in .opencode/skills/ within your project.
Skill Priority: Project skills > Personal skills > Superpowers skills
Updating
OpenCode installs Superpowers through a git-backed package spec. Some OpenCode
and Bun versions pin that resolved git dependency in a lockfile or cache, so a
restart may not pick up the newest Superpowers commit. If updates do not appear,
clear OpenCode's package cache or reinstall the plugin.
To pin a specific version, use a branch or tag:
{
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git#v5.0.3"]
}How It Works
The plugin does two things:
- Injects bootstrap context via the
experimental.chat.messages.transformhook, adding superpowers awareness to every conversation. - Registers the skills directory via the
confighook, so OpenCode discovers all superpowers skills without symlinks or manual config.
Tool Mapping
Skills speak in actions rather than naming any one runtime's tools. On OpenCode these resolve to:
- "Create a todo" / "mark complete in todo list" โ
todowrite Subagent (general-purpose):template โ OpenCode'stasktool withsubagent_type: "general"(or"explore"for codebase exploration)- "Invoke a skill" โ OpenCode's native
skilltool - "Read a file" โ
read - "Create a file" / "edit a file" / "delete a file" โ
apply_patch - "Run a shell command" โ
bash - "Search file contents" / "find files by name" โ
grep,glob - "Fetch a URL" โ
webfetch
(Verified against the installed OpenCode CLI's tool inventory.)
Troubleshooting
Plugin not loading
- Check OpenCode logs:
opencode run --print-logs "hello" 2>&1 | grep -i superpowers - Verify the plugin line in your
opencode.jsonis correct - Make sure you're running a recent version of OpenCode
Windows install issues
Some Windows OpenCode builds have upstream installer issues with git-backed
plugin specs, including cache paths for git+https URLs and Bun not findinggit.exe even when it works in a normal terminal. If OpenCode cannot install
the plugin, try installing with system npm and pointing OpenCode at the local
package:
npm install superpowers@git+https://github.com/obra/superpowers.git --prefix "$HOME\.config\opencode"Then use the installed package path in opencode.json:
{
"plugin": ["~/.config/opencode/node_modules/superpowers"]
}Skills not found
- Use OpenCode's
skilltool to list available skills - Check that the plugin is loading (see above)
- Each skill needs a
SKILL.mdfile with valid YAML frontmatter
Bootstrap not appearing
- Check OpenCode version supports
experimental.chat.messages.transformhook - Restart OpenCode after config changes
Getting Help
- Report issues: https://github.com/obra/superpowers/issues
- Main documentation: https://github.com/obra/superpowers
- OpenCode docs: https://opencode.ai/docs/