Skip to main content

What a Plugin Adds

A plugin gives a capability executable code. While pure skills (SKILL.md only) rely on the LLM using existing tools like shell_exec, plugins define their own tools with custom logic.

Plugin Structure

The WolffishPlugin Interface

Your plugin must export an object implementing this interface:

Example Plugin

Here’s a minimal plugin that provides a hello_world tool:
And the corresponding SKILL.md:

Plugin Lifecycle

  1. Discoverycerebellum.ts scans brain/cerebellum/ on startup
  2. Import — If a plugin/index.mjs exists, it’s dynamically imported
  3. Initinit(context) is called with the plugin’s directory and workspace root
  4. Executionexecute(toolName, args) is called each time the LLM invokes a tool
  5. Destroydestroy() is called on app shutdown for cleanup

Important Notes

Plugins are .mjs files (ES modules), not .ts. They run in the Electron main process with full Node.js access. This means they can do anything — file I/O, network requests, child processes. The amygdala’s safety gate is the only thing between a plugin and execution.
Use context.pluginDir to resolve paths relative to your plugin (for config files, templates, etc.) and context.workspaceRoot for accessing workspace-level data.
Plugins should handle their own errors gracefully and always return a ToolResult. If your plugin throws, motor.ts will catch it and retry up to 3 times with exponential backoff.