Skip to content

fix(opencode): expose skills through v1 and v2 plugin APIs - #1547

Open
ucirello wants to merge 4 commits into
EveryInc:mainfrom
ucirello:fix/opencode-v1-v2-plugin
Open

fix(opencode): expose skills through v1 and v2 plugin APIs#1547
ucirello wants to merge 4 commits into
EveryInc:mainfrom
ucirello:fix/opencode-v1-v2-plugin

Conversation

@ucirello

@ucirello ucirello commented Aug 26, 2026

Copy link
Copy Markdown

Summary

One plugin declaration now exposes Compound Engineering skills through both OpenCode plugin APIs. In OpenCode v2, slash commands attach the selected skill natively and pass command arguments as prompt text, instead of asking the model to issue a separate Load and execute... request.

Design Decisions

  • The v1 config hook adds the bundled skills path and creates slash-command wrappers.
  • The v2 setup registers skill definitions through the current draft API and falls back to the older embedded-source API.
  • A v2 command such as /ce-plan add OAuth login sends text: "add OAuth login" and skills: [{ id: "ce-plan" }]. Existing prompt attachments are preserved and the selected skill is not duplicated.
  • Skill frontmatter is removed before registration while the skill's real location is retained, so OpenCode can resolve supporting files relative to the skill.
  • Skills marked non-user-invocable do not receive slash commands.

New concepts

Native v2 skill attachments

OpenCode v2 can attach a skill by ID when submitting a prompt. OpenCode then loads the skill content and supporting files from the registered skill location. This keeps the user request separate from the skill instructions and avoids a model-mediated skill-loading turn. Use this pattern when a command is a thin entry point to a registered skill. It is not a copy of the skill body into a command template.

Validation

  • bun test tests/opencode-plugin-commands.test.ts - 9 passed.
  • bun run release:validate - passed.
  • OpenCode v1 1.18.23 - interactive slash menu verified with Compound Engineering skills.
  • OpenCode v2 0.0.0-beta-18314 - standalone startup loaded the repository plugin and reached the interactive TUI; native skill-command behavior was manually verified.
  • bun run test - not completed within 360 seconds; it remained in tests/skills/ce-work-cross-model-routes.test.ts.
  • bun run typecheck and bun run lint - not configured in this repository.

Security Disclosure

The plugin reads bundled SKILL.md files and passes their registered locations and content to OpenCode. No new shell execution, credential handling, permission rules, or dependencies were introduced.

Agent Disclosure

  • Model: OpenCode · openai/gpt-5.6-luna

@ucirello ucirello changed the title DNR: fix(opencode): support v1 and v2 plugin loading fix(opencode): support v1 and v2 plugin loading Aug 26, 2026
@ucirello
ucirello marked this pull request as ready for review August 26, 2026 23:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2c46d5c50

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .opencode/plugins/compound-engineering.js
@ucirello ucirello changed the title fix(opencode): support v1 and v2 plugin loading fix(opencode): expose skills through v1 and v2 plugin APIs Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant