Provides best practices for AI agent orchestration including MCP servers, A2A protocol, multi-agent coordination, and swarm architectures. Use when designing agent systems, configuring MCP servers, setting up agent teams, or when user mentions 'MCP', 'A2A', 'agent orchestration', 'multi-agent', 'swarm', 'agent team', 'LangGraph', 'CrewAI', 'AutoGen'.
Instrucciones de origen · Vista previa de solo lectura
name
agent-orchestration
description
Provides best practices for AI agent orchestration including MCP servers, A2A protocol, multi-agent coordination, and swarm architectures. Use when designing agent systems, configuring MCP servers, setting up agent teams, or when user mentions 'MCP', 'A2A', 'agent orchestration', 'multi-agent', 'swarm', 'agent team', 'LangGraph', 'CrewAI', 'AutoGen'.
type
skill
category
orchestration
status
stable
origin
tibsfox
modified
false
first_seen
"2026-02-07T00:00:00.000Z"
first_path
examples/agent-orchestration/SKILL.md
superseded_by
null
Agent Orchestration
Best practices for designing, deploying, and coordinating AI agent systems using MCP servers, A2A protocol, and multi-agent patterns.
Agent Orchestration Patterns
Orchestration determines how agents are coordinated, who makes decisions, and how work flows between them.
Pattern
Description
Best For
Drawback
Centralized
Single orchestrator dispatches tasks to worker agents
Predictable workflows, clear task boundaries
Orchestrator is a bottleneck and single point of failure
Hierarchical
Manager agents delegate to specialist sub-agents
Complex multi-domain tasks
Deep hierarchies add latency and lose context
Peer-to-peer
Agents communicate directly, no central coordinator
Collaborative reasoning, brainstorming
Hard to debug, potential infinite loops
Pipeline
Agents process sequentially, output feeds next agent
Data transformation, multi-stage analysis
Slow for parallelizable work, rigid ordering
Blackboard
Shared state space that agents read from and write to
Problems requiring incremental refinement
Contention on shared state, ordering issues
Auction/Market
Agents bid on tasks based on capability and capacity
Dynamic workload distribution
Overhead of bidding, suboptimal for simple tasks
Swarm
Many lightweight agents with simple rules, emergent behavior
Exploration, search, large-scale parallel tasks
Unpredictable outcomes, hard to steer
Choosing the Right Pattern
Is the workflow predictable and linear?
YES --> Pipeline or Centralized
NO --> Does it require specialized domain expertise?
YES --> Hierarchical (domain managers + specialists)
NO --> Do agents need to collaborate on shared output?
YES --> Blackboard or Peer-to-peer
NO --> Is the workload dynamic and variable?
YES --> Auction/Market
NO --> Centralized (default safe choice)
MCP (Model Context Protocol) for DevOps
MCP provides a standardized way for AI agents to interact with external tools, services, and data sources. Each MCP server exposes capabilities that agents can discover and invoke.
A2A is Google's open protocol for agent interoperability. It enables agents built on different frameworks to discover each other, negotiate capabilities, and exchange tasks.
A2A Core Concepts
Concept
Description
Agent Card
JSON metadata describing an agent's capabilities, endpoint, and auth
Task
A unit of work sent from one agent to another
Message
Communication within a task (text, files, structured data)
Artifact
Output produced by an agent (files, data, results)
Push Notification
Server-sent updates for long-running tasks
A2A Agent Card
{"name":"DevOps Deployment Agent","description":"Handles deployments, rollbacks, and release management","url":"https://agents.internal/deploy","version":"1.0.0","capabilities":{"streaming":true,"pushNotifications":true,"stateTransitionHistory":true},"authentication":{"schemes":["bearer"],"credentials":"oauth2_token"},"defaultInputModes":["text/plain","application/json"],"defaultOutputModes":["text/plain","application/json"],"skills":[{"id":"deploy-service","name":"Deploy Service","description":"Deploy a service to staging or production","tags":["deployment","release"],"examples":["Deploy payment-api v2.3.1 to staging","Roll back auth-service in production to previous version"]},{"id":"deployment-status","name":"Check Deployment Status","description":"Get current deployment status and history","tags":["monitoring","status"]}]}
A2A Task Message Exchange
{"jsonrpc":"2.0","method":"tasks/send","id":"req-001","params":{"id":"task-deploy-2025-001","message":{"role":"user","parts":[{"type":"text","text":"Deploy payment-api v2.3.1 to staging environment"},{"type":"data","mimeType":"application/json","data":{"service":"payment-api","version":"v2.3.1","environment":"staging","strategy":"canary","canary_percentage":10,"rollback_on_error":true}}]}}}
A2A Task Response
{"jsonrpc":"2.0","id":"req-001","result":{"id":"task-deploy-2025-001","status":{"state":"completed","message":{"role":"agent","parts":[{"type":"text","text":"Deployed payment-api v2.3.1 to staging, canary at 10%."}]}},"artifacts":[{"name":"deployment-report","parts":[{"type":"data","mimeType":"application/json","data":{"deployment_id":"deploy-abc123","status":"healthy","canary_metrics":{"error_rate":0.001,"p99_latency_ms":245}}}]}]}}
Agent Team Configuration
Agent teams assign distinct roles to specialized agents that collaborate on complex tasks.
Claude Code Agent Team Configuration
# agent-team.yaml -- DevOps agent team using Claude Codeteam:name:devops-ops-teamcoordination:centralizedagents:-role:orchestratormodel:claude-sonnet-4-20250514system_prompt:"Receive requests, delegate to specialists, synthesize results. Never act directly."tools: [dispatch_to_agent, check_agent_status, aggregate_results]
-role:code-reviewermodel:claude-sonnet-4-20250514system_prompt:"Review code for security, reliability, team standards. Actionable feedback with line refs."tools: [github_pr_read, github_pr_comment, run_static_analysis]
-role:deployment-agentmodel:claude-sonnet-4-20250514system_prompt:"Handle deployments. Verify pre-conditions, canary for prod, confirm health checks."tools: [kubernetes_apply, deployment_status, rollback_deployment, run_smoke_tests]
-role:incident-respondermodel:claude-sonnet-4-20250514system_prompt:"Gather metrics, correlate with changes, propose mitigations. No prod changes without approval."tools: [query_prometheus, query_logs, get_recent_deployments, create_incident_report]
workflows:deploy_request:- { agent:code-reviewer, action:review_changes, gate:approval_required }
- { agent:deployment-agent, action:deploy_to_staging }
- { agent:deployment-agent, action:run_smoke_tests, gate:tests_must_pass }
- { agent:deployment-agent, action:deploy_to_production }
- { agent:orchestrator, action:notify_team }
Swarm Architecture Comparison
Swarm architectures use multiple lightweight agents that coordinate through simple rules or shared state.
# openai_agents_deploy.pyfrom agents import Agent, handoff, Runner
code_reviewer = Agent(
name="Code Reviewer",
instructions="""Review code changes for security and reliability.
If approved, hand off to Deployer. If rejected, explain why.""",
handoffs=["deployer"],
)
deployer = Agent(
name="Deployer",
instructions="""Deploy the approved changes. Use canary strategy
for production. Hand off to Monitor after deployment.""",
handoffs=["monitor"],
tools=[deploy_to_staging, deploy_to_production, run_smoke_tests],
)
monitor = Agent(
name="Monitor",
instructions="""Monitor the deployment for 15 minutes. Check error
rates, latency, and resource usage. Report any anomalies.""",
tools=[query_metrics, check_error_rate, check_latency],
)
# Run the pipeline
result = Runner.run(
code_reviewer,
input="Deploy payment-api v2.3.1 -- changes include rate limiting middleware",
)
"Code review complete, handing off to deployment agent"
Communication Topology
Centralized (Star): Peer-to-peer (Mesh):
A --- B
B C |\ /|
\ / | X |
A (orchestrator) |/ \|
/ \ C --- D
D E
Pipeline (Chain): Hierarchical (Tree):
A --> B --> C --> D A
/ \
B C
/ \ \
D E F
Shared State Protocol
# agent_state.py -- Thread-safe shared state (Blackboard pattern)import threading
from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing importAnyclassSharedAgentState:
"""Shared state space for multi-agent coordination."""def__init__(self):
self._state: dict[str, Any] = {}
self._lock = threading.RLock()
defwrite(self, key: str, value: Any, agent_id: str) -> None:
withself._lock:
self._state[key] = {
"value": value, "updated_by": agent_id,
"updated_at": datetime.now(timezone.utc).isoformat(),
}
defread(self, key: str) -> Any | None:
withself._lock:
entry = self._state.get(key)
return entry["value"] if entry elseNone