Plugin directory model
The header comment insrc/utils/plugins/pluginLoader.ts documents the expected plugin structure:
plugin.jsoncommands/agents/hooks/
Discovery and precedence
The same header comment describes discovery precedence:- marketplace-based plugins
- session-only plugin directories
loadPluginCommands.ts.
Caching and versioning
The loader creates versioned cache paths under the plugins directory and can also probe seed caches. It supports both directory caches and zip-cache variants. This is a sophisticated installation system rather than a naive “clone into folder” flow.Commands and skills from plugins
src/utils/plugins/loadPluginCommands.ts turns plugin markdown into command objects.
It supports:
- namespace derivation from directory layout
SKILL.mdhandling- frontmatter parsing
- argument substitution
- plugin variable substitution
- model and effort overrides
Security-relevant behavior
Plugin loading includes:- source allow/block checks
- duplicate detection
- validation of manifest and hooks config
- path validation to stay inside intended bases