Skip to content

feat(plugin): expose skills API to plugins via PluginInput.skills#29356

Open
sjawhar wants to merge 1 commit into
anomalyco:devfrom
sjawhar:feat/plugin-skills-api
Open

feat(plugin): expose skills API to plugins via PluginInput.skills#29356
sjawhar wants to merge 1 commit into
anomalyco:devfrom
sjawhar:feat/plugin-skills-api

Conversation

@sjawhar
Copy link
Copy Markdown

@sjawhar sjawhar commented May 26, 2026

Issue for this PR

Closes #18688

Re-submission of #18686 (closed by automated cleanup), rebased onto current dev. The previous PR could not be reopened because the branch has been force-pushed since closure.

Type of change

  • Bug fix
  • New feature

What does this PR do?

Exposes the native skills API (skill.all(), skill.get(name), skill.dirs()) to plugins via PluginInput.skills, matching the feature request in #18688. This lets plugins discover and reason about user-defined skills the same way the agent runtime does.

How did you verify your code works?

New test/plugin/native-skills.test.ts covers the plugin-input surface end-to-end. Adjacent tests updated to provide the new Skill layer dependency. bun typecheck passes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Provide Skill.Service in Plugin.layer so EffectBridge captures it
in the closure. Without this, external plugins calling input.skills.*
would fail with 'Service not found: @opencode/Skill' because the bridge
captures Effect.context() at layer construction time, before the runtime
provides Skill.

Fix the bridged callbacks to use the captured 'skill' service directly
rather than re-looking up Skill.Service inside bridge.promise.

Add Skill.defaultLayer to Plugin.defaultLayer so the dependency is
self-contained for the new skills API. Update test layers in
loader-shared.test.ts and auth-override.test.ts to provide Skill alongside
the bare Plugin.layer they construct directly.

Also remove the global OPENCODE_DISABLE_DEFAULT_PLUGINS=true from
test/preload.ts — hoisting it to the global preload broke any test that
relies on default plugins being loaded (digitalocean router synthesis,
session.llm OpenAI tests). The skill-specific tests that need plugins
disabled (loader-shared, native-skills) set the env var themselves with
proper afterAll cleanup, so removing the global default doesn't affect
them.
@legion-implementer legion-implementer Bot force-pushed the feat/plugin-skills-api branch from a1bef44 to 28db1bc Compare May 26, 2026 09:00
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.

[FEATURE]: Expose native skill discovery to plugins via PluginInput.skills

1 participant