Add Claude Code compatible plugin system#34
Open
k29 wants to merge 1 commit intotigy32:mainfrom
Open
Conversation
Implement a plugin system that is drop-in compatible with Claude Code
plugins, allowing users to install and use plugins from the Claude Code
ecosystem with minimal or no modifications.
- Plugin discovery from multiple directories with priority ordering:
1. ~/.claude/plugins/ (Claude Code user-level, lowest priority)
2. ~/.tycode/plugins/ (Tycode user-level)
3. .claude/plugins/ in workspace (Claude Code project-level)
4. .tycode/plugins/ in workspace (Tycode project-level, highest)
- Support for Claude Code plugin manifest (.claude-plugin/plugin.json)
with custom paths for commands, agents, skills, hooks, and MCP servers
- Native Rust plugin support via tycode-plugin.toml and dynamic loading
- **Commands**: Slash commands from markdown files with YAML frontmatter
- **Agents**: Subagent definitions from markdown files
- **Skills**: Integrated with existing skills system, plugin skill dirs
- **Hooks**: Shell command execution with JSON stdin/stdout protocol
- **MCP Servers**: Plugin-provided MCP server configurations
Implemented hook events matching Claude Code specification:
- PreToolUse: Before tool execution (can block/modify)
- PostToolUse: After successful tool execution
- PostToolUseFailure: After tool execution fails
- UserPromptSubmit: When user submits prompt
- SessionStart: At session start
Hook features:
- JSON input via stdin with session context
- Configurable timeouts with process termination on timeout
- Tool name matchers for selective hook execution
- ${CLAUDE_PLUGIN_ROOT} variable expansion
- /plugins - List all installed plugins
- /plugin install <source> - Install from GitHub or local path
- /plugin uninstall <name> - Remove a plugin
- /plugin enable/disable <name> - Toggle plugin state
- /plugin info <name> - Show plugin details
- /plugin reload - Reload all plugins
- /hooks - List all registered hooks from enabled plugins
- owner/repo - GitHub shorthand
- owner/repo@branch - GitHub with branch/tag
- name@owner/repo - Named install with custom directory name
- github:owner/repo - Explicit GitHub prefix
- ./path or /path - Local filesystem
- Comprehensive README section on plugins and hooks
- Security note about hook shell command execution
- Commands reference table with all slash commands
- Plugin System TODOs section for planned features
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.
Implement a plugin system that is drop-in compatible with Claude Code plugins, allowing users to install and use plugins from the Claude Code ecosystem with minimal or no modifications.
Plugin discovery from multiple directories with priority ordering:
Support for Claude Code plugin manifest (.claude-plugin/plugin.json) with custom paths for commands, agents, skills, hooks, and MCP servers
Native Rust plugin support via tycode-plugin.toml and dynamic loading
Commands: Slash commands from markdown files with YAML frontmatter
Agents: Subagent definitions from markdown files
Skills: Integrated with existing skills system, plugin skill dirs
Hooks: Shell command execution with JSON stdin/stdout protocol
MCP Servers: Plugin-provided MCP server configurations
Implemented hook events matching Claude Code specification:
Hook features:
JSON input via stdin with session context
Configurable timeouts with process termination on timeout
Tool name matchers for selective hook execution
${CLAUDE_PLUGIN_ROOT} variable expansion
/plugins - List all installed plugins
/plugin install - Install from GitHub or local path
/plugin uninstall - Remove a plugin
/plugin enable/disable - Toggle plugin state
/plugin info - Show plugin details
/plugin reload - Reload all plugins
/hooks - List all registered hooks from enabled plugins
owner/repo - GitHub shorthand
owner/repo@branch - GitHub with branch/tag
name@owner/repo - Named install with custom directory name
github:owner/repo - Explicit GitHub prefix
./path or /path - Local filesystem
Comprehensive README section on plugins and hooks
Security note about hook shell command execution
Commands reference table with all slash commands
Plugin System TODOs section for planned features