developing-genkit-dart
firebase/agent-skills
Generates code and documentation for building AI agents in Dart using the Genkit SDK.
What is developing-genkit-dart?
Genkit Dart is an AI SDK that provides a unified interface for code generation, structured outputs, tools, flows, and AI agents in Dart and Flutter applications. Use this skill when building AI-powered Dart applications, integrating LLMs, or creating agentic workflows.
- Generate and document Genkit Dart code for AI agent development
- Initialize Genkit, configure generation, define tools and flows
- Integrate LLM providers via plugins (Google Gemini, Anthropic Claude, OpenAI GPT)
- Build type-safe schemas using the schemantic library for structured outputs
- Stream AI responses and call remote flow endpoints
- Trace and debug executions using the Genkit CLI developer UI
How to install developing-genkit-dart
npx skills add https://github.com/firebase/agent-skills --skill developing-genkit-dart- Dart SDK installed
- Genkit CLI installed (via curl or npm)
- API keys for desired LLM provider (Google, Anthropic, OpenAI, or Firebase)
How to use developing-genkit-dart
- 1.Install Genkit CLI: curl -sL cli.genkit.dev | bash or npm install -g genkit-cli
- 2.Verify installation: genkit --version
- 3.Initialize Genkit in your Dart project with Genkit()
- 4.Define tools using ai.defineTool() and flows using ai.defineFlow()
- 5.Configure LLM plugins (genkit_google_genai, genkit_anthropic, genkit_openai, etc.) with API credentials
- 6.Run your application with genkit start -- dart run main.dart to access the developer UI
- 7.Use schemantic library for type-safe schema definitions in tools and flows
- 8.Verify code compiles cleanly with dart analyze before deployment
Use cases
- Building conversational AI agents in Dart/Flutter applications
- Integrating Claude, Gemini, or GPT models into Dart backends
- Creating agentic workflows with tools and flows for task automation
- Developing locally with the Genkit CLI for real-time tracing and debugging
- Hosting Genkit flows over HTTP using Dart Shelf for web services
- Dart and Flutter developers building AI-powered applications
- Backend engineers integrating LLMs into Dart services
- AI agent developers using Genkit framework
- Teams needing local development and debugging tools for generative AI
developing-genkit-dart FAQ
Genkit Dart supports Google Gemini (genkit_google_genai), Anthropic Claude (genkit_anthropic), OpenAI GPT (genkit_openai), Firebase AI (genkit_firebase_ai), and custom compatible endpoints via plugins.
Schemantic is a required library for defining type-safe schemas in Genkit Dart tools, flows, and prompts. Use it whenever you encounter @Schema() annotations or need to map data structures for AI operations.
Use the Genkit CLI by running genkit start -- dart run main.dart. This provides a local developer UI for tracing executions, testing flows, and evaluating model outputs.
Yes, use the genkit_shelf plugin to integrate Genkit flows over HTTP using Dart Shelf for web server hosting.
Always run dart analyze to verify the code compiles cleanly before generating your final response.
Full instructions (SKILL.md)
Source of truth, from firebase/agent-skills.
name: developing-genkit-dart description: Generates code and provides documentation for the Genkit Dart SDK. Use when the user asks to build AI agents in Dart, use Genkit flows, or integrate LLMs into Dart/Flutter applications. metadata: genkit-managed: true
Genkit Dart
Genkit Dart is an AI SDK for Dart that provides a unified interface for code generation, structured outputs, tools, flows, and AI agents.
Core Features and Usage
If you need help with initializing Genkit (Genkit()), Generation (ai.generate), Tooling (ai.defineTool), Flows (ai.defineFlow), Embeddings (ai.embedMany), streaming, or calling remote flow endpoints, please load the core framework reference:
references/genkit.md
Genkit CLI (recommended)
The Genkit CLI provides a local development UI for running Flow, tracing executions, playing with models, and evaluating outputs.
check if the user has it installed: genkit --version
Installation:
curl -sL cli.genkit.dev | bash # Native CLI
# OR
npm install -g genkit-cli # Via npm
Usage:
Wrap your run command with genkit start to attach the Genkit developer UI and tracing:
genkit start -- dart run main.dart
Plugin Ecosystem
Genkit relies on a large suite of plugins to perform generative AI actions, interface with external LLMs, or host web servers.
When asked to use any given plugin, always verify usage by referring to its corresponding reference below. You should load the reference when you need to know the specific initialization arguments, tools, models, and usage patterns for the plugin:
| Plugin Name | Reference Link | Description |
|---|---|---|
genkit_google_genai | references/genkit_google_genai.md | Load for Google Gemini plugin interface usage. |
genkit_anthropic | references/genkit_anthropic.md | Load for Anthropic plugin interface for Claude models. |
genkit_openai | references/genkit_openai.md | Load for OpenAI plugin interface for GPT models, Groq, and custom compatible endpoints. |
genkit_middleware | references/genkit_middleware.md | Load for Tooling for specific agentic behavior: filesystem, skills, and toolApproval interrupts. |
genkit_mcp | references/genkit_mcp.md | Load for Model Context Protocol integration (Server, Host, and Client capabilities). |
genkit_chrome | references/genkit_chrome.md | Load for Running Gemini Nano locally inside the Chrome browser using the Prompt API. |
genkit_shelf | references/genkit_shelf.md | Load for Integrating Genkit Flow actions over HTTP using Dart Shelf. |
genkit_firebase_ai | references/genkit_firebase_ai.md | Load for Firebase AI plugin interface (Gemini API via Vertex AI). |
External Dependencies
Whenever you define schemas mapping inside of Tools, Flows, and Prompts, you must use the schemantic library.
To learn how to use schemantic, ensure you read references/schemantic.md for how to implement type safe generated Dart code. This is particularly relevant when you encounter symbols like @Schema(), SchemanticType, or classes with the $ prefix. Genkit Dart uses schemantic for all of its data models so it's a CRITICAL skill to understand for using Genkit Dart.
Best Practices
- Always check that code cleanly compiles using
dart analyzebefore generating the final response. - Always use the Genkit CLI for local development and debugging.
Related skills
More from firebase/agent-skills and the wider catalog.
firebase-basics
Firebase CLI setup, authentication, and project management for agent workflows
firebase-auth-basics
Set up Firebase Authentication for user sign-in, management, and secure data access.
firebase-hosting-basics
Deploy static web apps, SPAs, and microservices to Firebase Hosting with a single command.
firebase-app-hosting-basics
Deploy full-stack Next.js and Angular apps with Firebase App Hosting.
firebase-data-connect
Build and deploy PostgreSQL-backed Firebase backends with GraphQL, auto-generated queries, and type-safe SDKs.
developing-genkit-js
Develop AI-powered applications using Genkit in Node.js/TypeScript with flows, tools, and multi-provider support.