Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/ai-ml/jeremy-genkit-pro/skills/genkit-production-expert

genkit-production-expert

Verified

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

FileKindSize
SKILL.mdskill md5.9 KB
references/ARD.mdmarkdown4.9 KB
references/PRD.mdmarkdown4.4 KB
references/errors.mdmarkdown5.1 KB
references/examples.mdmarkdown12.9 KB
references/how-it-works.mdmarkdown1.2 KB
references/production-best-practices-applied.mdmarkdown913 B
references/workflow-examples.mdmarkdown2.7 KB
scripts/init-genkit.shexecutablescript1.6 KB

references/errors.md

View on GitHub
# Error Handling Reference

## Genkit Flow Errors

| Error | Cause | Solution |
|-------|-------|----------|
| `SAFETY_BLOCK` response | Model safety filters triggered on input or output | Review prompt content for policy violations; adjust safety settings in `GenerationConfig`; add input sanitization before `ai.generate()` |
| `QUOTA_EXCEEDED` | API rate limit or daily token quota reached | Implement exponential backoff with jitter; request quota increase via Cloud Console; cache repeated prompts with TTL |
| `ZodError: invalid input` | Runtime input does not match Zod schema | Add `.describe()` to schema fields for better error messages; validate inputs upstream before calling the flow |
| `ZodError: invalid output` | Model output does not match expected output schema | Tighten the prompt to match schema structure; use `response_mime_type: application/json`; add a retry with rephrased prompt |

## Retriever & RAG Errors

| Error | Cause | Solution |
|-------|-------|----------|
| Empty retrieval results | Vector database query found no matches above similarity threshold | Lower the similarity threshold; verify documents are indexed with matching embedding model version; run `ai.index()` to re-index |
| `Embedding dimension mismatch` | Retriever uses different embedding model than indexer | Ensure both indexer and retriever use the same embedder (e.g., `textEmbedding004`); re-index if model changed |
| `Firestore findNearest: index not found` | Firestore vector index not created for the collection | Create a composite index with `gcloud firestore indexes composite create` including the embedding field |
| Retriever returns stale documents | Indexed content was updated but embeddings were not regenerated | Implement an update pipeline that re-embeds documents on change; add `updatedAt` timestamps for cache invalidation |

## Deployment Errors

| Error | Cause | Solution |
|-------|-------|----------|
| `Function timeout` on Firebase Functions | Cold start or flow execution exceeds 60s default limit | Increase `timeoutSeconds` in function config (max 540s for 2nd gen); set `minInstances: 1` to avoid cold starts; use Cloud Run for long-running flows |
| `ENOMEM` or container OOM | Insufficient memory for model response processing | Increase memory allocation (`--memory 1Gi`); reduce `maxOutputTokens`; stream responses instead of buffering |
| `ERR_MODULE_NOT_FOUND` in deployed function | Dependencies not bundled correctly | Verify `tsconfig.json` `outDir` matches function entry point; run `npm run build` before deploy; check `package.json` exports field |
| `Cloud Run: service unavailable` after deploy | Health check fails during startup | Ensure the flow server binds to `0.0.0.0:$PORT`; add a health check endpoint at `/` or `/_ah/health` |

## Model & Provider Errors

| Error | Cause | Solution |
|-------|-------|----------|
| `Model not found` | Model ID doesn't match provider format | Use `gemini25Flash` or `gemini25Pro` exports from `@genkit-ai/googleai`; don't use raw model strings unless explicitly supported |
| `API key not valid` | Missing or expired Google AI API key | Set `GOOGLE_GENAI_API_KEY` env var; rotate keys periodically; use `gcloud secrets` for production |
| `INVALID_ARGUMENT: max tokens exceeded` | Prompt plus expected output exceeds model context window | Reduce prompt size; summarize context; use retrieval to inject only relevant snippets |
| Provider timeout | Network or API latency spike | Set `timeout` in generation config; implement circuit breaker pattern; add fallback to alternative model |

## Local Development Errors

| Error | Cause | Solution |
|-------|-------|----------|
| Genkit Developer UI won't start | Port 4000 already in use or missing `genkit` CLI | Kill process on port 4000 (`lsof -i :4000`); ensure `genkit` CLI is installed globally (`npm install -g genkit`) |
| `tsx` not found | TypeScript execution tool not installed | Install `tsx` as dev dependency: `npm install -D tsx`; or use `npx tsx` |
| Flow test hangs indefinitely | Async flow never resolves or rejects | Add timeout to test cases; verify all async branches have proper error handling; mock external API calls in tests |
| `ECONNREFUSED` when testing flows | Flow server not running or wrong port | Start server with `npx genkit start -- tsx src/index.ts`; verify URL matches the flow server port (default 3400) |

## Tracing & Monitoring Errors

| Error | Cause | Solution |
|-------|-------|----------|
| No traces appearing in Firebase Console | `enableTracingAndMetrics` not set or wrong project | Pass `enableTracingAndMetrics: true` in Genkit config; verify `GOOGLE_CLOUD_PROJECT` env var matches Firebase project |
| Missing custom span attributes | Span not properly closed or attribute key rejected | Use OpenTelemetry-compliant attribute names; ensure spans are ended in `finally` blocks |
| High cardinality warning in monitoring | Too many unique flow names or label values | Use parameterized flow names; avoid dynamic values in metric labels |

---
*[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall