Repository navigation
Preserve plugin namespaces when loading skills - #433
Merged
ilovepixelart merged 14 commits intoNov 14, 2026
Merged
Conversation
pluginSkills() runs on every session start, input, tool call and preload, and printed the same collision warning each time. The two warnings now go through warnOnce, which moves from subagent/agents.ts to internal/warn-once.ts so both modules share one implementation.
The plugin_skill tool split the name on any whitespace while
parseSkillInvocation split on a space only, so the tool accepted
{"command":"/kit:deploy\nprod"} and then failed with "/kit:deploy was
not run." Both now end the name at the first whitespace character.
Claude Code documents that plugin skills are not affected by skillOverrides. The setting was applied to them, with a bare-name fallback, so a key written for a personal "deploy" skill also turned off every plugin's "deploy". Plugin skills now ignore the setting for the command, the plugin_skill listing and both invocation paths; personal and project skills keep their behaviour.
user-invocable: false only kept the command from being registered. Typed "/kit:deploy prod" or "/skill:kit:deploy prod" then reached the input handler, which expanded the hidden skill's body. The input path now checks the flag for plugin skills, shows a notice and expands nothing. The plugin_skill tool is unaffected.
Claude Code names a plugin skill plugin:<directory> internally and uses the frontmatter name for display. Only plugin:<frontmatter name> resolved. The directory spelling now resolves on typed input, the plugin_skill tool and subagent preloading. It registers no second command and adds no listing entry, and a skill's own name wins over another skill's directory alias.
"/skill:deploy prod" for the plugin skill kit:deploy resolved to nothing and the literal text reached the model. A bare /skill:<name> now resolves to the plugin skill when exactly one enabled plugin ships that name and no personal, project or pi skill has it, and emits a notice once per process and name that points at /<plugin>:<name>. When several plugins ship the name nothing runs and the notice lists the qualified names. The bare form is documented as deprecated and due for removal in the next major version.
With plugins aaa and kit both shipping "deploy", an agent from plugin kit with "skills: [deploy]" preloaded aaa's skill. Claude Code resolves a bare name as the exact name, then <agent's own plugin>:<name>, then the first :name match. The own-plugin step is now applied before the cross-plugin fallback.
Four behaviours could be removed with the suite still green: - inlineFork: the fork test ran without a UI, where a fork waits anyway. A model-invoked fork is now run with a UI and must return its result through the tool. - the followUp delivery of a typed plugin skill while the agent is busy. - the hook filter "if: Skill(name)" for a plugin_skill call. - the explicit /skill:plugin:name input form.
docs/skills.md said a skill with malformed frontmatter degrades to pi's plain expansion of the raw body. pi's loader skips such a skill, so a personal or project skill is not registered and typed input naming it passes through unexpanded. A plugin skill behaves the same way: no command, no plugin_skill entry, a warning naming the file. The doc line now states that, and a test pins the plugin side.
docs/skills.md said the plugin_skill listing refreshes through prepareLoadout while a comment in commands.ts said pi cannot re-describe a tool. pi runs a tool's prepareLoadout hook whenever it applies the active tools and takes replacement descriptions from it (added in pi 0.99.0). The comment now says slash_command keeps its first description because it defines no such hook, and the doc states when the hook runs and which pi versions lack it.
The sentence "Use that form for pi -p" in docs/skills.md refers to /skill:plugin:name and had drifted behind the alias and user-invocable sentences.
The local in expandSkillInvocation held the refusal returned by bareFormRefusal, not a list of ambiguous skills.
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
Preserve the Claude plugin namespace in skill commands and model discovery:
Plugin skills now register their own commands and use a
plugin_skilltool for model invocation. Both entry points share argument/file expansion, plugin variables, invocation restrictions, hooks, and fork handling. Personal and project skills keep/skill:name.Keep
Skillgrants, denials, scoped calls, and hook names consistent across both tools, including child agents. Preserve subagent skill preloading through qualified plugin names and a bare-name fallback. Resolve duplicate plugin skill definitions consistently; existing plugin commands win name collisions.Evidence
/skill:name.After: regression tests cover namespaced discovery, actual command-handler expansion, live invocation restrictions, current working directories, hooks/forks, session refresh, tool restrictions, and child-agent preloading.
npm run checkpasses: 3,380 tests passed; 5 skipped. Coverage floors pass (98.96% lines, 93.40% branches).bash scripts/e2e-smoke.shpasses all 20 assertions against the provider payload from a real pi CLI, including namespaced model discovery, expanded plugin commands through RPC, and the qualified skill input in print mode.Merge Danger
Door: two-way
Blast Radius: plugins
Existing plugin-skill invocations must change from
/skill:nameto/plugin:name. The explicit/skill:plugin:nameform is also accepted; use it withpi -pon older pi versions whose print mode exits before an extension command's submitted prompt starts. Plugin-rootSKILL.mdlayout remains unsupported. No dependency or release-version changes.