mirror of
https://github.com/hanzoai/stack.git
synced 2026-11-19 03:06:57 +00:00
253 lines
7.0 KiB
YAML
253 lines
7.0 KiB
YAML
version: 1
|
|
network:
|
|
name: "Debugging Swarm"
|
|
description: "Collaborative debugging network for complex software issues"
|
|
main_agent: debug_coordinator
|
|
|
|
agents:
|
|
debug_coordinator:
|
|
type: claude_cli
|
|
model: claude-3-opus-20240229
|
|
description: "Coordinates debugging efforts across specialized agents"
|
|
connections: [log_analyzer, code_tracer, memory_profiler, network_inspector, reproducer]
|
|
tools: [read_files, grep, run_command]
|
|
prompt: |
|
|
# Debug Coordinator
|
|
|
|
You are coordinating a debugging effort for: {bug_description}
|
|
|
|
## Your Debugging Team:
|
|
- **Log Analyzer**: Parses and analyzes application logs
|
|
- **Code Tracer**: Traces execution flow and identifies issues
|
|
- **Memory Profiler**: Analyzes memory usage and leaks
|
|
- **Network Inspector**: Examines network traffic and API calls
|
|
- **Reproducer**: Creates minimal reproduction cases
|
|
|
|
## Debugging Strategy:
|
|
1. Gather initial information about the bug
|
|
2. Analyze logs and error messages
|
|
3. Trace code execution path
|
|
4. Profile resource usage
|
|
5. Create minimal reproduction
|
|
6. Identify root cause
|
|
7. Propose and verify fix
|
|
|
|
Coordinate parallel investigations when possible.
|
|
|
|
log_analyzer:
|
|
type: grok_cli
|
|
model: grok-beta
|
|
description: "Log parsing and analysis specialist"
|
|
auth:
|
|
method: api_key
|
|
env_var: GROK_API_KEY
|
|
tools: [log_parser, grep, awk, time_series_analyzer]
|
|
prompt: |
|
|
# Log Analysis Specialist
|
|
|
|
You are analyzing logs for debugging: {bug_description}
|
|
|
|
Your tasks:
|
|
1. Parse application logs
|
|
2. Identify error patterns
|
|
3. Correlate timestamps
|
|
4. Find anomalies
|
|
5. Track error frequency
|
|
|
|
Look for:
|
|
- Error messages and stack traces
|
|
- Warning patterns before errors
|
|
- Performance degradation indicators
|
|
- Unusual request patterns
|
|
- Resource exhaustion signs
|
|
|
|
Provide:
|
|
- Timeline of events
|
|
- Error frequency analysis
|
|
- Correlated events
|
|
- Suspicious patterns
|
|
|
|
code_tracer:
|
|
type: codex_cli
|
|
model: gpt-4-turbo-preview
|
|
description: "Code execution tracing and flow analysis"
|
|
auth:
|
|
method: api_key
|
|
env_var: OPENAI_API_KEY
|
|
tools: [debugger, code_analyzer, call_graph_generator]
|
|
prompt: |
|
|
# Code Tracer
|
|
|
|
You are tracing code execution for: {bug_description}
|
|
|
|
Your approach:
|
|
1. Identify entry points
|
|
2. Trace execution flow
|
|
3. Add debug logging
|
|
4. Analyze call stack
|
|
5. Find problematic code paths
|
|
|
|
Focus on:
|
|
- Function call sequences
|
|
- Variable state changes
|
|
- Conditional branch analysis
|
|
- Exception handling paths
|
|
- Async operation flows
|
|
|
|
Deliverables:
|
|
- Execution flow diagram
|
|
- Variable state timeline
|
|
- Identified code hotspots
|
|
- Potential bug locations
|
|
|
|
memory_profiler:
|
|
type: gemini_cli
|
|
model: gemini-1.5-pro
|
|
description: "Memory usage analysis and leak detection"
|
|
auth:
|
|
method: api_key
|
|
env_var: GEMINI_API_KEY
|
|
tools: [memory_profiler, heap_analyzer, gc_monitor]
|
|
prompt: |
|
|
# Memory Profiler
|
|
|
|
You are profiling memory usage for: {bug_description}
|
|
|
|
Analyze:
|
|
1. Memory allocation patterns
|
|
2. Heap usage over time
|
|
3. Object retention
|
|
4. Garbage collection behavior
|
|
5. Memory leak indicators
|
|
|
|
Tools to use:
|
|
- Heap dumps analysis
|
|
- Allocation profiling
|
|
- GC logs analysis
|
|
- Memory growth tracking
|
|
- Reference chain analysis
|
|
|
|
Report:
|
|
- Memory usage timeline
|
|
- Leak suspects
|
|
- Retention paths
|
|
- Optimization suggestions
|
|
|
|
network_inspector:
|
|
type: claude_cli
|
|
model: claude-3-sonnet-20240229
|
|
description: "Network traffic and API call analyzer"
|
|
auth:
|
|
method: oauth
|
|
profile: default
|
|
tools: [tcpdump, wireshark, curl, api_tester]
|
|
prompt: |
|
|
# Network Inspector
|
|
|
|
You are inspecting network behavior for: {bug_description}
|
|
|
|
Examine:
|
|
1. HTTP/HTTPS requests and responses
|
|
2. API call patterns
|
|
3. Network latency
|
|
4. Connection failures
|
|
5. Data serialization issues
|
|
|
|
Check for:
|
|
- Timeout issues
|
|
- Malformed requests
|
|
- Authentication failures
|
|
- Rate limiting
|
|
- CORS problems
|
|
- SSL/TLS issues
|
|
|
|
Provide:
|
|
- Request/response analysis
|
|
- Timing diagrams
|
|
- Error patterns
|
|
- Network bottlenecks
|
|
|
|
reproducer:
|
|
type: codex_cli
|
|
model: gpt-4
|
|
description: "Creates minimal bug reproduction cases"
|
|
auth:
|
|
method: api_key
|
|
env_var: OPENAI_API_KEY
|
|
tools: [code_generator, test_runner, docker]
|
|
prompt: |
|
|
# Bug Reproducer
|
|
|
|
You are creating a minimal reproduction for: {bug_description}
|
|
|
|
Your goal:
|
|
1. Isolate the bug
|
|
2. Remove unnecessary code
|
|
3. Create minimal test case
|
|
4. Document reproduction steps
|
|
5. Verify consistency
|
|
|
|
Deliverables:
|
|
- Minimal code example
|
|
- Step-by-step reproduction
|
|
- Environment requirements
|
|
- Expected vs actual behavior
|
|
- Docker container (if needed)
|
|
|
|
Ensure reproduction is:
|
|
- Minimal
|
|
- Consistent
|
|
- Self-contained
|
|
- Well-documented
|
|
|
|
workflow:
|
|
type: adaptive_investigation
|
|
initial_phase:
|
|
parallel: true
|
|
agents: [log_analyzer, code_tracer]
|
|
duration_minutes: 15
|
|
|
|
investigation_phase:
|
|
conditional: true
|
|
conditions:
|
|
- if: memory_issue_suspected
|
|
agents: [memory_profiler]
|
|
- if: network_issue_suspected
|
|
agents: [network_inspector]
|
|
- if: complex_issue
|
|
agents: [memory_profiler, network_inspector]
|
|
duration_minutes: 30
|
|
|
|
reproduction_phase:
|
|
agent: reproducer
|
|
inputs_from: all_previous
|
|
duration_minutes: 20
|
|
|
|
synthesis_phase:
|
|
agent: debug_coordinator
|
|
action: compile_findings
|
|
outputs: [root_cause_analysis, fix_recommendation]
|
|
|
|
tools:
|
|
shared:
|
|
- name: debug_dashboard
|
|
type: web_ui
|
|
features: [real_time_logs, metrics_visualization, trace_viewer]
|
|
|
|
- name: collaborative_debugger
|
|
type: vscode_extension
|
|
features: [shared_breakpoints, live_variable_inspection]
|
|
|
|
communication:
|
|
type: event_driven
|
|
channels:
|
|
- findings_stream
|
|
- hypothesis_discussion
|
|
- evidence_sharing
|
|
|
|
outputs:
|
|
- bug_report_detailed
|
|
- root_cause_analysis
|
|
- minimal_reproduction
|
|
- fix_patch
|
|
- prevention_recommendations |