AGENT SKILL

gcp-examples-expert

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".

License 许可
MIT
最近更新
2025-12-18
Stars
★ 29
Forks
9

01 前言 Front Matter

name
gcp-examples-expert
license
MIT
description
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".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash

02 资源文件 6

03 SKILL.md 正文

What This Skill Does

Expert 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.

When This Skill Activates

Trigger Phrases

  • "Show me ADK sample code"
  • "Genkit starter template"
  • "Vertex AI code example"
  • "Agent Starter Pack template"
  • "Gemini function calling example"
  • "Multi-agent orchestration pattern"
  • "Google Cloud starter kit"
  • "Production agent template"
  • "How to implement RAG with Genkit"
  • "A2A protocol code example"

Use Cases

  • Quick access to official Google Cloud code examples
  • Production-ready agent templates
  • Genkit flow patterns (RAG, multi-step workflows, tool calling)
  • Vertex AI training and deployment code
  • Gemini API integration examples
  • Multi-agent system orchestration
  • Infrastructure as Code (Terraform) templates

Code Example Categories

1. ADK (Agent Development Kit) Samples

Source: google/adk-samples

Examples Provided:

  • Basic agent creation with Code Execution Sandbox
  • Memory Bank configuration for stateful agents
  • A2A protocol implementation for inter-agent communication
  • Multi-tool agent configuration
  • VPC Service Controls integration
  • IAM least privilege patterns

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

2. Agent Starter Pack

Source: GoogleCloudPlatform/agent-starter-pack

Examples Provided:

  • Production agent with monitoring and observability
  • Auto-scaling configuration
  • Security best practices (Model Armor, VPC-SC)
  • Cloud Monitoring dashboards
  • Alerting policies
  • Error tracking setup

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

3. Firebase Genkit

Source: firebase/genkit

Examples Provided:

  • RAG flows with vector search
  • Multi-step workflows
  • Tool calling integration
  • Prompt templates
  • Evaluation frameworks
  • Deployment patterns (Cloud Run, Functions)

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
});

4. Vertex AI Samples

Source: GoogleCloudPlatform/vertex-ai-samples

Examples Provided:

  • Custom model training with Gemini
  • Batch prediction jobs
  • Hyperparameter tuning
  • Model evaluation
  • Endpoint deployment with auto-scaling
  • A/B testing patterns

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

5. Generative AI Examples

Source: GoogleCloudPlatform/generative-ai

Examples Provided:

  • Gemini multimodal analysis (text, images, video)
  • Function calling with live APIs
  • Structured output generation
  • Grounding with Google Search
  • Safety filters and content moderation
  • Token counting and cost optimization

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

6. AgentSmithy

Source: GoogleCloudPlatform/agentsmithy

Examples Provided:

  • Multi-agent orchestration
  • Supervisory agent patterns
  • Agent-to-agent communication
  • Workflow coordination (sequential, parallel, conditional)
  • Task delegation strategies
  • Error handling and retry logic

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

Workflow

Phase 1: Identify Use Case

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)

Phase 2: Provide Code Example

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

Phase 3: Explain Best Practices

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

Phase 4: Deployment Guidance

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

Tool Permissions

This skill uses the following tools:

  • Read: Access code examples and documentation
  • Write: Create starter template files
  • Edit: Modify templates for user's project
  • Grep: Search for specific patterns in examples
  • Glob: Find related code files
  • Bash: Run setup commands and validation

Example Interactions

Example 1: ADK Agent Creation

User: "Show me how to create an ADK agent with Code Execution"

Skill Activates:

  • Provides code example from google/adk-samples
  • Includes Code Execution Sandbox configuration
  • Shows 14-day state persistence setup
  • Demonstrates security best practices
  • Links to official ADK documentation

Example 2: Genkit RAG Flow

User: "I need a Genkit starter template for RAG"

Skill Activates:

  • Provides RAG flow code from firebase/genkit
  • Shows vector search integration
  • Demonstrates embedding generation
  • Includes context retrieval logic
  • Provides deployment configuration

Example 3: Production Agent Template

User: "What's the best way to deploy a production agent?"

Skill Activates:

  • Provides Agent Starter Pack template
  • Shows auto-scaling configuration
  • Includes monitoring dashboard setup
  • Demonstrates alerting policies
  • Provides Terraform deployment code

Example 4: Gemini Multimodal

User: "How do I analyze video with Gemini?"

Skill Activates:

  • Provides multimodal code from generative-ai repo
  • Shows video part creation
  • Demonstrates prompt engineering
  • Includes error handling
  • Provides cost optimization tips

Example 5: Multi-Agent System

User: "I want to build a multi-agent system"

Skill Activates:

  • Provides AgentSmithy orchestration code
  • Shows supervisory agent pattern
  • Demonstrates A2A protocol usage
  • Includes workflow coordination
  • Provides testing strategies

Best Practices Applied

Security

✅ 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)

Performance

✅ 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

Observability

✅ 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

Reliability

✅ Multi-region deployment for high availability ✅ Circuit breaker patterns for fault tolerance ✅ Retry logic with exponential backoff ✅ Health check endpoints ✅ Graceful degradation strategies

Cost Optimization

✅ 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

Integration with Other Plugins

Works with jeremy-genkit-pro

  • Provides Genkit code examples
  • Complements Genkit flow architect agent
  • Shares Genkit production best practices

Works with jeremy-adk-orchestrator

  • Provides ADK sample code
  • Shows A2A protocol implementation
  • Demonstrates multi-agent patterns

Works with jeremy-vertex-validator

  • Provides production-ready code that passes validation
  • Follows security and performance best practices
  • Includes monitoring from the start

Works with jeremy-*-terraform plugins

  • Provides infrastructure code examples
  • Shows Terraform module patterns
  • Demonstrates resource configuration

Version History

  • 1.0.0 (2025): Initial release with 6 official Google Cloud repository integrations

References

04 同仓库更多 Skills

BbgnsurfTech
BbgnsurfTech/claude-skills-collection

UI 视觉回归测试

testing-visual-regression

使用截图比较检测 UI 组件中的视觉变化。 在检测意外的 UI 更改或像素差异时使用。 用“测试视觉变化”、“比较截图”或“检测 UI 回归”等短语触发。

测试工程师测试与质量保障
★ 29
BbgnsurfTech
BbgnsurfTech/claude-skills-collection

单元测试自动生成

generating-unit-tests

从源代码自动生成全面的单元测试,覆盖正常路径、边界条件和错误情况。 在为函数、类或模块创建测试覆盖时使用。 用“生成单元测试”、“为…创建测试”或“添加测试覆盖”等短语触发。

测试工程师测试与质量保障
★ 29
BbgnsurfTech
BbgnsurfTech/claude-skills-collection

测试报告生成与可视化

generating-test-reports

生成包含指标、覆盖率和可视化内容的全面测试报告。 在执行专项测试时使用。 用“生成测试报告”、“创建测试文档”或“显示测试指标”等短语触发。

测试工程师测试与质量保障
★ 29
BbgnsurfTech
BbgnsurfTech/claude-skills-collection

测试执行编排与协调

orchestrating-test-execution

协调跨多个环境和框架的并行测试执行。 在执行专项测试时使用。 用“编排测试”、“运行并行测试”或“协调测试执行”等短语触发。

测试工程师测试与质量保障
★ 29
BbgnsurfTech
BbgnsurfTech/claude-skills-collection

managing-test-environments

Provision and manage isolated test environments with configuration and data. Use when performing specialized testing. Trigger with phrases like "manage test environment", "provision test env", or "setup test infrastructure".

★ 29
BbgnsurfTech
BbgnsurfTech/claude-skills-collection

generating-test-doubles

Generate mocks, stubs, spies, and fakes for dependency isolation. Use when creating mocks, stubs, or test isolation fixtures. Trigger with phrases like "generate mocks", "create test doubles", or "setup stubs".

★ 29