Overview
OrcBot supports hot-loadable skills via TypeScript or JavaScript plugins. Plugins are dynamically loaded at runtime without requiring restarts.Plugin System Features
Hot-Loading
- Zero restarts needed
- Loaded at runtime from
~/.orcbot/plugins/ - Changes detected automatically
Self-Repair
- If a plugin fails, OrcBot attempts automatic repair
- Uses
self_repair_skillto fix broken code - Error isolation prevents crashes
Security
- Allow/deny lists for plugin control
- Sandbox execution context
- Safe mode disables plugin loading
Plugin Locations
OrcBot scans these directories for plugins:Creating Your First Plugin
Simple Plugin Example
1
Create Plugin Directory
2
Create index.js
3
Test the Plugin
Plugin API Reference
args- Object containing skill argumentscontext- Optional execution context (agent, config, memory)
Advanced Plugin Examples
API Integration Plugin
Database Plugin
File Processing Plugin
TypeScript Plugin
Plugin Documentation (SKILL.md)
Create aSKILL.md file for better agent understanding:
Error Handling
- Returns error if location not found
- Returns error if API key not configured
- Returns error if API request fails
Disable Plugins
Plugin Metadata
Add custom metadata to your plugins:Error Handling
Plugin Load Errors
If a plugin fails to load:- Isolates the error
- Attempts
self_repair_skillto fix syntax/logic issues - Retries loading
- Falls back to disabling plugin if repair fails
Runtime Errors
Handle errors gracefully in your plugin:Testing Plugins
Manual Testing
Unit Testing
Create tests for your plugin:Debugging Plugins
Enable Debug Logs
Check Plugin Loading
View Loaded Plugins
Best Practices
Error Handling
- Always return
{ success: boolean }structure - Provide detailed error messages
- Log errors for debugging
- Validate input parameters
Security
- Never hardcode secrets in plugins
- Use environment variables for sensitive data
- Validate and sanitize all inputs
- Use
requiresAdminfor dangerous operations - Implement rate limiting for API calls
Performance
- Use async/await for I/O operations
- Cache expensive computations
- Set reasonable timeouts
- Clean up resources (close connections)
Documentation
- Include clear
descriptionandusage - Create SKILL.md with examples
- Document all parameters
- Show example return values
- List environment requirements
Advanced: Context Access
Access OrcBot internals from your plugin:Publishing Plugins
Share your plugins with the community:-
Create GitHub repo:
-
Add README:
Configuration
Set environment variable: -
Publish to npm (optional):
Troubleshooting
Plugin Not Loading
1
Check Location
2
Check Syntax
3
Check Exports
4
Check Logs
Skill Not Recognized
If OrcBot doesn’t recognize your skill:- Check skill name format (lowercase, underscores)
- Verify
module.exportsis an array - Ensure
name,description,usage, andhandlerare present - Restart OrcBot or trigger hot-reload