adk-sample-creator
danielvogler/ai-skills-library/.agents/skills/adk-sample-creator/SKILL.md
Author new samples for the ADK Python repository. Use this skill when the user wants to create a new sample demonstrating a feature or agent pattern (e.g., dynamic nodes, standalone agents, fan-out/fan-in) or when adding examples to subdirectories under `contributing/`.
Skill0 starsChanged 4 months ago
What's in it
- ADK Sample Creator
- Guidelines
- 1. Folder Name
- 2. agent.py Content
- 3. README.md Content
- How To
---
name: adk-sample-creator
description: Author new samples for the ADK Python repository. Use this skill when the user wants to create a new sample demonstrating a feature or agent pattern (e.g., dynamic nodes, standalone agents, fan-out/fan-in) or when adding examples to subdirectories under `contributing/`.
---
# ADK Sample Creator
This skill helps you create new samples for the ADK Python repository. You should search for subdirectories under `contributing` (such as `new_workflow_samples`, `workflow_samples`, etc.) and confirm with the user which folder they want to use before creating the sample.
> [!TIP]
> Before creating samples, you can use the `adk-style` skill to learn about ADK 2.0 architecture knowledge and best practices.
A sample consists of:
1. A directory per sample.
2. An `agent.py` file defining the agent or workflow logic.
3. A `README.md` file explaining the sample.
## Guidelines
### 1. Folder Name
Use snake_case for the folder name (e.g., `dynamic_nodes`, `fan_out_fan_in`).
### 2. `agent.py` Content
The `agent.py` should focus on demonstrating a specific feature or agent pattern. Use absolute imports for testing convenience.
> [!IMPORTANT]
> **Model Selection**: Do not set the `model` parameter explicitly (e.g., `model="gemini-2.5-flash"`) on `Agent` instances in sample agents. Instead, let them default to the system-configured model, unless a specific model is explicitly requested by the user.
Choose one of the following patterns:
#### Pattern A: Workflows (for complex graphs)
Use this when you need multiple nodes, routing, or parallel execution.
**Imports:**
```python
from google.adk import Agent
from google.adk import Context
from google.adk.workflow import node
from google.adk.workflow import JoinNode
from google.adk.workflow._workflow_class import Workflow
```
**Anatomy:**
```python
my_agent = Agent(name="my_agent", ...)
@node()
async def my_node(node_input: str):
return "result"
root_agent = Workflow(
name="root_wf",
edges=[("START", my_node)],
)
```
#### Pattern B: Standalone Agents (for single-agent or simple tool use)
Use this when you don't need a graph and the agent handles the loop.
**Imports:**
```python
from google.adk import Agent
from google.adk.tools import google_search # example
```
**Anatomy:**
```python
root_agent = Agent(
name="standalone_assistant",
instruction="You are a helpful assistant.",
description="An assistant that can help with queries.",
tools=[google_search],
)
```
### 3. `README.md` Content
Each sample should have a `README.md` with the following structure:
- **Overview**: What the sample does.
- **Sample Inputs**: Examples of inputs to test with. Each prompt must be wrapped in backticks. If a prompt has an explanation, always add a blank line between the prompt and the explanation, and indent the explanation by two spaces.
- **Graph**: Visualization of the graph flow (Mermaid recommended for workflows).
- **How To**: Explanation of key techniques used (e.g., `ctx.run_node`).
#### README Example Template:
````markdown
# ADK Sample Name
## Overview
Brief description.
## Sample Inputs
- `Prompt example 1`
- `Prompt example 2`
*Explanation or expected behavior*
## Graph
```mermaid
graph TD
START --> MyNode
```
````
## How To
Explain the details.
````
## Examples
### Dynamic Nodes
Snippet from `dynamic_nodes/agent.py`:
```python
@node(rerun_on_resume=True)
async def orchestrate(ctx: Context, node_input: str) -> str:
while True:
headline = await ctx.run_node(generate_headline)
# ...
````
### Fan Out Fan In
Snippet from `fan_out_fan_in/agent.py`:
```python
root_agent = Workflow(
name="root_agent",
edges=[("START", (node_a, node_b), join_node, aggregate)],
)
```
More agent context in danielvogler/ai-skills-library
82 other files this repository gives its agents, the first 60 shown.
AGENTS.md
CLAUDE.md
Skill
- adding-dbt-unit-test.agents/skills/adding-dbt-unit-test/SKILL.md
- adk-agent-builder.agents/skills/adk-agent-builder/SKILL.md
- adk-architecture.agents/skills/adk-architecture/SKILL.md
- adk-debug.agents/skills/adk-debug/SKILL.md
- adk-setup.agents/skills/adk-setup/SKILL.md
- adk-style.agents/skills/adk-style/SKILL.md
- answering-natural-language-questions-with-dbt.agents/skills/answering-natural-language-questions-with-dbt/SKILL.md
- api-and-interface-design.agents/skills/api-and-interface-design/SKILL.md
- auditing-skills.agents/skills/auditing-skills/SKILL.md
- aws-ami-builder.agents/skills/aws-ami-builder/SKILL.md
- azure-image-builder.agents/skills/azure-image-builder/SKILL.md
- azure-verified-modules.agents/skills/azure-verified-modules/SKILL.md
- babysit-pr.agents/skills/babysit-pr/SKILL.md
- browser-testing-with-devtools.agents/skills/browser-testing-with-devtools/SKILL.md
- building-dbt-semantic-layer.agents/skills/building-dbt-semantic-layer/SKILL.md
- ci-cd-and-automation.agents/skills/ci-cd-and-automation/SKILL.md
- code-breaking-changes.agents/skills/code-breaking-changes/SKILL.md
- code-review-and-quality.agents/skills/code-review-and-quality/SKILL.md
- code-review-change-size.agents/skills/code-review-change-size/SKILL.md
- code-review-context.agents/skills/code-review-context/SKILL.md
- code-review.agents/skills/code-review/SKILL.md
- code-review-testing.agents/skills/code-review-testing/SKILL.md
- code-simplification.agents/skills/code-simplification/SKILL.md
- codex-pr-body.agents/skills/codex-pr-body/SKILL.md
- configuring-dbt-mcp-server.agents/skills/configuring-dbt-mcp-server/SKILL.md
- context-engineering.agents/skills/context-engineering/SKILL.md
- creating-mermaid-dbt-dag.agents/skills/creating-mermaid-dbt-dag/SKILL.md
- debugging-and-error-recovery.agents/skills/debugging-and-error-recovery/SKILL.md
- deep-agents-core.agents/skills/deep-agents-core/SKILL.md
- deep-agents-memory.agents/skills/deep-agents-memory/SKILL.md
- deep-agents-orchestration.agents/skills/deep-agents-orchestration/SKILL.md
- deprecation-and-migration.agents/skills/deprecation-and-migration/SKILL.md
- documentation-and-adrs.agents/skills/documentation-and-adrs/SKILL.md
- doubt-driven-development.agents/skills/doubt-driven-development/SKILL.md
- fetching-dbt-docs.agents/skills/fetching-dbt-docs/SKILL.md
- final-checks.agents/skills/final-checks/SKILL.md
- frontend-ui-engineering.agents/skills/frontend-ui-engineering/SKILL.md
- gemini-api-dev.agents/skills/gemini-api-dev/SKILL.md
- gemini-interactions-api.agents/skills/gemini-interactions-api/SKILL.md
- gemini-live-api-dev.agents/skills/gemini-live-api-dev/SKILL.md
- github-actions.agents/skills/github-actions/SKILL.md
- github.agents/skills/github/SKILL.md
- git-workflow-and-versioning.agents/skills/git-workflow-and-versioning/SKILL.md
- idea-refine.agents/skills/idea-refine/SKILL.md
- incremental-implementation.agents/skills/incremental-implementation/SKILL.md
- interview-me.agents/skills/interview-me/SKILL.md
- karpathy-guidelines.agents/skills/karpathy-guidelines/SKILL.md
- migrating-dbt-core-to-fusion.agents/skills/migrating-dbt-core-to-fusion/SKILL.md
- migrating-dbt-project-across-platforms.agents/skills/migrating-dbt-project-across-platforms/SKILL.md
- new-terraform-provider.agents/skills/new-terraform-provider/SKILL.md
- performance-optimization.agents/skills/performance-optimization/SKILL.md
- planning-and-task-breakdown.agents/skills/planning-and-task-breakdown/SKILL.md
- provider-actions.agents/skills/provider-actions/SKILL.md
- provider-docs.agents/skills/provider-docs/SKILL.md
- provider-resources.agents/skills/provider-resources/SKILL.md
- provider-test-patterns.agents/skills/provider-test-patterns/SKILL.md
- push-to-registry.agents/skills/push-to-registry/SKILL.md
- react-native-best-practices.agents/skills/react-native-best-practices/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

