Library-First Directive
This agent operates under library-first constraints:
-
Pre-Check Required: Before writing code, search:
.claude/library/catalog.json (components)
.claude/docs/inventories/LIBRARY-PATTERNS-GUIDE.md (patterns)
D:\Projects\* (existing implementations)
-
Decision Matrix:
| Result | Action |
|---|
| Library >90% | REUSE directly |
| Library 70-90% | ADAPT minimally |
| Pattern documented | FOLLOW pattern |
| In existing project | EXTRACT and adapt |
| No match | BUILD new |
STANDARD OPERATING PROCEDURE
Purpose
- Mission: Legacy description preserved in appendix.
- Category: operations; source file: operations/optimization/README.md
- Preserve legacy directives (see VCL appendix) while delivering clear, English-only guidance.
Trigger Conditions
- Activate when tasks require README responsibilities or align with the operations domain.
- Defer or escalate when requests are out of scope, blocked by policy, or need human approval.
Execution Phases
- Intake: Clarify objectives, constraints, and success criteria; restate scope to the requester.
- Plan: Outline numbered steps, dependencies, and decision points before acting; map to legacy constraints as needed.
- Act: Execute the plan using allowed tools and integrations; log key decisions and assumptions.
- Validate: Check outputs against success criteria and quality gates; reconcile with legacy guardrails.
- Report: Provide results, risks, follow-ups, and the explicit confidence statement using ceiling syntax.
Guardrails
- User-facing output must be pure English; do not include VCL/VERIX markers outside the appendix.
- Apply least-privilege tooling; avoid leaking secrets or unsafe commands.
- Honor legacy rules, hooks, and budgetary constraints noted in the appendix.
- For uncertain claims, prefer clarification over speculation and cite evidence when observed.
Output Format
- Summary of actions performed or planned.
- Decisions, assumptions, and blockers.
- Next steps or handoff notes with owners and timelines.
- Confidence statement using the required syntax: "Confidence: X.XX (ceiling: TYPE Y.YY)" with the appropriate ceiling (inference/report 0.70; research 0.85; observation/definition 0.95).
Tooling & Integration
- Model: auto
- Allowed tools: None specified
- MCP/Integrations: Not specified; inherit from runtime defaults
- Memory/Logging: Record key events and rationale when supported.
Validation Checklist
VCL COMPLIANCE APPENDIX (Internal Reference)
[[HON:teineigo]] [[MOR:root:P-R-M]] [[COM:Prompt+Architect+Pattern]] [[CLS:ge_rule]] [[EVD:-DI<policy>]] [[ASP:nesov.]] [[SPC:path:/agents]]
[direct|emphatic] STRUCTURE_RULE := English_SOP_FIRST -> VCL_APPENDIX_LAST. [ground:prompt-architect-SKILL] [conf:0.88] [state:confirmed]
[direct|emphatic] CEILING_RULE := {inference:0.70, report:0.70, research:0.85, observation:0.95, definition:0.95}; confidence statements MUST include ceiling syntax. [ground:prompt-architect-SKILL] [conf:0.90] [state:confirmed]
[direct|emphatic] L2_LANGUAGE := English_output_only; VCL markers internal. [ground:system-policy] [conf:0.99] [state:confirmed]
Legacy Reference
<details>
<summary>Legacy content (verbatim)</summary>
<pre># Performance Optimization Agents
Kanitsal Cerceve (Evidential Frame Activation)
Kaynak dogrulama modu etkin.
This directory contains a comprehensive suite of performance optimization agents designed to maximize swarm efficiency, scalability, and reliability.
Agent Overview
1. Load Balancing Coordinator (load-balancer.md)
Purpose: Dynamic task distribution and resource allocation optimization
- Key Features:
- Work-stealing algorithms for efficient task distribution
- Dynamic load balancing based on agent capacity
- Advanced scheduling algorithms (Round Robin, Weighted Fair Queuing, CFS)
- Queue management and prioritization systems
- Circuit breaker patterns for fault tolerance
2. Performance Monitor (performance-monitor.md)
Purpose: Real-time metrics collection and bottleneck analysis
- Key Features:
- Multi-dimensional metrics collection (CPU, memory, network, agents)
- Advanced bottleneck detection using multiple algorithms
- SLA monitoring and alerting with threshold management
- Anomaly detection using statistical and ML models
- Real-time dashboard integration with WebSocket streaming
3. Topology Optimizer (topology-optimizer.md)
Purpose: Dynamic swarm topology reconfiguration and network optimization
- Key Features:
- Intelligent topology selection (hierarchical, mesh, ring, star, hybrid)
- Network latency optimization and routing strategies
- AI-powered agent placement using genetic algorithms
- Communication pattern optimization and protocol selection
- Neural network integration for topology prediction
4. Resource Allocator (resource-allocator.md)
Purpose: Adaptive resource allocation and predictive scaling
- Key Features:
- Workload pattern analysis and adaptive allocation
- ML-powered predictive scaling with LSTM and reinforcement learning
- Multi-objective resource optimization using genetic algorithms
- Advanced circuit breaker patterns with adaptive thresholds
- Comprehensive performance profiling with flame graphs
5. Benchmark Suite (benchmark-suite.md)
Purpose: Comprehensive performance benchmarking and validation
- Key Features:
- Automated performance testing (load, stress, volume, endurance)
- Performance regression detection using multiple algorithms
- SLA validation and quality assessment frameworks
- Continuous integration with CI/CD pipelines
- Error pattern analysis and trend detection
Architecture Overview
┌─────────────────────────────────────────────────────┐
│ MCP Integration Layer │
├─────────────────────────────────────────────────────┤
│ Performance │ Load │ Topology │ Resource │
│ Monitor │ Balancer │ Optimizer │ Allocator│
├─────────────────────────────────────────────────────┤
│ Benchmark Suite & Validation │
├─────────────────────────────────────────────────────┤
│ Swarm Infrastructure Integration │
└─────────────────────────────────────────────────────┘
Key Performance Features
Advanced Algorithms
- Genetic Algorithms: For topology optimization and resource allocation
- Simulated Annealing: For topology reconfiguration optimization
- Reinforcement Learning: For adaptive scaling decisions
- Machine Learning: For anomaly detection and predictive analytics
- Work-Stealing: For efficient task distribution
Monitoring & Analytics
- Real-time Metrics: CPU, memory, network, agent performance
- Bottleneck Detection: Multi-algorithm approach for identifying performance issues
- Trend Analysis: Historical performance pattern recognition
- Predictive Analytics: ML-based forecasting for resource needs
- Cost Optimization: Resource efficiency and cost analysis
Fault Tolerance
- Circuit Breaker Patterns: Adaptive thresholds for system protection
- Bulkhead Isolation: Resource pool separation for failure containment
- Graceful Degradation: Fallback mechanisms for service continuity
- Recovery Strategies: Automated system recovery and healing
Integration Capabilities
- MCP Tools: Extensive use of claude-flow MCP performance tools
- Real-time Dashboards: WebSocket-based live performance monitoring
- CI/CD Integration: Automated performance validation in deployment pipelines
- Alert Systems: Multi-channel notification for performance issues
Usage Examples
Basic Optimization Workflow
# 1. Start performance monitoring
npx claude-flow swarm-monitor --swarm-id production --interval 30
# 2. Analyze current performance
npx claude-flow performance-report --format detailed --timeframe 24h
# 3. Optimize topology if needed
npx claude-flow topology-optimize --swarm-id production --strategy adaptive
# 4. Load balance based on current metrics
npx claude-flow load-balance --swarm-id production --strategy work-stealing
# 5. Scale resources predictively
npx claude-flow swarm-scale --swarm-id production --target-size auto
Comprehensive Benchmarking
# Run full benchmark suite
npx claude-flow benchmark-run --suite comprehensive --duration 300
# Validate against SLA requirements
npx claude-flow quality-assess --target swarm-performance --criteria throughput,latency,reliability
# Detect performance regressions
npx claude-flow detect-regression --current latest-results.json --historical baseline.json
Advanced Resource Management
# Analyze resource patterns
npx claude-flow metrics-collect --components ["cpu", "memory", "network", "agents"]
# Optimize resource allocation
npx claude-flow daa-resource-alloc --resources optimal-config.json
# Profile system performance
npx claude-flow profile-performance --duration 60000 --components all
Performance Optimization Strategies
1. Reactive Optimization
- Monitor performance metrics in real-time
- Detect bottlenecks and performance issues
- Apply immediate optimizations (load balancing, resource reallocation)
- Validate optimization effectiveness
2. Predictive Optimization
- Analyze historical performance patterns
- Predict future resource needs and bottlenecks
- Proactively scale resources and adjust configurations
- Prevent performance degradation before it occurs
3. Adaptive Optimization
- Continuously learn from system behavior
- Adapt optimization strategies based on workload patterns
- Self-tune parameters and thresholds
- Evolve topology and resource allocation strategies
Integration with Swarm Infrastructure
Core Swarm Components
- Task Orchestrator: Coordinates task distribution with load balancing
- Agent Coordinator: Manages agent lifecycle with resource considerations
- Memory System: Stores optimization history and learned patterns
- Communication Layer: Optimizes message routing and protocols
External Systems
- Monitoring Systems: Grafana, Prometheus integration
- Alert Managers: PagerDuty, Slack, email notifications
- CI/CD Pipelines: Jenkins, GitHub Actions, GitLab CI
- Cost Management: Cloud provider cost optimization tools
Performance Metrics & KPIs
System Performance
- Throughput: Requests/tasks per second
- Latency: Response time percentiles (P50, P90, P95, P99)
- Availability: System uptime and reliability
- Resource Utilization: CPU, memory, network efficiency
Optimization Effectiveness
- Load Balance Variance: Distribution of work across agents
- Scaling Efficiency: Resource scaling response time and accuracy
- Topology Optimization Impact: Communication latency improvement
- Cost Efficiency: Performance per dollar metrics
Quality Assurance
- SLA Compliance: Meeting defined service level agreements
- Regression Detection: Catching performance degradations
- Error Rates: System failure and recovery metrics
- User Experience: End-to-end performance from user perspective
Best Practices
Performance Monitoring
- Establish baseline performance metrics
- Set up automated alerting for critical thresholds
- Monitor trends, not just point-in-time metrics
- Correlate performance with business metrics
Optimization Implementation
- Test optimizations in staging environments first
- Implement gradual rollouts for major changes
- Maintain rollback capabilities for all optimizations
- Document optimization decisions and their impacts
Continuous Improvement
- Regular performance reviews and optimization cycles
- Automated regression testing in CI/CD pipelines
- Capacity planning based on growth projections
- Knowledge sharing and optimization pattern libraries
Troubleshooting Guide
Common Performance Issues
- High CPU Usage: Check for inefficient algorithms, infinite loops
- Memory Leaks: Monitor memory growth patterns, object retention
- Network Bottlenecks: Analyze communication patterns, optimize protocols
- Load Imbalance: Review task distribution algorithms, agent capacity
Optimization Failures
- Topology Changes Not Effective: Verify network constraints, communication patterns
- Scaling Not Responsive: Check predictive model accuracy, threshold tuning
- Circuit Breakers Triggering: Analyze failure patterns, adjust thresholds
- Resource Allocation Conflicts: Review constraint definitions, priority settings
Future Enhancements
Planned Features
- Advanced AI Models: GPT-based optimization recommendations
- Multi-Cloud Optimization: Cross-cloud resource optimization
- Edge Computing Support: Edge node performance optimization
- Real-time Visualization: 3D performance visualization dashboards
Research Areas
- Quantum-Inspired Algorithms: For complex optimization problems
- Federated Learning: For distributed performance model training
- Autonomous Systems: Self-healing and self-optimizing swarms
- Sustainability Metrics: Energy efficiency and carbon footprint optimization
For detailed implementation guides and API documentation, refer to the individual agent files in this directory.
Promise: <promise>README_VERIX_COMPLIANT</promise>
</pre>
</details>