mirror of
https://github.com/obra/superpowers.git
synced 2026-09-28 09:42:11 +00:00
18 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
01c004da99 |
fix(opencode): strip quote pairs after joining multi-line frontmatter values
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
1eae439437 | docs(opencode): describe supported V2 setup and bootstrap behavior | ||
|
|
2c4dcd851a | fix(opencode): retain bootstrap after native compaction | ||
|
|
96ecdeb0fa | fix(opencode): retry unsuccessful child-session lookups | ||
|
|
07f9d6f6fc |
fix(opencode): register skills with Skill.Info 2.0.4 path field; contain per-skill add failures
Reported on PR #2106 (80avin): on OpenCode v2.0.4 the plugin is disabled at startup with "Plugin disabled after skill.transform failed", losing both skill registration and bootstrap injection. Root cause: upstream commit 199aabe9e2 (first released in v2.0.4) renamed Skill.Info's required file field `location` -> `path` and removed `slash`. draft.add() decodes payloads with Schema.decodeUnknownSync against that schema, so our `location` payloads now fail decode with "Missing key path". Why the failure was silent: the decode error is thrown during the host's state rebuild, where the State layer catches it and hard-disables the whole plugin group asynchronously - the throw never reaches the try/catch around ctx.skill.transform(), and the session "context" hook is torn down as collateral. Fix: - skill payloads now use `path` (2.0.4 contract); no v2.0.3 compatibility retained per review decision - draft.add() failures are contained per skill inside the transform callback, so one rejected payload skips that skill (visible in server logs) instead of the host disabling the entire plugin - new test-skill-registration unit test pins the 2.0.4 payload contract (absolute path field, no stale location/slash, hostile-add containment) and is registered in run-tests.sh; full suite 3/3 green |
||
|
|
4996eb00bd |
fix(opencode): align V2 tool mapping with the 2.0.3 catalog; harden plugin internals
- V2 bootstrap mapping now teaches write/edit/websearch (verified against a live v2.0.3 /api/plugin tool catalog) instead of routing all file mutation through patch - frontmatter parser tolerates CRLF and YAML block scalars/continuation lines - child-session cache is bounded (512 entries, oldest-quarter eviction) - INSTALL.md and docs/README.opencode.md tool tables synced to the 2.0.3 catalog; unit-test needle list extended to cover the new tools |
||
|
|
ca380ba488 |
fix(opencode): differentiate tool mapping by host flavor and harden child detection
Current opencode2 builds renamed the model-facing tools (bash→shell,
task→subagent with `agent` instead of `subagent_type`, apply_patch→
patch/patchText) and removed todowrite entirely, so the single v1
mapping injected on v2 hosts taught the model stale tool names.
- export V1_MAPPING/V2_MAPPING and inject the flavor-correct one on
each path (v1 messages.transform → V1; v2 ctx.session.hook("context")
→ V2, incl. no-todo-tool guidance and sessionID continuation)
- child-session detection now keys on parentID presence (primary
signal on both flavors) with dual-shape unwrapping preserved; v1
#2160 behavior unchanged
- mirror surfaces updated: INSTALL.md dual mapping tables,
README.opencode.md host-flavor notes, test-bootstrap-caching.mjs
asserts both mappings + drives the v2 context hook end-to-end
- skills: add OpenCode to executing-plans' subagent-capable list,
accurate OpenCode worktree status (git fallback; TUI dialogs are
user-side only), generalized live-subagent resume guidance
|
||
|
|
5c0ac7ee00 |
fix(opencode): skip controller bootstrap in task subagent sessions (#2160)
Detect child sessions structurally via session parentID instead of
relying on the model honoring <SUBAGENT-STOP>:
- V1: sessionID from firstUser.info.sessionID (hook input is empty at
runtime), parentID via client.session.get({path:{id}})
- V2: sessionID from the context-hook event, parentID via
ctx.session.get({sessionID})
Decision cached per session; lookup failures fail open (previous
behavior) and are not cached. Skills registration is unaffected, so
workers keep explicit access to execution skills.
|
||
|
|
ca8cb53f46 |
fix(opencode): skip V2 setup when V1 invokes it with a V1-shaped ctx
opencode 1.18.18 also calls default.setup, but with a ctx that lacks the skill/session domains, so the defensive try/catch logged a TypeError into every V1 session transcript even though V1 is fully served by the SuperpowersPlugin named export. Detect the V1 shape and return quietly. |
||
|
|
6e31f3f7db |
fix(opencode): adapt to V2 skill draft API removal (#2106)
OpenCode V2 removed SkillDraft.source() in 1113adfd5e (#41622): the skill service now stores values only, and filesystem scanning moved to the config side. The plugin's draft.source({type:'directory'}) call threw 'draft.source is not a function', which killed the entire V2 plugin activation generation. Because V2 gates model.list on PluginSupervisor.flush (23b0688a7f, #41783), that failure left flush pending forever and the TUI showed no providers or models ('Model catalog initialization timed out', /api/model 503). Register each skills/<name>/SKILL.md as a native Skill.Info object via draft.add({id, name, description, location, content}) instead, matching the {list, add, update, remove} draft API and the pattern used by V2's built-in skill plugin. Wrap skill registration, hook registration, and the context hook callback in try/catch so a future V2 API change degrades to a logged error instead of taking down the whole generation again. session.hook('context') payload shape is unchanged and keeps working. Verified end-to-end on opencode2 v0.0.0-beta-17595: 24 skills listed via /api/skill (all superpowers skills present), /api/model returns 83 models across 3 providers, no 'failed to reload plugins' in server logs. V1 path untouched. |
||
|
|
2ee6281747 |
feat(opencode): add V2 (opencode2) plugin compatibility
Add dual V1/V2 support to the OpenCode plugin. The same source file now
works on both OpenCode V1 (opencode) and V2 (opencode2) without version
detection at runtime.
V2 changes:
- Add default export { id, server, setup } for V2 PluginSupervisor
- setup() registers skills via ctx.skill.transform() (V2 native API)
- setup() injects bootstrap via ctx.session.hook('context') (V2 equivalent
of V1's experimental.chat.messages.transform)
- config hook guards against V2 array-format skills to avoid conflicts
Both APIs confirmed active at runtime via diagnostics in the V2 beta.
No external dependencies added — pure JavaScript throughout.
Docs updated with V2 install instructions, OPENCODE_CONFIG_DIR side-by-side
setup, and accurate How It Works section for both versions.
|
||
|
|
f030d6ef88 | Tighten cross-platform tool references | ||
|
|
f2cbfbefeb |
Release v5.1.0 (#1468)
* docs: add Codex App compatibility design spec (PRI-823) Design for making using-git-worktrees, finishing-a-development-branch, and subagent-driven-development skills work in the Codex App's sandboxed worktree environment. Read-only environment detection via git-dir vs git-common-dir comparison, ~48 lines across 4 files, zero breaking changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: address spec review feedback for PRI-823 Fix three Important issues from spec review: - Clarify Step 1.5 placement relative to existing Steps 2/3 - Re-derive environment state at cleanup time instead of relying on earlier skill output - Acknowledge pre-existing Step 5 cleanup inconsistency Also: precise step references, exact codex-tools.md content, clearer Integration section update instructions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: address team review feedback for PRI-823 spec - Add commit SHA + data loss warning to handoff payload (HIGH) - Add explicit commit step before handoff (HIGH) - Remove misleading "mark as externally managed" from Path B - Add executing-plans 1-line edit (was missing) - Add branch name derivation rules - Add conditional UI language for non-App environments - Add sandbox fallback for permission errors - Add STOP directive after Step 0 reporting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: clarify executing-plans in What Does NOT Change section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add cleanup guard test (#5) and sandbox fallback test (#10) to spec Both tests address real risk scenarios: - #5: cleanup guard bug would delete Codex App's own worktree (data loss) - #10: Local thread sandbox fallback needs manual Codex App validation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add implementation plan for Codex App compatibility (PRI-823) 8 tasks covering: environment detection in using-git-worktrees, Step 1.5 + cleanup guard in finishing-a-development-branch, Integration line updates, codex-tools.md docs, automated tests, and final verification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(codex-tools): add named agent dispatch mapping for Codex (#647) * fix(writing-skills): correct false 'only two fields' frontmatter claim (#882) * Replace subagent review loops with lightweight inline self-review The subagent review loop (dispatching a fresh agent to review plans/specs) doubled execution time (~25 min overhead) without measurably improving plan quality. Regression testing across 5 versions (v3.6.0 through v5.0.4) with 5 trials each showed identical plan sizes, task counts, and quality scores regardless of whether the review loop ran. Changes: - writing-plans: Replace subagent Plan Review Loop with inline Self-Review checklist (spec coverage, placeholder scan, type consistency) - writing-plans: Add explicit "No Placeholders" section listing plan failures (TBD, vague descriptions, undefined references, "similar to Task N") - brainstorming: Replace subagent Spec Review Loop with inline Spec Self-Review (placeholder scan, internal consistency, scope check, ambiguity check) - Both skills now use "look at it with fresh eyes" framing Testing: 5 trials with the new skill show self-review catches 3-5 real bugs per run (spawn positions, API mismatches, seed bugs, grid indexing) in ~30s instead of ~25 min. Remaining defects are comparable to the subagent approach. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Revert "Replace subagent review loops with lightweight inline self-review" This reverts commit |
||
|
|
0a1124ba53 |
fix(opencode): inject bootstrap as user message instead of system message
Move bootstrap injection from experimental.chat.system.transform to experimental.chat.messages.transform, prepending to the first user message instead of adding a system message. This avoids two issues: - System messages repeated every turn inflate token usage (#750) - Multiple system messages break Qwen and other models (#894) Tested on OpenCode 1.3.2 with Claude Sonnet 4.5 — brainstorming skill fires correctly on "Let's make a React to do list" prompt. |
||
|
|
2d942f3b01 |
fix(opencode): align skills path across bootstrap, runtime, and tests
The bootstrap text advertised a configDir-based skills path that didn't match the runtime path (resolved relative to the plugin file). Tests used yet another hardcoded path and referenced a nonexistent lib/ dir. - Remove misleading skills path from bootstrap text; the agent should use the native skill tool, not read files by path - Fix test setup to create a consistent layout matching the plugin's ../../skills resolution - Export SUPERPOWERS_SKILLS_DIR from setup.sh so tests use a single source of truth - Add regression test that bootstrap doesn't advertise the old path - Remove broken cp of nonexistent lib/ directory Fixes #847 |
||
|
|
f4b54a1717 |
Auto-register skills from plugin, simplify OpenCode install to one line
The plugin's new `config` hook injects the skills directory into OpenCode's live config singleton, so skills are discovered automatically without symlinks or manual config edits. Installation is now just adding one line to opencode.json: "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"] Rewrote docs/README.opencode.md and .opencode/INSTALL.md to reflect the new approach, removing ~200 lines of platform-specific symlink instructions. Added migration notes for existing users. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
c070e6bd45 |
fix(opencode): correct TodoWrite tool mapping to todowrite
TodoWrite maps to OpenCode's built-in `todowrite` tool, not `update_plan`. Verified against OpenCode source (packages/opencode/src/tool/todo.ts). Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> |
||
|
|
03087b13b8 |
fix(opencode): standardize on plugins/ directory per official docs
OpenCode officially documents ~/.config/opencode/plugins/ (plural) as the plugin directory. Our docs previously used plugin/ (singular), which also works but caused confusion. Changes: - Renamed .opencode/plugin/ to .opencode/plugins/ in repo structure - Updated INSTALL.md to use plugins/ everywhere - Updated README.opencode.md (all platforms: Linux, macOS, Windows CMD, PowerShell, Git Bash) to use plugins/ - Updated test scripts to match Tested: Both singular and plural forms work, but we now match official docs. Fixes #343 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |