Compare commits

..

4 Commits

Author SHA1 Message Date
Jesse Vincent
d525598b32 Add OpenCode native skills changes to release notes
Documents:
- Breaking change: switch to native skill tool
- Fix for agent reset bug (#226)
- Fix for Windows installation (#232)
2026-01-22 12:50:18 -08:00
Jesse Vincent
6491a1d9cf feat(opencode): use native skills and fix agent reset bug (#226)
- Replace custom use_skill/find_skills tools with OpenCode's native skill tool
- Use experimental.chat.system.transform hook instead of session.prompt
  (fixes #226 agent reset on first message)
- Symlink skills directory into ~/.config/opencode/skills/superpowers/
- Update installation docs with comprehensive Windows support:
  - Command Prompt, PowerShell, and Git Bash instructions
  - Proper symlink vs junction handling
  - Reinstall safety with cleanup steps
  - Verification commands for each shell
2026-01-22 12:50:18 -08:00
oribi
06dcd150ad fix: respect OPENCODE_CONFIG_DIR for personal skills lookup (#297)
* fix: respect OPENCODE_CONFIG_DIR for personal skills lookup

The plugin was hardcoded to look for personal skills in ~/.config/opencode/skills,
ignoring users who set OPENCODE_CONFIG_DIR to a custom path (e.g., for dotfiles management).

Now uses OPENCODE_CONFIG_DIR if set, falling back to the default path.

* fix: update help text to use dynamic paths

Use configDir and personalSkillsDir variables in help text so paths
are accurate when OPENCODE_CONFIG_DIR is set.

* fix: normalize OPENCODE_CONFIG_DIR before use

Handle edge cases where the env var might be:
- Empty or whitespace-only
- Using ~ for home directory (common in .env files)
- A relative path

Now trims, expands ~, and resolves to absolute path.
2026-01-22 12:47:18 -08:00
Vinicius da Motta
6354d817eb fix use_skill agent context (#290) 2026-01-22 12:47:18 -08:00
6 changed files with 5 additions and 110 deletions

View File

@@ -1,14 +0,0 @@
@echo off
setlocal
REM Windows shim for the extensionless Node.js launcher (superpowers-codex).
REM
REM Windows cannot execute extensionless scripts with shebangs, so this wrapper
REM invokes Node.js directly.
REM
REM Usage:
REM superpowers-codex.cmd bootstrap
REM superpowers-codex.cmd use-skill superpowers:brainstorming
REM superpowers-codex.cmd find-skills
node "%~dp0superpowers-codex" %*

17
.gitattributes vendored
View File

@@ -1,17 +0,0 @@
# Ensure shell scripts always have LF line endings
*.sh text eol=lf
# Ensure the polyglot wrapper keeps LF (it's parsed by both cmd and bash)
*.cmd text eol=lf
# Common text files
*.md text eol=lf
*.json text eol=lf
*.js text eol=lf
*.mjs text eol=lf
*.ts text eol=lf
# Explicitly mark binary files
*.png binary
*.jpg binary
*.gif binary

View File

@@ -36,20 +36,6 @@ Components:
The visual companion is opt-in and falls back gracefully to terminal-only operation.
### Bug Fixes
**Fixed Windows hook execution for Claude Code 2.1.x**
Claude Code 2.1.x changed how hooks execute on Windows: it now auto-detects `.sh` files in commands and prepends `bash `. This broke the polyglot wrapper pattern because `bash "run-hook.cmd" session-start.sh` tries to execute the .cmd file as a bash script.
Fix: hooks.json now calls session-start.sh directly. Claude Code 2.1.x handles the bash invocation automatically. Also added .gitattributes to enforce LF line endings for shell scripts (fixes CRLF issues on Windows checkout).
**Fixed Windows Codex launcher (#243, #285)**
Windows cannot execute extensionless scripts with shebangs, so the `superpowers-codex` script would either open an "Open with" dialog or produce no output in PowerShell.
Fix: Added `.codex/superpowers-codex.cmd` wrapper that invokes Node.js directly. Updated docs with Windows-specific installation and usage instructions.
### Improvements
**Instruction priority clarified in using-superpowers**

View File

@@ -19,27 +19,13 @@ Fetch and follow instructions from https://raw.githubusercontent.com/obra/superp
### Installation Steps
#### macOS / Linux
#### 1. Clone Superpowers
```bash
mkdir -p ~/.codex/superpowers
git clone https://github.com/obra/superpowers.git ~/.codex/superpowers
```
#### Windows
**Command Prompt:**
```cmd
mkdir "%USERPROFILE%\.codex\superpowers"
git clone https://github.com/obra/superpowers.git "%USERPROFILE%\.codex\superpowers"
```
**PowerShell:**
```powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex\superpowers"
git clone https://github.com/obra/superpowers.git "$env:USERPROFILE\.codex\superpowers"
```
#### 2. Install Bootstrap
The bootstrap file is included in the repository at `.codex/superpowers-bootstrap.md`. Codex will automatically use it from the cloned location.
@@ -48,20 +34,12 @@ The bootstrap file is included in the repository at `.codex/superpowers-bootstra
Tell Codex:
**macOS / Linux:**
```
Run ~/.codex/superpowers/.codex/superpowers-codex find-skills to show available skills
```
**Windows:**
```
Run ~/.codex/superpowers/.codex/superpowers-codex.cmd find-skills to show available skills
```
You should see a list of available skills with descriptions.
> **Note:** On Windows, always use the `.cmd` extension when running superpowers-codex commands.
## Usage
### Finding Skills
@@ -148,26 +126,12 @@ git pull
2. Check CLI works: `~/.codex/superpowers/.codex/superpowers-codex find-skills`
3. Verify skills have SKILL.md files
### CLI script not executable (macOS/Linux)
### CLI script not executable
```bash
chmod +x ~/.codex/superpowers/.codex/superpowers-codex
```
### Windows: "Open with" dialog or no output
On Windows, you must use the `.cmd` wrapper:
```cmd
~/.codex/superpowers/.codex/superpowers-codex.cmd find-skills
```
Or invoke with Node directly:
```cmd
node "%USERPROFILE%\.codex\superpowers\.codex\superpowers-codex" find-skills
```
### Node.js errors
The CLI script requires Node.js. Verify:
@@ -176,7 +140,7 @@ The CLI script requires Node.js. Verify:
node --version
```
Should show v14 or higher (v18+ recommended).
Should show v14 or higher (v18+ recommended for ES module support).
## Getting Help

View File

@@ -6,7 +6,7 @@
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start.sh"
}
]
}

View File

@@ -1,30 +1,6 @@
: << 'CMDBLOCK'
@echo off
REM ============================================================================
REM DEPRECATED: This polyglot wrapper is no longer used as of Claude Code 2.1.x
REM ============================================================================
REM
REM Claude Code 2.1.x changed the Windows execution model for hooks:
REM
REM Before (2.0.x): Hooks ran with shell:true, using the system default shell.
REM This wrapper provided cross-platform compatibility by
REM being both a valid .cmd file (Windows) and bash script.
REM
REM After (2.1.x): Claude Code now auto-detects .sh files in hook commands
REM and prepends "bash " on Windows. This broke the wrapper
REM because the command:
REM "run-hook.cmd" session-start.sh
REM became:
REM bash "run-hook.cmd" session-start.sh
REM ...and bash cannot execute a .cmd file.
REM
REM The fix: hooks.json now calls session-start.sh directly. Claude Code 2.1.x
REM handles the bash invocation automatically on Windows.
REM
REM This file is kept for reference and potential backward compatibility.
REM ============================================================================
REM
REM Original purpose: Polyglot wrapper to run .sh scripts cross-platform
REM Polyglot wrapper: runs .sh scripts cross-platform
REM Usage: run-hook.cmd <script-name> [args...]
REM The script should be in the same directory as this wrapper