anomalyco / anomalyco/opencode

plugins: skill transforms cannot filter skills by active child project

Open
#47,285 0 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 4, 2026.

2.0
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 painter and breakdown plugins; an unrelated herdr-agent-state.js plugin is present but currently fails to load

Reproduction

  1. Install a global plugin under ~/.config/opencode/plugins/ that registers ctx.skill.transform(...).
  2. In setup, inspect ctx.location and attempt to remove global skills only when ctx.location.project.canonical is below ~/Projects.
  3. Open ~/Projects/example.
  4. Observe that the plugin was initialized with /home/<user> rather than the active project, so the project condition does not match.
  5. Alternatively, place the plugin in ~/Projects/.opencode/plugins/ and open ~/Projects/example.
  6. Observe that the plugin context and skill transform are bound to ~/Projects; the transform does not affect the child repository’s skill registry.
  7. Querying /api/skill for the child location still returns global skills from ~/.claude/skills and ~/.agents/skills alongside 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/skills and ~/.claude/skills only 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.