developing-genkit-js

Develop AI applications with Genkit flows, agents, and middleware in Node.js and TypeScript.

Updated May 11, 2026
One-click install
npx skills add https://github.com/alon3153/upe-social-publisher --skill developing-genkit-js-alon3153
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-genkit-js
Source: https://github.com/alon3153/upe-social-publisher/tree/main/.agents/skills/developing-genkit-js
Command: npx skills add https://github.com/alon3153/upe-social-publisher --skill developing-genkit-js-alon3153

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building AI-powered features in JavaScript/TypeScript requires correct usage of the Genkit framework, which underwent major breaking API changes in v1.x. This Skill provides up-to-date guidance, migration patterns, and error troubleshooting so you avoid deprecated APIs and resolve validation, type, and runtime errors quickly. ## Core Features & Use Cases - Flows, Prompts & Agents: Implement single-shot flows, Dotprompt templates, and beta multi-turn agents with sessions, interrupts, branching, background execution, and artifacts. - Middleware & Orchestration: Attach retry, fallback, filesystem, skills, tool-approval, and multi-agent delegation middleware, or build custom middleware with generateMiddleware. - Error Troubleshooting Protocol: A mandatory common-errors reference maps deprecated pre-1.0 APIs (configureGenkit, response.text(), global defineFlow) to their v1.x replacements. - CLI Workflows: Use genkit start, flow:run, docs:search, and trace inspection to verify behavior with traces instead of blind runs. - Use Case: When a user asks to build a chatbot with tool calling in TypeScript, the Skill guides agent definition, session persistence, HTTP deployment via Express or Next.js, and trace-based verification. ## Quick Start Ask the assistant to create a Genkit flow or agent in TypeScript, for example to build a weather chatbot with a tool and streaming response.

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?▼

Initialize Genkit with genkit({ plugins: [...] }), then call ai.defineFlow with a name, Zod input and output schemas, and an async handler. Import z and genkit from the main genkit package, not from deprecated @genkit-ai/flow or @genkit-ai/core packages.

How do I build a multi-turn AI agent with Genkit?▼

Use ai.defineAgent from genkit/beta, which requires genkit version 1.39.0 or higher. Agents support sessions with snapshot persistence, typed custom state, human-in-the-loop interrupts, branching, and background execution via chat.send and chat.sendStream.

Why does response.text() fail in Genkit v1.x?▼

Genkit v1.x changed response access from methods to properties, so response.text() and response.output() are deprecated. Use response.text and response.output directly, and check the common-errors reference for other pre-1.0 migration patterns.

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 plugin package, install it, and swap the model reference in your generate calls.

How do I debug Genkit flows and see model inputs and outputs?▼

Run your app with genkit start -- npx tsx src/index.ts to capture traces, then inspect them with genkit trace:list and genkit trace:get <traceId>. Running the app directly with node or tsx skips trace capture entirely.

What are the limitations of Genkit beta agents?▼

Beta agents come from genkit/beta and their APIs may change before stabilization. Background execution and branching require a session store, flow:run cannot invoke agents directly, and sub-agent interrupts are reported as tool responses rather than resumable interrupts.