Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

8.0 KB
Raw Blame

Claude Flow Plugin Integration

Overview

This document describes how claude-flow integrates with the official Claude Code plugin system.

Plugin Structure

plugin/
β”œβ”€β”€ .claude-plugin/
β”‚   └── plugin.json          # Official plugin manifest
β”œβ”€β”€ .mcp.json                 # MCP server bundle
β”œβ”€β”€ hooks/
β”‚   └── hooks.json            # Hook configurations
β”œβ”€β”€ skills -> ../.claude/skills     # 60+ skills
β”œβ”€β”€ commands -> ../.claude/commands # 100+ commands
└── agents -> ../v2/.claude/agents  # 80+ agents

Official Claude Code Integration Points

1. Plugin Manifest (plugin.json)

{
  "name": "claude-flow",
  "version": "3.0.0",
  "capabilities": {
    "skills": true,
    "commands": true,
    "agents": true,
    "hooks": true,
    "mcpServers": true
  }
}

2. Hook Event Mapping

V3 Internal Event Official Claude Code Event Tool Matcher
PreEdit PreToolUse ^(Write|Edit|MultiEdit)$
PostEdit PostToolUse ^(Write|Edit|MultiEdit)$
PreCommand PreToolUse ^Bash$
PostCommand PostToolUse ^Bash$
PreTask UserPromptSubmit -
PostTask PostToolUse ^Task$
SessionStart SessionStart -
SessionEnd Stop -
AgentSpawn PostToolUse ^Task$
AgentTerminate SubagentStop -
PreRoute UserPromptSubmit -

3. MCP Server Bundle

The plugin bundles three MCP servers:

  1. claude-flow (required): Core swarm coordination
  2. ruv-swarm (optional): Enhanced topology patterns
  3. flow-nexus (optional): Cloud orchestration

4. Skills Integration

Skills follow the official SKILL.md format:

---
name: skill-name
description: What this skill does
allowed-tools: Read, Write, Bash
---

# Skill Name

[Instructions for Claude]

V3 Hooks Bridge

The @claude-flow/hooks package includes an official hooks bridge:

import {
  OfficialHooksBridge,
  processOfficialHookInput,
  outputOfficialHookResult,
  executeWithBridge,
} from '@claude-flow/hooks';

// Process input from Claude Code
const input = await processOfficialHookInput();

// Convert to V3 context
const context = OfficialHooksBridge.toV3Context(input);

// Execute V3 handler
const result = await handler(context);

// Convert back to official output
const output = OfficialHooksBridge.toOfficialOutput(result, input.hook_event_name);
outputOfficialHookResult(output);

Installation

Via Plugin Command (Recommended)

# Add plugin marketplace
/plugin marketplace add claude-flow https://github.com/ruvnet/claude-flow

# Install plugin
/plugin install claude-flow

Manual Installation

# Clone and link
git clone https://github.com/ruvnet/claude-flow
claude --plugin-dir ./claude-flow/plugin

Via npx Init

npx claude-flow@alpha init --hooks

Configuration

Enable All Hooks

Add to .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [...],
    "PostToolUse": [...],
    "UserPromptSubmit": [...],
    "SessionStart": [...],
    "Stop": [...]
  }
}

Selective Hooks

Enable only specific hooks by choosing matchers:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "^(Write|Edit)$",
        "hooks": [{ "type": "command", "command": "npx claude-flow@alpha hooks pre-edit" }]
      }
    ]
  }
}

MCP Tool Access

After installation, MCP tools are available:

  • mcp__claude-flow__swarm_init
  • mcp__claude-flow__agent_spawn
  • mcp__claude-flow__task_orchestrate
  • mcp__claude-flow__memory_usage
  • mcp__claude-flow__hooks_route
  • mcp__claude-flow__hooks_metrics

Marketplace Publishing

Create Marketplace Entry

{
  "name": "claude-flow-marketplace",
  "plugins": [
    {
      "name": "claude-flow",
      "description": "Multi-agent swarm coordination",
      "version": "3.0.0",
      "path": "plugin"
    }
  ]
}

Host on GitHub

  1. Push to repository
  2. Add marketplace: /plugin marketplace add name https://github.com/user/repo
  3. Users install: /plugin install claude-flow@name

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Claude Code                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Official Hooks API                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ PreToolUse  β”‚ PostToolUse β”‚ SessionStartβ”‚ UserPrompt   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         β”‚             β”‚             β”‚             β”‚          β”‚
β”‚         β–Ό             β–Ό             β–Ό             β–Ό          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚              Official Hooks Bridge                        β”‚β”‚
β”‚  β”‚  (v3/@claude-flow/hooks/src/bridge/official-hooks-bridge)β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚         β”‚             β”‚             β”‚             β”‚          β”‚
β”‚         β–Ό             β–Ό             β–Ό             β–Ό          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ PreEdit     β”‚ PostEdit    β”‚ SessionStartβ”‚ PreTask      β”‚ β”‚
β”‚  β”‚ PreCommand  β”‚ PostCommand β”‚ SessionEnd  β”‚ PostTask     β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                     V3 Hooks System                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    @claude-flow/hooks                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Registry  β”‚ Executor  β”‚ Daemons   β”‚ MCP Tools         β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚              Skills β”‚ Commands β”‚ Agents β”‚ MCP Servers       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Benefits

  1. Seamless Integration: V3 hooks map directly to official events
  2. Full Feature Access: 60+ skills, 100+ commands, 80+ agents
  3. MCP Bundling: All servers configured in one file
  4. Marketplace Ready: Standard plugin format for distribution
  5. Backward Compatible: Works with existing .claude/ configurations