developing-genkit-js

Develop AI applications with Genkit flows, tools, and models in Node.js and TypeScript.

Updated Aug 5, 2024
One-click install
npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill developing-genkit-js-nikhilkakarla
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-genkit-js
Source: https://github.com/nikhilkakarla/nikhilkakarla.github.io/tree/main/.agents/skills/developing-genkit-js
Command: npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill developing-genkit-js-nikhilkakarla

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires genkit-cli, genkit, @genkit-ai/google-genai, and includes references (resource) components.

What problem does it solve? Genkit v1.x introduced breaking API changes that make older code patterns and internal knowledge unreliable, causing validation errors, type errors, and deprecated API usage. This Skill provides up-to-date guidance, error troubleshooting protocols, and CLI-driven documentation lookup for building Genkit applications correctly. ## Core Features & Use Cases - Guided Development Workflow: Detects your framework (Next.js, Firebase, Express), selects a model provider, and applies best practices for flows, tools, and Zod schemas. - Error Troubleshooting Protocol: A mandatory common-errors reference covering v1.x migration issues like configureGenkit, response.text(), and deprecated model identifiers. - CLI Documentation Access: Uses genkit docs:search and genkit docs:read to retrieve authoritative, current documentation instead of relying on outdated knowledge. - Use Case: You encounter a ValidationError after upgrading Genkit. The Skill directs you to the common-errors reference, identifies the deprecated import pattern, and applies the documented v1.x fix. ## Quick Start Ask the assistant to create a Genkit flow in TypeScript that generates a joke using the Google AI Gemini model.

Frequently Asked Questions about developing-genkit-js

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Genkit flow in TypeScript?▼

Define flows on the Genkit instance using ai.defineFlow with a name, Zod input and output schemas, and an async handler function. Import z and genkit from the main genkit package, never from @genkit-ai/flow or @genkit-ai/core.

How do I set up Genkit in a new Node.js project?▼

Install the genkit CLI version 1.29.0 or higher, choose a provider plugin like @genkit-ai/google-genai, then create a genkit.ts file that initializes genkit with your plugins and default model. Add a genkit:ui script to run the Developer UI.

Why does my Genkit code fail after upgrading to v1.x?▼

Genkit v1.x introduced breaking changes: configureGenkit is replaced by genkit() instantiation, response.text() is now a property not a method, and defineFlow must be called on the ai instance. Check the common-errors reference for the full migration mapping.

Which Gemini models work with Genkit Google AI plugin?▼

Use gemini-2.5-* or gemini-3-* series models such as gemini-2.5-flash for general tasks or gemini-3.1-pro-preview for complex reasoning. The gemini-1.5-* and gemini-2.0-* series are decommissioned and will throw errors.

Can I use Genkit with providers other than Google AI?▼

Yes, Genkit is provider-agnostic and supports OpenAI, Anthropic, Ollama, and others through plugins. Run genkit docs:search "plugins" to find the correct package and installation instructions for your chosen provider.

Why does Genkit image generation return errors or wrong output?▼

Image generation models like gemini-2.5-flash-image require responseModalities set to ["TEXT", "IMAGE"] in the config. Without this setting, generation fails or returns incorrect output formats.