用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ag2ai/resource-hub --skill add-agent-to-team命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
REST and WebSocket endpoint patterns, error handling, and Pydantic schema conventions for the backend
Architecture, directory layout, communication protocol, and conventions for the full-stack multi-agent application
Step-by-step guide to add a new REST or WebSocket endpoint to the backend
基于 SOC 职业分类
正在显示 SKILL.md
| name | add-agent-to-team |
| description | Step-by-step guide to add a new agent to the multi-agent team |
| license | Apache-2.0 |
backend/app/agents.pyAdd the agent inside the with config: block alongside the existing agents:
with config:
planner = AssistantAgent(...)
coder = AssistantAgent(...)
reviewer = AssistantAgent(...)
# New agent
tester = AssistantAgent(
name="tester",
system_message=(
"You are a testing agent. Given the coder's implementation, "
"write comprehensive unit tests covering edge cases and error "
"conditions. Use pytest conventions."
),
)
AGENTS = [planner, coder, reviewer, tester]
AGENT_NAMES updates automatically since it's derived from AGENTS.
For RoundRobinPattern, agents execute in list order — place the new agent where it should speak in the sequence.
If switching to AutoPattern for dynamic routing:
from autogen.agentchat.group.patterns.pattern import AutoPattern
pattern = AutoPattern(
initial_agent=planner,
agents=AGENTS,
)
max_rounds in run_team()Each agent takes one round. If you added an agent, increase max_rounds to allow at least 2 full cycles:
result = await run_group_chat(
pattern=pattern,
messages=message,
max_rounds=8, # was 6 with 3 agents
)
In frontend/src/components/Chat.tsx, add a color entry:
const AGENT_COLORS: Record<string, string> = {
planner: "#2563eb",
coder: "#059669",
reviewer: "#d97706",
tester: "#7c3aed", // new
system: "#6b7280",
};
In backend/tests/test_api.py:
async def test_health(client: AsyncClient) -> None:
resp = await client.get("/api/health")
body = resp.json()
assert "tester" in body["agents"]
AGENTS list in the correct positionmax_rounds updated to accommodate the new agent