agent-communication-debugger
Diagnoses and debugs A2A agent communication issues including agent status, message routing, transport connectivity, and log analysis. Use when agents aren't responding, messages aren't being delivered, routing is incorrect, or when debugging orchestrator, coder-agent, tester-agent communication problems.
What this skill does
# Agent Communication Debugger
Debug and diagnose issues with the A2A (Agent-to-Agent) communication system, including the orchestrator, coder-agent, tester-agent, and message transport layers.
## Prerequisites
- A2A agent system located in `a2a_communicating_agents/`
- Python 3.10+ environment
- Access to agent logs in `logs/` directory
- Agent configurations in respective `agent.json` files
## Instructions
### 1. Check Agent Status
First, determine which agents are running:
```bash
# Check all agent processes
ps aux | grep -E "(orchestrator|coder|tester|websocket)_agent|main.py" | grep -v grep
```
Look for:
- `orchestrator_agent/main.py`
- `coder_agent/main.py`
- `tester_agent/main.py`
- `websocket_server.py`
**Common issues:**
- Agent process not found → Agent isn't running, needs to be started
- Multiple instances → Duplicate processes causing conflicts
### 2. Inspect Agent Configurations
Read the agent configuration files to verify capabilities and topics:
```bash
# View orchestrator config
cat a2a_communicating_agents/orchestrator_agent/agent.json
# View coder agent config
cat a2a_communicating_agents/coder_agent/agent.json
# View tester agent config (if exists)
cat a2a_communicating_agents/tester_agent/agent.json
```
**Verify:**
- Agent names match expected values
- Topics are correctly defined
- Capabilities describe what the agent does
- No JSON syntax errors
### 3. Check Agent Logs
Examine logs for errors and message flow:
```bash
# View orchestrator logs (last 50 lines)
tail -50 logs/orchestrator.log
# View all logs with timestamps
tail -f logs/*.log
# Search for specific errors
grep -i "error\|exception\|failed" logs/*.log
# Check for routing decisions
grep -i "routing to\|routed to" logs/orchestrator.log
```
**Look for:**
- Connection errors
- Routing decisions showing wrong agent selection
- JSON parsing errors
- Message processing failures
### 4. Verify Message Transport
Check if the message transport (WebSocket or RAG board) is working:
```bash
# Check if WebSocket server is running
ps aux | grep websocket_server | grep -v grep
netstat -tlnp 2>/dev/null | grep 8765 || ss -tlnp 2>/dev/null | grep 8765
# Check RAG board storage
ls -lh a2a_communicating_agents/storage/
ls -lh storage/
# Check recent messages in message board
tail -20 storage/message_board.jsonl 2>/dev/null || echo "Message board not found"
```
**Expected:**
- WebSocket server on port 8765 (if using WebSocket transport)
- Recent messages in storage/message_board.jsonl (if using RAG transport)
- No permission errors accessing storage
### 5. Test Message Sending
Use the provided test script to send a message and verify delivery:
```bash
# Send a test message to orchestrator
python .claude/skills/agent-debug/scripts/test_message.py
```
This script will:
1. Send a test message to the orchestrator topic
2. Wait for response
3. Show message delivery status
4. Display any responses received
### 6. Diagnose Routing Issues
If messages reach orchestrator but route to wrong agent:
**Check orchestrator's routing logic:**
```bash
# View the decide_route method
grep -A 50 "def decide_route" a2a_communicating_agents/orchestrator_agent/main.py
```
**Check priority keyword mappings:**
```bash
# View fallback routing keywords
grep -A 20 "priority_mappings = {" a2a_communicating_agents/orchestrator_agent/main.py
```
**Verify agent discovery:**
```bash
# Check discovered agents in logs
grep "Discovered.*agents" logs/orchestrator.log | tail -5
```
**Common routing issues:**
- Agent not discovered → Check agent.json exists and is valid
- Wrong agent selected → Keywords don't match, update priority_mappings
- Null target → No suitable agent found, check agent topics/capabilities
### 7. Check Environment Variables
Verify API keys and configuration:
```bash
# Check if OPENAI_API_KEY is set (don't display value)
env | grep -E "(OPENAI|API_KEY)" | sed 's/=.*/=***HIDDEN***/'
# Check model configuration
grep -E "(model|MODEL)" .env 2>/dev/null | sed 's/=.*/=***HIDDEN***/' || echo "No .env file"
```
**Required environment variables:**
- `OPENAI_API_KEY` - For LLM-based routing and code generation
- `ORCHESTRATOR_MODEL` or `OPENAI_MODEL` - Model to use (default: gpt-5-mini)
- `CODER_MODEL` - Model for coder agent (optional, defaults to OPENAI_MODEL)
### 8. Restart Agents (if needed)
If agents are stuck or not responding:
```bash
# Stop all agents
pkill -f "orchestrator_agent/main.py"
pkill -f "coder_agent/main.py"
pkill -f "tester_agent/main.py"
pkill -f "websocket_server.py"
# Wait a moment
sleep 2
# Start WebSocket server (if using)
cd a2a_communicating_agents
nohup python agent_messaging/websocket_server.py > ../logs/websocket.log 2>&1 &
# Start orchestrator
nohup python orchestrator_agent/main.py > ../logs/orchestrator.log 2>&1 &
# Start coder agent
nohup python coder_agent/main.py > ../logs/coder.log 2>&1 &
# Verify they started
sleep 3
ps aux | grep -E "(orchestrator|coder|websocket)" | grep -v grep
```
### 9. Common Issues and Solutions
See [common_issues.md](common_issues.md) for a detailed troubleshooting guide covering:
- Messages not being delivered
- Routing to wrong agent
- Agent not generating responses
- Duplicate message processing
- Transport connectivity problems
## Quick Diagnostic Checklist
Run through this checklist systematically:
- [ ] All required agents are running (orchestrator, coder, tester)
- [ ] WebSocket server is running (if using WebSocket transport)
- [ ] Agent configuration files are valid JSON
- [ ] Orchestrator discovered all agents (check logs)
- [ ] OPENAI_API_KEY is set in environment
- [ ] Recent log entries show activity
- [ ] No Python exceptions in logs
- [ ] Test message sends and receives successfully
- [ ] Routing decisions select correct agent
## Examples
### Example 1: Agent Not Responding to Messages
User problem:
```
I'm sending messages to the orchestrator but getting no response
```
Debug workflow:
1. Check if orchestrator is running:
```bash
ps aux | grep orchestrator_agent | grep -v grep
```
Result: No process found → Orchestrator isn't running
2. Check logs for crash:
```bash
tail -50 logs/orchestrator.log
```
Result: ImportError for OpenAI package
3. Solution: Install missing dependency
```bash
pip install openai
```
4. Restart orchestrator:
```bash
cd a2a_communicating_agents
nohup python orchestrator_agent/main.py > ../logs/orchestrator.log 2>&1 &
```
5. Verify it's running:
```bash
ps aux | grep orchestrator_agent | grep -v grep
tail -10 logs/orchestrator.log
```
### Example 2: Messages Routing to Wrong Agent
User problem:
```
I asked for code but it routed to dashboard-agent instead of coder-agent
```
Debug workflow:
1. Check orchestrator discovered coder-agent:
```bash
grep "Discovered.*agents" logs/orchestrator.log | tail -1
```
Result: Shows coder-agent in list ✓
2. Check routing decision in logs:
```bash
grep -A 5 "please write.*code" logs/orchestrator.log
```
Result: Shows routing to dashboard-agent
3. Check routing logic:
```bash
grep -A 30 "priority_mappings = {" a2a_communicating_agents/orchestrator_agent/main.py
```
Result: Keywords look correct
4. Check LLM routing decision:
```bash
grep "Error in decision making" logs/orchestrator.log
```
Result: LLM routing failed, falling back to heuristic
5. Check API key:
```bash
env | grep OPENAI_API_KEY | sed 's/=.*/=***HIDDEN***/'
```
Result: Variable not set
6. Solution: Set API key and restart orchestrator:
```bash
export OPENAI_API_KEY="your-key-here"
# Or add to .env file
echo "OPENAI_API_KEY=your-key-here" >> .env
```
7. Restart orchestrator to pick up new environment
### Example 3: Coder Agent Acknowledges But Doesn't Generate Code
User problem:
```
Coder agent receives the message but only acknowledges, doesn't generate code
```
Debug workflow:
1. Check coder agent logs:
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.