From ag2-agent-scaffold
Scaffold a new AG2 ConversableAgent with tool functions and LLM config. Use when creating a standalone agent that needs tools, a system prompt, and proper structure.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ag2-agent-scaffold:new-agentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are scaffolding a new AG2 (AutoGen) agent. Follow the AG2 framework patterns exactly.
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, LLMConfig
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="agent_name",
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=LLMConfig({"api_type": "anthropic", "model": "claude-sonnet-4-6"}),
functions=[tool_name],
)
description is used by orchestrators to route tasks -- keep it concise@tool() decorator from autogen.toolsexcept: -- always catch specific exceptions or Exceptionnpx claudepluginhub ag2ai/ag2-claude-plugins --plugin ag2-agent-scaffoldGenerates, scaffolds, or refactors an AI agent (subagent/specialized role) from intent, renders per host tool, and validates the output.
Guides creation of autonomous agents for Claude Code plugins, covering file structure, YAML frontmatter fields like name and description, system prompts, triggering conditions, tools, and best practices.
Scaffolds custom Claude Agent SDK configurations: generates system prompts, Python agent options, entry points, and docs for new specialized subagents.