jeremylongshore/tons-of-skills-marketplace / plugins/ai-ml/jeremy-genkit-pro/skills/genkit-production-expert
genkit-production-expert
VerifiedBuild production Firebase Genkit applications including RAG systems, multi-step flows, and tool calling for Node.js/Python/Go. Deploy to Firebase Functions or Cloud Run with AI monitoring. Use when asked to "create genkit flow" or "implement RAG". Trigger with relevant phrases based on skill purpose.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.9 KB |
| references/ARD.md | markdown | 4.9 KB |
| references/PRD.md | markdown | 4.4 KB |
| references/errors.md | markdown | 5.1 KB |
| references/examples.md | markdown | 12.9 KB |
| references/how-it-works.md | markdown | 1.2 KB |
| references/production-best-practices-applied.md | markdown | 913 B |
| references/workflow-examples.md | markdown | 2.7 KB |
| scripts/init-genkit.shexecutable | script | 1.6 KB |
references/ARD.md
View on GitHub# ARD: Genkit Production Expert
> Part of [Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)
## System Context
The Genkit Production Expert operates within a developer's project to create, configure, and deploy Firebase Genkit flows. It interacts with the local codebase for implementation and Google Cloud services for model access and deployment.
```
Developer Request
↓
[Genkit Production Expert]
├── Reads: project config, existing flows, schemas
├── Writes: flows, tools, retrievers, deploy config
└── Calls: genkit CLI, npm/pip, firebase deploy, gcloud
↓
Deployed Genkit Flow
├── Firebase Functions / Cloud Run
├── Gemini API (Vertex AI)
├── Vector Search (Firestore)
└── OpenTelemetry Tracing
```
## Data Flow
1. **Input**: User request specifying the flow type (simple/multi-step/RAG/agent), target language (TypeScript/Python/Go), model preference, and deployment target (Firebase Functions/Cloud Run)
2. **Processing**: Scaffold project structure, define typed schemas, implement the flow with model bindings, add tool definitions or retrievers as needed, configure error handling and tracing, then deploy with auto-scaling parameters
3. **Output**: Complete flow implementation with schemas, deployment configuration (firebase.json or Cloud Run YAML), monitoring setup (OpenTelemetry traces, Firebase Console integration), and cost optimization report
## Key Design Decisions
| Decision | Choice | Rationale |
|----------|--------|-----------|
| Schema-first design | Define Zod/Pydantic schemas before flow logic | Catches type errors at runtime boundaries, not deep inside flow execution |
| Gemini 2.5 Flash default | Flash for throughput, Pro for complex reasoning | 10x cheaper than Pro; sufficient for most flow types; upgrade only when quality demands |
| OpenTelemetry native | Built-in Genkit tracing over custom logging | Standard observability protocol; integrates with Cloud Monitoring without custom code |
| Firebase Functions for simple flows | Functions over Cloud Run for single-purpose flows | Zero infrastructure management, automatic scaling, sub-second deployment |
| Cloud Run for long flows | Cloud Run when execution exceeds 60s Functions limit | Configurable timeout up to 60 minutes; supports streaming responses |
| Error categorization | Distinct handling for SAFETY_BLOCK, QUOTA_EXCEEDED, schema errors | Each error type needs different recovery: retry, fallback, or user notification |
| Context caching for RAG | Cache embedding results for repeated document queries | Reduces token costs and latency for frequently accessed knowledge bases |
## Tool Usage Pattern
| Tool | Purpose |
|------|---------|
| Read | Inspect existing Genkit config, flow files, schema definitions, and package.json/requirements.txt |
| Write | Create new flow files, schema definitions, retriever implementations, and deployment configs |
| Edit | Patch existing flows to add tools, fix schemas, update model config, or add error handling |
| Grep | Search for import patterns, model usage, schema references, and configuration values |
| Glob | Discover project layout — flow files, test files, config files across the repository |
| Bash(cmd:*) | Run genkit CLI, npm/pip install, firebase deploy, test execution, and gcloud commands |
## Error Handling Strategy
| Error Class | Detection | Recovery |
|------------|-----------|----------|
| SAFETY_BLOCK | Gemini response contains `finishReason: SAFETY` | Log the blocked content category; retry with adjusted safety settings or sanitized input |
| QUOTA_EXCEEDED | 429 status or `RESOURCE_EXHAUSTED` error | Implement exponential backoff with jitter; queue requests; request quota increase |
| Schema validation failure | Zod/Pydantic throws validation error before `ai.generate()` | Return descriptive error message identifying the invalid field; do not call the model |
| Retriever empty results | Vector search returns zero documents above threshold | Lower similarity threshold; verify embeddings are indexed; check embedding model version |
| Deployment timeout | Firebase Functions cold start exceeds 60s | Increase memory allocation (512MB+); set min instances > 0; migrate to Cloud Run for long flows |
## Extension Points
- Custom model providers: add non-Google providers (OpenAI, Anthropic) via Genkit's plugin system
- Evaluation pipelines: integrate Genkit's `ai.evaluate()` for automated flow quality scoring
- Context caching: add prompt caching for repeated queries to reduce token costs
- Streaming responses: enable SSE streaming for chat-style flows on Cloud Run
- Multi-flow orchestration: chain multiple flows using Genkit's flow-to-flow calling pattern
- Custom retrievers: extend beyond Firestore vector search to Pinecone, Weaviate, or Elasticsearch
- Cost dashboards: generate Cloud Monitoring dashboards specific to token usage and model cost per flow
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |