Use this file to discover all available pages before exploring further.
The plugin system uses a fluent builder API to create MCP tools, lifecycle hooks, background workers, and LLM provider integrations. Plugins integrate into the same coordination ledger, memory system, and hooks pipeline as Ruflo’s built-in capabilities — so custom tools appear natively in Claude Code’s tool palette and custom hooks fire at the same lifecycle events as the core system.
@claude-flow/mcp has zero @claude-flow/* dependencies by design, so plugins stay lightweight even when the full Ruflo CLI is not installed in the target environment. The @claude-flow/plugins builder package imports only what it needs.
The ruflo-plugin-creator scaffold generates a complete project layout with TypeScript configuration, entry points for tools, hooks, and workers, and a test harness.
Edit src/index.ts to define your plugin’s tools, hooks, and workers using the builder API. The example below creates a code analysis plugin with one MCP tool, a post-task hook that stores results, and a background worker for periodic analysis.
All required MCPToolBuilder parameters have correct types
Hook event names are valid (see the full list below)
Worker minWorkers ≤ maxWorkers
package.json has name, version, and main fields
4
Test
Run the test suite against the scaffolded test harness. Tests spin up an in-process MCP server, fire tool calls, trigger hooks, and assert on outputs without requiring a full Ruflo installation.
npx ruflo@latest plugins test --name my-analyzer
5
Publish
Publish the plugin to the Ruflo marketplace. The publish step runs validate and test automatically before uploading.
Every parameter passed to .param() must have one of the following types. The builder generates a JSON Schema inputSchema from these declarations automatically.
Workers declared with new WorkerPool(name, options) join Ruflo’s 12 built-in background workers. They appear in worker/status output and can be triggered manually with worker/run.
new WorkerPool('my-worker', { minWorkers: 1, // Minimum workers kept alive (default: 1) maxWorkers: 4, // Maximum concurrent workers (default: 4) taskTimeout: 30000, // Task timeout in ms (default: 30000)})
Set taskTimeout conservatively. Workers that exceed the timeout are terminated and their tasks are marked failed. Long-running analysis tasks should report incremental progress via the MCP Tasks API rather than blocking a single worker.
Use ProviderRegistry to add LLM providers beyond the built-in set (Anthropic, OpenAI, Google, Cohere, Ollama). The registry integrates with the Thompson sampling model router and automatic failover chain.
Once registered, the model router considers this provider in cost-optimized routing decisions and falls back to it if higher-priority providers are unavailable.