
Agent Load Balancer
Distribute tasks across multiple agents with work-stealing queues and adaptive balancing so solo-built swarms do not idle while one worker overloads.
Overview
agent-load-balancer is an agent skill most often used in Operate (also Build) that coordinates multi-agent task queues with work-stealing and adaptive load balancing.
Install
npx skills add https://github.com/ruvnet/ruflo --skill agent-load-balancerWhat is this skill?
- Work-stealing scheduler with global priority queue and per-agent local queues
- Victim selection strategy before falling back to the global queue
- Load Balancing Coordinator agent profile focused on dynamic task distribution
- JavaScript-oriented reference implementation for stealWork and queue maps
- Positioned for performance optimization under uneven agent utilization
Adoption & trust: 644 installs on skills.sh; 58.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your multi-agent setup piles work on one worker while others sit idle because you lack a steal-aware scheduler and shared queue fallback.
Who is it for?
Solo builders operating custom JavaScript or Node orchestrators with several parallel agents and unpredictable task sizes.
Skip if: Single-agent Claude sessions, managed Kubernetes ingress-only scaling, or teams without a process that enqueues discrete agent tasks.
When should I use this skill?
Invoke with $agent-load-balancer when coordinating dynamic task distribution, work-stealing, and adaptive load balancing across agents.
What do I get? / Deliverables
Tasks flow through local and global queues with work-stealing so agents rebalance under load without manual task reassignment.
- Work-stealing scheduler pattern integrated into your orchestrator
- Documented global vs local queue policy
- Tuned victim-selection and fallback behavior under load
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Operate is canonical because load balancing matters once several agents run concurrently in production-like workloads, not only during first scaffold. Infra subphase covers schedulers, global vs local queues, victim selection, and work-stealing coordination code paths.
Where it fits
Embed local queues and steal hooks when you scaffold a Node-based agent farm for codegen shards.
Stress-test steal thresholds so P95 task wait stays flat when bursty PR review jobs arrive.
Tune victim selection when one agent class consistently hoards long-running research tasks.
How it compares
Orchestration pattern skill for agent task queues—not AWS ALB configuration or generic HTTP reverse-proxy setup.
Common Questions / FAQ
Who is agent-load-balancer for?
Developers running ruflo-style or custom multi-agent runners who need code-level work-stealing rather than a SaaS scheduler.
When should I use agent-load-balancer?
In Operate when production swarms show hot spots; in Build when you first wire local/global queues into your orchestrator; and during Ship perf passes when validating parallel agent throughput.
Is agent-load-balancer safe to install?
Use the Security Audits panel on this Prism page; stealing tasks across agents can affect ordering and idempotency—review concurrency rules in your own codebase.
SKILL.md
READMESKILL.md - Agent Load Balancer
--- 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); } }; ``` ### 2. Dynamic Load Balancing ```javascript // Real-time load balancing system const loadBalancer = { // Agent capacity tracking agentCapacities: new Map(), currentLoads: new Map(), performanceMetrics: new Map(), // Dynamic load balancing async balanceLoad() { const agents = await this.getActiveAgents(); const loadDistribution = this.calculateLoadDistribution(agents); // Identify overloaded and underloaded agents const { overloaded, underloaded } = this.categorizeAgents(loadDistribution); // Migrate tasks from overloaded to underloaded agents for (const overloadedAgent of overloaded) { const candidateTasks = await this.getMovableTasks(overloadedAgent.id); const targetAgent = this.selectTargetAgent(underloaded, candidateTasks); if (targetAgent) { await this.migrateTasks(candidateTasks, overloadedAgent.id, targetAgent.id); } } }, // Weighted Fair Queuing implementation async scheduleWithWFQ(tasks) { const weights = await this.calculateAgentWeights(); const virtualTimes = new Map(); return tasks.sort((a, b) => { const aFinishTime = this.calculateFinishTime(a, weights, virtualTimes); const bFinishTime = this.calculateFinishTime(b, weights, virtualTimes); return aFinishTime - bFinishTime; }); } }; ``` ### 3. Queue Management & Prioritization ```javascript // Advanced queue management system class PriorityTaskQueue { constructor() { this.queues = { critical: new PriorityQueue((a, b) => a.deadline - b.deadline), high: new PriorityQueue((a, b) => a.priority - b.priority), normal: new WeightedRoundRobinQueue(), low: new FairShareQueue() }; this.schedulingWeights = { critical: 0.4, high: 0.3, normal: 0.2, low: 0.1 }; } // Multi-level feedback queue scheduling async scheduleNext() { // Critical tasks always first if (!this.queues.critical.isEmpty()) { return this.queues.critical.dequeue(); } // Use weighted scheduling for other levels const random = Math.random(); let cumulative = 0; for (const [level, weight] of Object.entries(this.schedulingWeights)) { cumulative += weight; if (random <= cumulative && !this.queues[level].isEmpty()) { return this.queues[