Skip to content

Plugin System Overview

OpenClaw's plugin system enables channels, tools, hooks, and HTTP routes to be registered and loaded in a pluggable fashion. All 34 extensions and 52 skills are integrated through this system.

Source Location

src/plugins/
├── registry.ts          # Plugin registry
├── types.ts             # Core type definitions
├── loader.ts            # Dynamic loader
├── hooks.ts             # Hooks system
└── *.test.ts            # Test files

extensions/              # 34 extensions
├── msteams/
├── matrix/
├── memory-lancedb/
├── diagnostics-otel/
└── ...

skills/                  # 52 skills
├── github/
├── gmail/
├── google-calendar/
└── ...

Registration Architecture

Five Registration Types

Source: src/plugins/registry.ts

TypeDescriptionExamples
PluginToolRegistrationAgent-usable toolsGitHub tools, browser tools
PluginChannelRegistrationChannel plugin + dockTelegram, Discord
PluginHookRegistrationLifecycle hooksMessage interception, audit logging
PluginHttpRegistrationHTTP routesWebhook endpoints
PluginServiceRegistrationBackground servicesScheduled sync, message polling

PluginRecord

typescript
// src/plugins/registry.ts (simplified)
interface PluginRecord {
  id: string;            // Unique plugin identifier
  name: string;          // Display name
  version: string;       // Semantic version
  kind: PluginKind;      // "extension" | "skill" | "core"
  origin: string;        // Source path or package name
  manifest: PluginManifest;  // Plugin manifest data
}

Chapter Navigation

  1. Plugin SDK -- OpenClawPluginApi, factory pattern, context
  2. Extension Loading -- Dynamic import, manifest parsing
  3. Hooks Mechanism -- Lifecycle hooks, event system

OpenClaw Source Code Tutorial