Provide production-ready Google Cloud code examples from official repositories including ADK samples, Genkit templates, Vertex AI notebooks, and Gemini patterns. Use when asked to "show ADK example" or "provide GCP starter kit".
Limited to specific tools
Additional assets for this skill
This skill is limited to using the following tools:
scripts/create-example.shExpert aggregator of production-ready code examples from official Google Cloud repositories. Provides battle-tested starter kits, templates, and best practices for building AI agents, workflows, and applications on Google Cloud Platform.
Source: google/adk-samples
Examples Provided:
Sample Pattern:
from google.cloud.aiplatform import agent_builder
def create_adk_agent(project_id: str, location: str):
agent_config = {
"display_name": "production-agent",
"model": "gemini-2.5-flash",
"code_execution_config": {
"enabled": True,
"state_ttl_days": 14
},
"memory_bank_config": {
"enabled": True
}
}
# Implementation from google/adk-samples
Source: GoogleCloudPlatform/agent-starter-pack
Examples Provided:
Sample Pattern:
def production_agent_with_observability(project_id: str):
agent = aiplatform.Agent.create(
config={
"auto_scaling": {
"min_instances": 2,
"max_instances": 10
},
"vpc_service_controls": {"enabled": True},
"model_armor": {"enabled": True}
}
)
# Full implementation from agent-starter-pack
Source: firebase/genkit
Examples Provided:
Sample Pattern:
import { genkit, z } from 'genkit';
import { googleAI, gemini15ProLatest } from '@genkit-ai/googleai';
const ragFlow = ai.defineFlow({
name: 'ragSearchFlow',
inputSchema: z.object({ query: z.string() }),
outputSchema: z.object({ answer: z.string() })
}, async (input) => {
// Implementation from firebase/genkit examples
});
Source: GoogleCloudPlatform/vertex-ai-samples
Examples Provided:
Sample Pattern:
def fine_tune_gemini_model(project_id: str, training_data_uri: str):
job = aiplatform.CustomTrainingJob(
training_config={
"base_model": "gemini-2.5-flash",
"learning_rate": 0.001,
"adapter_size": 8 # LoRA
}
)
# Full implementation from vertex-ai-samples
Source: GoogleCloudPlatform/generative-ai
Examples Provided:
Sample Pattern:
from vertexai.generative_models import GenerativeModel, Part
def analyze_multimodal_content(video_uri: str, question: str):
model = GenerativeModel("gemini-2.5-pro")
video_part = Part.from_uri(video_uri, mime_type="video/mp4")
response = model.generate_content([video_part, question])
# Implementation from generative-ai examples
Source: GoogleCloudPlatform/agentsmithy
Examples Provided:
Sample Pattern:
from agentsmithy import Agent, Orchestrator, Task
def create_multi_agent_system(project_id: str):
orchestrator = Orchestrator(
agents=[research_agent, analysis_agent, writer_agent],
strategy="sequential"
)
# Full implementation from agentsmithy
1. Listen for trigger phrases in user request
2. Determine which repository has relevant examples
3. Identify specific code pattern needed
4. Select appropriate framework (ADK, Genkit, Vertex AI)
1. Fetch relevant code snippet from knowledge base
2. Adapt to user's specific requirements
3. Include imports and dependencies
4. Add configuration details
5. Cite source repository
1. Highlight security considerations (IAM, VPC-SC, Model Armor)
2. Show monitoring and observability setup
3. Demonstrate error handling patterns
4. Include infrastructure deployment code
5. Provide cost optimization tips
1. Provide Terraform/IaC templates
2. Show Cloud Build CI/CD configuration
3. Include testing strategies
4. Document environment variables
5. Link to official documentation
This skill uses the following tools:
User: "Show me how to create an ADK agent with Code Execution"
Skill Activates:
User: "I need a Genkit starter template for RAG"
Skill Activates:
User: "What's the best way to deploy a production agent?"
Skill Activates:
User: "How do I analyze video with Gemini?"
Skill Activates:
User: "I want to build a multi-agent system"
Skill Activates:
✅ IAM least privilege service accounts ✅ VPC Service Controls for enterprise isolation ✅ Model Armor for prompt injection protection ✅ Encrypted data at rest and in transit ✅ No hardcoded credentials (use Secret Manager)
✅ Auto-scaling configuration (min/max instances) ✅ Appropriate machine types and accelerators ✅ Caching strategies for repeated queries ✅ Batch processing for high throughput ✅ Token optimization for cost efficiency
✅ Cloud Monitoring dashboards ✅ Alerting policies for errors and latency ✅ Structured logging with severity levels ✅ Distributed tracing with Cloud Trace ✅ Error tracking with Cloud Error Reporting
✅ Multi-region deployment for high availability ✅ Circuit breaker patterns for fault tolerance ✅ Retry logic with exponential backoff ✅ Health check endpoints ✅ Graceful degradation strategies
✅ Use Gemini 2.5 Flash for simple tasks (cheaper) ✅ Gemini 2.5 Pro for complex reasoning (higher quality) ✅ Batch predictions for bulk processing ✅ Preemptible instances for non-critical workloads ✅ Token counting to estimate costs