Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): discover skills from installed plugins #6453

ClosedMoinax(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/6453/headopened View on GitHub

What Changed

Claude skill discovery now also reads the roots contributed by installed plugins, so plugin skills reach the $ picker under the <plugin>:<skill> name Claude Code resolves.

Two files plus a doc line, no new dependency, no contract or UI change.

Why

Fixes #5622. discoverClaudeSkills scanned <config dir>/skills and the workspace only. Every skill installed through a plugin was therefore invisible in the picker — on my machine, 8 skills out of 52 were discoverable, and the issue reports the same for mattpocock-skills.

Four decisions worth explaining, since none of them is obvious from the diff:

Read installed_plugins.json, don't glob the plugin tree. A marketplace checkout carries skills for every plugin it offers, not just the ones installed. Globbing would fill the picker with skills the CLI refuses to load — worse than missing them, because selecting one fails at send time.

Skip what the CLI would not load, for the same reason. A plugin can be installed and switched off in settings.json, and an install can be project-scoped to a different workspace. Neither loads, so neither belongs in the picker. On my machine that is 39 phantom entries — sentry, vercel and friends — kept out.

Try three candidate paths per plugin. The install record does not say where a plugin's skills live, and three layouts exist in the wild: a cached install, a plugin inside a marketplace checkout, and a marketplace whose root is the plugin. installPath alone is not enough — it is stale for directory-sourced marketplaces. The first candidate that actually yields skills wins, so a layout that does not exist costs one listing.

Read both the conventional folder and the manifest. skills/<name> is the usual layout, and a plugin manifest may point at skills kept elsewhere in the tree. mattpocock-skills buckets every one of its own under skills/<category>/<name>, which a scan of skills/* never reaches — 25 skills, all of them invisible without this. A manifest entry names one skill folder, or a folder of them when it carries no SKILL.md of its own; both shapes ship today, and guessing wrong drops the skills silently rather than loudly.

Prefix the names. Claude Code exposes a plugin's skill as <plugin>:<skill>, and the composer sends the name straight back to the provider — an unprefixed ponytail is not a name the CLI resolves.

Manifests are user-editable JSON with no schema guarantee, so every field is narrowed (asRecord / asString) rather than asserted; a malformed manifest yields no roots instead of throwing.

UI Changes

None — no new surface, no layout change. The observable difference is that skills which were already installed now appear in the existing $ picker.

Test plan

  • Rebased onto main, which resolves the conflict with #5488 (.agents/skills); plugin roots slot in between the user root and the workspace ones, so precedence stays user → plugins → .agents → .claude.
  • apps/server — vp run typecheck: no errors.
  • apps/server — vp test run src/provider/Drivers/ClaudeSkills.test.ts: 12 passed (10 pre-existing, 2 new).
  • The new cases build plugin trees in a temp dir. One asserts a manifest-declared skill nested under skills/<category>/<name> is found while an undeclared sibling is not, and that a manifest naming a folder of skills is read as one; the other asserts a plugin switched off in settings.json and an install owned by another workspace both stay out, while a project-scoped install for this workspace comes in — and, for a plugin installed both ways, that the project entry wins even though the user entry is listed first.
  • Lint clean on both files.
  • Verified end to end against my real config: 8 → 52 skills discovered, matching exactly what the CLI itself loads in that workspace, and invoking a prefixed skill from the picker works.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes — n/a, no UI change
  • I included a video for animation/interaction changes — n/a

Updated to address the review findings: nested plugin skills are now discovered through the manifest, and install scope no longer leaks across projects. The disabled-plugin filter came along with the second one — same class of bug, and the larger half of it in practice. The second round added manifest-entry tolerance and most-specific-install precedence; the two findings I left alone are answered inline.

Written with Claude Opus 5 in T3 Code.

Note

Discover skills from installed Claude plugins and prefix them as <plugin>:<skill>

  • Extends discoverClaudeSkills in ClaudeSkills.ts to read installed_plugins.json and known_marketplaces.json, locate skill directories contributed by each plugin, and surface them with a <plugin>:<skill> name prefix.
  • Respects enabledPlugins settings from global and workspace-level config files; plugins explicitly disabled or installed for a different workspace are excluded.
  • Precedence order is now: user skills → plugin skills → workspace skills (.agents then .claude).
  • Behavioral Change: plugin skills now appear between user and workspace skills in the collision precedence chain, which may change which definition wins when names conflict.
Macroscope summarized 13519c2.

Note

Medium Risk Adds substantial filesystem and JSON parsing on the provider snapshot path; mistakes could surface wrong or unusable skill names, but behavior is best-effort with tests and no contract/UI changes.

Overview Claude skill discovery now includes skills from installed Claude Code plugins so they show up in the $ picker with the same <plugin>:<skill> names the CLI uses.

discoverClaudeSkills reads installed_plugins.json and known_marketplaces.json, merges enabledPlugins from user and workspace settings, and only surfaces plugins the CLI would load (not disabled, not another project’s local install). For each plugin it tries installPath, marketplace plugins/<name>, and marketplace root until it finds skills; it scans skills/* and manifest paths in plugin.json / .claude-plugin/plugin.json, including nested or folder-declared skills. Precedence is user → plugins → .agents → .claude, with project skills still winning on collisions.

User docs describe plugin skills and naming. New tests cover the three install layouts, manifest-only paths, and enablement / workspace scoping.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 13519c2760bee9691c45b80c38febeb4b97db5b6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 63a11ef4-5643-4a52-ac89-df7a927169b6

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds new functionality to discover skills from installed plugins, introducing substantial new runtime behavior and ~400 lines of logic for plugin manifest parsing and scope resolution. Combined with this being the author's first contribution, human review is warranted.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 397c4934afe2c88ea45d1b1dc5abad9bbf64c911. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. Note: GPT-6 on behalf of shivam (@shivamhwp).

      Installed plugins are not enabled by default. With enabled@shop, unmentioned@shop, and disabled@shop installed, and settings containing only enabled@shop: true and disabled@shop: false, Claude Code 2.1.268 publishes only the enabled plugin. This PR also exposes unmentioned because it skips only explicit false.

      Require enabledPlugins[key] === true after merging settings. Update the layout fixtures to explicitly enable the plugins they expect to discover; otherwise they encode the incorrect default. Preserve current main's skill identity, invocation flags, overrides, root selection and collision precedence when rebasing this change.

    6. Following up on @shivamhwp's enablement report. I reproduced the behavior and prepared a small patch against 13519c2760bee9691c45b80c38febeb4b97db5b6.

      With otherwise identical installed-plugin fixtures, Claude Code 2.1.268 exposes no plugin commands when the enabledPlugins entry is missing or false. Setting it to true exposes the skill. The patch changes the admission check and adds the missing-entry case to the existing test. Other fixtures explicitly enable their plugins so the installation and workspace-scope assertions remain meaningful.

      The regression failed with the extra unmentioned:unmentioned skill before the change. All 12 tests in ClaudeSkills.test.ts passed afterward. This used an isolated Vitest 4.1.10 runner with Node 24.18.1 and matching Effect 4.0.0-beta.103 packages against the actual source files. The repository's Vite Plus wrapper was not exercised because the workspace dependency install stalled. The Claude check used SDK initialization without sending a model prompt.

      Patch against the current PR head, two files and 22 changed lines
      diff --git a/apps/server/src/provider/Drivers/ClaudeSkills.test.ts b/apps/server/src/provider/Drivers/ClaudeSkills.test.ts
      index a0f1c5305..23cb5ddd8 100644
      --- a/apps/server/src/provider/Drivers/ClaudeSkills.test.ts
      +++ b/apps/server/src/provider/Drivers/ClaudeSkills.test.ts
      @@ -346,6 +346,12 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => {
               path.join(pluginsDir, "known_marketplaces.json"),
               json(`{'shop':{'installLocation':'${shop}'},'flat':{'installLocation':'${flat}'}}`),
             );
      +      yield* fs.writeFileString(
      +        path.join(configDir, "settings.json"),
      +        json(
      +          "{'enabledPlugins':{'cached@shop':true,'nested@shop':true,'flat@flat':true,'empty@nowhere':true,'unwanted@shop':true}}",
      +        ),
      +      );
       
             // A marketplace plugin nobody installed must stay out of the picker.
             yield* writeSkill(path.join(shop, "plugins", "unwanted", "skills"), "nope", "---\n---\n");
      @@ -411,6 +417,10 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => {
                 'folder@shop':[{'installPath':'${folder}'}]
               }}`),
             );
      +      yield* fs.writeFileString(
      +        path.join(configDir, "settings.json"),
      +        json("{'enabledPlugins':{'bucketed@shop':true,'rooted@shop':true,'folder@shop':true}}"),
      +      );
       
             const skills = yield* discoverClaudeSkills({ homePath: configDir }, undefined, {});
       
      @@ -424,7 +434,7 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => {
           }),
         );
       
      -  it.effect("skips plugins switched off in settings and installs owned by another workspace", () =>
      +  it.effect("skips plugins not enabled in settings and installs owned by another workspace", () =>
           Effect.gen(function* () {
             const fs = yield* FileSystem.FileSystem;
             const path = yield* Path.Path;
      @@ -441,6 +451,7 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => {
             });
             const on = yield* install("on");
             const off = yield* install("off");
      +      const unmentioned = yield* install("unmentioned");
             const mine = yield* install("mine");
             const theirs = yield* install("theirs");
             const everywhere = yield* install("everywhere");
      @@ -448,7 +459,9 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => {
       
             yield* fs.writeFileString(
               path.join(configDir, "settings.json"),
      -        json("{'enabledPlugins':{'on@shop':true,'off@shop':false}}"),
      +        json(
      +          "{'enabledPlugins':{'on@shop':true,'off@shop':false,'both@shop':true,'theirs@shop':true}}",
      +        ),
             );
             yield* fs.makeDirectory(path.join(workspace, ".claude"), { recursive: true });
             yield* fs.writeFileString(
      @@ -460,6 +473,7 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => {
               json(`{'plugins':{
                 'on@shop':[{'installPath':'${on}'}],
                 'off@shop':[{'installPath':'${off}'}],
      +          'unmentioned@shop':[{'installPath':'${unmentioned}'}],
                 'mine@shop':[{'scope':'local','projectPath':'${workspace}','installPath':'${mine}'}],
                 'theirs@shop':[{'scope':'local','projectPath':'${path.join(tempDir, "elsewhere")}','installPath':'${theirs}'}],
                 'both@shop':[
      diff --git a/apps/server/src/provider/Drivers/ClaudeSkills.ts b/apps/server/src/provider/Drivers/ClaudeSkills.ts
      index 1274ca67a..2a7dcf309 100644
      --- a/apps/server/src/provider/Drivers/ClaudeSkills.ts
      +++ b/apps/server/src/provider/Drivers/ClaudeSkills.ts
      @@ -267,9 +267,7 @@ const discoverPluginSkillDirectories = Effect.fn("discoverPluginSkillDirectories
         const directories: Array<ClaudeSkillDirectory> = [];
         for (const [key, value] of Object.entries(installed)) {
           const [plugin, marketplace] = key.split("@");
      -    // An explicit `false` is the only way a plugin is off; an install the
      -    // settings never mention is on, which is how a fresh install behaves.
      -    if (!plugin || enabledPlugins[key] === false) {
      +    if (!plugin || enabledPlugins[key] !== true) {
             continue;
           }
           const installLocation = marketplace
    7. Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

      Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

    8. juliusmarminge closed this

Sign in to join this conversation.