new-a2a-agent

new-a2a-agent is a command for Claude Code from davepoon/buildwithclaude. It costs 21 tokens per session (804 once invoked), scanned A, original, MIT.

A command that creates an A2A-compliant AG2 agent as a standalone service. A2A is a standard for allowing AI agents to communicate, and AG2 is a Python framework for building them.

In plain words
What is it for?
Use it to scaffold an agent with server wiring, a capability card, skill definitions, tool functions, setup instructions, and optional token or connector middleware.
Why use it?
It provides a defined project structure and asks for the details needed to connect the agent, its tools, skills, and authentication.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the ag2-agent-builder plugin — 7 commands, 3 agents shipped together

Good fit Use it to scaffold an agent with server wiring, a capability card, skill definitions, tool functions, setup instructions, and optional token or connector middleware.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/davepoon/buildwithclaude/new-a2a-agent
About the project

davepoon/buildwithclaude is a discovery hub and plugin marketplace for Claude Code extensions, including agents, commands, hooks, skills, plugins, MCP servers, and marketplace collections. Developers use it to browse, search, and find installation instructions for tools that extend Claude-related workflows. Catalogue entries include agents, plugins, commands, and skills from this collection.

davepoon/buildwithclaude · 3,421 stars · on GitHub · buildwithclaude.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/davepoon/buildwithclaude

Made for: Claude Code.

Or install ag2-agent-builder, the plugin that ships this one along with the rest of its 7 commands, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for new-a2a-agent

README.md
[![agentmods](https://agentmods.dev/badge/commands/davepoon/buildwithclaude/new-a2a-agent.svg)](https://agentmods.dev/commands/davepoon/buildwithclaude/new-a2a-agent)
Your own site
<a href="https://agentmods.dev/commands/davepoon/buildwithclaude/new-a2a-agent"><img src="https://agentmods.dev/badge/commands/davepoon/buildwithclaude/new-a2a-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 804 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00804
Opus 5 $0.00010 $0.00402
Sonnet 5 $0.00004 $0.00161
Haiku 4.5 $0.00002 $0.00080

Measured 8d ago against content hash f406c33caac6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

new-a2a-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ag2-agent-builder/commands/new-a2a-agent.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are scaffolding a new A2A-compliant AG2 agent for deployment as a standalone service.

Instructions

  1. Ask the user for:

    • Agent name and purpose
    • What tools/capabilities it needs
    • Authentication requirements (Bearer, OAuth2, none)
    • Skills the agent exposes (human-readable capabilities)
    • Whether it needs connector/token middleware
  2. Create the agent following this exact structure:

File Structure

agents/<agent-name>/
  <agent_name>.py    # Agent + tools + A2A server
  README.md          # Capabilities, setup, environment variables

A2A Agent Code Pattern

import json
import os
from autogen import ConversableAgent
from autogen.tools import tool
from a2a_agent_server import A2aAgentServer, CardSettings, Skill


# --- Tool Functions ---

@tool()
def example_tool(query: str) -> str:
    """Description of what this tool does.

    Args:
        query: The input query to process
    """
    try:
        result = {"items": [], "count": 0}
        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 discovery and routing",
    system_message="""You are a [role] specialist.

Your capabilities:
- [List specific capabilities]

When using tools:
- Always check the success field in tool responses
- If a tool fails, explain the error clearly to the user
- Never fabricate data -- only report what tools return
""",
    llm_config={"model": "gpt-4o-mini"},
    functions=[example_tool],
)


# --- A2A Server ---

server = A2aAgentServer(
    agent,
    url="http://0.0.0.0:8000/agent-name/",
    agent_card=CardSettings(
        organization="AG2 AI",
        version="1.0.0",
        capabilities=["capability_1", "capability_2"],
        authentication_schemes=["Bearer"],
        default_input_modes=["text/plain"],
        default_output_modes=["text/plain", "application/json"],
        skills=[
            Skill(
                id="skill_one",
                description="Human-readable description of this skill",
                examples=["Example request that uses this skill"],
            ),
            Skill(
                id="skill_two",
                description="Another skill description",
                examples=["Another example request"],
            ),
        ],
    ),
).build()

Read the full file on GitHub · 130 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 130 lines · 21 tokens per session scan A f406c33caac6

Subscribe to this mod's changes

new-a2a-agent is a command published in the GitHub repository davepoon/buildwithclaude (3,421 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 804 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.