Skip to content

feat(cli,ai): Load Claude Code plugins in Studio AI for skills, commands, and agents#2896

Open
borkweb wants to merge 9 commits intotrunkfrom
feature/claude-skills
Open

feat(cli,ai): Load Claude Code plugins in Studio AI for skills, commands, and agents#2896
borkweb wants to merge 9 commits intotrunkfrom
feature/claude-skills

Conversation

@borkweb
Copy link
Copy Markdown
Member

@borkweb borkweb commented Mar 24, 2026

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

  • 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

borkweb added 3 commits March 24, 2026 15:42
…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
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Mar 24, 2026

📊 Performance Test Results

Comparing 3fb148e vs trunk

app-size

Metric trunk 3fb148e Diff Change
App Size (Mac) 1268.05 MB 1268.05 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 3fb148e Diff Change
load 1907 ms 1935 ms +28 ms ⚪ 0.0%

site-startup

Metric trunk 3fb148e Diff Change
siteCreation 8190 ms 8186 ms 4 ms ⚪ 0.0%
siteStartup 4839 ms 4927 ms +88 ms 🔴 1.8%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

borkweb added 6 commits March 26, 2026 08:45
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants