Komut#buildwithclaude
0
New agent
Araç işlevleri, sistem istemi ve LLM yapılandırmasıyla yeni bir AG2 ConversableAgent'ı oluşturun
yazan kuscubasiece·8 Eylül 2026
Kaynak: davepoon/claude-code-subagents-collection · MIT
Araç işlevleri, sistem istemi ve LLM yapılandırmasıyla yeni bir AG2 ConversableAgent'ı oluşturun
Kaynak: davepoon/claude-code-subagents-collection · MIT
mkdir -p .claude/commands && curl -sL https://www.antrophiclove.com/api/kaynak/new-agent/raw -o .claude/commands/new-agent.mdHedef dosya: .claude/commands/new-agent.md
You are scaffolding a new AG2 (AutoGen) agent. Follow the AG2 framework patterns exactly.
Ask the user for:
Create the agent following this exact structure:
agents/<agent-name>/
<agent_name>.py # Agent definition + tools
README.md # Capabilities documentation
import json
from autogen import ConversableAgent
from autogen.tools import tool
# --- Tool Functions ---
# Each tool returns a JSON string with {"success": bool, "data": ..., "error": ...}
@tool()
def tool_name(param1: str, param2: int = 10) -> str:
"""Clear description of what this tool does.
Args:
param1: Description of param1
param2: Description of param2 (default: 10)
"""
try:
# Implementation
result = {"key": "value"}
return json.dumps({"success": True, "data": result})
except Exception as e:
return json.dumps({"success": False, "error": str(e)})
# --- Agent Definition ---
agent = ConversableAgent(
name="AgentName",
description="One-line description for orchestrator routing",
system_message="""You are a [role description].
Your capabilities:
- Capability 1
- Capability 2
Guidelines:
- Always use the appropriate tool for the task
- Return structured responses
- Handle errors gracefully and explain what went wrong
""",
llm_config={"model": "gpt-4o-mini"},
functions=[tool_name],
)
description is used by orchestrators to route tasks -- keep it concise@tool() decorator from autogen.toolsexcept: -- always catch specific exceptions or Exception