workerssuper 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +13 -0
- package/.codex/INSTALL.md +67 -0
- package/.cursor-plugin/plugin.json +18 -0
- package/.gitattributes +18 -0
- package/.github/FUNDING.yml +3 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +52 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
- package/.github/ISSUE_TEMPLATE/platform_support.md +23 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +87 -0
- package/.opencode/INSTALL.md +83 -0
- package/.opencode/plugins/superpowers.js +107 -0
- package/CHANGELOG.md +13 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/GEMINI.md +2 -0
- package/LICENSE +21 -0
- package/README.md +187 -0
- package/RELEASE-NOTES.md +1057 -0
- package/agents/code-reviewer.md +48 -0
- package/commands/brainstorm.md +5 -0
- package/commands/execute-plan.md +5 -0
- package/commands/write-plan.md +5 -0
- package/docs/README.codex.md +126 -0
- package/docs/README.opencode.md +130 -0
- package/docs/plans/2025-11-22-opencode-support-design.md +294 -0
- package/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
- package/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +711 -0
- package/docs/plans/2026-01-17-visual-brainstorming.md +571 -0
- package/docs/superpowers/plans/2026-01-22-document-review-system.md +301 -0
- package/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +523 -0
- package/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +479 -0
- package/docs/superpowers/specs/2026-01-22-document-review-system-design.md +136 -0
- package/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +162 -0
- package/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +118 -0
- package/docs/testing.md +303 -0
- package/docs/windows/polyglot-hooks.md +212 -0
- package/gemini-extension.json +6 -0
- package/hooks/hooks-cursor.json +10 -0
- package/hooks/hooks.json +16 -0
- package/hooks/run-hook.cmd +46 -0
- package/hooks/session-start +57 -0
- package/package.json +5 -0
- package/skills/brainstorming/SKILL.md +164 -0
- package/skills/brainstorming/scripts/frame-template.html +214 -0
- package/skills/brainstorming/scripts/helper.js +88 -0
- package/skills/brainstorming/scripts/server.cjs +338 -0
- package/skills/brainstorming/scripts/start-server.sh +153 -0
- package/skills/brainstorming/scripts/stop-server.sh +55 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +286 -0
- package/skills/dispatching-parallel-agents/SKILL.md +182 -0
- package/skills/executing-plans/SKILL.md +70 -0
- package/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/receiving-code-review/SKILL.md +213 -0
- package/skills/requesting-code-review/SKILL.md +105 -0
- package/skills/requesting-code-review/code-reviewer.md +146 -0
- package/skills/subagent-driven-development/SKILL.md +277 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +296 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/using-git-worktrees/SKILL.md +218 -0
- package/skills/using-superpowers/SKILL.md +115 -0
- package/skills/using-superpowers/references/codex-tools.md +25 -0
- package/skills/using-superpowers/references/gemini-tools.md +33 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/writing-plans/SKILL.md +145 -0
- package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/skills/writing-skills/SKILL.md +655 -0
- package/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/skills/writing-skills/persuasion-principles.md +187 -0
- package/skills/writing-skills/render-graphs.js +168 -0
- package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/tests/brainstorm-server/package-lock.json +36 -0
- package/tests/brainstorm-server/package.json +10 -0
- package/tests/brainstorm-server/server.test.js +424 -0
- package/tests/brainstorm-server/windows-lifecycle.test.sh +351 -0
- package/tests/brainstorm-server/ws-protocol.test.js +392 -0
- package/tests/claude-code/README.md +158 -0
- package/tests/claude-code/analyze-token-usage.py +168 -0
- package/tests/claude-code/run-skill-tests.sh +187 -0
- package/tests/claude-code/test-document-review-system.sh +177 -0
- package/tests/claude-code/test-helpers.sh +202 -0
- package/tests/claude-code/test-subagent-driven-development-integration.sh +314 -0
- package/tests/claude-code/test-subagent-driven-development.sh +165 -0
- package/tests/explicit-skill-requests/prompts/action-oriented.txt +3 -0
- package/tests/explicit-skill-requests/prompts/after-planning-flow.txt +17 -0
- package/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +11 -0
- package/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +8 -0
- package/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +3 -0
- package/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +1 -0
- package/tests/explicit-skill-requests/prompts/skip-formalities.txt +3 -0
- package/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +1 -0
- package/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +1 -0
- package/tests/explicit-skill-requests/run-all.sh +70 -0
- package/tests/explicit-skill-requests/run-claude-describes-sdd.sh +100 -0
- package/tests/explicit-skill-requests/run-extended-multiturn-test.sh +113 -0
- package/tests/explicit-skill-requests/run-haiku-test.sh +144 -0
- package/tests/explicit-skill-requests/run-multiturn-test.sh +143 -0
- package/tests/explicit-skill-requests/run-test.sh +136 -0
- package/tests/opencode/run-tests.sh +163 -0
- package/tests/opencode/setup.sh +73 -0
- package/tests/opencode/test-plugin-loading.sh +72 -0
- package/tests/opencode/test-priority.sh +198 -0
- package/tests/opencode/test-tools.sh +104 -0
- package/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +8 -0
- package/tests/skill-triggering/prompts/executing-plans.txt +1 -0
- package/tests/skill-triggering/prompts/requesting-code-review.txt +3 -0
- package/tests/skill-triggering/prompts/systematic-debugging.txt +11 -0
- package/tests/skill-triggering/prompts/test-driven-development.txt +7 -0
- package/tests/skill-triggering/prompts/writing-plans.txt +10 -0
- package/tests/skill-triggering/run-all.sh +60 -0
- package/tests/skill-triggering/run-test.sh +88 -0
- package/tests/subagent-driven-dev/go-fractals/design.md +81 -0
- package/tests/subagent-driven-dev/go-fractals/plan.md +172 -0
- package/tests/subagent-driven-dev/go-fractals/scaffold.sh +45 -0
- package/tests/subagent-driven-dev/run-test.sh +106 -0
- package/tests/subagent-driven-dev/svelte-todo/design.md +70 -0
- package/tests/subagent-driven-dev/svelte-todo/plan.md +222 -0
- package/tests/subagent-driven-dev/svelte-todo/scaffold.sh +46 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description: |
|
|
4
|
+
Use this agent when a major project step has been completed and needs to be reviewed against the original plan and coding standards. Examples: <example>Context: The user is creating a code-review agent that should be called after a logical chunk of code is written. user: "I've finished implementing the user authentication system as outlined in step 3 of our plan" assistant: "Great work! Now let me use the code-reviewer agent to review the implementation against our plan and coding standards" <commentary>Since a major project step has been completed, use the code-reviewer agent to validate the work against the plan and identify any issues.</commentary></example> <example>Context: User has completed a significant feature implementation. user: "The API endpoints for the task management system are now complete - that covers step 2 from our architecture document" assistant: "Excellent! Let me have the code-reviewer agent examine this implementation to ensure it aligns with our plan and follows best practices" <commentary>A numbered step from the planning document has been completed, so the code-reviewer agent should review the work.</commentary></example>
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a Senior Code Reviewer with expertise in software architecture, design patterns, and best practices. Your role is to review completed project steps against original plans and ensure code quality standards are met.
|
|
9
|
+
|
|
10
|
+
When reviewing completed work, you will:
|
|
11
|
+
|
|
12
|
+
1. **Plan Alignment Analysis**:
|
|
13
|
+
- Compare the implementation against the original planning document or step description
|
|
14
|
+
- Identify any deviations from the planned approach, architecture, or requirements
|
|
15
|
+
- Assess whether deviations are justified improvements or problematic departures
|
|
16
|
+
- Verify that all planned functionality has been implemented
|
|
17
|
+
|
|
18
|
+
2. **Code Quality Assessment**:
|
|
19
|
+
- Review code for adherence to established patterns and conventions
|
|
20
|
+
- Check for proper error handling, type safety, and defensive programming
|
|
21
|
+
- Evaluate code organization, naming conventions, and maintainability
|
|
22
|
+
- Assess test coverage and quality of test implementations
|
|
23
|
+
- Look for potential security vulnerabilities or performance issues
|
|
24
|
+
|
|
25
|
+
3. **Architecture and Design Review**:
|
|
26
|
+
- Ensure the implementation follows SOLID principles and established architectural patterns
|
|
27
|
+
- Check for proper separation of concerns and loose coupling
|
|
28
|
+
- Verify that the code integrates well with existing systems
|
|
29
|
+
- Assess scalability and extensibility considerations
|
|
30
|
+
|
|
31
|
+
4. **Documentation and Standards**:
|
|
32
|
+
- Verify that code includes appropriate comments and documentation
|
|
33
|
+
- Check that file headers, function documentation, and inline comments are present and accurate
|
|
34
|
+
- Ensure adherence to project-specific coding standards and conventions
|
|
35
|
+
|
|
36
|
+
5. **Issue Identification and Recommendations**:
|
|
37
|
+
- Clearly categorize issues as: Critical (must fix), Important (should fix), or Suggestions (nice to have)
|
|
38
|
+
- For each issue, provide specific examples and actionable recommendations
|
|
39
|
+
- When you identify plan deviations, explain whether they're problematic or beneficial
|
|
40
|
+
- Suggest specific improvements with code examples when helpful
|
|
41
|
+
|
|
42
|
+
6. **Communication Protocol**:
|
|
43
|
+
- If you find significant deviations from the plan, ask the coding agent to review and confirm the changes
|
|
44
|
+
- If you identify issues with the original plan itself, recommend plan updates
|
|
45
|
+
- For implementation problems, provide clear guidance on fixes needed
|
|
46
|
+
- Always acknowledge what was done well before highlighting issues
|
|
47
|
+
|
|
48
|
+
Your output should be structured, actionable, and focused on helping maintain high code quality while ensuring project goals are met. Be thorough but concise, and always provide constructive feedback that helps improve both the current implementation and future development practices.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Deprecated - use the superpowers:executing-plans skill instead"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Tell your human partner that this command is deprecated and will be removed in the next major release. They should ask you to use the "superpowers executing-plans" skill instead.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Superpowers for Codex
|
|
2
|
+
|
|
3
|
+
Guide for using Superpowers with OpenAI Codex via native skill discovery.
|
|
4
|
+
|
|
5
|
+
## Quick Install
|
|
6
|
+
|
|
7
|
+
Tell Codex:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.codex/INSTALL.md
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Manual Installation
|
|
14
|
+
|
|
15
|
+
### Prerequisites
|
|
16
|
+
|
|
17
|
+
- OpenAI Codex CLI
|
|
18
|
+
- Git
|
|
19
|
+
|
|
20
|
+
### Steps
|
|
21
|
+
|
|
22
|
+
1. Clone the repo:
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/obra/superpowers.git ~/.codex/superpowers
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
2. Create the skills symlink:
|
|
28
|
+
```bash
|
|
29
|
+
mkdir -p ~/.agents/skills
|
|
30
|
+
ln -s ~/.codex/superpowers/skills ~/.agents/skills/superpowers
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
3. Restart Codex.
|
|
34
|
+
|
|
35
|
+
4. **For subagent skills** (optional): Skills like `dispatching-parallel-agents` and `subagent-driven-development` require Codex's multi-agent feature. Add to your Codex config:
|
|
36
|
+
```toml
|
|
37
|
+
[features]
|
|
38
|
+
multi_agent = true
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Windows
|
|
42
|
+
|
|
43
|
+
Use a junction instead of a symlink (works without Developer Mode):
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.agents\skills"
|
|
47
|
+
cmd /c mklink /J "$env:USERPROFILE\.agents\skills\superpowers" "$env:USERPROFILE\.codex\superpowers\skills"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## How It Works
|
|
51
|
+
|
|
52
|
+
Codex has native skill discovery — it scans `~/.agents/skills/` at startup, parses SKILL.md frontmatter, and loads skills on demand. Superpowers skills are made visible through a single symlink:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
~/.agents/skills/superpowers/ → ~/.codex/superpowers/skills/
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The `using-superpowers` skill is discovered automatically and enforces skill usage discipline — no additional configuration needed.
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
Skills are discovered automatically. Codex activates them when:
|
|
63
|
+
- You mention a skill by name (e.g., "use brainstorming")
|
|
64
|
+
- The task matches a skill's description
|
|
65
|
+
- The `using-superpowers` skill directs Codex to use one
|
|
66
|
+
|
|
67
|
+
### Personal Skills
|
|
68
|
+
|
|
69
|
+
Create your own skills in `~/.agents/skills/`:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mkdir -p ~/.agents/skills/my-skill
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Create `~/.agents/skills/my-skill/SKILL.md`:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
---
|
|
79
|
+
name: my-skill
|
|
80
|
+
description: Use when [condition] - [what it does]
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
# My Skill
|
|
84
|
+
|
|
85
|
+
[Your skill content here]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The `description` field is how Codex decides when to activate a skill automatically — write it as a clear trigger condition.
|
|
89
|
+
|
|
90
|
+
## Updating
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
cd ~/.codex/superpowers && git pull
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Skills update instantly through the symlink.
|
|
97
|
+
|
|
98
|
+
## Uninstalling
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
rm ~/.agents/skills/superpowers
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Windows (PowerShell):**
|
|
105
|
+
```powershell
|
|
106
|
+
Remove-Item "$env:USERPROFILE\.agents\skills\superpowers"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Optionally delete the clone: `rm -rf ~/.codex/superpowers` (Windows: `Remove-Item -Recurse -Force "$env:USERPROFILE\.codex\superpowers"`).
|
|
110
|
+
|
|
111
|
+
## Troubleshooting
|
|
112
|
+
|
|
113
|
+
### Skills not showing up
|
|
114
|
+
|
|
115
|
+
1. Verify the symlink: `ls -la ~/.agents/skills/superpowers`
|
|
116
|
+
2. Check skills exist: `ls ~/.codex/superpowers/skills`
|
|
117
|
+
3. Restart Codex — skills are discovered at startup
|
|
118
|
+
|
|
119
|
+
### Windows junction issues
|
|
120
|
+
|
|
121
|
+
Junctions normally work without special permissions. If creation fails, try running PowerShell as administrator.
|
|
122
|
+
|
|
123
|
+
## Getting Help
|
|
124
|
+
|
|
125
|
+
- Report issues: https://github.com/obra/superpowers/issues
|
|
126
|
+
- Main documentation: https://github.com/obra/superpowers
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Superpowers for OpenCode
|
|
2
|
+
|
|
3
|
+
Complete guide for using Superpowers with [OpenCode.ai](https://opencode.ai).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add superpowers to the `plugin` array in your `opencode.json` (global or project-level):
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Restart OpenCode. The plugin auto-installs via Bun and registers all skills automatically.
|
|
16
|
+
|
|
17
|
+
Verify by asking: "Tell me about your superpowers"
|
|
18
|
+
|
|
19
|
+
### Migrating from the old symlink-based install
|
|
20
|
+
|
|
21
|
+
If you previously installed superpowers using `git clone` and symlinks, remove the old setup:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Remove old symlinks
|
|
25
|
+
rm -f ~/.config/opencode/plugins/superpowers.js
|
|
26
|
+
rm -rf ~/.config/opencode/skills/superpowers
|
|
27
|
+
|
|
28
|
+
# Optionally remove the cloned repo
|
|
29
|
+
rm -rf ~/.config/opencode/superpowers
|
|
30
|
+
|
|
31
|
+
# Remove skills.paths from opencode.json if you added one for superpowers
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Then follow the installation steps above.
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Finding Skills
|
|
39
|
+
|
|
40
|
+
Use OpenCode's native `skill` tool to list all available skills:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
use skill tool to list skills
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Loading a Skill
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
use skill tool to load superpowers/brainstorming
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Personal Skills
|
|
53
|
+
|
|
54
|
+
Create your own skills in `~/.config/opencode/skills/`:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mkdir -p ~/.config/opencode/skills/my-skill
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Create `~/.config/opencode/skills/my-skill/SKILL.md`:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
---
|
|
64
|
+
name: my-skill
|
|
65
|
+
description: Use when [condition] - [what it does]
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
# My Skill
|
|
69
|
+
|
|
70
|
+
[Your skill content here]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Project Skills
|
|
74
|
+
|
|
75
|
+
Create project-specific skills in `.opencode/skills/` within your project.
|
|
76
|
+
|
|
77
|
+
**Skill Priority:** Project skills > Personal skills > Superpowers skills
|
|
78
|
+
|
|
79
|
+
## Updating
|
|
80
|
+
|
|
81
|
+
Superpowers updates automatically when you restart OpenCode. The plugin is re-installed from the git repository on each launch.
|
|
82
|
+
|
|
83
|
+
To pin a specific version, use a branch or tag:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git#v5.0.3"]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## How It Works
|
|
92
|
+
|
|
93
|
+
The plugin does two things:
|
|
94
|
+
|
|
95
|
+
1. **Injects bootstrap context** via the `experimental.chat.system.transform` hook, adding superpowers awareness to every conversation.
|
|
96
|
+
2. **Registers the skills directory** via the `config` hook, so OpenCode discovers all superpowers skills without symlinks or manual config.
|
|
97
|
+
|
|
98
|
+
### Tool Mapping
|
|
99
|
+
|
|
100
|
+
Skills written for Claude Code are automatically adapted for OpenCode:
|
|
101
|
+
|
|
102
|
+
- `TodoWrite` → `todowrite`
|
|
103
|
+
- `Task` with subagents → OpenCode's `@mention` system
|
|
104
|
+
- `Skill` tool → OpenCode's native `skill` tool
|
|
105
|
+
- File operations → Native OpenCode tools
|
|
106
|
+
|
|
107
|
+
## Troubleshooting
|
|
108
|
+
|
|
109
|
+
### Plugin not loading
|
|
110
|
+
|
|
111
|
+
1. Check OpenCode logs: `opencode run --print-logs "hello" 2>&1 | grep -i superpowers`
|
|
112
|
+
2. Verify the plugin line in your `opencode.json` is correct
|
|
113
|
+
3. Make sure you're running a recent version of OpenCode
|
|
114
|
+
|
|
115
|
+
### Skills not found
|
|
116
|
+
|
|
117
|
+
1. Use OpenCode's `skill` tool to list available skills
|
|
118
|
+
2. Check that the plugin is loading (see above)
|
|
119
|
+
3. Each skill needs a `SKILL.md` file with valid YAML frontmatter
|
|
120
|
+
|
|
121
|
+
### Bootstrap not appearing
|
|
122
|
+
|
|
123
|
+
1. Check OpenCode version supports `experimental.chat.system.transform` hook
|
|
124
|
+
2. Restart OpenCode after config changes
|
|
125
|
+
|
|
126
|
+
## Getting Help
|
|
127
|
+
|
|
128
|
+
- Report issues: https://github.com/obra/superpowers/issues
|
|
129
|
+
- Main documentation: https://github.com/obra/superpowers
|
|
130
|
+
- OpenCode docs: https://opencode.ai/docs/
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# OpenCode Support Design
|
|
2
|
+
|
|
3
|
+
**Date:** 2025-11-22
|
|
4
|
+
**Author:** Bot & Jesse
|
|
5
|
+
**Status:** Design Complete, Awaiting Implementation
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Add full superpowers support for OpenCode.ai using a native OpenCode plugin architecture that shares core functionality with the existing Codex implementation.
|
|
10
|
+
|
|
11
|
+
## Background
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
### Key Differences Between Platforms
|
|
16
|
+
|
|
17
|
+
- **Claude Code**: Native Anthropic plugin system + file-based skills
|
|
18
|
+
- **Codex**: No plugin system → bootstrap markdown + CLI script
|
|
19
|
+
- **OpenCode**: JavaScript/TypeScript plugins with event hooks and custom tools API
|
|
20
|
+
|
|
21
|
+
### OpenCode's Agent System
|
|
22
|
+
|
|
23
|
+
- **Primary agents**: Build (default, full access) and Plan (restricted, read-only)
|
|
24
|
+
- **Subagents**: General (research, searching, multi-step tasks)
|
|
25
|
+
- **Invocation**: Automatic dispatch by primary agents OR manual `@mention` syntax
|
|
26
|
+
- **Configuration**: Custom agents in `opencode.json` or `~/.config/opencode/agent/`
|
|
27
|
+
|
|
28
|
+
## Architecture
|
|
29
|
+
|
|
30
|
+
### High-Level Structure
|
|
31
|
+
|
|
32
|
+
1. **Shared Core Module** (`lib/skills-core.js`)
|
|
33
|
+
- Common skill discovery and parsing logic
|
|
34
|
+
- Used by both Codex and OpenCode implementations
|
|
35
|
+
|
|
36
|
+
2. **Platform-Specific Wrappers**
|
|
37
|
+
- Codex: CLI script (`.codex/superpowers-codex`)
|
|
38
|
+
- OpenCode: Plugin module (`.opencode/plugin/superpowers.js`)
|
|
39
|
+
|
|
40
|
+
3. **Skill Directories**
|
|
41
|
+
- Core: `~/.config/opencode/superpowers/skills/` (or installed location)
|
|
42
|
+
- Personal: `~/.config/opencode/skills/` (shadows core skills)
|
|
43
|
+
|
|
44
|
+
### Code Reuse Strategy
|
|
45
|
+
|
|
46
|
+
Extract common functionality from `.codex/superpowers-codex` into shared module:
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
// lib/skills-core.js
|
|
50
|
+
module.exports = {
|
|
51
|
+
extractFrontmatter(filePath), // Parse name + description from YAML
|
|
52
|
+
findSkillsInDir(dir, maxDepth), // Recursive SKILL.md discovery
|
|
53
|
+
findAllSkills(dirs), // Scan multiple directories
|
|
54
|
+
resolveSkillPath(skillName, dirs), // Handle shadowing (personal > core)
|
|
55
|
+
checkForUpdates(repoDir) // Git fetch/status check
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Skill Frontmatter Format
|
|
60
|
+
|
|
61
|
+
Current format (no `when_to_use` field):
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
---
|
|
65
|
+
name: skill-name
|
|
66
|
+
description: Use when [condition] - [what it does]; [additional context]
|
|
67
|
+
---
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## OpenCode Plugin Implementation
|
|
71
|
+
|
|
72
|
+
### Custom Tools
|
|
73
|
+
|
|
74
|
+
**Tool 1: `use_skill`**
|
|
75
|
+
|
|
76
|
+
Loads a specific skill's content into the conversation (equivalent to Claude's Skill tool).
|
|
77
|
+
|
|
78
|
+
```javascript
|
|
79
|
+
{
|
|
80
|
+
name: 'use_skill',
|
|
81
|
+
description: 'Load and read a specific skill to guide your work',
|
|
82
|
+
schema: z.object({
|
|
83
|
+
skill_name: z.string().describe('Name of skill (e.g., "superpowers:brainstorming")')
|
|
84
|
+
}),
|
|
85
|
+
execute: async ({ skill_name }) => {
|
|
86
|
+
const { skillPath, content, frontmatter } = resolveAndReadSkill(skill_name);
|
|
87
|
+
const skillDir = path.dirname(skillPath);
|
|
88
|
+
|
|
89
|
+
return `# ${frontmatter.name}
|
|
90
|
+
# ${frontmatter.description}
|
|
91
|
+
# Supporting tools and docs are in ${skillDir}
|
|
92
|
+
# ============================================
|
|
93
|
+
|
|
94
|
+
${content}`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Tool 2: `find_skills`**
|
|
100
|
+
|
|
101
|
+
Lists all available skills with metadata.
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
{
|
|
105
|
+
name: 'find_skills',
|
|
106
|
+
description: 'List all available skills',
|
|
107
|
+
schema: z.object({}),
|
|
108
|
+
execute: async () => {
|
|
109
|
+
const skills = discoverAllSkills();
|
|
110
|
+
return skills.map(s =>
|
|
111
|
+
`${s.namespace}:${s.name}
|
|
112
|
+
${s.description}
|
|
113
|
+
Directory: ${s.directory}
|
|
114
|
+
`).join('\n');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Session Startup Hook
|
|
120
|
+
|
|
121
|
+
When a new session starts (`session.started` event):
|
|
122
|
+
|
|
123
|
+
1. **Inject using-superpowers content**
|
|
124
|
+
- Full content of the using-superpowers skill
|
|
125
|
+
- Establishes mandatory workflows
|
|
126
|
+
|
|
127
|
+
2. **Run find_skills automatically**
|
|
128
|
+
- Display full list of available skills upfront
|
|
129
|
+
- Include skill directories for each
|
|
130
|
+
|
|
131
|
+
3. **Inject tool mapping instructions**
|
|
132
|
+
```markdown
|
|
133
|
+
**Tool Mapping for OpenCode:**
|
|
134
|
+
When skills reference tools you don't have, substitute:
|
|
135
|
+
- `TodoWrite` → `update_plan`
|
|
136
|
+
- `Task` with subagents → Use OpenCode subagent system (@mention)
|
|
137
|
+
- `Skill` tool → `use_skill` custom tool
|
|
138
|
+
- Read, Write, Edit, Bash → Your native equivalents
|
|
139
|
+
|
|
140
|
+
**Skill directories contain:**
|
|
141
|
+
- Supporting scripts (run with bash)
|
|
142
|
+
- Additional documentation (read with read tool)
|
|
143
|
+
- Utilities specific to that skill
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
4. **Check for updates** (non-blocking)
|
|
147
|
+
- Quick git fetch with timeout
|
|
148
|
+
- Notify if updates available
|
|
149
|
+
|
|
150
|
+
### Plugin Structure
|
|
151
|
+
|
|
152
|
+
```javascript
|
|
153
|
+
// .opencode/plugin/superpowers.js
|
|
154
|
+
const skillsCore = require('../../lib/skills-core');
|
|
155
|
+
const path = require('path');
|
|
156
|
+
const fs = require('fs');
|
|
157
|
+
const { z } = require('zod');
|
|
158
|
+
|
|
159
|
+
export const SuperpowersPlugin = async ({ client, directory, $ }) => {
|
|
160
|
+
const superpowersDir = path.join(process.env.HOME, '.config/opencode/superpowers');
|
|
161
|
+
const personalDir = path.join(process.env.HOME, '.config/opencode/skills');
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
'session.started': async () => {
|
|
165
|
+
const usingSuperpowers = await readSkill('using-superpowers');
|
|
166
|
+
const skillsList = await findAllSkills();
|
|
167
|
+
const toolMapping = getToolMappingInstructions();
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
context: `${usingSuperpowers}\n\n${skillsList}\n\n${toolMapping}`
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
tools: [
|
|
175
|
+
{
|
|
176
|
+
name: 'use_skill',
|
|
177
|
+
description: 'Load and read a specific skill',
|
|
178
|
+
schema: z.object({
|
|
179
|
+
skill_name: z.string()
|
|
180
|
+
}),
|
|
181
|
+
execute: async ({ skill_name }) => {
|
|
182
|
+
// Implementation using skillsCore
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'find_skills',
|
|
187
|
+
description: 'List all available skills',
|
|
188
|
+
schema: z.object({}),
|
|
189
|
+
execute: async () => {
|
|
190
|
+
// Implementation using skillsCore
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## File Structure
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
superpowers/
|
|
202
|
+
├── lib/
|
|
203
|
+
│ └── skills-core.js # NEW: Shared skill logic
|
|
204
|
+
├── .codex/
|
|
205
|
+
│ ├── superpowers-codex # UPDATED: Use skills-core
|
|
206
|
+
│ ├── superpowers-bootstrap.md
|
|
207
|
+
│ └── INSTALL.md
|
|
208
|
+
├── .opencode/
|
|
209
|
+
│ ├── plugin/
|
|
210
|
+
│ │ └── superpowers.js # NEW: OpenCode plugin
|
|
211
|
+
│ └── INSTALL.md # NEW: Installation guide
|
|
212
|
+
└── skills/ # Unchanged
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Implementation Plan
|
|
216
|
+
|
|
217
|
+
### Phase 1: Refactor Shared Core
|
|
218
|
+
|
|
219
|
+
1. Create `lib/skills-core.js`
|
|
220
|
+
- Extract frontmatter parsing from `.codex/superpowers-codex`
|
|
221
|
+
- Extract skill discovery logic
|
|
222
|
+
- Extract path resolution (with shadowing)
|
|
223
|
+
- Update to use only `name` and `description` (no `when_to_use`)
|
|
224
|
+
|
|
225
|
+
2. Update `.codex/superpowers-codex` to use shared core
|
|
226
|
+
- Import from `../lib/skills-core.js`
|
|
227
|
+
- Remove duplicated code
|
|
228
|
+
- Keep CLI wrapper logic
|
|
229
|
+
|
|
230
|
+
3. Test Codex implementation still works
|
|
231
|
+
- Verify bootstrap command
|
|
232
|
+
- Verify use-skill command
|
|
233
|
+
- Verify find-skills command
|
|
234
|
+
|
|
235
|
+
### Phase 2: Build OpenCode Plugin
|
|
236
|
+
|
|
237
|
+
1. Create `.opencode/plugin/superpowers.js`
|
|
238
|
+
- Import shared core from `../../lib/skills-core.js`
|
|
239
|
+
- Implement plugin function
|
|
240
|
+
- Define custom tools (use_skill, find_skills)
|
|
241
|
+
- Implement session.started hook
|
|
242
|
+
|
|
243
|
+
2. Create `.opencode/INSTALL.md`
|
|
244
|
+
- Installation instructions
|
|
245
|
+
- Directory setup
|
|
246
|
+
- Configuration guidance
|
|
247
|
+
|
|
248
|
+
3. Test OpenCode implementation
|
|
249
|
+
- Verify session startup bootstrap
|
|
250
|
+
- Verify use_skill tool works
|
|
251
|
+
- Verify find_skills tool works
|
|
252
|
+
- Verify skill directories are accessible
|
|
253
|
+
|
|
254
|
+
### Phase 3: Documentation & Polish
|
|
255
|
+
|
|
256
|
+
1. Update README with OpenCode support
|
|
257
|
+
2. Add OpenCode installation to main docs
|
|
258
|
+
3. Update RELEASE-NOTES
|
|
259
|
+
4. Test both Codex and OpenCode work correctly
|
|
260
|
+
|
|
261
|
+
## Next Steps
|
|
262
|
+
|
|
263
|
+
1. **Create isolated workspace** (using git worktrees)
|
|
264
|
+
- Branch: `feature/opencode-support`
|
|
265
|
+
|
|
266
|
+
2. **Follow TDD where applicable**
|
|
267
|
+
- Test shared core functions
|
|
268
|
+
- Test skill discovery and parsing
|
|
269
|
+
- Integration tests for both platforms
|
|
270
|
+
|
|
271
|
+
3. **Incremental implementation**
|
|
272
|
+
- Phase 1: Refactor shared core + update Codex
|
|
273
|
+
- Verify Codex still works before moving on
|
|
274
|
+
- Phase 2: Build OpenCode plugin
|
|
275
|
+
- Phase 3: Documentation and polish
|
|
276
|
+
|
|
277
|
+
4. **Testing strategy**
|
|
278
|
+
- Manual testing with real OpenCode installation
|
|
279
|
+
- Verify skill loading, directories, scripts work
|
|
280
|
+
- Test both Codex and OpenCode side-by-side
|
|
281
|
+
- Verify tool mappings work correctly
|
|
282
|
+
|
|
283
|
+
5. **PR and merge**
|
|
284
|
+
- Create PR with complete implementation
|
|
285
|
+
- Test in clean environment
|
|
286
|
+
- Merge to main
|
|
287
|
+
|
|
288
|
+
## Benefits
|
|
289
|
+
|
|
290
|
+
- **Code reuse**: Single source of truth for skill discovery/parsing
|
|
291
|
+
- **Maintainability**: Bug fixes apply to both platforms
|
|
292
|
+
- **Extensibility**: Easy to add future platforms (Cursor, Windsurf, etc.)
|
|
293
|
+
- **Native integration**: Uses OpenCode's plugin system properly
|
|
294
|
+
- **Consistency**: Same skill experience across all platforms
|