From 18b893a2faa0c0ea2f541c17cde2fb11fd228c05 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:19:40 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 +++ README.md | 3 + plugin.lock.json | 45 +++++++++ skills/genkit-infra-expert/SKILL.md | 147 ++++++++++++++++++++++++++++ 4 files changed, 207 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 plugin.lock.json create mode 100644 skills/genkit-infra-expert/SKILL.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..2d0d708 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "jeremy-genkit-terraform", + "description": "Terraform modules for Firebase Genkit infrastructure and deployments", + "version": "1.0.0", + "author": { + "name": "Jeremy Longshore", + "email": "jeremy@intentsolutions.io" + }, + "skills": [ + "./skills" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed44382 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# jeremy-genkit-terraform + +Terraform modules for Firebase Genkit infrastructure and deployments diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..bd41d87 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:jeremylongshore/claude-code-plugins-plus:plugins/devops/jeremy-genkit-terraform", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "aa17e2563c4358aa34851528d21175227d8e6f31", + "treeHash": "05d57b6fa2d5d669fdb730d1ecc4f314e37cbdb9f24d81183ef755056ff1c178", + "generatedAt": "2025-11-28T10:18:54.309162Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "jeremy-genkit-terraform", + "description": "Terraform modules for Firebase Genkit infrastructure and deployments", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "702771cbad20ccc3c0926d38ca1eed1eb129655900fe2d2d80dc5d010cfb6943" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "49c78767e0a11328faf9053e10c764fb13cd341ab7dbcbb363e6039e2e73137e" + }, + { + "path": "skills/genkit-infra-expert/SKILL.md", + "sha256": "72da631e2765d0984c7d7c591ee95f43a8aaf00de85dc31dd14c81cfeda714d9" + } + ], + "dirSha256": "05d57b6fa2d5d669fdb730d1ecc4f314e37cbdb9f24d81183ef755056ff1c178" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/genkit-infra-expert/SKILL.md b/skills/genkit-infra-expert/SKILL.md new file mode 100644 index 0000000..e7ad930 --- /dev/null +++ b/skills/genkit-infra-expert/SKILL.md @@ -0,0 +1,147 @@ +--- +name: genkit-infra-expert +description: | + Terraform infrastructure specialist for deploying Genkit applications to production. + Provisions Firebase Functions, Cloud Run services, GKE clusters, monitoring, and CI/CD for Genkit AI workflows. + Triggers: "deploy genkit terraform", "genkit infrastructure", "firebase functions terraform", "cloud run genkit" +allowed-tools: Read, Write, Edit, Grep, Glob, Bash +version: 1.0.0 +--- + +## What This Skill Does + +Expert in provisioning production infrastructure for Firebase Genkit applications using Terraform. Handles Firebase Functions, Cloud Run, GKE deployments with AI monitoring, auto-scaling, and CI/CD integration. + +## When This Skill Activates + +Triggers: "deploy genkit with terraform", "provision genkit infrastructure", "firebase functions terraform", "cloud run deployment terraform", "genkit production infrastructure" + +## Core Terraform Modules + +### Firebase Functions Deployment + +```hcl +resource "google_cloudfunctions2_function" "genkit_function" { + name = "genkit-ai-flow" + location = var.region + + build_config { + runtime = "nodejs20" + entry_point = "genkitFlow" + source { + storage_source { + bucket = google_storage_bucket.genkit_source.name + object = google_storage_bucket_object.genkit_code.name + } + } + } + + service_config { + max_instance_count = 100 + available_memory = "512Mi" + timeout_seconds = 300 + environment_variables = { + GOOGLE_API_KEY = var.gemini_api_key + ENABLE_AI_MONITORING = "true" + } + } +} +``` + +### Cloud Run for Genkit + +```hcl +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" + } + } + + env { + name = "GOOGLE_API_KEY" + value_source { + secret_key_ref { + secret = google_secret_manager_secret.gemini_key.id + version = "latest" + } + } + } + } + } + + traffic { + type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST" + percent = 100 + } +} +``` + +### AI Monitoring Integration + +```hcl +resource "google_monitoring_dashboard" "genkit_dashboard" { + dashboard_json = jsonencode({ + displayName = "Genkit AI Monitoring" + mosaicLayout = { + columns = 12 + tiles = [ + { + width = 6 + height = 4 + widget = { + title = "Token Consumption" + xyChart = { + dataSets = [{ + timeSeriesQuery = { + timeSeriesFilter = { + filter = "resource.type=\"cloud_function\" AND metric.type=\"genkit.ai/token_usage\"" + } + } + }] + } + } + }, + { + width = 6 + height = 4 + widget = { + title = "Latency" + xyChart = { + dataSets = [{ + timeSeriesQuery = { + timeSeriesFilter = { + filter = "resource.type=\"cloud_function\" AND metric.type=\"genkit.ai/latency\"" + } + } + }] + } + } + } + ] + } + }) +} +``` + +## Tool Permissions + +Read, Write, Edit, Grep, Glob, Bash - Full infrastructure provisioning + +## References + +- Genkit Deployment: https://genkit.dev/docs/deployment +- Firebase Terraform: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function