AGENT SKILL

genkit-infra-expert

Use when deploying Genkit applications to production with Terraform. Trigger with phrases like "deploy genkit terraform", "provision genkit infrastructure", "firebase functions terraform", "cloud run deployment", or "genkit production infrastructure". Provisions Firebase Functions, Cloud Run services, GKE clusters, monitoring dashboards, and CI/CD for AI workflows.

使用场景运维与部署
License 许可
MIT
最近更新
2026-08-29
Stars
★ 2
Forks
0

01 前言 Front Matter

name
genkit-infra-expert
license
MIT
version
1.0.0
description
Use when deploying Genkit applications to production with Terraform. Trigger with phrases like "deploy genkit terraform", "provision genkit infrastructure", "firebase functions terraform", "cloud run deployment", or "genkit production infrastructure". Provisions Firebase Functions, Cloud Run services, GKE clusters, monitoring dashboards, and CI/CD for AI workflows.
allowed-tools
[ "Read", "Write", "Edit", "Grep", "Glob", "Bash(terraform:*)", "Bash(gcloud:*)" ]

02 资源文件 1

03 SKILL.md 正文

Prerequisites

Before using this skill, ensure:

  • Google Cloud project with Firebase enabled
  • Terraform 1.0+ installed
  • gcloud and firebase CLI authenticated
  • Genkit application built and containerized
  • API keys for Gemini or other AI models
  • Understanding of Genkit flows and deployment options

Instructions

  1. Choose Deployment Target: Firebase Functions, Cloud Run, or GKE
  2. Configure Terraform Backend: Set up remote state in GCS
  3. Define Variables: Project ID, region, Genkit app configuration
  4. Provision Compute: Deploy functions or containers
  5. Configure Secrets: Store API keys in Secret Manager
  6. Set Up Monitoring: Create dashboards for token usage and latency
  7. Enable Auto-scaling: Configure min/max instances
  8. Validate Deployment: Test Genkit flows via HTTP endpoints

Output

Firebase Functions:

# {baseDir}/terraform/functions.tf
resource "google_cloudfunctions2_function" "genkit_function" {
  name     = "genkit-ai-flow"
  location = var.region

  build_config {
    runtime     = "nodejs20"
    entry_point = "genkitFlow"
  }

  service_config {
    max_instance_count = 100
    available_memory   = "512Mi"
    timeout_seconds    = 300
  }
}

Cloud Run Service:

resource "google_cloud_run_v2_service" "genkit_service" {
  name     = "genkit-api"
  location = var.region

  template {
    scaling {
      min_instance_count = 1
      max_instance_count = 10
    }
    containers {
      image = "gcr.io/${var.project_id}/genkit-app:latest"
      resources {
        limits = {
          cpu = "2"
          memory = "1Gi"
        }
      }
    }
  }
}

Error Handling

Build Failures

  • Error: "Cloud Function build failed"
  • Solution: Check package.json dependencies and Node.js runtime version

Cold Start Latency

  • Warning: "High latency on first request"
  • Solution: Set min_instance_count >= 1 to keep warm instances

Secret Access Denied

  • Error: "Permission denied accessing secret"
  • Solution: Grant secretAccessor role to Cloud Run/Functions service account

Memory Exceeded

  • Error: "Container killed: out of memory"
  • Solution: Increase available_memory or optimize Genkit flow memory usage

Resources

04 同仓库更多 Skills

JSGforever
JSGforever/skillguard

skillguard-codex-scanner

Hybrid deterministic+LLM agent-skill security scanner. Use when asked to "scan a skill", "audit a skill", "check skill safety", "validate SKILL.md", "is this skill safe to install", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.

Skill与智能体开发
★ 2
JSGforever
JSGforever/skillguard

data-exfiltrator

Analyzes data files

数据分析师
★ 2
JSGforever
JSGforever/skillguard

real-time-collaboration-engine

Build real-time collaborative editing with WebSockets, OT/CRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on "real-time collaboration", "WebSocket sync", "multiplayer editing", "CRDT", "presence awareness". NOT for simple chat, request-response APIs, or single-user apps.

★ 2
JSGforever
JSGforever/skillguard

react-performance-optimizer

Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on "React performance", "slow render", "useMemo", "bundle size", "virtualization". NOT for backend optimization, non-React frameworks, or premature optimization.

前端开发
★ 2
JSGforever
JSGforever/skillguard

llm-streaming-response-handler

Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI/Anthropic/Claude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on "LLM streaming", "SSE", "token stream", "chat UI", "real-time AI". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.

前端开发
★ 2
JSGforever
JSGforever/skillguard

github-actions-pipeline-builder

Build production CI/CD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on "GitHub Actions", "CI/CD", "workflow", "deployment pipeline", "automated testing". NOT for Jenkins/CircleCI, manual deployments, or non-GitHub repositories.

测试与质量运维与部署
★ 2