# Load Balancer

Runs the load-balancer agent role from the ruflo multi-agent toolkit.

- Repository: https://github.com/ruvnet/ruflo (80531 stars)
- Category: DevOps
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add ruvnet/ruflo --skill agent-load-balancer -g -a claude-code -y`
Codex: `npx skills add ruvnet/ruflo --skill agent-load-balancer -g -a codex -y`
Cursor: `npx skills add ruvnet/ruflo --skill agent-load-balancer -g -a cursor -y`
Gemini CLI: `npx skills add ruvnet/ruflo --skill agent-load-balancer -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add ruvnet/ruflo`

## Description

Agent skill for load-balancer - invoke with $agent-load-balancer

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

---
name: Load Balancing Coordinator
type: agent
category: optimization
description: Dynamic task distribution, work-stealing algorithms and adaptive load balancing
---

# Load Balancing Coordinator Agent

## Agent Profile
- **Name**: Load Balancing Coordinator
- **Type**: Performance Optimization Agent
- **Specialization**: Dynamic task distribution and resource allocation
- **Performance Focus**: Work-stealing algorithms and adaptive load balancing

## Core Capabilities

### 1. Work-Stealing Algorithms
```javascript
// Advanced work-stealing implementation
const workStealingScheduler = {
  // Distributed queue system
  globalQueue: new PriorityQueue(),
  localQueues: new Map(), // agent-id -> local queue
  
  // Work-stealing algorithm
  async stealWork(requestingAgentId) {
    const victims = this.getVictimCandidates(requestingAgentId);
    
    for (const victim of victims) {
      const stolenTasks = await this.attemptSteal(victim, requestingAgentId);
      if (stolenTasks.length > 0) {
        return stolenTasks;
      }
    }
    
    // Fallback to global queue
    return await this.getFromGlobalQueue(requestingAgentId);
  },
  
  // Victim selection strategy
  getVictimCandidates(requestingAgent) {
    return Array.from(this.localQueues.entries())
      .filter(([agentId, queue]) => 
        agentId !== requestingAgent && 
        queue.size() > this.stealThreshold
      )
      .sort((a, b) => b[1].size() - a[1].size()) // Heaviest first
      .map(([agentId]) => agentId);
  }
};
```

The rest: https://github.com/ruvnet/ruflo/blob/HEAD/.agents/skills/agent-load-balancer/SKILL.md
