feat(plugins): wire contributed skills / commands / agents / mcpServers#132
Merged
Conversation
Plugins could contribute 7 things but only hooks were wired into the live
session; contributed skills/commands/agents/mcpServers were parsed and ignored.
Now the trusted+enabled plugins' contributions load:
core:
- collectPluginContributions({home,disabled}) → { dirs, mcpServers } for the
trusted+enabled plugins (untrusted ones excluded — same security gate as
discoverPlugins). One place both hosts reuse.
- loadSlashCommands gains `pluginDirs` (+ a 'plugin' command source); plugin
`<dir>/commands/*.md` load, overridable by user/project.
- runAgent gains `pluginDirs`, threaded into the Task tool's loadSubAgents so
plugin-bundled sub-agents resolve. (loadSkills already supported pluginDirs.)
cli (repl.ts + headless.ts):
- collect contributions early; pass pluginDirs to loadSkills + loadSlashCommands
+ runAgent; merge plugin-contributed mcpServers into the MCP connect set
(user settings win on a name clash).
Now wired: hooks + skills + commands + sub-agents + mcpServers (5 of 7).
statusLines + modes remain (they need live registries that don't exist yet).
Tests: +3 — loadSlashCommands plugin source (+ project override),
collectPluginContributions returns dirs+mcpServers for trusted / excludes
untrusted. Core 604 green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Plugins could declare 7 contribution points but only hooks were wired into a live session — contributed skills / commands / agents / mcpServers were parsed and then ignored (the audit's gap). Now the trusted+enabled plugins' contributions load.
Changes
core:
collectPluginContributions({home,disabled})→{ dirs, mcpServers }for trusted+enabled plugins (untrusted excluded — same security gate asdiscoverPlugins). Single helper both hosts reuse.loadSlashCommandsgainspluginDirs(+ a'plugin'command source): plugin<dir>/commands/*.mdload, overridable by user/project on a name clash.runAgentgainspluginDirs, threaded into the Task tool'sloadSubAgentsso plugin-bundled sub-agents resolve. (loadSkillsalready supportedpluginDirs.)cli (
repl.ts+headless.ts): collect contributions early; passpluginDirstoloadSkills+loadSlashCommands+runAgent; merge plugin-contributedmcpServersinto the connect set (user settings win on a clash).Now wired: hooks + skills + commands + sub-agents + mcpServers (5 of 7).
statusLines+modesremain — they'd need live registries that don't exist yet.Tests
+3:
loadSlashCommandsplugin source + project-override;collectPluginContributionsreturns dirs+mcpServers for a trusted plugin and excludes an untrusted one. Core suite 604 green; full repo green via pre-commit.🤖 Generated with Claude Code