developing-genkit-js
Build AI apps with Genkit in JavaScript
Also available from: genkit-ai
Developers need guidance to use the Genkit framework correctly in Node.js and TypeScript projects. This skill provides reference documentation, common error solutions, and code patterns for building AI-powered applications with Genkit.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "developing-genkit-js". Set up a new Genkit project with Google AI provider
Expected outcome:
- Create the ai directory in your source folder
- Install genkit and @genkit-ai/google-genai packages
- Create genkit.ts with genkit() initialization and googleAI plugin
- Create flows and tools subdirectories for organization
- Add genkit:ui script to package.json for Dev UI access
- Set the GEMINI_API_KEY environment variable
Using "developing-genkit-js". Fix ValidationError when using defineFlow with pre-1.0 imports
Expected outcome:
- Replace `import { defineFlow } from "@genkit-ai/flow"` with defining flows on the ai instance
- Replace `import { genkit } from "@genkit-ai/core"` with `import { genkit } from "genkit"`
- Replace `configureGenkit()` with `const ai = genkit({ plugins: [...] })`
- Access response text via `response.text` property instead of `response.text()` method
- Run type check with `npx tsc --noEmit` to verify the migration is complete
Security Audit
Low RiskAll 194 static analyzer findings are false positives. The skill consists entirely of markdown documentation and code examples for the Genkit JS framework. The 176 'external_commands' detections are markdown inline code spans (backtick formatting) showing CLI commands like `genkit --version` and `npx tsc --noEmit`, not actual shell execution. The 'weak cryptographic algorithm' findings have no corresponding crypto operations in the source. The 'hardcoded URL' findings are documentation references (localhost dev UI and example.com placeholder). The 'env_access' finding is documentation instructing users to set API keys. No executable code exists in this skill. Safe to publish.
Low Risk Issues (4)
Quality Score
What You Can Build
Set up a new Genkit project
A developer wants to add AI features to an existing Node.js application using Genkit. The skill guides directory structure, package installation, plugin configuration, and initial flow creation.
Migrate from Genkit pre-1.0 to v1.x
A team maintains a Genkit application built before the v1.0 release. The skill identifies deprecated APIs, provides migration patterns for imports, model references, and flow definitions.
Build multimodal AI features
A product team wants to add image generation or text-to-speech to their application. The skill provides working examples for Gemini multimodal models with correct configuration.
Try These Prompts
I want to add AI features to my Node.js project using Genkit. Help me set up the project structure, install the required packages, and create a simple flow that generates text.
I am getting TypeScript errors in my Genkit flow. Check the common errors reference and help me identify if this is a deprecated API issue or an import problem.
I need a Genkit flow that returns structured JSON output using Zod schemas. Show me how to define the schema, create the flow, and access the typed output.
I want to build a Genkit flow that generates images using Gemini 2.5 Flash Image model and streams partial results. Include the correct responseModalities configuration and explain how to handle the media output.
Best Practices
- Always use the Genkit CLI (`genkit docs:search`, `genkit docs:read`) to look up current documentation rather than relying on internal knowledge, as Genkit APIs change frequently between versions.
- Store API keys and sensitive configuration in environment variables or .env files. Never hardcode credentials in source files or commit them to version control.
- Use Zod schemas from the `genkit` package (not the standalone `zod` package) for all input and output definitions. Add `.describe()` annotations to guide the LLM in populating schema fields correctly.
Avoid
- Do not import from deprecated packages like `@genkit-ai/core`, `@genkit-ai/ai`, or `@genkit-ai/flow`. Import core functionality directly from the `genkit` package instead.
- Do not skip reading the common errors reference when troubleshooting. Many errors are caused by deprecated API usage that has documented solutions.
- Do not use decommissioned model versions like `gemini-2.0-*` or `gemini-1.5-*`. Always use the latest generation models specified in the best practices reference.