jpskill.com
🛠️ 開発・MCP コミュニティ

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.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o agent-communication-debugger.zip https://jpskill.com/download/18967.zip && unzip -o agent-communication-debugger.zip && rm agent-communication-debugger.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18967.zip -OutFile "$d\agent-communication-debugger.zip"; Expand-Archive "$d\agent-communication-debugger.zip" -DestinationPath $d -Force; ri "$d\agent-communication-debugger.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して agent-communication-debugger.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → agent-communication-debugger フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
4

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

エージェント間通信デバッガー

オーケストレーター、コーダーエージェント、テスターエージェント、およびメッセージ転送レイヤーを含む A2A (Agent-to-Agent) 通信システムの問題をデバッグおよび診断します。

前提条件

  • a2a_communicating_agents/ にある A2A エージェントシステム
  • Python 3.10+ 環境
  • logs/ ディレクトリ内のエージェントログへのアクセス
  • agent.json ファイル内のエージェント設定

手順

1. エージェントステータスの確認

まず、どのエージェントが実行されているかを確認します。

# すべてのエージェントプロセスを確認
ps aux | grep -E "(orchestrator|coder|tester|websocket)_agent|main.py" | grep -v grep

以下を探してください。

  • orchestrator_agent/main.py
  • coder_agent/main.py
  • tester_agent/main.py
  • websocket_server.py

一般的な問題:

  • エージェントプロセスが見つからない → エージェントが実行されていません。起動する必要があります。
  • 複数のインスタンス → 重複するプロセスが競合を引き起こしています。

2. エージェント設定の検査

エージェント設定ファイルを読み取り、機能とトピックを確認します。

# オーケストレーターの設定を表示
cat a2a_communicating_agents/orchestrator_agent/agent.json

# コーダーエージェントの設定を表示
cat a2a_communicating_agents/coder_agent/agent.json

# テスターエージェントの設定を表示 (存在する場合)
cat a2a_communicating_agents/tester_agent/agent.json

確認事項:

  • エージェント名が期待値と一致していること
  • トピックが正しく定義されていること
  • 機能がエージェントの動作を記述していること
  • JSON 構文エラーがないこと

3. エージェントログの確認

エラーとメッセージフローについてログを調べます。

# オーケストレーターログを表示 (最後の50行)
tail -50 logs/orchestrator.log

# タイムスタンプ付きのすべてのログを表示
tail -f logs/*.log

# 特定のエラーを検索
grep -i "error\|exception\|failed" logs/*.log

# ルーティングの決定を確認
grep -i "routing to\|routed to" logs/orchestrator.log

探すべきもの:

  • 接続エラー
  • 間違ったエージェント選択を示すルーティングの決定
  • JSON 解析エラー
  • メッセージ処理の失敗

4. メッセージ転送の確認

メッセージ転送 (WebSocket または RAG ボード) が機能しているかを確認します。

# WebSocket サーバーが実行されているかを確認
ps aux | grep websocket_server | grep -v grep
netstat -tlnp 2>/dev/null | grep 8765 || ss -tlnp 2>/dev/null | grep 8765

# RAG ボードストレージを確認
ls -lh a2a_communicating_agents/storage/
ls -lh storage/

# メッセージボードの最近のメッセージを確認
tail -20 storage/message_board.jsonl 2>/dev/null || echo "Message board not found"

期待されること:

  • ポート 8765 で WebSocket サーバーが実行されていること (WebSocket 転送を使用している場合)
  • storage/message_board.jsonl に最近のメッセージがあること (RAG 転送を使用している場合)
  • ストレージへのアクセスで権限エラーがないこと

5. メッセージ送信のテスト

提供されているテストスクリプトを使用してメッセージを送信し、配信を確認します。

# オーケストレーターにテストメッセージを送信
python .claude/skills/agent-debug/scripts/test_message.py

このスクリプトは以下を実行します。

  1. オーケストレーターのトピックにテストメッセージを送信します。
  2. 応答を待ちます。
  3. メッセージ配信ステータスを表示します。
  4. 受信した応答を表示します。

6. ルーティングの問題の診断

メッセージがオーケストレーターに到達するものの、間違ったエージェントにルーティングされる場合:

オーケストレーターのルーティングロジックを確認:

# decide_route メソッドを表示
grep -A 50 "def decide_route" a2a_communicating_agents/orchestrator_agent/main.py

優先キーワードマッピングを確認:

# フォールバックルーティングキーワードを表示
grep -A 20 "priority_mappings = {" a2a_communicating_agents/orchestrator_agent/main.py

エージェントの検出を確認:

# ログで検出されたエージェントを確認
grep "Discovered.*agents" logs/orchestrator.log | tail -5

一般的なルーティングの問題:

  • エージェントが検出されない → agent.json が存在し、有効であることを確認してください。
  • 間違ったエージェントが選択される → キーワードが一致しません。priority_mappings を更新してください。
  • ターゲットが null → 適切なエージェントが見つかりません。エージェントのトピック/機能を確認してください。

7. 環境変数の確認

API キーと設定を確認します。

# OPENAI_API_KEY が設定されているかを確認 (値を表示しない)
env | grep -E "(OPENAI|API_KEY)" | sed 's/=.*/=***HIDDEN***/'

# モデル設定を確認
grep -E "(model|MODEL)" .env 2>/dev/null | sed 's/=.*/=***HIDDEN***/' || echo "No .env file"

必要な環境変数:

  • OPENAI_API_KEY - LLM ベースのルーティングとコード生成用
  • ORCHESTRATOR_MODEL または OPENAI_MODEL - 使用するモデル (デフォルト: gpt-5-mini)
  • CODER_MODEL - コーダーエージェント用モデル (オプション、デフォルトは OPENAI_MODEL)

8. エージェントの再起動 (必要に応じて)

エージェントが停止しているか、応答しない場合:

# すべてのエージェントを停止
pkill -f "orchestrator_agent/main.py"
pkill -f "coder_agent/main.py"
pkill -f "tester_agent/main.py"
pkill -f "websocket_server.py"

# 少し待つ
sleep 2

# WebSocket サーバーを起動 (使用している場合)
cd a2a_communicating_agents
nohup python agent_messaging/websocket_server.py > ../logs/websocket.log 2>&1 &

# オーケストレーターを起動
nohup python orchestrator_agent/main.py > ../logs/orchestrator.log 2>&1 &

# コーダーエージェントを起動
nohup python coder_agent/main.py > ../logs/coder.log 2>&1 &

# 起動したことを確認
sleep 3
ps aux | grep -E "(orchestrator|coder|websocket)" | grep -v grep

9. 一般的な問題と解決策

詳細なトラブルシューティングガイドについては、common_issues.md を参照してください。以下をカバーしています。

  • メッセージが配信されない
  • 間違ったエージェントにルーティングされる
  • エージェントが応答を生成しない
  • 重複するメッセージ処理
  • 転送接続の問題

クイック診断チェックリスト

このチェックリストを体系的に実行してください。

  • [ ] 必要なすべてのエージェント (オーケストレーター、コーダー、テスター) が実行されています。
  • [ ] WebSocket サーバーが実行されています (WebSocket 転送を使用している場合)。
  • [ ] エージェント設定ファイルが有効な JSON です。
  • [ ] オーケストレーターがすべてのエージェントを検出しました (ログを確認)。
  • [ ] OPENAI_API_KEY が環境に設定されています。
  • [ ] 最近のログエントリにアクティビティが表示されています。
  • [ ] ログに Python 例外がありません。
  • [ ] テストメッセージが正常に送受信されます。
  • [ ] ルーティングの決定が正しいエージェントを選択しています。

例 1: エージェントがメッセージに応答しない

ユーザーの問題:

オーケストレーターにメッセージを送信していますが、応答がありません

デバッグワークフロー:

  1. オーケストレーターが実行されているかを確認します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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:

# 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:

# 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:

# 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:

# 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:

# 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:

# View the decide_route method
grep -A 50 "def decide_route" a2a_communicating_agents/orchestrator_agent/main.py

Check priority keyword mappings:

# View fallback routing keywords
grep -A 20 "priority_mappings = {" a2a_communicating_agents/orchestrator_agent/main.py

Verify agent discovery:

# 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:

# 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:

# 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 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:

    ps aux | grep orchestrator_agent | grep -v grep

    Result: No process found → Orchestrator isn't running

  2. Check logs for crash:

    tail -50 logs/orchestrator.log

    Result: ImportError for OpenAI package

  3. Solution: Install missing dependency

    pip install openai
  4. Restart orchestrator:

    cd a2a_communicating_agents
    nohup python orchestrator_agent/main.py > ../logs/orchestrator.log 2>&1 &
  5. Verify it's running:

    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:

    grep "Discovered.*agents" logs/orchestrator.log | tail -1

    Result: Shows coder-agent in list ✓

  2. Check routing decision in logs:

    grep -A 5 "please write.*code" logs/orchestrator.log

    Result: Shows routing to dashboard-agent

  3. Check routing logic:

    grep -A 30 "priority_mappings = {" a2a_communicating_agents/orchestrator_agent/main.py

    Result: Keywords look correct

  4. Check LLM routing decision:

    grep "Error in decision making" logs/orchestrator.log

    Result: LLM routing failed, falling back to heuristic

  5. Check API key:

    env | grep OPENAI_API_KEY | sed 's/=.*/=***HIDDEN***/'

    Result: Variable not set

  6. Solution: Set API key and restart orchestrator:

    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:

    grep -i "generate\|code" logs/coder.log | tail -20

    Result: "OpenAI package not available. Code generation will be limited."

  2. Check if OpenAI is installed:

    python -c "import openai; print(openai.__version__)" 2>&1

    Result: ModuleNotFoundError

  3. Install OpenAI package:

    pip install openai
  4. Restart coder agent:

    pkill -f "coder_agent/main.py"
    cd a2a_communicating_agents
    nohup python coder_agent/main.py > ../logs/coder.log 2>&1 &
  5. Verify initialization:

    grep "Initialized with model" logs/coder.log | tail -1

    Result: Should show model name (e.g., gpt-5-mini)

  6. Send test message and verify code generation

Example 4: Complete System Health Check

User request:

Run a complete diagnostic on the agent system

Complete diagnostic workflow:

  1. Check all agents running:

    echo "=== Agent Processes ==="
    ps aux | grep -E "(orchestrator|coder|tester|websocket)" | grep -v grep
  2. Check agent configs:

    echo "=== Agent Configurations ==="
    for agent in orchestrator_agent coder_agent tester_agent; do
      if [ -f "a2a_communicating_agents/$agent/agent.json" ]; then
        echo "--- $agent ---"
        cat "a2a_communicating_agents/$agent/agent.json" | python -m json.tool
      fi
    done
  3. Check environment:

    echo "=== Environment Variables ==="
    env | grep -E "(OPENAI|MODEL)" | sed 's/=.*/=***HIDDEN***/'
  4. Check recent logs:

    echo "=== Recent Log Activity ==="
    tail -5 logs/*.log 2>/dev/null
  5. Check for errors:

    echo "=== Recent Errors ==="
    grep -i "error\|exception" logs/*.log | tail -10
  6. Test message sending:

    echo "=== Message Transport Test ==="
    python .claude/skills/agent-debug/scripts/test_message.py
  7. Provide summary report with:

    • Agent status (running/stopped)
    • Configuration validity
    • Environment completeness
    • Recent error count
    • Transport test result

Related Tools

  • orchestrator_chat.py - Interactive chat interface for testing
  • send_agent_message.py - Send messages programmatically
  • Agent start/stop scripts in a2a_communicating_agents/

Summary

This skill provides systematic debugging for the A2A agent communication system. Use it whenever:

  • Agents aren't communicating
  • Messages aren't being delivered
  • Routing is incorrect
  • System behavior is unexpected

Follow the diagnostic steps in order, checking status → configuration → logs → transport → routing. Most issues are:

  1. Agent not running
  2. Missing dependencies
  3. Missing API keys
  4. Invalid configurations
  5. Routing logic issues

Start with the Quick Diagnostic Checklist and drill down based on what fails.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。