Adk Agent Builder
google/adk-python
Builds ADK (Agent Development Kit) Python agents: LLM agents with tools, graph workflows of function and agent nodes, conditional routing, fan-out and join, schema-validated delegation between…
Test AG2 beta agents and tools without hitting a real LLM provider.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-testing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/ag2-testing .claude/skills/ag2-testing && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "ag2-testing" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-testing into .claude/skills/ag2-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-testing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-testingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-testing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/ag2-testing .agents/skills/ag2-testing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ag2-testing" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-testing into .agents/skills/ag2-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-testing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-testing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/ag2-testing .cursor/skills/ag2-testing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ag2-testing" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-testing into .cursor/skills/ag2-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-testing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ag2ai/build-with-ag2.git --path .agents/skills/ag2-testing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-testing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/ag2-testing .gemini/skills/ag2-testing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ag2-testing" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-testing into .gemini/skills/ag2-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-testing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ag2ai/build-with-ag2 ag2-testingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/ag2-testing .github/skills/ag2-testing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ag2-testing" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-testing into .github/skills/ag2-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-testing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ag2ai/build-with-ag2 ag2-testing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ag2ai/build-with-ag2.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/ag2-testing .opencode/skills/ag2-testing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ag2-testing" agent skill from https://github.com/ag2ai/build-with-ag2/tree/main/.agents/skills/ag2-testing into .opencode/skills/ag2-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ag2-testing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ag2-testingTest AG2 beta agents and tools without hitting a real LLM provider.
Ag2 Testing is an agent skill from ag2ai/build-with-ag2. Test AG2 beta agents and tools without hitting a real LLM provider. Pass TestConfig(...) from autogen.beta.testing as the agent's config (or per-ask) to mock LLM responses, inject ToolCallEvents to simulate tool execution, and assert success / error paths. Use when the user is writing pytest tests for an Agent or Tool.
Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Unit testing and Building AI agents. It works with pytest. The repository describes itself as: Sample code and application showcases to get you going with AG2 (formally AutoGen). The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 29eeac3. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
OPENAI_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Ag2 Testing loads about 1.3k tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 327 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ag2ai/build-with-ag2 at commit 29eeac3, republished under its Apache-2.0 licence (© ag2ai). 327 words, ~1,273 tokens.
.claude/skills/ag2-testing/SKILL.md (or your agent's skills folder).Writing tests for code that builds AG2 beta Agents, custom @tool functions, middleware, or response schemas — anywhere you don't want to make real LLM API calls.
import pytest
from autogen.beta import Agent
from autogen.beta.testing import TestConfig
@pytest.mark.asyncio
async def test_mocked_response():
agent = Agent("test_agent")
reply = await agent.ask("Hi!", config=TestConfig("This is a mocked response."))
assert reply.body == "This is a mocked response."TestConfig(*responses) replaces the model client. Each positional arg is the mocked response for the next sequential turn — strings for text replies, ToolCallEvent for tool dispatches.
Pass a ToolCallEvent first (the model "decides" to call the tool), then the final answer:
import pytest
from autogen.beta import Agent
from autogen.beta.events import ToolCallEvent
from autogen.beta.testing import TestConfig
@pytest.mark.asyncio
async def test_tool_success():
def my_tool() -> str:
return "tool execution result"
agent = Agent("test_agent", tools=[my_tool])
config = TestConfig(
ToolCallEvent(name="my_tool"),
"final result",
)
reply = await agent.ask("Please use my_tool", config=config)
assert reply.body == "final result"If a tool raises, the exception propagates to ask():
@pytest.mark.asyncio
async def test_tool_raises():
def failing_tool() -> str:
raise ValueError("Something went wrong")
config = TestConfig(
ToolCallEvent(name="failing_tool"),
"result",
)
agent = Agent("test_agent", config=config, tools=[failing_tool])
with pytest.raises(ValueError, match="Something went wrong"):
await agent.ask("Hi!")If the LLM calls a tool the agent doesn't have, the framework raises ToolNotFoundError:
from autogen.beta.exceptions import ToolNotFoundError
@pytest.mark.asyncio
async def test_tool_not_found():
config = TestConfig(ToolCallEvent(name="unregistered_tool"))
agent = Agent("test_agent", config=config)
with pytest.raises(ToolNotFoundError, match="Tool `unregistered_tool` not found"):
await agent.ask("Hi!")Depends dependenciesdef get_production_db():
raise Exception("Do not call in tests!")
@tool
def read_data(db: Annotated[object, Depends(get_production_db)]) -> str:
return "Data"
agent = Agent("test", tools=[read_data])
agent.dependency_provider.override(get_production_db, lambda: "mock_db")Inject dependenciesJust pass dependencies={...} to agent.ask(...):
await agent.ask("Read", dependencies={"database_pool": fake_pool})from autogen.beta import MemoryStream
from autogen.beta.events import ToolCallEvent
stream = MemoryStream()
collected: list[ToolCallEvent] = []
stream.where(ToolCallEvent).subscribe(lambda e: collected.append(e))
await agent.ask("Test", stream=stream)
assert collected[0].name == "expected_tool"Each positional arg in TestConfig(...) corresponds to one model response. For a multi-turn test, supply enough responses for each turn the test exercises.
website/docs/beta/testing.mdx.pyproject.toml. Use @pytest.mark.asyncio (the project uses pytest-asyncio).website/docs/beta/advanced/stream.mdx.@pytest.mark.asyncio — the test will skip or fail oddly.TestConfig runs out of responses if the agent makes more LLM calls than you expect (e.g. tool error → another LLM call). Add more positional args or assert that the call sequence is what you intended.Depends to inject test doubles.reply.body when you set a response_schema — body is the raw text. Use await reply.content() for the validated value.Agent instances across async tests — agents carry mutable state (variables, dependencies). Construct fresh agents per test for isolation.TestConfig per-test or via a fixture; never rely on OPENAI_API_KEY etc. being available in test environments.© ag2ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/ag2-testing of ag2ai/build-with-ag2.
Open the folder on GitHubat commit 29eeac3
Ag2 Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Ag2 Testing this skillag2ai/build-with-ag2 | 252 | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Adk Agent Buildergoogle/adk-python | 22k | — | ~879 | Automated safety check: Pass | Apache-2.0 | |
| Adk Verify Snippetsgoogle/adk-python | 22k | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Hermetic Python Unit TestsdimensionalOS/dimos | 4.6k | — | ~1.4k | Automated safety check: Pass | Custom licence | |
| Test GuardamElnagdy/guard-skills | 1.3k | 2 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Fla Optimization Loopfla-org/flash-linear-attention | 5.8k | — | ~2.6k | Automated safety check: Pass | MIT |
google/adk-python
Builds ADK (Agent Development Kit) Python agents: LLM agents with tools, graph workflows of function and agent nodes, conditional routing, fan-out and join, schema-validated delegation between…
google/adk-python
Checks that every Python code block in a Markdown file actually compiles and runs, by extracting each block to a temporary file, executing it in an isolated subprocess, and writing a pass/fail…
dimensionalOS/dimos
Rules for writing, fixing and reviewing pytest unit tests that are hermetic: behavior-focused, deterministic, isolated and cheap to run.
amElnagdy/guard-skills
Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.
fla-org/flash-linear-attention
Disciplined, reproducible loop for making an FLA kernel faster (Triton, Gluon, TileLang, CuTe) without ever breaking or gaming correctness.
saleor/saleor
Run pytest tests with automatic virtual environment activation. Use this skill whenever running tests, executing pytest, or when asked to "run tests", "test…
ag2ai/build-with-ag2
Add a custom Python tool to an AG2 beta Agent using the @tool decorator.
ag2ai/build-with-ag2
Intercept the AG2 beta agent loop with BaseMiddleware — wrap full turns (onturn), each LLM call (onllmcall), each tool execution (ontoolexecution), or each human-input request (onhumaninput).
ag2ai/build-with-ag2
Wire AG2 beta's shipped tools into an Agent — both provider-native server-side tools (web search, web fetch, code execution, MCP, image generation, memory) and locally-executed common toolkits…
ag2ai/build-with-ag2
Persist agent state across runs, shape what the LLM sees per turn, and cap history to fit a context window.
ag2ai/build-with-ag2
Monitor an AG2 beta agent's stream — log events, detect repeated tool calls, track token spend, build trigger-driven observers, route observer alerts to the model, and halt on FATAL conditions.
ag2ai/build-with-ag2
Build a minimal AG2 beta Agent end to end — pick a model provider, set a prompt, call agent.ask(), then continue the conversation with reply.ask() (multi-turn).
Works with
Categories
Test AG2 beta agents and tools without hitting a real LLM provider. Ag2 Testing is an agent skill from ag2ai/build-with-ag2. Test AG2 beta agents and tools without hitting a real LLM provider.
Ag2 Testing fits situations like: the user is writing pytest tests for an Agent; tasks that involve Unit testing; tasks that involve Building AI agents.
Run `npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a claude-code`. Or copy the skill folder (.agents/skills/ag2-testing in ag2ai/build-with-ag2) into .claude/skills/ag2-testing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a codex`. Or copy the skill folder (.agents/skills/ag2-testing in ag2ai/build-with-ag2) into .agents/skills/ag2-testing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ag2ai/build-with-ag2 --skill ag2-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ag2-testing, .gemini/skills/ag2-testing, .github/skills/ag2-testing and .opencode/skills/ag2-testing in your project.
Going by SKILL.md and its folder, Ag2 Testing needs credentials named OPENAI_API_KEY. Our summary lists: Python 3; A credential in OPENAI_API_KEY.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Ag2 Testing is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Ag2 Testing: Adk Agent Builder (google/adk-python, 22k stars), Adk Verify Snippets (google/adk-python, 22k stars), Hermetic Python Unit Tests (dimensionalOS/dimos, 4.6k stars) and Test Guard (amElnagdy/guard-skills, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ag2ai (a GitHub organization) maintains it in ag2ai/build-with-ag2, which has 252 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on September 6, 2026.
Source: ag2ai/build-with-ag2 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.