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

multi-agent-analysis

Analyze coordination patterns, handoff mechanisms, and state sharing in multi-agent systems. Use when (1) understanding how agents transfer control, (2) evaluating shared vs isolated state patterns, (3) mapping communication protocols between agents, (4) assessing multi-agent orchestration approaches, or (5) comparing coordination models across frameworks.

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して multi-agent-analysis.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → multi-agent-analysis フォルダができる
  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
同梱ファイル
1

📖 Skill本文(日本語訳)

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

[スキル名] multi-agent-analysis

マルチエージェント分析

マルチエージェントシステムにおける協調パターンを分析します。

プロセス

  1. 協調モデルの特定 — Supervisor、Peer-to-Peer、Pipeline
  2. ハンドオフの文書化 — エージェント間で制御がどのように移転されるか
  3. 状態共有の分類 — Blackboard vs メッセージパッシング
  4. 通信の追跡 — プロトコルとデータフロー

協調モデル

Supervisor (階層型)

        ┌─────────────┐
        │  Supervisor │
        │   (Router)  │
        └──────┬──────┘
               │
    ┌──────────┼──────────┐
    │          │          │
    ▼          ▼          ▼
┌───────┐  ┌───────┐  ┌───────┐
│Worker1│  │Worker2│  │Worker3│
│(Search)│  │(Code) │  │(Write)│
└───────┘  └───────┘  └───────┘
class Supervisor:
    def route(self, task: str) -> Agent:
        """Decide which worker handles the task"""
        if "search" in task:
            return self.search_agent
        elif "code" in task:
            return self.code_agent
        else:
            return self.general_agent

    def run(self, input: str):
        while not self.is_done():
            agent = self.route(self.current_task)
            result = agent.run(self.current_task)
            self.update_state(result)

特徴:

  • 中央制御点
  • 明確なルーティングロジック
  • 単一障害点
  • 理解しやすい

Peer-to-Peer

┌───────┐     ┌───────┐
│Agent A│◄───►│Agent B│
└───┬───┘     └───┬───┘
    │             │
    │  ┌───────┐  │
    └─►│Agent C│◄─┘
       └───────┘
class PeerAgent:
    def __init__(self, peers: list["PeerAgent"]):
        self.peers = peers

    def delegate(self, task: str):
        """Find a peer that can handle this"""
        for peer in self.peers:
            if peer.can_handle(task):
                return peer.run(task)
        return self.run_locally(task)

    def broadcast(self, message: str):
        """Send to all peers"""
        for peer in self.peers:
            peer.receive(message)

特徴:

  • 分散型
  • 単一障害に対する耐性
  • 複雑な協調
  • デバッグがより困難

Pipeline (シーケンシャル)

┌───────┐    ┌───────┐    ┌───────┐    ┌───────┐
│Planner│───►│Executor│───►│Reviewer│───►│Output │
└───────┘    └───────┘    └───────┘    └───────┘
class Pipeline:
    def __init__(self, stages: list[Agent]):
        self.stages = stages

    def run(self, input):
        result = input
        for stage in self.stages:
            result = stage.run(result)
        return result

特徴:

  • 明確なデータフロー
  • 推論しやすい
  • 並列処理の制限
  • 各ステージがボトルネック

Market-Based

class MarketCoordinator:
    def __init__(self, agents: list[Agent]):
        self.agents = agents

    def auction(self, task: str):
        """Agents bid on tasks"""
        bids = []
        for agent in self.agents:
            bid = agent.bid(task)  # Returns confidence/cost
            bids.append((agent, bid))

        # Select winner
        winner = max(bids, key=lambda x: x[1])
        return winner[0].run(task)

特徴:

  • 動的な割り当て
  • 自己組織化
  • 入札のオーバーヘッド
  • チューニングが複雑

ハンドオフメカニズム

明示的な転送

class Agent:
    def handoff_to(self, target: "Agent", context: dict):
        """Explicit control transfer"""
        return HandoffResult(
            target_agent=target,
            context=context,
            return_control=True
        )

    def run(self, input):
        result = self.think(input)
        if result.needs_specialist:
            return self.handoff_to(
                self.get_specialist(result.domain),
                context={"original_task": input, "progress": result}
            )
        return result

ルーターベース

class Router:
    def __init__(self, agents: dict[str, Agent]):
        self.agents = agents
        self.routing_llm = LLM()

    def route(self, input: str) -> Agent:
        decision = self.routing_llm.generate(f"""
        Given this input: {input}
        Which agent should handle it?
        Options: {list(self.agents.keys())}
        """)
        return self.agents[decision.agent_name]

暗黙的 (状態ベース)

class StateBasedCoordinator:
    def run(self, input):
        state = {"input": input, "stage": "planning"}

        while state["stage"] != "done":
            # Agent selection based on state
            agent = self.get_agent_for_stage(state["stage"])
            result = agent.run(state)
            state = self.update_state(state, result)

        return state["output"]

状態共有パターン

Blackboard (共有グローバル状態)

class Blackboard:
    """Shared state all agents can read/write"""
    def __init__(self):
        self.state = {}
        self.lock = threading.Lock()

    def read(self, key: str):
        return self.state.get(key)

    def write(self, key: str, value):
        with self.lock:
            self.state[key] = value

# Agents share the blackboard
blackboard = Blackboard()
agent_a = Agent(blackboard)
agent_b = Agent(blackboard)

長所: シンプル、完全な可視性 短所: 競合状態、密結合、スケーリングが困難

Message Passing (分離された状態)

class Agent:
    def __init__(self):
        self.inbox = Queue()
        self.state = {}  # Private state

    def send(self, target: "Agent", message: dict):
        target.inbox.put(message)

    def receive(self) -> dict:
        return self.inbox.get()

    def run(self):
        while True:
            message = self.receive()
            result = self.process(message)
            if message.get("reply_to"):
                self.send(message["reply_to"], result)

長所: 分離、明確な境界、スケーラブル 短所: より複雑、非同期処理

Hybrid

class Hybrid
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Multi-Agent Analysis

Analyzes coordination patterns in multi-agent systems.

Process

  1. Identify coordination model — Supervisor, peer-to-peer, pipeline
  2. Document handoffs — How control transfers between agents
  3. Classify state sharing — Blackboard vs message passing
  4. Trace communication — Protocol and data flow

Coordination Models

Supervisor (Hierarchical)

        ┌─────────────┐
        │  Supervisor │
        │   (Router)  │
        └──────┬──────┘
               │
    ┌──────────┼──────────┐
    │          │          │
    ▼          ▼          ▼
┌───────┐  ┌───────┐  ┌───────┐
│Worker1│  │Worker2│  │Worker3│
│(Search)│  │(Code) │  │(Write)│
└───────┘  └───────┘  └───────┘
class Supervisor:
    def route(self, task: str) -> Agent:
        """Decide which worker handles the task"""
        if "search" in task:
            return self.search_agent
        elif "code" in task:
            return self.code_agent
        else:
            return self.general_agent

    def run(self, input: str):
        while not self.is_done():
            agent = self.route(self.current_task)
            result = agent.run(self.current_task)
            self.update_state(result)

Characteristics:

  • Central control point
  • Clear routing logic
  • Single point of failure
  • Easy to understand

Peer-to-Peer

┌───────┐     ┌───────┐
│Agent A│◄───►│Agent B│
└───┬───┘     └───┬───┘
    │             │
    │  ┌───────┐  │
    └─►│Agent C│◄─┘
       └───────┘
class PeerAgent:
    def __init__(self, peers: list["PeerAgent"]):
        self.peers = peers

    def delegate(self, task: str):
        """Find a peer that can handle this"""
        for peer in self.peers:
            if peer.can_handle(task):
                return peer.run(task)
        return self.run_locally(task)

    def broadcast(self, message: str):
        """Send to all peers"""
        for peer in self.peers:
            peer.receive(message)

Characteristics:

  • Decentralized
  • Resilient to single failures
  • Complex coordination
  • Harder to debug

Pipeline (Sequential)

┌───────┐    ┌───────┐    ┌───────┐    ┌───────┐
│Planner│───►│Executor│───►│Reviewer│───►│Output │
└───────┘    └───────┘    └───────┘    └───────┘
class Pipeline:
    def __init__(self, stages: list[Agent]):
        self.stages = stages

    def run(self, input):
        result = input
        for stage in self.stages:
            result = stage.run(result)
        return result

Characteristics:

  • Clear data flow
  • Easy to reason about
  • Limited parallelism
  • Each stage is a bottleneck

Market-Based

class MarketCoordinator:
    def __init__(self, agents: list[Agent]):
        self.agents = agents

    def auction(self, task: str):
        """Agents bid on tasks"""
        bids = []
        for agent in self.agents:
            bid = agent.bid(task)  # Returns confidence/cost
            bids.append((agent, bid))

        # Select winner
        winner = max(bids, key=lambda x: x[1])
        return winner[0].run(task)

Characteristics:

  • Dynamic allocation
  • Self-organizing
  • Overhead of bidding
  • Complex to tune

Handoff Mechanisms

Explicit Transfer

class Agent:
    def handoff_to(self, target: "Agent", context: dict):
        """Explicit control transfer"""
        return HandoffResult(
            target_agent=target,
            context=context,
            return_control=True
        )

    def run(self, input):
        result = self.think(input)
        if result.needs_specialist:
            return self.handoff_to(
                self.get_specialist(result.domain),
                context={"original_task": input, "progress": result}
            )
        return result

Router-Based

class Router:
    def __init__(self, agents: dict[str, Agent]):
        self.agents = agents
        self.routing_llm = LLM()

    def route(self, input: str) -> Agent:
        decision = self.routing_llm.generate(f"""
        Given this input: {input}
        Which agent should handle it?
        Options: {list(self.agents.keys())}
        """)
        return self.agents[decision.agent_name]

Implicit (State-Based)

class StateBasedCoordinator:
    def run(self, input):
        state = {"input": input, "stage": "planning"}

        while state["stage"] != "done":
            # Agent selection based on state
            agent = self.get_agent_for_stage(state["stage"])
            result = agent.run(state)
            state = self.update_state(state, result)

        return state["output"]

State Sharing Patterns

Blackboard (Shared Global State)

class Blackboard:
    """Shared state all agents can read/write"""
    def __init__(self):
        self.state = {}
        self.lock = threading.Lock()

    def read(self, key: str):
        return self.state.get(key)

    def write(self, key: str, value):
        with self.lock:
            self.state[key] = value

# Agents share the blackboard
blackboard = Blackboard()
agent_a = Agent(blackboard)
agent_b = Agent(blackboard)

Pros: Simple, full visibility Cons: Race conditions, tight coupling, hard to scale

Message Passing (Isolated State)

class Agent:
    def __init__(self):
        self.inbox = Queue()
        self.state = {}  # Private state

    def send(self, target: "Agent", message: dict):
        target.inbox.put(message)

    def receive(self) -> dict:
        return self.inbox.get()

    def run(self):
        while True:
            message = self.receive()
            result = self.process(message)
            if message.get("reply_to"):
                self.send(message["reply_to"], result)

Pros: Isolation, clear boundaries, scalable Cons: More complex, async handling

Hybrid

class HybridCoordinator:
    def __init__(self, agents):
        # Shared read-only context
        self.shared_context = {"tools": [...], "config": {...}}

        # Per-agent mutable state
        self.agent_states = {a.id: {} for a in agents}

        # Message queues for communication
        self.queues = {a.id: Queue() for a in agents}

Communication Protocol Analysis

Direct Invocation

result = agent_b.run(input)

Latency: Lowest Coupling: Highest Async: No

Queue-Based

task_queue.put(task)
# ... later ...
result = result_queue.get()

Latency: Medium Coupling: Low Async: Yes

Event-Driven

event_bus.emit("task:created", task)

@event_bus.on("task:created")
def handle_task(task):
    result = process(task)
    event_bus.emit("task:completed", result)

Latency: Variable Coupling: Lowest Async: Yes

Output Template

## Multi-Agent Analysis: [Framework Name]

### Coordination Model
- **Type**: [Supervisor/Peer-to-Peer/Pipeline/Market]
- **Central Control**: [Yes/No]
- **Location**: `path/to/orchestrator.py`

### Agent Inventory

| Agent | Role | Can Delegate To |
|-------|------|-----------------|
| Supervisor | Routing | All workers |
| SearchAgent | Web search | None |
| CodeAgent | Code execution | Reviewer |

### Handoff Mechanism
- **Type**: [Explicit/Router/Implicit]
- **Bidirectional**: [Yes/No]
- **Context Preserved**: [Full/Partial/Minimal]

### State Sharing
- **Pattern**: [Blackboard/Message/Hybrid]
- **Shared State**: [List what's shared]
- **Isolation Level**: [None/Partial/Full]

### Communication Protocol
- **Method**: [Direct/Queue/Event]
- **Async**: [Yes/No]
- **Location**: `path/to/comms.py`

### Loop Prevention
- **Mechanism**: [Depth limit/Visited set/None]
- **Max Handoffs**: [N or Unlimited]

Integration

  • Prerequisite: codebase-mapping to identify agent files
  • Feeds into: comparative-matrix for coordination decisions
  • Related: control-loop-extraction for individual agent loops