Plugins

Plugins extend Clew with custom commands, agents, skills, execution hooks, MCP servers, and LSP integrations. Plugin management is handled by src/services/plugins/ and src/utils/plugins/.

What Plugins Can Provide

ExtensionDescription
Slash CommandsCustom /command implementations registered via plugin manifest
AgentsSpecialized agent configurations with custom prompts and tool access
SkillsReusable task instructions from plugin skill directories
Execution HooksPre/post hooks at tool, bash, prompt, and edit stages
MCP ServersModel Context Protocol server definitions bundled with the plugin
LSP ServersLanguage Server Protocol integration

Hook System

Hook PointWhen It Fires
PreToolUseBefore a tool executes — validation, input modification, logging
PostToolUseAfter a tool completes — result transformation, audit
PreBashBefore shell command execution — sanitization, env injection
PostPromptAfter prompt construction — context augmentation
PreAcceptEditBefore accepting an edit — validation, policy enforcement

Plugin Management

/plugin                          # List installed plugins
/plugin-details                  # Show detailed plugin information
/reload-plugins                  # Activate pending plugin changes
claude plugin validate /path       # Validate a plugin manifest (CLI)

Plugins are loaded from these locations:

  • Bundled — Shipped with Clew
  • User — Installed by the user (via marketplace or manual)
  • Plugin dir — Custom directories via --plugin-dir <path> (repeatable)

The PluginInstallationManager (src/services/plugins/PluginInstallationManager.ts) handles automatic installation, marketplace reconciliation, and plugin refresh. Use /reload-plugins after installing or updating plugins.

Built-in Plugins

PluginDescription
commit-commandsGit workflow — commit, push, PR creation, branch cleanup (clean_gone)
commit-push-prCommit, push, and open a PR in one step
code-reviewAutomated PR code review
feature-devGuided feature development with codebase understanding
frontend-designProduction-grade UI/UX generation
verifyTypecheck, lint, build, and test pipeline
precommitPre-commit review with full verification
commitConventional git commit message generation
simplifyCode quality and reuse review
debugDebugging assistance and diagnosis
web-searchMulti-provider web search
scraplingWeb scraping with Scrapling framework
skillifyCreate reusable skills from workflows
rememberSave user preferences

Plugin Structure

my-plugin/
  manifest.json         # Plugin metadata and capability declarations
  commands/             # Custom slash commands
  skills/               # Reusable task instructions
  agents/               # Agent configurations
  hooks/                # Hook implementations

Marketplace

Plugins can be distributed through marketplaces. The marketplaceManager (src/utils/plugins/marketplaceManager.ts) handles marketplace source discovery, cache management, and plugin installation from remote sources.