AG

agent-topology-optimizer

An optimization agent that reconfigures communication networks between swarm participants.

Install

mkdir -p .claude/skills/agent-topology-optimizer && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5853" && unzip -o skill.zip -d .claude/skills/agent-topology-optimizer && rm skill.zip

Installs to .claude/skills/agent-topology-optimizer

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Agent skill for topology-optimizer - invoke with $agent-topology-optimizer
74 charsno explicit “when” trigger
Advanced

Key capabilities

  • Analyzes current swarm performance metrics
  • Reconfigures network topologies dynamically
  • Evaluates mesh/star/hierarchical structures
  • Plans agent migration for optimal flow
  • Predicts workload-based efficiency gains

How it works

It runs a predictive analysis model against the current swarm state to generate candidate topologies and evaluates them via multi-objective metrics.

Inputs & outputs

You give it
Swarm workload profile and constraints
You get back
Optimal topology configuration plan

When to use agent-topology-optimizer

  • Improving swarm performance
  • Reconfiguring agent communication
  • Optimizing network topology

About this skill


name: Topology Optimizer type: agent category: optimization description: Dynamic swarm topology reconfiguration and communication pattern optimization

Topology Optimizer Agent

Agent Profile

  • Name: Topology Optimizer
  • Type: Performance Optimization Agent
  • Specialization: Dynamic swarm topology reconfiguration and network optimization
  • Performance Focus: Communication pattern optimization and adaptive network structures

Core Capabilities

1. Dynamic Topology Reconfiguration

// Advanced topology optimization system
class TopologyOptimizer {
  constructor() {
    this.topologies = {
      hierarchical: new HierarchicalTopology(),
      mesh: new MeshTopology(),
      ring: new RingTopology(),
      star: new StarTopology(),
      hybrid: new HybridTopology(),
      adaptive: new AdaptiveTopology()
    };
    
    this.optimizer = new NetworkOptimizer();
    this.analyzer = new TopologyAnalyzer();
    this.predictor = new TopologyPredictor();
  }
  
  // Intelligent topology selection and optimization
  async optimizeTopology(swarm, workloadProfile, constraints = {}) {
    // Analyze current topology performance
    const currentAnalysis = await this.analyzer.analyze(swarm.topology);
    
    // Generate topology candidates based on workload
    const candidates = await this.generateCandidates(workloadProfile, constraints);
    
    // Evaluate each candidate topology
    const evaluations = await Promise.all(
      candidates.map(candidate => this.evaluateTopology(candidate, workloadProfile))
    );
    
    // Select optimal topology using multi-objective optimization
    const optimal = this.selectOptimalTopology(evaluations, constraints);
    
    // Plan migration strategy if topology change is beneficial
    if (optimal.improvement > constraints.minImprovement || 0.1) {
      const migrationPlan = await this.planMigration(swarm.topology, optimal.topology);
      return {
        recommended: optimal.topology,
        improvement: optimal.improvement,
        migrationPlan,
        estimatedDowntime: migrationPlan.estimatedDowntime,
        benefits: optimal.benefits
      };
    }
    
    return { recommended: null, reason: 'No significant improvement found' };
  }
  
  // Generate topology candidates
  async generateCandidates(workloadProfile, constraints) {
    const candidates = [];
    
    // Base topology variations
    for (const [type, topology] of Object.entries(this.topologies)) {
      if (this.isCompatible(type, workloadProfile, constraints)) {
        const variations = await topology.generateVariations(workloadProfile);
        candidates.push(...variations);
      }
    }
    
    // Hybrid topology generation
    const hybrids = await this.generateHybridTopologies(workloadProfile, constraints);
    candidates.push(...hybrids);
    
    // AI-generated novel topologies
    const aiGenerated = await this.generateAITopologies(workloadProfile);
    candidates.push(...aiGenerated);
    
    return candidates;
  }
  
  // Multi-objective topology evaluation
  async evaluateTopology(topology, workloadProfile) {
    const metrics = await this.calculateTopologyMetrics(topology, workloadProfile);
    
    return {
      topology,
      metrics,
      score: this.calculateOverallScore(metrics),
      strengths: this.identifyStrengths(metrics),
      weaknesses: this.identifyWeaknesses(metrics),
      suitability: this.calculateSuitability(metrics, workloadProfile)
    };
  }
}

2. Network Latency Optimization

// Advanced network latency optimization
class NetworkLatencyOptimizer {
  constructor() {
    this.latencyAnalyzer = new LatencyAnalyzer();
    this.routingOptimizer = new RoutingOptimizer();
    this.bandwidthManager = new BandwidthManager();
  }
  
  // Comprehensive latency optimization
  async optimizeLatency(network, communicationPatterns) {
    const optimization = {
      // Physical network optimization
      physical: await this.optimizePhysicalNetwork(network),
      
      // Logical routing optimization
      routing: await this.optimizeRouting(network, communicationPatterns),
      
      // Protocol optimization
      protocol: await this.optimizeProtocols(network),
      
      // Caching strategies
      caching: await this.optimizeCaching(communicationPatterns),
      
      // Compression optimization
      compression: await this.optimizeCompression(communicationPatterns)
    };
    
    return optimization;
  }
  
  // Physical network topology optimization
  async optimizePhysicalNetwork(network) {
    // Calculate optimal agent placement
    const placement = await this.calculateOptimalPlacement(network.agents);
    
    // Minimize communication distance
    const distanceOptimization = this.optimizeCommunicationDistance(placement);
    
    // Bandwidth allocation optimization
    const bandwidthOptimization = await this.optimizeBandwidthAllocation(network);
    
    return {
      placement,
      distanceOptimization,
      bandwidthOptimization,
      expectedLatencyReduction: this.calculateExpectedReduction(
        distanceOptimization, 
        bandwidthOptimization
      )
    };
  }
  
  // Intelligent routing optimization
  async optimizeRouting(network, patterns) {
    // Analyze communication patterns
    const patternAnalysis = this.analyzeCommunicationPatterns(patterns);
    
    // Generate optimal routing tables
    const routingTables = await this.generateOptimalRouting(network, patternAnalysis);
    
    // Implement adaptive routing
    const adaptiveRouting = new AdaptiveRoutingSystem(routingTables);
    
    // Load balancing across routes
    const loadBalancing = new RouteLoadBalancer(routingTables);
    
    return {
      routingTables,
      adaptiveRouting,
      loadBalancing,
      patternAnalysis
    };
  }
}

3. Agent Placement Strategies

// Sophisticated agent placement optimization
class AgentPlacementOptimizer {
  constructor() {
    this.algorithms = {
      genetic: new GeneticPlacementAlgorithm(),
      simulated_annealing: new SimulatedAnnealingPlacement(),
      particle_swarm: new ParticleSwarmPlacement(),
      graph_partitioning: new GraphPartitioningPlacement(),
      machine_learning: new MLBasedPlacement()
    };
  }
  
  // Multi-algorithm agent placement optimization
  async optimizePlacement(agents, constraints, objectives) {
    const results = new Map();
    
    // Run multiple algorithms in parallel
    const algorithmPromises = Object.entries(this.algorithms).map(
      async ([name, algorithm]) => {
        const result = await algorithm.optimize(agents, constraints, objectives);
        return [name, result];
      }
    );
    
    const algorithmResults = await Promise.all(algorithmPromises);
    
    for (const [name, result] of algorithmResults) {
      results.set(name, result);
    }
    
    // Ensemble optimization - combine best results
    const ensembleResult = await this.ensembleOptimization(results, objectives);
    
    return {
      bestPlacement: ensembleResult.placement,
      algorithm: ensembleResult.algorithm,
      score: ensembleResult.score,
      individualResults: results,
      improvementPotential: ensembleResult.improvement
    };
  }
  
  // Genetic algorithm for agent placement
  async geneticPlacementOptimization(agents, constraints) {
    const ga = new GeneticAlgorithm({
      populationSize: 100,
      mutationRate: 0.1,
      crossoverRate: 0.8,
      maxGenerations: 500,
      eliteSize: 10
    });
    
    // Initialize population with random placements
    const initialPopulation = this.generateInitialPlacements(agents, constraints);
    
    // Define fitness function
    const fitnessFunction = (placement) => this.calculatePlacementFitness(placement, constraints);
    
    // Evolve optimal placement
    const result = await ga.evolve(initialPopulation, fitnessFunction);
    
    return {
      placement: result.bestIndividual,
      fitness: result.bestFitness,
      generations: result.generations,
      convergence: result.convergenceHistory
    };
  }
  
  // Graph partitioning for agent placement
  async graphPartitioningPlacement(agents, communicationGraph) {
    // Use METIS-like algorithm for graph partitioning
    const partitioner = new GraphPartitioner({
      objective: 'minimize_cut',
      balanceConstraint: 0.05, // 5% imbalance tolerance
      refinement: true
    });
    
    // Create communication weight matrix
    const weights = this.createCommunicationWeights(agents, communicationGraph);
    
    // Partition the graph
    const partitions = await partitioner.partition(communicationGraph, weights);
    
    // Map partitions to physical locations
    const placement = this.mapPartitionsToLocations(partitions, agents);
    
    return {
      placement,
      partitions,
      cutWeight: partitioner.getCutWeight(),
      balance: partitioner.getBalance()
    };
  }
}

4. Communication Pattern Optimization

// Advanced communication pattern optimization
class CommunicationOptimizer {
  constructor() {
    this.patternAnalyzer = new PatternAnalyzer();
    this.protocolOptimizer = new ProtocolOptimizer();
    this.messageOptimizer = new MessageOptimizer();
    this.compressionEngine = new CompressionEngine();
  }
  
  // Comprehensive communication optimization
  async optimizeCommunication(swarm, historicalData) {
    // Analyze communication patterns
    const patterns = await this.patternAnalyzer.analyze(historicalData);
    
    // Optimize based on pattern analysis
    const optimizations = {
      // Message batching optimization
      batching: await this.optimizeMessageBatching(patterns),
      
      // Protocol selection optimization
      protocols: await this.optimizeProtocols(patterns),
      
      // Compression optimization
      compression: await this.optimizeCompression(patterns),
      
      // Caching strategies
      ca

---

*Content truncated.*

When not to use it

  • In small, single-agent setups
  • When network stability is prioritized over throughput

Limitations

  • Complex migrations can temporarily disrupt swarm state
  • Requires accurate workload profiles

How it compares

It actively modifies the communication structure between agents, rather than simply passing messages through a static configuration.

Compared to similar skills

agent-topology-optimizer side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
agent-topology-optimizer (this skill)16moReviewAdvanced
agent-orchestration-multi-agent-optimize24moNo flagsAdvanced
unbrowse52moReviewIntermediate
posthog-performance-tuning127dReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

agent-orchestration-multi-agent-optimize

sickn33

Optimize multi-agent systems with coordinated profiling, workload distribution, and cost-aware orchestration. Use when improving agent performance, throughput, or reliability.

218

unbrowse

unbrowse-ai

Analyze any website's network traffic and turn it into reusable API skills backed by a shared marketplace. Skills discovered by any agent are published, scored, and reusable by all agents. Capture network traffic, discover API endpoints, learn patterns, execute learned skills, and manage auth for gated sites. Use when someone wants to extract structured data from a website, discover API endpoints, automate web interactions, or work without official API documentation.

57

posthog-performance-tuning

jeremylongshore

Optimize PostHog API performance with caching, batching, and connection pooling. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for PostHog integrations. Trigger with phrases like "posthog performance", "optimize posthog", "posthog latency", "posthog caching", "posthog slow", "posthog batch".

11

coderabbit-performance-tuning

jeremylongshore

Optimize CodeRabbit API performance with caching, batching, and connection pooling. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for CodeRabbit integrations. Trigger with phrases like "coderabbit performance", "optimize coderabbit", "coderabbit latency", "coderabbit caching", "coderabbit slow", "coderabbit batch".

01

performance-analysis

ruvnet

Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms

10

skill-tuning

catlog22

Universal skill diagnosis and optimization tool. Detect and fix skill execution issues including context explosion, long-tail forgetting, data flow disruption, and agent coordination failures. Supports Gemini CLI for deep analysis. Triggers on "skill tuning", "tune skill", "skill diagnosis", "optimize skill", "skill debug".

10

Search skills

Search the agent skills registry