feat(cli,ai): Load Claude Code plugins in Studio AI for skills, commands, and agents#2896
Open
feat(cli,ai): Load Claude Code plugins in Studio AI for skills, commands, and agents#2896
Conversation
…nds, and agents ## Summary When using the anthropic-claude or anthropic-api-key provider, Studio AI now loads all installed Claude Code plugins from ~/.claude/plugins/. This makes plugin skills, commands, and agents available as slash commands with autocomplete support in the TUI prompt. ## Why Studio AI users with Claude Code MAX plans couldn't leverage their installed plugins within Studio. This required using a separate API key and losing access to familiar workflows and custom agents provided by their Claude Code plugin ecosystem. ## How - New `claude-code-plugins.ts` module reads `~/.claude/plugins/installed_plugins.json` and scans plugin directories for skills (`skills/*/SKILL.md`), commands (`commands/*.md`), and agents (`agents/*.md`) - Plugins are loaded via the SDK's `plugins` option, gated on provider type - Autocomplete uses `AutocompleteItem` with separate label/value: skills show short names, commands show the full `plugin:name` prefix - `Skill`, `Agent`, and `Task` added to auto-allowed tools for plugin command execution - Site context moves to the system prompt for slash commands (SDK requires leading `/`), while regular prompts keep it prepended for maximum model visibility - Autocomplete refreshes dynamically when the provider changes via `/provider` ## Testing - [ ] Build CLI (`npm run cli:build`) and run `node apps/cli/dist/cli/main.js ai` - [ ] Switch to anthropic-claude provider with `/provider` - [ ] Type `/` and verify installed plugin skills and commands appear in autocomplete - [ ] Select a plugin command from autocomplete and verify it executes - [ ] Switch to wpcom provider and verify plugin commands no longer appear
Collaborator
📊 Performance Test ResultsComparing 3fb148e vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
…into feature/claude-skills
The `existsSync` mock used `filePath in fileMap` which fails typecheck because PathLike can be a Buffer (not a valid key type). The `readdirSync` mock needed explicit type casting to satisfy the overloaded function signature.
Normalize paths to forward slashes in mock helpers so that test file map lookups work on Windows where path.join() produces backslash separators.
The previous fix normalized lookup paths to forward slashes but not the fileMap keys themselves. On Windows, MANIFEST_PATH contains backslashes, so the key wouldn't match the forward-slash lookup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When using the anthropic-claude or anthropic-api-key provider, Studio AI now loads all installed Claude Code plugins from
~/.claude/plugins/. This makes plugin skills, commands, and agents available as slash commands with autocomplete support in the TUI prompt.Why
Studio AI users with Claude Code plans couldn't leverage their installed claude plugins within Studio. This resulted in losing access to familiar workflows and custom agents provided by their Claude Code plugin ecosystem.
How
claude-code-plugins.tsmodule reads~/.claude/plugins/installed_plugins.jsonand scans plugin directories for skills (skills/*/SKILL.md), commands (commands/*.md), and agents (agents/*.md)pluginsoption, gated on provider typeAutocompleteItemwith separate label/value: skills show short names, commands show the fullplugin:nameprefixSkill,Agent, andTaskadded to auto-allowed tools for plugin command execution/), while regular prompts keep it prepended for maximum model visibility/providerTesting
npm run cli:build) and runnode apps/cli/dist/cli/main.js ai/provider/and verify installed plugin skills and commands appear in autocomplete