genkit-production-expert
About
This skill builds production Firebase Genkit applications with RAG systems, multi-step flows, and tool calling for Node.js/Python/Go. It handles deployment to Firebase Functions or Cloud Run with AI monitoring. Use it when asked to create Genkit flows or implement RAG solutions.
Quick Install
Claude Code
Recommended/plugin add https://github.com/jeremylongshore/claude-code-plugins-plusgit clone https://github.com/jeremylongshore/claude-code-plugins-plus.git ~/.claude/skills/genkit-production-expertCopy and paste this command in Claude Code to install this skill
Documentation
What This Skill Does
This skill provides comprehensive expertise in building production-ready Firebase Genkit applications across Node.js (1.0), Python (Alpha), and Go (1.0). It handles the complete lifecycle from initialization to deployment with AI monitoring.
Core Capabilities
- Project Initialization: Set up properly structured Genkit projects with best practices
- Flow Architecture: Design multi-step AI workflows with proper error handling
- RAG Implementation: Build retrieval-augmented generation systems with vector search
- Tool Integration: Implement function calling and custom tools
- Monitoring Setup: Configure AI monitoring for Firebase Console
- Multi-Language Support: Expert guidance for TypeScript, Python, and Go implementations
- Production Deployment: Deploy to Firebase Functions or Google Cloud Run
When This Skill Activates
This skill automatically activates when you mention:
Trigger Phrases
- "Create a Genkit flow"
- "Implement RAG with Genkit"
- "Deploy Genkit to Firebase"
- "Set up Gemini integration"
- "Configure AI monitoring"
- "Build Genkit application"
- "Design AI workflow"
- "Genkit tool calling"
- "Vector search with Genkit"
- "Genkit production deployment"
Use Case Patterns
- Setting up new Genkit projects
- Implementing RAG systems with embedding models
- Integrating Gemini 2.5 Pro/Flash models
- Creating multi-step AI workflows
- Deploying to production with monitoring
- Debugging Genkit flows
- Optimizing token usage and costs
How It Works
Phase 1: Requirements Analysis
User Request → Analyze needs → Determine:
- Target language (Node.js/Python/Go)
- Flow complexity (simple/multi-step/RAG)
- Model requirements (Gemini version, custom models)
- Deployment target (Firebase/Cloud Run/local)
Phase 2: Project Setup
Check existing project → If new:
- Initialize project structure
- Install dependencies
- Configure environment variables
- Set up TypeScript/Python/Go config
If existing:
- Analyze current structure
- Identify integration points
- Preserve existing code
Phase 3: Implementation
Design flow architecture → Implement:
- Input/output schemas (Zod/Pydantic/Go structs)
- Model configuration
- Tool definitions (if needed)
- Retriever setup (for RAG)
- Error handling
- Tracing configuration
Phase 4: Testing & Validation
Create test cases → Run locally:
- Genkit Developer UI
- Unit tests
- Integration tests
- Token usage analysis
Phase 5: Production Deployment
Configure deployment → Deploy:
- Firebase Functions (with AI monitoring)
- Cloud Run (with auto-scaling)
- Set up monitoring dashboards
- Configure alerting
Workflow Examples
Example 1: Simple Question-Answering Flow
User Request: "Create a Genkit flow that answers user questions using Gemini 2.5 Flash"
Skill Response:
- Creates TypeScript project (default)
- Implements flow with input validation:
const qaFlow = ai.defineFlow(
{
name: 'qaFlow',
inputSchema: z.object({ question: z.string() }),
outputSchema: z.object({ answer: z.string() }),
},
async (input) => {
const { text } = await ai.generate({
model: gemini25Flash,
prompt: `Answer this question: ${input.question}`,
config: { temperature: 0.3 }, // Lower for factual answers
});
return { answer: text };
}
);
- Sets up local testing
- Provides deployment instructions
Example 2: RAG System with Vector Search
User Request: "Implement RAG with Genkit for our documentation search"
Skill Response:
- Analyzes document storage needs
- Implements retriever with embeddings:
const docRetriever = ai.defineRetriever(
{
name: 'docRetriever',
configSchema: z.object({ k: z.number().default(5) }),
},
async (query, config) => {
// Generate embedding
const embedding = await ai.embed({
embedder: textEmbeddingGecko,
content: query,
});
// Search vector database
const results = await vectorDB.search(embedding, config.k);
return results.map(doc => ({
content: doc.text,
metadata: { source: doc.source },
}));
}
);
- Creates RAG flow combining retrieval + generation
- Sets up vector database connection
- Implements caching for efficiency
Example 3: Multi-Agent Tool Calling
User Request: "Create a Genkit agent with weather and calendar tools"
Skill Response:
- Defines tools with proper schemas:
const weatherTool = ai.defineTool({
name: 'getWeather',
description: 'Get current weather for a location',
inputSchema: z.object({ location: z.string() }),
outputSchema: z.object({
temp: z.number(),
conditions: z.string(),
}),
}, async ({ location }) => {
// Call weather API
});
const calendarTool = ai.defineTool({
name: 'checkCalendar',
description: 'Check calendar availability',
inputSchema: z.object({ date: z.string() }),
outputSchema: z.object({ available: z.boolean() }),
}, async ({ date }) => {
// Check calendar API
});
- Creates agent flow with tool access:
const agentFlow = ai.defineFlow(async (userQuery) => {
const { text } = await ai.generate({
model: gemini25Flash,
prompt: userQuery,
tools: [weatherTool, calendarTool],
});
return text;
});
- Implements proper error handling
- Sets up tool execution tracing
Production Best Practices Applied
1. Schema Validation
- All inputs/outputs use Zod (TS), Pydantic (Python), or structs (Go)
- Prevents runtime errors from malformed data
2. Error Handling
try {
const result = await ai.generate({...});
return result;
} catch (error) {
if (error.code === 'SAFETY_BLOCK') {
// Handle safety filters
} else if (error.code === 'QUOTA_EXCEEDED') {
// Handle rate limits
}
throw error;
}
3. Cost Optimization
- Context caching for repeated prompts
- Token usage monitoring
- Temperature tuning for use case
- Model selection (Flash vs Pro)
4. Monitoring
- OpenTelemetry tracing enabled
- Custom span attributes
- Firebase Console integration
- Alert configuration
5. Security
- Environment variable management
- API key rotation support
- Input sanitization
- Output filtering
Integration with Other Tools
Works With ADK Plugin
When complex multi-agent orchestration is needed:
- Use Genkit for individual specialized flows
- Use ADK for orchestrating multiple Genkit flows
- Pass results via A2A protocol
Works With Vertex AI Validator
For production deployment:
- Genkit implements the flows
- Validator ensures production readiness
- Validates monitoring configuration
- Checks security compliance
Tool Permissions
This skill uses the following tools:
- Read: Analyze existing code and configuration
- Write: Create new flow files and configs
- Edit: Modify existing Genkit implementations
- Grep: Search for integration points
- Glob: Find related files
- Bash: Install dependencies, run tests, deploy
Troubleshooting Guide
Common Issue 1: API Key Not Found
Symptoms: Error "API key not provided" Solution:
- Check
.envfile exists - Verify
GOOGLE_API_KEYis set - Ensure
dotenvis loaded
Common Issue 2: Flow Not Appearing in UI
Symptoms: Flow not visible in Genkit Developer UI Solution:
- Ensure flow is exported
- Restart Genkit server
- Check console for errors
Common Issue 3: High Token Usage
Symptoms: Unexpected costs Solution:
- Implement context caching
- Use Gemini 2.5 Flash instead of Pro
- Lower temperature
- Compress prompts
Version History
- 1.0.0 (2025): Initial release with Node.js 1.0, Python Alpha, Go 1.0 support
- Supports Gemini 2.5 Pro/Flash
- AI monitoring integration
- Production deployment patterns
References
- Official Docs: https://genkit.dev/
- Node.js 1.0 Announcement: https://firebase.blog/posts/2025/02/announcing-genkit/
- Go 1.0 Announcement: https://developers.googleblog.com/en/announcing-genkit-go-10/
- Vertex AI Plugin: https://genkit.dev/docs/integrations/vertex-ai/
GitHub Repository
Related Skills
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
evaluating-llms-harness
TestingThis Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
llamaguard
OtherLlamaGuard is Meta's 7-8B parameter model for moderating LLM inputs and outputs across six safety categories like violence and hate speech. It offers 94-95% accuracy and can be deployed using vLLM, Hugging Face, or Amazon SageMaker. Use this skill to easily integrate content filtering and safety guardrails into your AI applications.
langchain
MetaLangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.
