Skills developing-genkit-dart
📦

developing-genkit-dart

Safe

Build AI applications with Genkit Dart SDK

Integrating AI models into Dart and Flutter applications requires understanding Genkit flows, tools, and plugins. This skill provides comprehensive reference documentation and code examples for the Genkit Dart SDK.

Supports: Claude Codex Code(CC)
🥉 76 Bronze
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "developing-genkit-dart". Initialize Genkit with the Anthropic plugin and generate text using Claude.

Expected outcome:

A Dart main function that imports genkit and genkit_anthropic, reads ANTHROPIC_API_KEY from Platform.environment, creates a Genkit instance with the anthropic plugin, and calls ai.generate with the claude-sonnet-4-5 model.

Using "developing-genkit-dart". Define a remote action client that calls a flow running on localhost.

Expected outcome:

Dart code using defineRemoteAction with a localhost URL, showing both non-streaming and streaming invocation patterns with type-safe input and output schemas.

Using "developing-genkit-dart". Set up a Shelf HTTP server to serve Genkit flows.

Expected outcome:

A Dart main function that imports genkit_shelf, defines a simple flow, and starts an HTTP server on port 8080 using startFlowServer.

Security Audit

Safe
v1 • 4/15/2026

This skill is a documentation and reference guide from the official Firebase agent-skills repository. It contains 11 markdown files with Dart code examples for the Genkit Dart SDK. The static analyzer reported 202 potential issues, but all are false positives. The primary detection was markdown code fences (```) misinterpreted as Ruby/shell backtick execution. Environment variable references in examples follow secure patterns (reading from Platform.environment rather than hardcoding credentials). Localhost URLs and API endpoint references are standard documentation examples. No executable code, no prompt injection attempts, and no malicious patterns were found. The skill is safe for publication.

11
Files scanned
1,078
Lines analyzed
0
findings
1
Total audits
No security issues found
Audited by: claude

Quality Score

45
Architecture
100
Maintainability
87
Content
50
Community
100
Security
91
Spec Compliance

What You Can Build

Flutter developer adding AI features

A Flutter developer integrates AI-powered text generation, image recognition, and tool calling into their mobile application using Genkit Dart.

Dart backend engineer building AI agents

A backend engineer defines Genkit flows with structured outputs and integrates multiple AI model providers including Google Gemini and Anthropic Claude.

Team adopting Model Context Protocol

A development team implements MCP host and server configurations to connect Genkit-powered applications with external tool servers.

Try These Prompts

Beginner: Generate text with Genkit
Write a Dart function that initializes Genkit with the Google AI plugin and generates a response to a user prompt using the Gemini model.
Beginner: Define a simple tool
Show me how to define a Genkit tool in Dart using schemantic for the input schema, with a function that returns weather data for a given location.
Intermediate: Create a streaming flow
Write a Genkit flow in Dart that accepts a topic string, generates a story using Gemini, streams the output chunks via context.sendChunk, and returns a completion message.
Advanced: Set up MCP host with multiple servers
Show me how to configure an MCP host in Genkit Dart that connects to a filesystem MCP server using npx, and how to reference the aggregated tools in a generate call.

Best Practices

  • Read API keys from environment variables using Platform.environment rather than hardcoding them in source files
  • Use the schemantic library with @Schema annotations for all tool input and flow output schemas to ensure type safety
  • Wrap Genkit flows with startFlowServer or integrate with existing Shelf routers for production HTTP endpoints

Avoid

  • Hardcoding API keys directly in Dart source files instead of using environment variables
  • Skipping the build_runner step after defining schemantic schemas, which prevents code generation
  • Binding HTTP servers to all network interfaces in production instead of localhost for development endpoints

Frequently Asked Questions

What is Genkit Dart?
Genkit Dart is an AI SDK for the Dart language. It provides a unified interface for text generation, structured outputs, tool calling, embeddings, and agentic workflows.
Which AI model providers does Genkit Dart support?
Genkit Dart supports Google Gemini, Anthropic Claude, OpenAI, and compatible providers through a plugin architecture. It also supports MCP integration and Chrome local AI.
How do I install the Genkit CLI?
You can install Genkit CLI via curl from cli.genkit.dev or through npm with npm install -g genkit-cli. Run genkit start to launch the developer UI.
What is schemantic and why does Genkit need it?
Schemantic is a Dart library for defining strongly typed data classes with automatic JSON schema generation. Genkit uses it for all data models including tools, flows, and messages.
How do I call a remote Genkit flow from a client?
Use defineRemoteAction from package:genkit/client.dart to define a typed client action with the flow URL and schemas, then call it directly or via streaming.
Can I require approval before tools execute?
Yes. The genkit_middleware package provides ToolApprovalPlugin which intercepts tool calls and returns FinishReason.interrupted, allowing you to prompt the user before execution.