anomalyco / anomalyco/opencode
plugins: skill transforms cannot filter skills by active child project
@rekram1-node is already working on this.
Since Sep 4, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
A plugin cannot filter globally discovered skills according to the active project. Globally installed plugins are initialized for the home location, while plugins inherited from a parent directory are bound to that parent rather than the active child repository.
This prevents implementing a policy that exposes built-in and project-local skills while hiding global compatibility skills inside project workspaces.
Environment
- opencode version:
0.0.0-beta-19086 - OS: Linux 7.1.9-arch1-2 x86_64
- Terminal: Ghostty (
TERM=xterm-256color,COLORTERM=truecolor) - Shell:
/usr/bin/zsh - Install/channel: V2 beta
- Active plugins: local
painterandbreakdownplugins; an unrelatedherdr-agent-state.jsplugin is present but currently fails to load
Reproduction
- Install a global plugin under
~/.config/opencode/plugins/that registersctx.skill.transform(...). - In
setup, inspectctx.locationand attempt to remove global skills only whenctx.location.project.canonicalis below~/Projects. - Open
~/Projects/example. - Observe that the plugin was initialized with
/home/<user>rather than the active project, so the project condition does not match. - Alternatively, place the plugin in
~/Projects/.opencode/plugins/and open~/Projects/example. - Observe that the plugin context and skill transform are bound to
~/Projects; the transform does not affect the child repository’s skill registry. - Querying
/api/skillfor the child location still returns global skills from~/.claude/skillsand~/.agents/skillsalongside project-local skills.
Expected Behavior
A plugin inherited or configured for an active project should be able to transform that project’s skill registry. Either plugin instances should receive the active leaf location, or skill transforms should expose the location whose registry is being edited.
This should allow preserving /builtin/* and skills under the active project while removing user-level skills for that project only.
Actual Behavior
The plugin context is bound to the location from which the plugin was initially loaded. Its skill transform does not apply to an active child project’s separate skill registry, making location-aware skill policies impossible from a global or parent plugin.
The global skills remain visible in the skills dialog and model-facing discovery.
Additional Context
The desired policy was:
- Keep OpenCode built-in skills.
- Keep skills defined inside the active project, such as
<project>/.agents/skills/shadcn. - Hide global skills from
~/.agents/skillsand~/.claude/skillsonly while working inside~/Projects. - Keep those global skills available outside project workspaces.
Adding more source-directory checks does not solve the issue because the transform is not applied to the active child location. Loading the plugin globally and from ~/Projects were both tested consistently.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.