Skip to main content

claude_agent/plugins/
mod.rs

1//! Plugin system with namespace-based resource management.
2//!
3//! Plugins are directories with a `.claude-plugin/plugin.json` manifest,
4//! containing any combination of:
5//! - `skills/` — Skill definitions (loaded via `SkillIndexLoader`)
6//! - `commands/` — Legacy skill markdown files (also loaded as skills)
7//! - `agents/` — Subagent definitions (loaded via `SubagentIndexLoader`)
8//! - `hooks/hooks.json` — Hook configurations
9//! - `.mcp.json` — MCP server configurations
10//!
11//! All resources are namespaced as `plugin-name:resource-name` to avoid collisions.
12//!
13//! # Directory Structure
14//!
15//! ```text
16//! ~/.claude/plugins/
17//! └── my-plugin/
18//!     ├── .claude-plugin/
19//!     │   └── plugin.json
20//!     ├── skills/
21//!     │   └── commit/
22//!     │       └── SKILL.md
23//!     ├── commands/
24//!     │   └── hello.md
25//!     ├── agents/
26//!     │   └── reviewer.md
27//!     ├── hooks/
28//!     │   └── hooks.json
29//!     └── .mcp.json
30//! ```
31
32mod discovery;
33mod error;
34mod loader;
35mod manager;
36mod manifest;
37pub mod namespace;
38
39pub use discovery::PluginDiscovery;
40pub use error::PluginError;
41pub use loader::PluginHookEntry;
42pub use manager::PluginManager;
43pub use manifest::{PluginAuthor, PluginDescriptor, PluginManifest};