Skip to main content

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_skill to 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:
Plugin structure:

Creating Your First Plugin

Simple Plugin Example

1

Create Plugin Directory

2

Create index.js

3

Test the Plugin

Plugin API Reference

Handler parameters:
  • args - Object containing skill arguments
  • context - Optional execution context (agent, config, memory)
Handler return:

Advanced Plugin Examples

API Integration Plugin

Database Plugin

File Processing Plugin

TypeScript Plugin

Compile TypeScript plugins:

Plugin Documentation (SKILL.md)

Create a SKILL.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:
OrcBot automatically:
  1. Isolates the error
  2. Attempts self_repair_skill to fix syntax/logic issues
  3. Retries loading
  4. 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:
Run tests:

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 requiresAdmin for 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 description and usage
  • Create SKILL.md with examples
  • Document all parameters
  • Show example return values
  • List environment requirements

Advanced: Context Access

Access OrcBot internals from your plugin:
Direct agent access is powerful but bypasses safety checks. Use responsibly.

Publishing Plugins

Share your plugins with the community:
  1. Create GitHub repo:
  2. Add README:

    Configuration

    Set environment variable:
  3. 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:
  1. Check skill name format (lowercase, underscores)
  2. Verify module.exports is an array
  3. Ensure name, description, usage, and handler are present
  4. Restart OrcBot or trigger hot-reload

Dependencies Not Found