Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
We are building a third-party plugin called hev that organizes OpenCode's already-discovered native Skills into user-defined Environments and binds one Environment to each OpenCode session. The plugin does not install, parse, or load Skill bodies. It only decides which native Skills the model should automatically see for the current session.
Today, plugins can contribute Skill sources, but they cannot filter the resolved, model-visible Skill catalog at runtime. Static agent permissions cannot represent a plugin-owned session-to-Environment binding. Post-processing the system prompt would also be fragile because the model-facing skill tool could bypass it.
Could the V2 plugin Skill API provide a session-scoped visibility hook, conceptually like this?
ctx.skill.visibility(async (event) => {
const allowed = await environmentSkills(event.sessionID)
event.skills = event.skills.filter((skill) => allowed.has(skill.name))
})The hook would receive the current session ID, agent ID, and resolved Skill list. Its result would be used consistently by both Skill guidance (<available_skills>) and the model-facing skill tool. This extension point could also support other plugins that manage Skill profiles, workspaces, or context budgets.
Compatibility boundaries:
- When no visibility hook is registered, current behavior remains unchanged.
- OpenCode continues to own native Skill discovery, permissions, and body loading.
- The hook only controls model-visible Skills; explicit user invocation such as
/skill-nameremains available. - Plugins own their session policy; no persisted OpenCode setting or HTTP API is required.
- No
hev-specific concept needs to enter OpenCode core.
This is related to #11972 and #33336, but distinct: those cover static frontmatter or agent-permission behavior, while this request enables dynamic, plugin-owned, per-session catalog selection.
Would this plugin extension point fit the project direction, and should an implementation currently target dev or v2? I would be happy to contribute it after design approval.
Activity
[-]Support session-scoped skill visibility in plugins[/-][+][FEATURE]: Support session-scoped skill visibility in plugins[/+][-][FEATURE]: Support session-scoped skill visibility in plugins[/-][+][FEATURE]: Let plugins filter model-visible Skills per session[/+]opencodejr commentedon Oct 28, 2026
Thanks for the detailed proposal! In short, you're asking for a session-scoped plugin hook that filters which already-discovered skills the model sees, applied the same way to
<available_skills>and to theskilltool, while/skill-namekeeps working. Maintainers will consider it.On your branch question: v2 now lives on
dev. Thev2branch was promoted todev, so that's the base for any work.In the meantime, you may be able to do most of this today with per-session permissions. Both the skill guidance (
Skill.available, which filters by theskillpermission) and theskilltool (permission.assert({ action: "skill", resources: [skill.id], sessionID })) check the same ruleset: the agent's rules plusSession.Info.permissions, which are evaluated last. A plugin can write that ruleset withctx.session.update. Here is a rough sketch; it type-checks against the plugin package but I haven't tested it end to end:It uses only deny rules, so it never re-allows a skill that an agent's config denies. Its limits are the reasons a real hook would still help:
permission.evaluatehook only affects tool calls. It can't hide entries from<available_skills>.Related issues: