Skip to main content
Plugins provide a way to package and distribute multiple agent components as a single unit. Instead of managing individual skills, hooks, and configurations separately, plugins bundle everything together for easier installation and distribution.

What Are Plugins?

A plugin is a directory structure that can contain:
  • Skills: Specialized knowledge and workflows
  • Hooks: Event handlers for tool lifecycle
  • MCP Config: External tool server configurations
  • Agents: Specialized agent definitions
  • Commands: Slash commands
The plugin format is compatible with the Claude Code plugin structure. Both .plugin/ (OpenHands-native) and .claude-plugin/ (Claude Code compatible) directory names are supported for the metadata directory.

Plugins vs Skills

Understanding the difference helps you choose the right approach:

Skills

Specialized prompts for specific tasks
  • One skill = one specific capability
  • Just a SKILL.md file (+ optional resources)
  • Lightweight and focused
  • Quick to create and share
When to use:
  • Adding single capabilities
  • Simple workflows
  • Domain-specific knowledge
  • Quick solutions

Plugins

Multi-component bundles
  • Multiple skills + hooks + config
  • Complete feature ecosystems
  • Coordinated components
  • Professional distribution
When to use:
  • Complete feature sets
  • Tool integrations
  • Team standards
  • Commercial distributions

Comparison Table

When to Use Each

Use a Skill when you need:
  • A single reusable prompt or workflow
  • Domain-specific knowledge
  • Simple automation
  • Quick solutions
Use a Plugin when you need:
  • Multiple related skills working together
  • Event handlers (hooks) for tool actions
  • External tool integrations (MCP)
  • Complete platform integrations
  • Team or organizational standards
Example: Code Quality As separate skills:
As a plugin:
The plugin version bundles all quality-related capabilities and automatically runs checks after file edits.

Plugin Structure

A complete plugin follows this directory structure:

Required Components

Only one file is required:
  • plugin-name/.plugin/plugin.json or plugin-name/.claude-plugin/plugin.json: Plugin metadata
All other components are optional—include only what your plugin needs.

Plugin Metadata

The plugin.json file defines your plugin:
The author field can also be a simple string such as "Your Name".

Plugin Components Explained

Skills in plugins work identically to standalone skills. Each skill has its own directory with a SKILL.md file:
See Skills Documentation for skill creation details.
Hooks are event handlers that run during tool lifecycle events:
Hook commands have access to these environment variables:
  • $OPENHANDS_PROJECT_DIR: Path to the project directory
  • $OPENHANDS_SESSION_ID: Current session identifier
  • $OPENHANDS_EVENT_TYPE: The triggering event type
  • $OPENHANDS_TOOL_NAME: Name of the tool that triggered the hook
Common use cases:
  • Run linters after file edits
  • Validate tool inputs
  • Log tool usage
  • Trigger dependent actions
Available hook events:
  • PreToolUse: Before tool execution
  • PostToolUse: After tool execution
  • UserPromptSubmit: When the user submits a prompt
  • SessionStart: When the session starts
  • SessionEnd: When the session ends
  • Stop: When execution stops
MCP (Model Context Protocol) servers provide external tools and resources:
Use cases:
  • Connect to external APIs
  • Add specialized tools
  • Integrate third-party services
Learn more: Model Context Protocol
Specialized agent definitions for specific tasks:
Agents in plugins can use the plugin’s skills and hooks automatically.
Custom slash commands for plugin functionality:
Commands provide quick access to plugin features.

Using Plugins

How you use plugins depends on your platform:
Via configuration file:Create ~/.openhands/config.toml:
Via command line:
Plugins are loaded when OpenHands starts.

Installing Plugins

From a Local Directory

  1. Verify plugin structure:
  2. Use the plugin path in your configuration or command line

From GitHub

Plugins can be loaded directly from GitHub repositories:

Plugin Sources

Official Registry

github.com/OpenHands/extensionsCommunity-maintained plugins

Custom Repositories

Your own GitHub repositoriesOrganization or private plugins

Creating Plugins

To create your own plugin:

1. Plan Your Components

Determine what your plugin needs:
  • Which skills?
  • What hooks for automation?
  • Any MCP integrations?
  • Custom commands?

2. Create Directory Structure

Use .claude-plugin/ instead of .plugin/ if you want Claude Code-compatible naming.

3. Create Plugin Metadata

Create my-plugin/.plugin/plugin.json (or my-plugin/.claude-plugin/plugin.json):

4. Add Components

Add skills, hooks, and other components as needed:

5. Test Locally

Load your plugin and verify all components work:

6. Distribute

Options for distribution:
  • GitHub repository: Push to GitHub and share URL
  • File sharing: Zip and share directory
  • Package registry: Submit to official registry

Plugin Examples

Code Quality Plugin

Contains:
  • Python linting skill
  • JavaScript linting skill
  • Post-edit hooks for auto-linting
  • Pre-commit setup
Use case: Enforce code standards

DevOps Plugin

Contains:
  • Kubernetes deployment skill
  • Docker build skill
  • CI/CD workflow skill
  • kubectl MCP server
Use case: Infrastructure management

API Integration Plugin

Contains:
  • REST API client skill
  • Authentication skill
  • Rate limiting hooks
  • API MCP server
Use case: External service integration

Testing Plugin

Contains:
  • Unit testing skill
  • Integration testing skill
  • Post-code hooks for test runs
  • Coverage commands
Use case: Automated testing

Plugin Development Best Practices

1

Start with Skills

Begin by creating the core skills your plugin needs. Test them individually before bundling.
2

Add Automation with Hooks

Identify repetitive tasks and automate them with hooks. Example: run linters after file edits.
3

Integrate External Tools

Add MCP servers for external tool integration. This provides your skills with additional capabilities.
4

Document Thoroughly

Include a comprehensive README explaining:
  • What the plugin does
  • How to install it
  • Configuration options
  • Example usage
5

Version Carefully

Use semantic versioning (major.minor.patch) and document breaking changes.

Troubleshooting

Check:
  • .plugin/plugin.json or .claude-plugin/plugin.json exists and is valid JSON
  • Plugin path is correct
  • All referenced files exist
Debug:
Check:
  • Skills have valid SKILL.md files
  • Frontmatter includes triggers
  • Trigger keywords match your prompts
Test: Use explicit trigger keywords from the skill’s frontmatter.
Check:
  • hooks/hooks.json syntax is valid
  • Hook matchers target the right tools
  • Commands are executable
Debug: Check logs for hook execution errors.

Next Steps

Further Reading

For SDK developers: