Skip to content

feat: add OpenCode plugin support (0.7.4) - #27

Merged
keli-wen merged 4 commits into
masterfrom
feat/opencode-plugin
Oct 3, 2026
Merged

keli-wen merged 4 commits into
masterfrom
feat/opencode-plugin

Conversation

@keli-wen

@keli-wen keli-wen commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

What

Add OpenCode support as a native plugin with seven agy--prefixed skills, sharing the existing companion and prompt templates. Install through opencode plugin, restart, and invoke /agy-<persona> or /agy-jobs.

Closes #26.

Why

OpenCode uses a flat skill-name space and a different plugin entrypoint. It needs branded entrypoints and automatic package registration, while keeping the same canonical workflows and avoiding manual skill-path configuration.

Design

  • One source of truth: use the shared scripts/generate-skills.mjs generator with Pi and OpenCode target configurations for output directory, naming, invocation syntax, metadata removal, and appended compatibility guidance. Generate opencode-skills/ from canonical skills/, adapting names, invocation tokens, resource paths, and host metadata. Existing Pi outputs stay unchanged.
  • Preserve workflow prose: append the same templates/harness-compatibility.md guidance used by Pi; share companion code, prompt templates, and reference assets.
  • Keep installation lightweight: a dependency-free package entrypoint registers the bundled skills directory. OpenCode provides the same-named slash commands; no command wrappers, tool bridge, or scheduler are added.
  • Support native Git installation: remove prepack, whose presence makes pacote spawn nested npm inside OpenCode’s compiled runtime and fail Git dependency preparation. pack:checked validates before creating an archive, prepublishOnly validates publishing, and CI still checks generated files. A regression verifies that stale output fails before archive creation.
  • Follow existing packaging and documentation patterns: mark generated files for GitHub, check both targets in the existing consistency job, and update the paired English/Chinese docs and agent installation guide. Keep real-host tests opt-in.

Verification

  • npm test: 198 passed, 0 failed, including generated-content, package-resource, plugin-registration, and fake-agy lifecycle checks.
  • npm run check:skills: generated files current; existing Pi outputs unchanged. npm run pack:checked and git diff --check passed.
  • OpenCode 1.18.34: isolated native installation of an actual npm archive and Git fixture, verified config replacement, seven skills and native commands, coexistence with an unrelated reviewer skill/command, and valid resource paths.
  • Installed the pushed commit directly from public GitHub with opencode plugin ... --global; all seven skills and installed companion paths were verified.
  • Packed-artifact tests exercise fake-agy ask and background job collection from another project directory.
  • The automated suites above use no model/provider calls. Separate live model checks are recorded below.

Live verification

Tested on macOS with OpenCode 1.18.34, the real Antigravity CLI 1.2.11, and DeepSeek as the OpenCode host model. The plugin was installed from the public GitHub commit through opencode plugin; OpenCode settings/cache and the task repository were disposable. Existing credentials were used without being copied into the repository or PR.

Invocation Observed result
/agy-ask Host executed the installed companion, real AGY returned AGY_OPENCODE_LIVE_OK, and the host relayed it (15.8 s).
/agy-staffer Dispatched a real background job, waited for done, and returned the verification code from a fixture file (37.8 s).
/agy-implementer Dispatched a real implementation job, corrected a subtraction bug in sum.mjs, collected its result, and independently reran node sum.test.mjs successfully (37.6 s). The original test and unrelated fixture stayed byte-identical; no commit was made.

The requested legacy model ID deepseek-v4-flash was rejected by OpenCode's current model catalog before any AGY execution. The successful runs used deepseek/deepseek-flash (current V4.1 Flash). DeepSeek's official model documentation says V4 Flash is retired and legacy API names route to V4.1 Flash. These results therefore do not claim a test of the retired V4 weights. The ask check preceded the generator-only refactor; staffer and implementer ran from commit 373b7cc, whose generated skills and companion are unchanged.

Compatibility

Targets OpenCode >=1.18.34 <2; V2 support is not claimed. Git-backed plugin updates use a new tag or commit reference because OpenCode caches previously installed specs. Node.js and an installed, authenticated Antigravity CLI remain prerequisites.

Release

Targets 0.7.4. Package, Claude Code, and Codex manifests are bumped together, with docs/releases/v0.7.4.md following the existing release-note format. No extra OpenCode-specific workflow appendix is added. The release-only changes passed all 10 Pi/OpenCode packaging tests and generated-skill consistency checks.

Try this PR

opencode plugin 'agy-staff@git+https://github.com/keli-wen/agy-staff.git#5cca91fed6a99f3cceb30f37c60844d99289f777' --global

Restart OpenCode, then run /agy-ask reply with OK.

@keli-wen keli-wen changed the title feat: add OpenCode plugin support feat: add OpenCode plugin support (0.7.4) Oct 3, 2026
@keli-wen
keli-wen merged commit 9a30e07 into master Oct 3, 2026
2 of 3 checks passed
@keli-wen keli-wen self-assigned this Oct 3, 2026
@keli-wen keli-wen added the enhancement New feature or request label Oct 3, 2026
@keli-wen
keli-wen deleted the feat/opencode-plugin branch October 6, 2026 16:29

This branch is waiting to be deployed

1 waiting deployment
manual-tests — 5cca91fe Waiting Oct 3, 2026 by keli-wen via Tests (Windows) #105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

请求加入opencode支持

1 participant