polyclaw v5.0.0

Creating Plugins

Plugins are self-contained packages that extend Polyclaw with new skills and capabilities.

Plugin Structure

my-plugin/
  PLUGIN.json        # Required: plugin manifest
  skills/
    my-skill/
      SKILL.md       # Skill definition
      (other files)  # Supporting files

PLUGIN.json Manifest

The manifest defines the plugin metadata, dependencies, and bundled skills.

{
  "id": "my-plugin",
  "name": "My Plugin",
  "description": "A custom plugin for Polyclaw",
  "version": "1.0.0",
  "author": "Your Name",
  "homepage": "https://github.com/you/my-plugin",
  "icon": "wrench",
  "default_enabled": false,
  "skills": [
    "my-skill"
  ],
  "dependencies": {
    "pip": ["some-package>=1.0"],
    "cli": ["some-cli-tool"]
  },
  "setup_skill": "my-skill",
  "setup_message": "Let's configure My Plugin. I'll need your API key."
}

Manifest Fields

FieldRequiredDescription
idYesUnique identifier (lowercase, hyphens)
nameYesDisplay name
descriptionYesShort description
versionYesSemantic version
authorNoPlugin author
homepageNoURL to plugin homepage or repo
iconNoIcon name or emoji
default_enabledNoWhether enabled on first discovery (default: false)
skillsNoArray of skill directory names (strings)
dependenciesNoRequired tools and packages
setup_skillNoSkill directory name to run during initial setup
setup_messageNoMessage shown when setup begins

Plugin Locations

Polyclaw discovers plugins from two directories:

LocationTypeDescription
plugins/ (project root)Built-inShipped with Polyclaw, read-only
~/.polyclaw/plugins/UserInstalled by user, read-write

Plugin Lifecycle

Installation

  1. Upload a ZIP file through the web dashboard or place the directory in the plugins folder
  2. Polyclaw discovers the PLUGIN.json manifest
  3. The plugin appears in the plugin registry

Enabling

  1. User enables the plugin via dashboard, slash command, or API
  2. Skill directories are copied to ~/.polyclaw/skills/

Setup Flow

If setup_skill is defined:

  1. The setup skill is activated
  2. setup_message is presented to the user
  3. The agent runs the setup conversation
  4. On completion, complete_setup() removes the setup skill marker

Disabling

  1. Plugin skill directories are removed from ~/.polyclaw/skills/
  2. Plugin state is updated to disabled

Managing Plugins

Via Web Dashboard

The Plugins page shows all discovered plugins with enable/disable toggles.

Created skill shown in customization view

Via Slash Commands

/plugins                # List all plugins
/plugin enable <id>     # Enable a plugin
/plugin disable <id>    # Disable a plugin

Via API

GET    /api/plugins                    # List plugins
GET    /api/plugins/<id>               # Get plugin details
POST   /api/plugins/<id>/enable        # Enable
POST   /api/plugins/<id>/disable       # Disable
GET    /api/plugins/<id>/setup         # Get setup skill content
POST   /api/plugins/<id>/setup         # Mark setup complete
POST   /api/plugins/import             # Upload ZIP
DELETE /api/plugins/<id>               # Remove user plugin

Example: Creating a Weather Plugin

weather-plugin/
  PLUGIN.json
  skills/
    weather/
      SKILL.md

PLUGIN.json:

{
  "id": "weather",
  "name": "Weather",
  "description": "Get weather forecasts",
  "version": "1.0.0",
  "skills": [
    "weather"
  ],
  "dependencies": {
    "pip": ["requests"]
  }
}

skills/weather/SKILL.md:

---
name: Weather Lookup
description: Get current weather and forecasts for any city
verb: weather
---

# Weather Lookup

When asked about weather, use the following approach:
1. Identify the city from the user's message
2. Call the weather API endpoint
3. Format the response with temperature, conditions, and forecast