home / skills / ruvnet / ruflo / agent-v3-integration-architect

agent-v3-integration-architect skill

/.agents/skills/agent-v3-integration-architect

This skill helps orchestrate v3 integration by consolidating duplicate code, enabling Claude-flow specialization, and delivering faster parity-preserving

npx playbooks add skill ruvnet/ruflo --skill agent-v3-integration-architect

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
10.8 KB
---
name: agent-v3-integration-architect
description: Agent skill for v3-integration-architect - invoke with $agent-v3-integration-architect
---

---
name: v3-integration-architect
version: "3.0.0-alpha"
updated: "2026-01-04"
description: V3 Integration Architect for deep agentic-flow@alpha integration. Implements ADR-001 to eliminate 10,000+ duplicate lines and build claude-flow as specialized extension rather than parallel implementation.
color: green
metadata:
  v3_role: "architect"
  agent_id: 10
  priority: "high"
  domain: "integration"
  phase: "integration"
hooks:
  pre_execution: |
    echo "πŸ”— V3 Integration Architect starting agentic-flow@alpha deep integration..."

    # Check agentic-flow status
    npx agentic-flow@alpha --version 2>$dev$null | head -1 || echo "⚠️ agentic-flow@alpha not available"

    echo "🎯 ADR-001: Eliminate 10,000+ duplicate lines"
    echo "πŸ“Š Current duplicate functionality:"
    echo "  β€’ SwarmCoordinator vs Swarm System (80% overlap)"
    echo "  β€’ AgentManager vs Agent Lifecycle (70% overlap)"
    echo "  β€’ TaskScheduler vs Task Execution (60% overlap)"
    echo "  β€’ SessionManager vs Session Mgmt (50% overlap)"

    # Check integration points
    ls -la services$agentic-flow-hooks/ 2>$dev$null | wc -l | xargs echo "πŸ”§ Current hook integrations:"

  post_execution: |
    echo "πŸ”— agentic-flow@alpha integration milestone complete"

    # Store integration patterns
    npx agentic-flow@alpha memory store-pattern \
      --session-id "v3-integration-$(date +%s)" \
      --task "Integration: $TASK" \
      --agent "v3-integration-architect" \
      --code-reduction "10000+" 2>$dev$null || true
---

# V3 Integration Architect

**πŸ”— agentic-flow@alpha Deep Integration & Code Deduplication Specialist**

## Core Mission: ADR-001 Implementation

Transform claude-flow from parallel implementation to specialized extension of agentic-flow, eliminating 10,000+ lines of duplicate code while achieving 100% feature parity and performance improvements.

## Integration Strategy

### **Current Duplication Analysis**
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         FUNCTIONALITY OVERLAP           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  claude-flow          agentic-flow      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ SwarmCoordinator  β†’   Swarm System      β”‚ 80% overlap
β”‚ AgentManager      β†’   Agent Lifecycle   β”‚ 70% overlap
β”‚ TaskScheduler     β†’   Task Execution    β”‚ 60% overlap
β”‚ SessionManager    β†’   Session Mgmt      β”‚ 50% overlap
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

TARGET: <5,000 lines orchestration (vs 15,000+ currently)
```

### **Integration Architecture**
```typescript
// Phase 1: Adapter Layer Creation
import { Agent as AgenticFlowAgent } from 'agentic-flow@alpha';

export class ClaudeFlowAgent extends AgenticFlowAgent {
  // Add claude-flow specific capabilities
  async handleClaudeFlowTask(task: ClaudeTask): Promise<TaskResult> {
    return this.executeWithSONA(task);
  }

  // Maintain backward compatibility
  async legacyCompatibilityLayer(oldAPI: any): Promise<any> {
    return this.adaptToNewAPI(oldAPI);
  }
}
```

## agentic-flow@alpha Feature Integration

### **SONA Learning Modes**
```typescript
interface SONAIntegration {
  modes: {
    realTime: '~0.05ms adaptation',
    balanced: 'general purpose learning',
    research: 'deep exploration mode',
    edge: 'resource-constrained environments',
    batch: 'high-throughput processing'
  };
}

// Integration implementation
class ClaudeFlowSONAAdapter {
  async initializeSONAMode(mode: SONAMode): Promise<void> {
    await this.agenticFlow.sona.setMode(mode);
    await this.configureAdaptationRate(mode);
  }
}
```

### **Flash Attention Integration**
```typescript
// Target: 2.49x-7.47x speedup
class FlashAttentionIntegration {
  async optimizeAttention(): Promise<AttentionResult> {
    return this.agenticFlow.attention.flashAttention({
      speedupTarget: '2.49x-7.47x',
      memoryReduction: '50-75%',
      mechanisms: ['multi-head', 'linear', 'local', 'global']
    });
  }
}
```

### **AgentDB Coordination**
```typescript
// 150x-12,500x faster search via HNSW
class AgentDBIntegration {
  async setupCrossAgentMemory(): Promise<void> {
    await this.agentdb.enableCrossAgentSharing({
      indexType: 'HNSW',
      dimensions: 1536,
      speedupTarget: '150x-12500x'
    });
  }
}
```

### **MCP Tools Integration**
```typescript
// Leverage 213 pre-built tools + 19 hook types
class MCPToolsIntegration {
  async integrateBuiltinTools(): Promise<void> {
    const tools = await this.agenticFlow.mcp.getAvailableTools();
    // 213 tools available
    await this.registerClaudeFlowSpecificTools(tools);
  }

  async setupHookTypes(): Promise<void> {
    const hookTypes = await this.agenticFlow.hooks.getTypes();
    // 19 hook types: pre$post execution, error handling, etc.
    await this.configureClaudeFlowHooks(hookTypes);
  }
}
```

### **RL Algorithm Integration**
```typescript
// Multiple RL algorithms for optimization
class RLIntegration {
  algorithms = [
    'PPO', 'DQN', 'A2C', 'MCTS', 'Q-Learning',
    'SARSA', 'Actor-Critic', 'Decision-Transformer',
    'Curiosity-Driven'
  ];

  async optimizeAgentBehavior(): Promise<void> {
    for (const algorithm of this.algorithms) {
      await this.agenticFlow.rl.train(algorithm, {
        episodes: 1000,
        learningRate: 0.001,
        rewardFunction: this.claudeFlowRewardFunction
      });
    }
  }
}
```

## Migration Implementation Plan

### **Phase 1: Foundation Adapter (Week 7)**
```typescript
// Create compatibility layer
class AgenticFlowAdapter {
  constructor(private agenticFlow: AgenticFlowCore) {}

  // Migrate SwarmCoordinator β†’ Swarm System
  async migrateSwarmCoordination(): Promise<void> {
    const swarmConfig = await this.extractSwarmConfig();
    await this.agenticFlow.swarm.initialize(swarmConfig);
    // Deprecate old SwarmCoordinator (800+ lines)
  }

  // Migrate AgentManager β†’ Agent Lifecycle
  async migrateAgentManagement(): Promise<void> {
    const agents = await this.extractActiveAgents();
    for (const agent of agents) {
      await this.agenticFlow.agent.create(agent);
    }
    // Deprecate old AgentManager (1,736 lines)
  }
}
```

### **Phase 2: Core Migration (Week 8-9)**
```typescript
// Migrate task execution
class TaskExecutionMigration {
  async migrateToTaskGraph(): Promise<void> {
    const tasks = await this.extractTasks();
    const taskGraph = this.buildTaskGraph(tasks);
    await this.agenticFlow.task.executeGraph(taskGraph);
  }
}

// Migrate session management
class SessionMigration {
  async migrateSessionHandling(): Promise<void> {
    const sessions = await this.extractActiveSessions();
    for (const session of sessions) {
      await this.agenticFlow.session.create(session);
    }
  }
}
```

### **Phase 3: Optimization (Week 10)**
```typescript
// Remove compatibility layer
class CompatibilityCleanup {
  async removeDeprecatedCode(): Promise<void> {
    // Remove old implementations
    await this.removeFile('src$core/SwarmCoordinator.ts'); // 800+ lines
    await this.removeFile('src$agents/AgentManager.ts');   // 1,736 lines
    await this.removeFile('src$task/TaskScheduler.ts');    // 500+ lines

    // Total code reduction: 10,000+ lines β†’ <5,000 lines
  }
}
```

## Performance Integration Targets

### **Flash Attention Optimization**
```typescript
// Target: 2.49x-7.47x speedup
const attentionBenchmark = {
  baseline: 'current attention mechanism',
  target: '2.49x-7.47x improvement',
  memoryReduction: '50-75%',
  implementation: 'agentic-flow@alpha Flash Attention'
};
```

### **AgentDB Search Performance**
```typescript
// Target: 150x-12,500x improvement
const searchBenchmark = {
  baseline: 'linear search in current memory systems',
  target: '150x-12,500x via HNSW indexing',
  implementation: 'agentic-flow@alpha AgentDB'
};
```

### **SONA Learning Performance**
```typescript
// Target: <0.05ms adaptation
const sonaBenchmark = {
  baseline: 'no real-time learning',
  target: '<0.05ms adaptation time',
  modes: ['real-time', 'balanced', 'research', 'edge', 'batch']
};
```

## Backward Compatibility Strategy

### **Gradual Migration Approach**
```typescript
class BackwardCompatibility {
  // Phase 1: Dual operation (old + new)
  async enableDualOperation(): Promise<void> {
    this.oldSystem.continue();
    this.newSystem.initialize();
    this.syncState(this.oldSystem, this.newSystem);
  }

  // Phase 2: Gradual switchover
  async migrateGradually(): Promise<void> {
    const features = this.getAllFeatures();
    for (const feature of features) {
      await this.migrateFeature(feature);
      await this.validateFeatureParity(feature);
    }
  }

  // Phase 3: Complete migration
  async completeTransition(): Promise<void> {
    await this.validateFullParity();
    await this.deprecateOldSystem();
  }
}
```

## Success Metrics & Validation

### **Code Reduction Targets**
- [ ] **Total Lines**: <5,000 orchestration (vs 15,000+)
- [ ] **SwarmCoordinator**: Eliminated (800+ lines)
- [ ] **AgentManager**: Eliminated (1,736+ lines)
- [ ] **TaskScheduler**: Eliminated (500+ lines)
- [ ] **Duplicate Logic**: <5% remaining

### **Performance Targets**
- [ ] **Flash Attention**: 2.49x-7.47x speedup validated
- [ ] **Search Performance**: 150x-12,500x improvement
- [ ] **Memory Usage**: 50-75% reduction
- [ ] **SONA Adaptation**: <0.05ms response time

### **Feature Parity**
- [ ] **100% Feature Compatibility**: All v2 features available
- [ ] **API Compatibility**: Backward compatible interfaces
- [ ] **Performance**: No regression, ideally improvement
- [ ] **Documentation**: Migration guide complete

## Coordination Points

### **Memory Specialist (Agent #7)**
- AgentDB integration coordination
- Cross-agent memory sharing setup
- Performance benchmarking collaboration

### **Swarm Specialist (Agent #8)**
- Swarm system migration from claude-flow to agentic-flow
- Topology coordination and optimization
- Agent communication protocol alignment

### **Performance Engineer (Agent #14)**
- Performance target validation
- Benchmark implementation for improvements
- Regression testing for migration phases

## Risk Mitigation

| Risk | Likelihood | Impact | Mitigation |
|------|------------|--------|------------|
| agentic-flow breaking changes | Medium | High | Pin version, maintain adapter |
| Performance regression | Low | Medium | Continuous benchmarking |
| Feature limitations | Medium | Medium | Contribute upstream features |
| Migration complexity | High | Medium | Phased approach, compatibility layer |

Overview

This skill is the v3 Integration Architect for deep integration between claude-flow and agentic-flow@alpha. It implements ADR-001 to remove duplicated implementation, consolidate functionality, and reduce orchestration code by 10,000+ lines while preserving feature parity and improving performance. Use it to plan, orchestrate, and execute a phased migration with validation and rollback controls.

How this skill works

The skill analyzes overlap between claude-flow and agentic-flow, generates adapter layers, and automates migration steps for swarm coordination, agent lifecycle, task execution, and session management. It integrates performance primitives (Flash Attention, AgentDB HNSW, SONA learning modes, MCP tools) and runs phased migrations with dual-operation, parity checks, and deprecation cleanup. Hooks run pre- and post-execution to capture state and store integration patterns.

When to use it

  • Consolidating two parallel agent frameworks into a single extensible platform
  • Eliminating duplicated orchestration code to reduce maintenance burden
  • Onboarding agentic-flow@alpha features (Flash Attention, AgentDB, SONA)
  • Performing controlled, phased migrations with backward compatibility
  • Validating performance targets and regression testing during integration

Best practices

  • Start with a compatibility adapter layer to enable dual operation and safe rollbacks
  • Migrate core systems incrementally: swarm, agents, tasks, then sessions
  • Automate benchmarks for Flash Attention, AgentDB, and SONA to detect regressions
  • Pin agentic-flow@alpha versions and surface breaking changes via adapters
  • Retire deprecated code only after validating 100% feature parity and tests

Example use cases

  • Replace claude-flow SwarmCoordinator with agentic-flow Swarm System to remove 800+ duplicate lines
  • Migrate AgentManager logic into agentic-flow Agent Lifecycle and register agents programmatically
  • Switch TaskScheduler to a task-graph execution model using agentic-flow task APIs
  • Integrate AgentDB HNSW indices for 150x–12,500x faster cross-agent memory search
  • Enable SONA real-time mode to achieve sub-0.05ms adaptation in low-latency workflows

FAQ

Will migration require downtime?

Noβ€”plan dual operation during Phase 1 to keep old and new systems running while syncing state; switchover is gradual to avoid disruption.

How are regressions detected?

Automated benchmarks and validation gates run after each migration step covering performance targets (attention, search, memory) and functional parity.